drivers/video/fb.c: Add support for LCD drivers that use a simulated framebuffer and must receive explicit notification when there is an update to a region in the framebuffer.

This commit is contained in:
Gregory Nutt 2017-09-11 16:43:12 -06:00
parent bf33f1d63e
commit f3fc9c0d03
2 changed files with 23 additions and 0 deletions
drivers/video
include/nuttx/video

@ -48,6 +48,8 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxglib.h>
#include <nuttx/video/fb.h>
/****************************************************************************
@ -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;

@ -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