ecore_drm2: fix scanout_on callback firing too often

We need to increase the on scanout count for a buffer only when the
plane it's on makes its transition from pending to visible.

Previously it was firing for every refresh which would break refcounting
for any plane using surface that didn't change every frame.
This commit is contained in:
Derek Foreman 2017-06-30 10:26:41 -05:00
parent d2b614111c
commit 3775a9645d
1 changed files with 3 additions and 2 deletions

View File

@ -292,6 +292,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
{
fb = plane->fb;
plane_scanout = plane->scanout;
if (!plane->dead)
{
/* First time this plane is scanned out */
@ -299,13 +300,13 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
fb->scanout_count++;
plane->scanout = EINA_TRUE;
if (fb->status_handler && (fb->scanout_count == 1))
if (fb->status_handler && (fb->scanout_count == 1) &&
(plane_scanout != plane->scanout))
fb->status_handler(fb,
ECORE_DRM2_FB_STATUS_SCANOUT_ON,
fb->status_data);
continue;
}
plane_scanout = plane->scanout;
output->planes = eina_list_remove_list(output->planes, l);
free(plane);
if (!plane_scanout) continue;