drm/amd/display: remove compbuf size wait
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Fri, 25 Jun 2021 13:09:09 +0000 (09:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Jul 2021 17:39:25 +0000 (13:39 -0400)
This tends to take miliseconds in certain scenarios and we'd rather not
wait that long. Due to how this interacts with det size update and
locking waiting should not be necessary as compbuf updates before
unlock.

Add a watch for config error instead as that is something we actually do
care about.

Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h

index 32fb22d..39485bd 100644 (file)
@@ -319,6 +319,7 @@ struct dcn_hubbub_registers {
                type DET3_SIZE_CURRENT;\
                type COMPBUF_SIZE;\
                type COMPBUF_SIZE_CURRENT;\
+               type CONFIG_ERROR;\
                type COMPBUF_RESERVED_SPACE_64B;\
                type COMPBUF_RESERVED_SPACE_ZS;\
                type DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A;\
index b5a7fa6..2043528 100644 (file)
@@ -124,8 +124,8 @@ static void dcn31_program_compbuf_size(struct hubbub *hubbub, unsigned int compb
                ASSERT(hubbub2->det0_size + hubbub2->det1_size + hubbub2->det2_size
                                + hubbub2->det3_size + compbuf_size_segments <= hubbub2->crb_size_segs);
                REG_UPDATE(DCHUBBUB_COMPBUF_CTRL, COMPBUF_SIZE, compbuf_size_segments);
-               REG_WAIT(DCHUBBUB_COMPBUF_CTRL, COMPBUF_SIZE_CURRENT, compbuf_size_segments, 1, 100);
                hubbub2->compbuf_size_segments = compbuf_size_segments;
+               ASSERT(REG_GET(DCHUBBUB_COMPBUF_CTRL, CONFIG_ERROR, &compbuf_size_segments) && !compbuf_size_segments);
        }
 }
 
index 298858d..e3a654b 100644 (file)
@@ -98,6 +98,7 @@
        HUBBUB_SF(DCHUBBUB_DET3_CTRL, DET3_SIZE_CURRENT, mask_sh),\
        HUBBUB_SF(DCHUBBUB_COMPBUF_CTRL, COMPBUF_SIZE, mask_sh),\
        HUBBUB_SF(DCHUBBUB_COMPBUF_CTRL, COMPBUF_SIZE_CURRENT, mask_sh),\
+       HUBBUB_SF(DCHUBBUB_COMPBUF_CTRL, CONFIG_ERROR, mask_sh),\
        HUBBUB_SF(COMPBUF_RESERVED_SPACE, COMPBUF_RESERVED_SPACE_64B, mask_sh),\
        HUBBUB_SF(COMPBUF_RESERVED_SPACE, COMPBUF_RESERVED_SPACE_ZS, mask_sh),\
        HUBBUB_SF(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A, DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A, mask_sh), \