diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2017-06-16 16:07:15 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2017-06-23 08:15:41 -0500 |
commit | a8c7b89cb7a3a8136102f340b6838a6a05fcb231 (patch) | |
tree | 3784174fb6a7711afa7ca7c6a652da6d9ec0bb4c | |
parent | be90b91ac125e8ef06a9251f1a31ad7c9a83ce12 (diff) | |
download | efl-a8c7b89cb7a3a8136102f340b6838a6a05fcb231.tar.gz |
ecore_drm2: Move fb from plane state struct to plane struct
The plane state struct needs the fb id for drm updates, and the plane
state can be updated even if it's pointed to by a dead plane.
Dead planes need to keep their fb so we can properly handle the fb
lifetime.
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_plane.c | 12 | ||||
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_private.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c index a83d1fb3fd..cc79bff1dd 100644 --- a/src/lib/ecore_drm2/ecore_drm2_plane.c +++ b/src/lib/ecore_drm2/ecore_drm2_plane.c @@ -96,7 +96,7 @@ out: pstate->in_use = EINA_TRUE; pstate->cid.value = output->crtc_id; pstate->fid.value = fb->id; - pstate->fb = fb; + plane->fb = fb; pstate->sx.value = 0; pstate->sy.value = 0; @@ -130,11 +130,15 @@ out: EAPI void ecore_drm2_plane_release(Ecore_Drm2_Plane *plane) { + Ecore_Drm2_Fb *fb; + EINA_SAFETY_ON_NULL_RETURN(plane); EINA_SAFETY_ON_TRUE_RETURN(plane->dead); + fb = plane->fb; + plane->output->fbs = - eina_list_append(plane->output->fbs, plane->state->fb); + eina_list_append(plane->output->fbs, fb); plane->dead = EINA_TRUE; plane->state->in_use = EINA_FALSE; @@ -171,9 +175,9 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb) _ecore_drm2_fb_ref(fb); plane->output->fbs = - eina_list_append(plane->output->fbs, plane->state->fb); + eina_list_append(plane->output->fbs, plane->fb); - plane->state->fb = fb; + plane->fb = fb; return EINA_TRUE; } plane->state->fid.value = fallback_id; diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 4837871311..730c7b52ce 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h @@ -104,7 +104,6 @@ typedef struct _Ecore_Drm2_Plane_State /* these are not part of an atomic state, but we store these here * so that we do not have to refetch properties when iterating planes */ - Ecore_Drm2_Fb *fb; uint32_t rotation_map[6]; uint32_t supported_rotations; @@ -175,6 +174,7 @@ struct _Ecore_Drm2_Plane int type; Ecore_Drm2_Plane_State *state; Ecore_Drm2_Output *output; + Ecore_Drm2_Fb *fb; Eina_Bool dead; }; |