feature: driver: add interface for fb driver
add get and set panel power interface for fb driver. add get and set framerate interface for fb driver. add panel information at videoinfo for fb driver. Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
This commit is contained in:
parent
83a9c2b24b
commit
3183251de0
@ -29,6 +29,10 @@ config FB_OVERLAY
|
||||
bool "Framebuffer overlay support"
|
||||
default n
|
||||
|
||||
config FB_MODULEINFO
|
||||
bool "Framebuffer module information support"
|
||||
default n
|
||||
|
||||
config FB_OVERLAY_BLIT
|
||||
bool "Framebuffer overlay blit support"
|
||||
depends on FB_OVERLAY
|
||||
|
@ -516,6 +516,44 @@ static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
#endif
|
||||
#endif /* CONFIG_FB_OVERLAY */
|
||||
|
||||
case FBIOSET_POWER:
|
||||
{
|
||||
DEBUGASSERT(fb->vtable != NULL &&
|
||||
fb->vtable->setpower != NULL);
|
||||
ret = fb->vtable->setpower(fb->vtable, (int)arg);
|
||||
}
|
||||
break;
|
||||
|
||||
case FBIOGET_POWER:
|
||||
{
|
||||
FAR int *power = (FAR int *)((uintptr_t)arg);
|
||||
|
||||
DEBUGASSERT(power != NULL && fb->vtable != NULL &&
|
||||
fb->vtable->getpower != NULL);
|
||||
*(power) = fb->vtable->getpower(fb->vtable);
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case FBIOGET_FRAMERATE:
|
||||
{
|
||||
FAR int *rate = (FAR int *)((uintptr_t)arg);
|
||||
|
||||
DEBUGASSERT(rate != NULL && fb->vtable != NULL &&
|
||||
fb->vtable->getframerate != NULL);
|
||||
*(rate) = fb->vtable->getframerate(fb->vtable);
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case FBIOSET_FRAMERATE:
|
||||
{
|
||||
DEBUGASSERT(fb->vtable != NULL &&
|
||||
fb->vtable->setframerate != NULL);
|
||||
ret = fb->vtable->setframerate(fb->vtable, (int)arg);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
gerr("ERROR: Unsupported IOCTL command: %d\n", cmd);
|
||||
ret = -ENOTTY;
|
||||
|
@ -272,6 +272,17 @@
|
||||
#endif
|
||||
#endif /* CONFIG_FB_OVERLAY */
|
||||
|
||||
/* Specific Controls ********************************************************/
|
||||
|
||||
#define FBIOSET_POWER _FBIOC(0x0012) /* Set panel power
|
||||
* Argument: int */
|
||||
#define FBIOGET_POWER _FBIOC(0x0013) /* Get panel current power
|
||||
* Argument: int* */
|
||||
#define FBIOSET_FRAMERATE _FBIOC(0x0014) /* Set frame rate
|
||||
* Argument: int */
|
||||
#define FBIOGET_FRAMERATE _FBIOC(0x0015) /* Get frame rate
|
||||
* Argument: int* */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
@ -293,6 +304,9 @@ struct fb_videoinfo_s
|
||||
#ifdef CONFIG_FB_OVERLAY
|
||||
uint8_t noverlays; /* Number of overlays supported */
|
||||
#endif
|
||||
#ifdef CONFIG_FB_MODULEINFO
|
||||
uint8_t moduleinfo[128]; /* Module information filled by vendor */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* This structure describes one color plane. Some YUV formats may support
|
||||
@ -569,6 +583,24 @@ struct fb_vtable_s
|
||||
FAR const struct fb_overlayblend_s *blend);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Specific Controls ******************************************************/
|
||||
|
||||
/* Set the frequency of the framebuffer update panel (0: disable refresh) */
|
||||
|
||||
int (*setframerate)(FAR struct fb_vtable_s *vtable, int rate);
|
||||
|
||||
/* Get the frequency of the framebuffer update panel (0: disable refresh) */
|
||||
|
||||
int (*getframerate)(FAR struct fb_vtable_s *vtable);
|
||||
|
||||
/* Get the panel power status (0: full off). */
|
||||
|
||||
int (*getpower)(FAR struct fb_vtable_s *vtable);
|
||||
|
||||
/* Enable/disable panel power (0: full off). */
|
||||
|
||||
int (*setpower)(FAR struct fb_vtable_s *vtable, int power);
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user