summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_fb.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-07 12:41:07 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2015-04-10 11:09:49 +0200
commita3a6399c3a89e8b2ccbfd8640972290787c4d50c (patch)
treefa2ac12d8a21d7b5ae536c10ea8d2c3a1b41b935 /src/lib/ecore_drm/ecore_drm_fb.c
parent0885834b68f96a3e60decf9d3de7157c28e36ecc (diff)
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>
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_fb.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_fb.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c
index 2a48f25685..da6b421d0d 100644
--- a/src/lib/ecore_drm/ecore_drm_fb.c
+++ b/src/lib/ecore_drm/ecore_drm_fb.c
@@ -9,11 +9,8 @@
9 * 9 *
10 * Functions that deal with frame buffers. 10 * Functions that deal with frame buffers.
11 * 11 *
12 *
13 */ 12 */
14 13
15/* TODO: DOXY !! */
16
17static Eina_Bool 14static Eina_Bool
18_ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) 15_ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb)
19{ 16{
@@ -137,3 +134,31 @@ ecore_drm_fb_destroy(Ecore_Drm_Fb *fb)
137 drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg); 134 drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
138 free(fb); 135 free(fb);
139} 136}
137
138EAPI void
139ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count)
140{
141 EINA_SAFETY_ON_NULL_RETURN(fb);
142
143#ifdef DRM_MODE_FEATURE_DIRTYFB
144 drmModeClip *clip;
145 unsigned int i = 0;
146 int ret;
147
148 clip = alloca(count * sizeof(drmModeClip));
149 for (i = 0; i < count; i++)
150 {
151 clip[i].x1 = rects[i].x;
152 clip[i].y1 = rects[i].y;
153 clip[i].x2 = rects[i].w;
154 clip[i].y2 = rects[i].h;
155 }
156
157 ret = drmModeDirtyFB(fb->fd, fb->id, clip, count);
158 if (ret)
159 {
160 if (ret == -EINVAL)
161 ERR("Could not mark FB as Dirty: %m");
162 }
163#endif
164}