summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_plane.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-06-16 16:07:15 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-06-23 08:15:41 -0500
commita8c7b89cb7a3a8136102f340b6838a6a05fcb231 (patch)
tree3784174fb6a7711afa7ca7c6a652da6d9ec0bb4c /src/lib/ecore_drm2/ecore_drm2_plane.c
parentbe90b91ac125e8ef06a9251f1a31ad7c9a83ce12 (diff)
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.
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_plane.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c12
1 files changed, 8 insertions, 4 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:
96 pstate->in_use = EINA_TRUE; 96 pstate->in_use = EINA_TRUE;
97 pstate->cid.value = output->crtc_id; 97 pstate->cid.value = output->crtc_id;
98 pstate->fid.value = fb->id; 98 pstate->fid.value = fb->id;
99 pstate->fb = fb; 99 plane->fb = fb;
100 100
101 pstate->sx.value = 0; 101 pstate->sx.value = 0;
102 pstate->sy.value = 0; 102 pstate->sy.value = 0;
@@ -130,11 +130,15 @@ out:
130EAPI void 130EAPI void
131ecore_drm2_plane_release(Ecore_Drm2_Plane *plane) 131ecore_drm2_plane_release(Ecore_Drm2_Plane *plane)
132{ 132{
133 Ecore_Drm2_Fb *fb;
134
133 EINA_SAFETY_ON_NULL_RETURN(plane); 135 EINA_SAFETY_ON_NULL_RETURN(plane);
134 EINA_SAFETY_ON_TRUE_RETURN(plane->dead); 136 EINA_SAFETY_ON_TRUE_RETURN(plane->dead);
135 137
138 fb = plane->fb;
139
136 plane->output->fbs = 140 plane->output->fbs =
137 eina_list_append(plane->output->fbs, plane->state->fb); 141 eina_list_append(plane->output->fbs, fb);
138 142
139 plane->dead = EINA_TRUE; 143 plane->dead = EINA_TRUE;
140 plane->state->in_use = EINA_FALSE; 144 plane->state->in_use = EINA_FALSE;
@@ -171,9 +175,9 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb)
171 _ecore_drm2_fb_ref(fb); 175 _ecore_drm2_fb_ref(fb);
172 176
173 plane->output->fbs = 177 plane->output->fbs =
174 eina_list_append(plane->output->fbs, plane->state->fb); 178 eina_list_append(plane->output->fbs, plane->fb);
175 179
176 plane->state->fb = fb; 180 plane->fb = fb;
177 return EINA_TRUE; 181 return EINA_TRUE;
178 } 182 }
179 plane->state->fid.value = fallback_id; 183 plane->state->fid.value = fallback_id;