forked from enlightenment/efl
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:
parent
d2b614111c
commit
3775a9645d
|
@ -292,6 +292,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
|
||||||
EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
|
EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
|
||||||
{
|
{
|
||||||
fb = plane->fb;
|
fb = plane->fb;
|
||||||
|
plane_scanout = plane->scanout;
|
||||||
if (!plane->dead)
|
if (!plane->dead)
|
||||||
{
|
{
|
||||||
/* First time this plane is scanned out */
|
/* First time this plane is scanned out */
|
||||||
|
@ -299,13 +300,13 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
|
||||||
fb->scanout_count++;
|
fb->scanout_count++;
|
||||||
|
|
||||||
plane->scanout = EINA_TRUE;
|
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,
|
fb->status_handler(fb,
|
||||||
ECORE_DRM2_FB_STATUS_SCANOUT_ON,
|
ECORE_DRM2_FB_STATUS_SCANOUT_ON,
|
||||||
fb->status_data);
|
fb->status_data);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
plane_scanout = plane->scanout;
|
|
||||||
output->planes = eina_list_remove_list(output->planes, l);
|
output->planes = eina_list_remove_list(output->planes, l);
|
||||||
free(plane);
|
free(plane);
|
||||||
if (!plane_scanout) continue;
|
if (!plane_scanout) continue;
|
||||||
|
|
Loading…
Reference in New Issue