diff options
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_plane.c')
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_plane.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c index 2bf1917545..a75173bcfc 100644 --- a/src/lib/ecore_drm2/ecore_drm2_plane.c +++ b/src/lib/ecore_drm2/ecore_drm2_plane.c @@ -96,6 +96,7 @@ out: pstate->in_use = EINA_TRUE; pstate->cid.value = output->crtc_id; pstate->fid.value = fb->id; + pstate->fb = fb; pstate->sx.value = 0; pstate->sy.value = 0; @@ -119,8 +120,7 @@ out: return NULL; } - fb->ref++; - + _ecore_drm2_fb_ref(fb); DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id); output->planes = eina_list_append(output->planes, plane); @@ -133,7 +133,10 @@ ecore_drm2_plane_release(Ecore_Drm2_Plane *plane) EINA_SAFETY_ON_NULL_RETURN(plane); EINA_SAFETY_ON_TRUE_RETURN(plane->dead); + plane->output->fbs = eina_list_append(plane->output->fbs, + plane->state->fb); plane->dead = EINA_TRUE; + plane->state->fb = NULL; plane->state->in_use = EINA_FALSE; _fb_atomic_flip_test(plane->output); } @@ -163,8 +166,14 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb) fallback_id = plane->state->fid.value; plane->state->fid.value = fb->id; - if (_fb_atomic_flip_test(plane->output)) return EINA_TRUE; - + if (_fb_atomic_flip_test(plane->output)) + { + _ecore_drm2_fb_ref(fb); + plane->output->fbs = eina_list_append(plane->output->fbs, + plane->state->fb); + plane->state->fb = fb; + return EINA_TRUE; + } plane->state->fid.value = fallback_id; return EINA_FALSE; } |