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:
Derek Foreman 2017-04-27 15:44:22 -05:00
parent 7dd8d6d163
commit 308a11cfd6
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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