]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "drm/amd/display: Optimize cursor position updates"
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Thu, 2 Jan 2025 18:12:24 +0000 (13:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:43 +0000 (16:35 +0200)
[ Upstream commit a5d258a00b41143d9c64880eed35799d093c4782 ]

This reverts commit 88c7c56d07c108ed4de319c8dba44aa4b8a38dd1.

SW and HW state are not always matching in some cases causing cursor to
be disabled.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c

index 01480a04f85ef52680bc0eb2bb946ea36b42c72e..9a3be1dd352b6af75b0c5299b5bbc7decca682f0 100644 (file)
@@ -483,11 +483,10 @@ void dpp1_set_cursor_position(
        if (src_y_offset + cursor_height <= 0)
                cur_en = 0;  /* not visible beyond top edge*/
 
-       if (dpp_base->pos.cur0_ctl.bits.cur0_enable != cur_en) {
-               REG_UPDATE(CURSOR0_CONTROL, CUR0_ENABLE, cur_en);
+       REG_UPDATE(CURSOR0_CONTROL,
+                       CUR0_ENABLE, cur_en);
 
-               dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en;
-       }
+       dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en;
 }
 
 void dpp1_cnv_set_optional_cursor_attributes(
index 712aff7e17f7a0f727f7751676216c9168d875a2..92b34fe47f7400a2615a4c8cb7107309a490d172 100644 (file)
@@ -155,11 +155,9 @@ void dpp401_set_cursor_position(
        struct dcn401_dpp *dpp = TO_DCN401_DPP(dpp_base);
        uint32_t cur_en = pos->enable ? 1 : 0;
 
-       if (dpp_base->pos.cur0_ctl.bits.cur0_enable != cur_en) {
-               REG_UPDATE(CURSOR0_CONTROL, CUR0_ENABLE, cur_en);
+       REG_UPDATE(CURSOR0_CONTROL, CUR0_ENABLE, cur_en);
 
-               dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en;
-       }
+       dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en;
 }
 
 void dpp401_set_optional_cursor_attributes(
index c74ee2d50a699ac574ca7ee82b9abe8c733eb685..b405fa22f87a9e4f8b24db3f91713699dda0d5ea 100644 (file)
@@ -1044,13 +1044,11 @@ void hubp2_cursor_set_position(
        if (src_y_offset + cursor_height <= 0)
                cur_en = 0;  /* not visible beyond top edge*/
 
-       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);
+       if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
+               hubp->funcs->set_cursor_attributes(hubp, &hubp->curs_attr);
 
-               REG_UPDATE(CURSOR_CONTROL,
+       REG_UPDATE(CURSOR_CONTROL,
                        CURSOR_ENABLE, cur_en);
-       }
 
        REG_SET_2(CURSOR_POSITION, 0,
                        CURSOR_X_POSITION, pos->x,
index 7013c124efcff81c7c3588eaf89d52cf5798ff7a..2d52100510f05f596a7eec2805a30524c3e7cc9a 100644 (file)
@@ -718,13 +718,11 @@ void hubp401_cursor_set_position(
                        dc_fixpt_from_int(dst_x_offset),
                        param->h_scale_ratio));
 
-       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);
+       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,