summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_plane.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-05-12 14:41:03 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-12 17:51:34 -0500
commitedcbff59b72ef8b26af99c1cb3c38f4ffb48282a (patch)
tree3715fc4cdd8906b55969edf4214fdc3f1e7da9d6 /src/lib/ecore_drm2/ecore_drm2_plane.c
parent69b941f018a5e289f4eb34adcfdc774c0d9a2409 (diff)
ecore_drm2: refcount fbs
Removes the previous "busy" flag, as now we might have an fb attached to multiple outputs at once, and need to be careful to destroy them only after they've been removed from all outputs. Removed the old "busy_set" API which nothing used, and renames fb_destroy to fb_discard to make it more clear that it's not immediately destroyed. It's all beta api, so I can do this.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c17
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:
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 100
100 pstate->sx.value = 0; 101 pstate->sx.value = 0;
101 pstate->sy.value = 0; 102 pstate->sy.value = 0;
@@ -119,8 +120,7 @@ out:
119 return NULL; 120 return NULL;
120 } 121 }
121 122
122 fb->ref++; 123 _ecore_drm2_fb_ref(fb);
123
124 DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id); 124 DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id);
125 output->planes = eina_list_append(output->planes, plane); 125 output->planes = eina_list_append(output->planes, plane);
126 126
@@ -133,7 +133,10 @@ ecore_drm2_plane_release(Ecore_Drm2_Plane *plane)
133 EINA_SAFETY_ON_NULL_RETURN(plane); 133 EINA_SAFETY_ON_NULL_RETURN(plane);
134 EINA_SAFETY_ON_TRUE_RETURN(plane->dead); 134 EINA_SAFETY_ON_TRUE_RETURN(plane->dead);
135 135
136 plane->output->fbs = eina_list_append(plane->output->fbs,
137 plane->state->fb);
136 plane->dead = EINA_TRUE; 138 plane->dead = EINA_TRUE;
139 plane->state->fb = NULL;
137 plane->state->in_use = EINA_FALSE; 140 plane->state->in_use = EINA_FALSE;
138 _fb_atomic_flip_test(plane->output); 141 _fb_atomic_flip_test(plane->output);
139} 142}
@@ -163,8 +166,14 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb)
163 166
164 fallback_id = plane->state->fid.value; 167 fallback_id = plane->state->fid.value;
165 plane->state->fid.value = fb->id; 168 plane->state->fid.value = fb->id;
166 if (_fb_atomic_flip_test(plane->output)) return EINA_TRUE; 169 if (_fb_atomic_flip_test(plane->output))
167 170 {
171 _ecore_drm2_fb_ref(fb);
172 plane->output->fbs = eina_list_append(plane->output->fbs,
173 plane->state->fb);
174 plane->state->fb = fb;
175 return EINA_TRUE;
176 }
168 plane->state->fid.value = fallback_id; 177 plane->state->fid.value = fallback_id;
169 return EINA_FALSE; 178 return EINA_FALSE;
170} 179}