The release flag is actually less useful than the existing in_use flag
for determining if a plane is unused. If a new plane is assigned before
the next flip cleans up released planes, then it can point to a released
plane state, and both it and the previous user will be freed on the next
commit, leaking a plane.
Putting the flag in the plane structure fixes this while still allowing us
to keep released planes around to ensure a recently released plane is
cleared from atomic state.
EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
{
- if (!plane->state->release) continue;
+ if (!plane->dead) continue;
output->planes = eina_list_remove_list(output->planes, l);
free(plane);
}
{
pstate = plane->state;
- if (pstate->release)
+ if (!pstate->in_use)
{
pstate->cid.value = 0;
pstate->fid.value = 0;
{
EINA_SAFETY_ON_NULL_RETURN(plane);
+ plane->dead = EINA_TRUE;
plane->state->in_use = EINA_FALSE;
- plane->state->release = EINA_TRUE;
_fb_atomic_flip_test(plane->output);
}
uint32_t num_formats;
uint32_t *formats;
- Eina_Bool in_use, release;
+ Eina_Bool in_use;
} Ecore_Drm2_Plane_State;
struct _Ecore_Drm2_Atomic_State
int type;
Ecore_Drm2_Plane_State *state;
Ecore_Drm2_Output *output;
+ Eina_Bool dead;
};
struct _Ecore_Drm2_Output_Mode