diff --git a/drivers/video/fb.c b/drivers/video/fb.c index ff7bcfa693..df5c964082 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include /**************************************************************************** @@ -418,6 +420,23 @@ static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; #endif +#ifdef CONFIG_NX_UPDATE + case FBIO_UPDATE: /* Get video plane info */ + { + FAR struct nxgl_rect_s *rect = + (FAR struct nxgl_rect_s *)((uintptr_t)arg); + struct fb_planeinfo_s pinfo; + + DEBUGASSERT(fb->vtable != NULL && fb->vtable->getplaneinfo != NULL); + ret = fb->vtable->getplaneinfo(fb->vtable, fb->plane, &pinfo); + if (ret >= 0) + { + nx_notify_rectangle(&pinfo, rect); + } + } + break; +#endif + default: gerr("ERROR: Unsupported IOCTL command: %d\n", cmd); ret = -ENOTTY; diff --git a/include/nuttx/video/fb.h b/include/nuttx/video/fb.h index 2ae2720491..d77927f72c 100644 --- a/include/nuttx/video/fb.h +++ b/include/nuttx/video/fb.h @@ -211,6 +211,10 @@ # define FBIOPUT_CURSOR _FBIOC(0x0006) /* Set cursor attibutes */ /* Argument: read-only struct fb_setcursor_s */ #endif +#ifdef CONFIG_NX_UPDATE +# define FBIO_UPDATE _FBIOC(0x0007) /* Update a rectangular region in the framebuffer */ + /* Argument: read-only struct nxgl_rect_s */ +#endif /**************************************************************************** * Public Types