summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c9
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 74284c4502..a771091a52 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -527,6 +527,8 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
527 state->plane_states = calloc(state->planes, sizeof(Ecore_Drm2_Plane_State)); 527 state->plane_states = calloc(state->planes, sizeof(Ecore_Drm2_Plane_State));
528 if (state->plane_states) 528 if (state->plane_states)
529 { 529 {
530 unsigned int f = 0;
531
530 for (i = 0; i < state->planes; i++) 532 for (i = 0; i < state->planes; i++)
531 { 533 {
532 drmModePlanePtr plane; 534 drmModePlanePtr plane;
@@ -539,8 +541,11 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
539 pstate->obj_id = pres->planes[i]; 541 pstate->obj_id = pres->planes[i];
540 pstate->mask = plane->possible_crtcs; 542 pstate->mask = plane->possible_crtcs;
541 pstate->num_formats = plane->count_formats; 543 pstate->num_formats = plane->count_formats;
542 memcpy(pstate->formats, plane->formats, 544
543 plane->count_formats * sizeof(plane->formats[0])); 545 pstate->formats = calloc(plane->count_formats, sizeof(uint32_t));
546
547 for (f = 0; f < plane->count_formats; f++)
548 pstate->formats[f] = plane->formats[f];
544 549
545 sym_drmModeFreePlane(plane); 550 sym_drmModeFreePlane(plane);
546 551
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 7bc69bf460..73e61f2431 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -649,7 +649,7 @@ typedef struct _Ecore_Drm2_Plane_State
649 uint32_t supported_rotations; 649 uint32_t supported_rotations;
650 650
651 uint32_t num_formats; 651 uint32_t num_formats;
652 uint32_t formats[]; 652 uint32_t *formats;
653} Ecore_Drm2_Plane_State; 653} Ecore_Drm2_Plane_State;
654 654
655struct _Ecore_Drm2_Atomic_State 655struct _Ecore_Drm2_Atomic_State