ecore-drm: Add API function to mark a Framebuffer as dirty

Summary: This adds an API function used to mark a framebuffer as dirty

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-04-07 12:41:07 -04:00 committed by Stefan Schmidt
parent 0885834b68
commit a3a6399c3a
2 changed files with 43 additions and 3 deletions

View File

@ -183,6 +183,7 @@ EAPI extern int ECORE_DRM_EVENT_SEAT_ADD; /**< @since 1.14 */
* @li @ref Ecore_Drm_Output_Group
* @li @ref Ecore_Drm_Input_Group
* @li @ref Ecore_Drm_Sprite_Group
* @li @ref Ecore_Drm_Fb_Group
*
*/
@ -233,6 +234,20 @@ EAPI Eina_Bool ecore_drm_sprites_crtc_supported(Ecore_Drm_Output *output, unsign
EAPI Ecore_Drm_Fb *ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height);
EAPI void ecore_drm_fb_destroy(Ecore_Drm_Fb *fb);
/**
* Mark an Ecore_Drm_Fb as dirty
*
* This function mark an Ecore_Drm_Fb as being dirty
*
* @param fb The Ecore_Drm_Fb to mark as dirty
* @param rects The regions of the Ecore_Drm_Fb which are dirty
* @param count The number of regions
*
* @ingroup Ecore_Drm_Fb_Group
* @since 1.15
*/
EAPI void ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count);
EAPI Eina_Bool ecore_drm_launcher_connect(Ecore_Drm_Device *dev);
EAPI void ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev);

View File

@ -9,11 +9,8 @@
*
* Functions that deal with frame buffers.
*
*
*/
/* TODO: DOXY !! */
static Eina_Bool
_ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb)
{
@ -137,3 +134,31 @@ ecore_drm_fb_destroy(Ecore_Drm_Fb *fb)
drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
free(fb);
}
EAPI void
ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count)
{
EINA_SAFETY_ON_NULL_RETURN(fb);
#ifdef DRM_MODE_FEATURE_DIRTYFB
drmModeClip *clip;
unsigned int i = 0;
int ret;
clip = alloca(count * sizeof(drmModeClip));
for (i = 0; i < count; i++)
{
clip[i].x1 = rects[i].x;
clip[i].y1 = rects[i].y;
clip[i].x2 = rects[i].w;
clip[i].y2 = rects[i].h;
}
ret = drmModeDirtyFB(fb->fd, fb->id, clip, count);
if (ret)
{
if (ret == -EINVAL)
ERR("Could not mark FB as Dirty: %m");
}
#endif
}