summaryrefslogtreecommitdiff
path: root/src
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
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 '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c12
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h2
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:
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;
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
104 104
105 /* these are not part of an atomic state, but we store these here 105 /* these are not part of an atomic state, but we store these here
106 * so that we do not have to refetch properties when iterating planes */ 106 * so that we do not have to refetch properties when iterating planes */
107 Ecore_Drm2_Fb *fb;
108 uint32_t rotation_map[6]; 107 uint32_t rotation_map[6];
109 uint32_t supported_rotations; 108 uint32_t supported_rotations;
110 109
@@ -175,6 +174,7 @@ struct _Ecore_Drm2_Plane
175 int type; 174 int type;
176 Ecore_Drm2_Plane_State *state; 175 Ecore_Drm2_Plane_State *state;
177 Ecore_Drm2_Output *output; 176 Ecore_Drm2_Output *output;
177 Ecore_Drm2_Fb *fb;
178 Eina_Bool dead; 178 Eina_Bool dead;
179}; 179};
180 180