Commit 1fd2cf09 authored by Melissa Wen's avatar Melissa Wen Committed by Alex Deucher

drm/amd/display: fix cursor offset on rotation 180

[why & how]
Cursor gets clipped off in the middle of the screen with hw
rotation 180. Fix a miscalculation of cursor offset when it's
placed near the edges in the pipe split case.

Cursor bugs with hw rotation were reported on AMD issue
tracker:
https://gitlab.freedesktop.org/drm/amd/-/issues/2247

The issues on rotation 270 was fixed by:
https://lore.kernel.org/amd-gfx/20221118125935.4013669-22-Brian.Chang@amd.com/
that partially addressed the rotation 180 too. So, this patch is the
final bits for rotation 180.
Reported-by: default avatarXaver Hugl <xaver.hugl@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2247Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Fixes: 9d84c7ef ("drm/amd/display: Correct cursor position on horizontal mirror")
Signed-off-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 17b6527d
...@@ -3594,7 +3594,7 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) ...@@ -3594,7 +3594,7 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
(int)hubp->curs_attr.width || pos_cpy.x (int)hubp->curs_attr.width || pos_cpy.x
<= (int)hubp->curs_attr.width + <= (int)hubp->curs_attr.width +
pipe_ctx->plane_state->src_rect.x) { pipe_ctx->plane_state->src_rect.x) {
pos_cpy.x = temp_x + viewport_width; pos_cpy.x = 2 * viewport_width - temp_x;
} }
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment