forked from enlightenment/efl
ecore-drm2: Iterate plane formats properly
This patch addresses an issue where plane formats were not being properly copied into our Plane State structure and causing any usage of our atomic code paths to crash and burn @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
8eb1e925ae
commit
c4b22eb59c
|
@ -527,6 +527,8 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
|
||||||
state->plane_states = calloc(state->planes, sizeof(Ecore_Drm2_Plane_State));
|
state->plane_states = calloc(state->planes, sizeof(Ecore_Drm2_Plane_State));
|
||||||
if (state->plane_states)
|
if (state->plane_states)
|
||||||
{
|
{
|
||||||
|
unsigned int f = 0;
|
||||||
|
|
||||||
for (i = 0; i < state->planes; i++)
|
for (i = 0; i < state->planes; i++)
|
||||||
{
|
{
|
||||||
drmModePlanePtr plane;
|
drmModePlanePtr plane;
|
||||||
|
@ -539,8 +541,11 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
|
||||||
pstate->obj_id = pres->planes[i];
|
pstate->obj_id = pres->planes[i];
|
||||||
pstate->mask = plane->possible_crtcs;
|
pstate->mask = plane->possible_crtcs;
|
||||||
pstate->num_formats = plane->count_formats;
|
pstate->num_formats = plane->count_formats;
|
||||||
memcpy(pstate->formats, plane->formats,
|
|
||||||
plane->count_formats * sizeof(plane->formats[0]));
|
pstate->formats = calloc(plane->count_formats, sizeof(uint32_t));
|
||||||
|
|
||||||
|
for (f = 0; f < plane->count_formats; f++)
|
||||||
|
pstate->formats[f] = plane->formats[f];
|
||||||
|
|
||||||
sym_drmModeFreePlane(plane);
|
sym_drmModeFreePlane(plane);
|
||||||
|
|
||||||
|
|
|
@ -649,7 +649,7 @@ typedef struct _Ecore_Drm2_Plane_State
|
||||||
uint32_t supported_rotations;
|
uint32_t supported_rotations;
|
||||||
|
|
||||||
uint32_t num_formats;
|
uint32_t num_formats;
|
||||||
uint32_t formats[];
|
uint32_t *formats;
|
||||||
} Ecore_Drm2_Plane_State;
|
} Ecore_Drm2_Plane_State;
|
||||||
|
|
||||||
struct _Ecore_Drm2_Atomic_State
|
struct _Ecore_Drm2_Atomic_State
|
||||||
|
|
Loading…
Reference in New Issue