forked from enlightenment/efl
ecore_drm2: Assign planes in ecore_drm2_plane_assign
Don't just test, allocate the resource, and then prevent further assignments from trying to use it as well.
This commit is contained in:
parent
7dd8d6d163
commit
308a11cfd6
|
@ -50,6 +50,9 @@ ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
|
|||
/* use algo based on format, size, etc to find a plane this FB can go in */
|
||||
EINA_LIST_FOREACH(output->plane_states, l, pstate)
|
||||
{
|
||||
if (pstate->in_use)
|
||||
continue;
|
||||
|
||||
/* test if this plane supports the given format */
|
||||
if (!_plane_format_supported(pstate, fb->format))
|
||||
continue;
|
||||
|
@ -90,6 +93,7 @@ out:
|
|||
plane = calloc(1, sizeof(Ecore_Drm2_Plane));
|
||||
if (!plane) return NULL;
|
||||
|
||||
pstate->in_use = EINA_TRUE;
|
||||
pstate->cid.value = output->crtc_id;
|
||||
pstate->fid.value = fb->id;
|
||||
|
||||
|
|
|
@ -651,6 +651,8 @@ typedef struct _Ecore_Drm2_Plane_State
|
|||
|
||||
uint32_t num_formats;
|
||||
uint32_t *formats;
|
||||
|
||||
Eina_Bool in_use;
|
||||
} Ecore_Drm2_Plane_State;
|
||||
|
||||
struct _Ecore_Drm2_Atomic_State
|
||||
|
|
Loading…
Reference in New Issue