diff options
author | Nevenko Stupar <nevenko.stupar@amd.com> | 2024-06-10 15:32:05 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-06-27 17:10:36 -0400 |
commit | ee8287e068a3995b0f8001dd6931e221dfb7c530 (patch) | |
tree | 424a74e59b9e462831cb43be813cbe6fa3588e2c /drivers/gpu/drm/amd/display/dc/hubp/dcn401 | |
parent | c6dfe8f20b00d0ac6addc0024d4c70693e78e7cd (diff) | |
download | linux-ee8287e068a3995b0f8001dd6931e221dfb7c530.tar.gz linux-ee8287e068a3995b0f8001dd6931e221dfb7c530.tar.bz2 linux-ee8287e068a3995b0f8001dd6931e221dfb7c530.zip |
drm/amd/display: Fix cursor issues with ODMs and HW rotations
[WHY & HOW]
Current code for cursor positions does not work properly
with different ODM options and HW rotations like ODM
2to1, 3to1 and 4to1, and has different issues depending on
angle of HW rotations.
[HOW]
Fixed these issues so to work properly when ODM is used with HW rotations.
Reviewed-by: Sridevi Arvindekar <sridevi.arvindekar@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Nevenko Stupar <nevenko.stupar@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/hubp/dcn401')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c b/drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c index 6692d57d5cce..a893160ae775 100644 --- a/drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +++ b/drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c @@ -654,12 +654,8 @@ void hubp401_cursor_set_position( struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp); int x_pos = pos->x - param->recout.x; int y_pos = pos->y - param->recout.y; - int x_hotspot = pos->x_hotspot; - int y_hotspot = pos->y_hotspot; int rec_x_offset = x_pos - pos->x_hotspot; int rec_y_offset = y_pos - pos->y_hotspot; - int cursor_height = (int)hubp->curs_attr.height; - int cursor_width = (int)hubp->curs_attr.width; uint32_t dst_x_offset; uint32_t cur_en = pos->enable ? 1 : 0; @@ -672,28 +668,6 @@ void hubp401_cursor_set_position( if (hubp->curs_attr.address.quad_part == 0) return; - // Transform cursor width / height and hotspots for offset calculations - if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) { - swap(cursor_height, cursor_width); - swap(x_hotspot, y_hotspot); - - if (param->rotation == ROTATION_ANGLE_90) { - // hotspot = (-y, x) - rec_x_offset = x_pos - (cursor_width - x_hotspot); - rec_y_offset = y_pos - y_hotspot; - } else if (param->rotation == ROTATION_ANGLE_270) { - // hotspot = (y, -x) - rec_x_offset = x_pos - x_hotspot; - rec_y_offset = y_pos - (cursor_height - y_hotspot); - } - } else if (param->rotation == ROTATION_ANGLE_180) { - // hotspot = (-x, -y) - if (!param->mirror) - rec_x_offset = x_pos - (cursor_width - x_hotspot); - - rec_y_offset = y_pos - (cursor_height - y_hotspot); - } - dst_x_offset = (rec_x_offset >= 0) ? rec_x_offset : 0; dst_x_offset *= param->ref_clk_khz; dst_x_offset /= param->pixel_clk_khz; @@ -705,18 +679,6 @@ void hubp401_cursor_set_position( dc_fixpt_from_int(dst_x_offset), param->h_scale_ratio)); - if (rec_x_offset >= (int)param->recout.width) - cur_en = 0; /* not visible beyond right edge*/ - - if (rec_x_offset + cursor_width <= 0) - cur_en = 0; /* not visible beyond left edge*/ - - if (rec_y_offset >= (int)param->recout.height) - cur_en = 0; /* not visible beyond bottom edge*/ - - if (rec_y_offset + cursor_height <= 0) - cur_en = 0; /* not visible beyond top edge*/ - if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0) hubp->funcs->set_cursor_attributes(hubp, &hubp->curs_attr); |