summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-06-16 16:17:56 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-06-23 08:15:41 -0500
commit69181cc9e84c680758ab7f7e531ebb356c40c4bf (patch)
tree8ed42b5b48d9f640b98cbee6b80c6455ada9e197 /src/lib/ecore_drm2
parentbc8b11bd7853b349e311a4b05db76d3525c85189 (diff)
ecore_drm2: Track number of times an fb is on scanout
The same fb can be placed in multiple hardware planes, we need to keep track of the number of planes it's on at any time so we can send events to a compositor in a later commit.
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c13
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 28154e567e..d656ddc5bb 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -149,6 +149,9 @@ _ecore_drm2_fb_destroy(Ecore_Drm2_Fb *fb)
149 149
150 if (!fb->dead) ERR("Destroying an fb that hasn't been discarded"); 150 if (!fb->dead) ERR("Destroying an fb that hasn't been discarded");
151 151
152 if (fb->scanout_count)
153 ERR("Destroyed fb on scanout %d times.", fb->scanout_count);
154
152 if (fb->mmap) munmap(fb->mmap, fb->sizes[0]); 155 if (fb->mmap) munmap(fb->mmap, fb->sizes[0]);
153 156
154 if (fb->id) sym_drmModeRmFB(fb->fd, fb->id); 157 if (fb->id) sym_drmModeRmFB(fb->fd, fb->id);
@@ -264,6 +267,7 @@ _ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output EINA_UNUSED, Ecore_Drm2_
264EAPI Eina_Bool 267EAPI Eina_Bool
265ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output) 268ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
266{ 269{
270 Eina_Bool plane_scanout;
267 Ecore_Drm2_Fb *fb; 271 Ecore_Drm2_Fb *fb;
268 272
269 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 273 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
@@ -284,13 +288,22 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
284 288
285 EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane) 289 EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
286 { 290 {
291 fb = plane->fb;
287 if (!plane->dead) 292 if (!plane->dead)
288 { 293 {
294 /* First time this plane is scanned out */
295 if (!plane->scanout)
296 fb->scanout_count++;
297
289 plane->scanout = EINA_TRUE; 298 plane->scanout = EINA_TRUE;
290 continue; 299 continue;
291 } 300 }
301 plane_scanout = plane->scanout;
292 output->planes = eina_list_remove_list(output->planes, l); 302 output->planes = eina_list_remove_list(output->planes, l);
293 free(plane); 303 free(plane);
304 if (!plane_scanout) continue;
305
306 fb->scanout_count--;
294 } 307 }
295 } 308 }
296 309
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index d387e90f42..4ec2147e76 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -154,6 +154,7 @@ struct _Ecore_Drm2_Fb
154 int w, h; 154 int w, h;
155 int depth, bpp; 155 int depth, bpp;
156 short ref; 156 short ref;
157 int scanout_count;
157 uint32_t id, handles[4]; 158 uint32_t id, handles[4];
158 uint32_t strides[4], sizes[4]; 159 uint32_t strides[4], sizes[4];
159 uint32_t format; 160 uint32_t format;