summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/hubp/dcn401
diff options
context:
space:
mode:
authorAric Cyr <Aric.Cyr@amd.com>2024-12-10 18:38:15 -0500
committerAlex Deucher <alexander.deucher@amd.com>2025-01-06 14:44:27 -0500
commit787e7be0c9fb1202124dd3f2dea0d39738f91bee (patch)
treec0b8ca44eb57fd8d7470521e6ad6876aaa090425 /drivers/gpu/drm/amd/display/dc/hubp/dcn401
parentde5d7a8802eac4e22ed95d2d959907ebc4aad3ac (diff)
downloadlinux-787e7be0c9fb1202124dd3f2dea0d39738f91bee.tar.gz
linux-787e7be0c9fb1202124dd3f2dea0d39738f91bee.tar.bz2
linux-787e7be0c9fb1202124dd3f2dea0d39738f91bee.zip
drm/amd/display: Optimize cursor position updates
[why] Updating the cursor enablement register can be a slow operation and accumulates when high polling rate cursors cause frequent updates asynchronously to the cursor position. [how] Since the cursor enable bit is cached there is no need to update the enablement register if there is no change to it. This removes the read-modify-write from the cursor position programming path in HUBP and DPP, leaving only the register writes. Reviewed-by: Josip Pavic <josip.pavic@amd.com> Signed-off-by: Aric Cyr <Aric.Cyr@amd.com> Signed-off-by: Roman Li <roman.li@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.c10
1 files changed, 6 insertions, 4 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 d38e3f3a1107..3595c74a3a2f 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
@@ -730,11 +730,13 @@ void hubp401_cursor_set_position(
dc_fixpt_from_int(dst_x_offset),
param->h_scale_ratio));
- if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
- hubp->funcs->set_cursor_attributes(hubp, &hubp->curs_attr);
+ if (hubp->pos.cur_ctl.bits.cur_enable != cur_en) {
+ if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
+ hubp->funcs->set_cursor_attributes(hubp, &hubp->curs_attr);
- REG_UPDATE(CURSOR_CONTROL,
- CURSOR_ENABLE, cur_en);
+ REG_UPDATE(CURSOR_CONTROL,
+ CURSOR_ENABLE, cur_en);
+ }
REG_SET_2(CURSOR_POSITION, 0,
CURSOR_X_POSITION, x_pos,