Allow user-space to use the cursor plane with a rotated underlying plane under the condition that both planes have the same rotation. Signed-off-by: Simon Ser <contact@xxxxxxxxxxx> Cc: Alex Deucher <alexander.deucher@xxxxxxx> Cc: Harry Wentland <hwentlan@xxxxxxx> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx> Cc: Michel Dänzer <michel@xxxxxxxxxxx> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index aba01255ba12..23ff33c78879 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9867,9 +9867,9 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state, return -EINVAL; } - if (new_underlying_state->rotation != DRM_MODE_ROTATE_0) { + if (new_underlying_state->rotation != new_cursor_state->rotation) { drm_dbg_atomic(crtc->dev, - "Cursor [PLANE:%d:%s] can't be used with rotated underlying [PLANE:%d:%s]\n", + "Cursor [PLANE:%d:%s] rotation doesn't match underlying [PLANE:%d:%s]\n", cursor->base.id, cursor->name, underlying->base.id, underlying->name); return -EINVAL; } diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 8eeca160d434..1b3ef68f5bc4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1487,8 +1487,7 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270; - if (dm->adev->asic_type >= CHIP_BONAIRE && - plane->type != DRM_PLANE_TYPE_CURSOR) + if (dm->adev->asic_type >= CHIP_BONAIRE) drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, supported_rotations); -- 2.41.0