summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c9
1 files changed, 7 insertions, 2 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