drm/amd/display: Create plane rotation property
authorPierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Thu, 12 Sep 2019 16:44:04 +0000 (09:44 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 Jul 2020 16:02:56 +0000 (12:02 -0400)
It's otherwise properly supported, just needs exposing to userspace.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 9b1f5244ec87c8b713ea987413544ed9231ae822..f4d983947c17a90248188d5f948a31da259cb052 100644 (file)
@@ -5866,6 +5866,7 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
        uint32_t formats[32];
        int num_formats;
        int res = -EPERM;
+       unsigned int supported_rotations;
 
        num_formats = get_plane_formats(plane, plane_cap, formats,
                                        ARRAY_SIZE(formats));
@@ -5900,6 +5901,13 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
                        DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE);
        }
 
+       supported_rotations =
+               DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
+               DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
+
+       drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
+                                          supported_rotations);
+
        drm_plane_helper_add(plane, &dm_plane_helper_funcs);
 
        /* Create (reset) the plane state */