aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-04-19 14:56:27 -0400
committerChris Michael <cp.michael@samsung.com>2017-04-19 14:58:11 -0400
commitc4b22eb59c8003a2975b26186a818fc4f1aefb1b (patch)
tree86c57056e85237381b8cae9db46747ef9d635bba /src/lib/ecore_drm2/ecore_drm2_device.c
parentelput: Remove specific case for pointer wheel tilt (diff)
downloadefl-c4b22eb59c8003a2975b26186a818fc4f1aefb1b.tar.gz
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>
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)
state->plane_states = calloc(state->planes, sizeof(Ecore_Drm2_Plane_State));
if (state->plane_states)
{
+ unsigned int f = 0;
+
for (i = 0; i < state->planes; i++)
{
drmModePlanePtr plane;
@@ -539,8 +541,11 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
pstate->obj_id = pres->planes[i];
pstate->mask = plane->possible_crtcs;
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);