Skip to contentSkip to conversation

drm/amd/display: Fix fast updates on DCE6

PATCH In review Timur Kristóf 2 participants 4 messages Sep 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix fast updates on DCE6

DCE6 should use legacy fast updates, just like all DCE8 - DCN2.

Technically DCE6 should have been included when the fast update code was refactored, but it just happened to work until now.

A recent commit "Attach only plane updates that actually changed" has exposed this issue because with that commit, DC accidentally took the new fast update code path for DCE6 as well, which caused it to boot into a black screen with a flip done timeout.

This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update".

Fixes 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence")
Fixes 9ec11bb842b6 ("drm/amd/display: Remove dc param from check_update")
---
 .../drm/amd/display/dc/resource/dce60/dce60_resource.c    | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +8 -0
index d2d56a1c4b8b..f4efa55952f3 100644
@@ -448,6 +448,12 @@ static const struct dce_abm_mask abm_mask = {
 		ABM_MASK_SH_LIST_DCE110(_MASK)
 };
 
+static const struct dc_debug_options debug_defaults = { 0 };
+
+static const struct dc_check_config config_defaults = {
+	.enable_legacy_fast_update = true,
+};
+
 #define CTX  ctx
 #define REG(reg) mm ## reg
 
@@ -937,6 +943,8 @@ static bool dce60_construct(
 	dc->caps.max_cursor_size = 64;
 	dc->caps.dual_link_dvi = true;
 	dc->caps.extended_aux_timeout_support = false;
+	dc->debug = debug_defaults;
+	dc->check_config = config_defaults;
 
 	/*************************************************
 	 *  Create resources                             *
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Timur Kristóf

DCE6 should use legacy fast updates, just like all DCE8 - DCN2.

Technically DCE6 should have been included when the fast update code was refactored, but it just happened to work until now.

A recent commit "Attach only plane updates that actually changed" has exposed this issue because with that commit, DC accidentally took the new fast update code path for DCE6 as well, which caused it to boot into a black screen with a flip done timeout.

Quoted 8 lines

This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update".

Fixes 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence")
Fixes 9ec11bb842b6 ("drm/amd/display: Remove dc param from check_update")
Quoted 29 lines
  .../drm/amd/display/dc/resource/dce60/dce60_resource.c    | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +8 -0
index d2d56a1c4b8b..f4efa55952f3 100644
@@ -448,6 +448,12 @@ static const struct dce_abm_mask abm_mask = {
  		ABM_MASK_SH_LIST_DCE110(_MASK)
  };
 
+static const struct dc_debug_options debug_defaults = { 0 };
+
+static const struct dc_check_config config_defaults = {
+	.enable_legacy_fast_update = true,
+};
+
  #define CTX  ctx
  #define REG(reg) mm ## reg
 
@@ -937,6 +943,8 @@ static bool dce60_construct(
  	dc->caps.max_cursor_size = 64;
  	dc->caps.dual_link_dvi = true;
  	dc->caps.extended_aux_timeout_support = false;
+	dc->debug = debug_defaults;
+	dc->check_config = config_defaults;
 
  	/*************************************************
  	 *  Create resources                             *
#2 lore raw
Quoted 40 lines · Mario Limonciello
Quoted 10 lines · Timur Kristóf

DCE6 should use legacy fast updates, just like all DCE8 - DCN2.

Technically DCE6 should have been included when the fast update code was refactored, but it just happened to work until now.

A recent commit "Attach only plane updates that actually changed" has exposed this issue because with that commit, DC accidentally took the new fast update code path for DCE6 as well, which caused it to boot into a black screen with a flip done timeout.

Quoted 8 lines

This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update".

Fixes 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence")
Fixes 9ec11bb842b6 ("drm/amd/display: Remove dc param from check_update")
Quoted 18 lines

  .../drm/amd/display/dc/resource/dce60/dce60_resource.c    | 8 ++++++++

  1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +6 -0
index d2d56a1c4b8b..f4efa55952f3 100644
@@ -448,6 +448,12 @@ static const struct dce_abm_mask abm_mask = {
           ABM_MASK_SH_LIST_DCE110(_MASK)
   };
+static const struct dc_debug_options debug_defaults = { 0 };
+
+static const struct dc_check_config config_defaults = {
+    .enable_legacy_fast_update = true,
+};
+
   #define CTX  ctx
   #define REG(reg) mm ## reg
Quoted 9 lines

drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c static bool dce60_construct( · line 949

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +2 -0
@@ -937,6 +943,8 @@ static bool dce60_construct(
       dc->caps.max_cursor_size = 64;
       dc->caps.dual_link_dvi = true;
       dc->caps.extended_aux_timeout_support = false;
+    dc->debug = debug_defaults;
+    dc->check_config = config_defaults;
       /*************************************************
        *  Create resources                             *

I would be remiss not to share something the code-review agent flagged when testing this for merge.

---
Incomplete fix: this is only dce60_construct(), which dc_create_resource_pool() uses for DCE_VERSION_6_0 (Tahiti / Pitcairn / Cape Verde) only.

dce60_resource.c has two more constructors that are reached for the other SI parts (see resource_parse_asic_id() in core/dc_resource.c:150-158):

dce61_construct() (line 1120) -> DCE_VERSION_6_1 (Hainan)
dce64_construct() (line 1318) -> DCE_VERSION_6_4 (Oland)
Neither gets dc->check_config assigned, so enable_legacy_fast_update stays false there (dc is kvzalloc'd in dc_create()), and both keep taking the new fast-update path that ac8349780c5d exposes. They should hit exactly the same black screen / flip-done timeout this patch is fixing, since all three share dce60_hw_sequencer_construct() and dce60_res_pool_funcs.

Suggest adding the same two lines to both, e.g. after dc->caps.is_apu = true; at line 1144 (dce61) and line 1342 (dce64):

dc->debug = debug_defaults;
dc->check_config = config_defaults;
---

I'll hold up the merge to decide what to do (we can just have a v2 if you want).

#3 lore raw
Quoted 77 lines · Central European Summer Time Mario Limonciello
Quoted 44 lines · Mario Limonciello
Quoted 15 lines · Timur Kristóf

DCE6 should use legacy fast updates, just like all DCE8 - DCN2.

Technically DCE6 should have been included when the fast update code was refactored, but it just happened to work until now.

A recent commit "Attach only plane updates that actually changed" has exposed this issue because with that commit, DC accidentally took the new fast update code path for DCE6 as well, which caused it to boot into a black screen with a flip done timeout.

This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update".

Quoted 5 lines
Fixes 0baae6246307 ("drm/amd/display: Refactor fast update to use new

HWSS build sequence")

Fixes 9ec11bb842b6 ("drm/amd/display: Remove dc param from

check_update")

Quoted 20 lines
  .../drm/amd/display/dc/resource/dce60/dce60_resource.c    | 8 ++++++++
  1 file changed, 8 insertions(+)
(quoted diff) +0 -0

dce60_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce60/ dce60_resource.c
index d2d56a1c4b8b..f4efa55952f3 100644

drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +6 -0
@@ -448,6 +448,12 @@ static const struct dce_abm_mask abm_mask = {
          ABM_MASK_SH_LIST_DCE110(_MASK)
  };
+static const struct dc_debug_options debug_defaults = { 0 };
+
+static const struct dc_check_config config_defaults = {
+    .enable_legacy_fast_update = true,
+};
+
  #define CTX  ctx
  #define REG(reg) mm ## reg
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c static bool dce60_construct( · line 949

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +2 -0
@@ -937,6 +943,8 @@ static bool dce60_construct(
      dc->caps.max_cursor_size = 64;
      dc->caps.dual_link_dvi = true;
      dc->caps.extended_aux_timeout_support = false;
+    dc->debug = debug_defaults;
+    dc->check_config = config_defaults;
      /*************************************************
       *  Create resources                             *

I would be remiss not to share something the code-review agent flagged when testing this for merge.

---
Incomplete fix: this is only dce60_construct(), which dc_create_resource_pool() uses for DCE_VERSION_6_0 (Tahiti / Pitcairn / Cape Verde) only.

dce60_resource.c has two more constructors that are reached for the other SI parts (see resource_parse_asic_id() in core/dc_resource.c:150-158):

dce61_construct() (line 1120) -> DCE_VERSION_6_1 (Hainan) dce64_construct() (line 1318) -> DCE_VERSION_6_4 (Oland) Neither gets dc->check_config assigned, so enable_legacy_fast_update stays false there (dc is kvzalloc'd in dc_create()), and both keep taking the new fast-update path that ac8349780c5d exposes. They should hit exactly the same black screen / flip-done timeout this patch is fixing, since all three share dce60_hw_sequencer_construct() and dce60_res_pool_funcs.

Suggest adding the same two lines to both, e.g. after dc->caps.is_apu = true; at line 1144 (dce61) and line 1342 (dce64):

Quoted 6 lines

dc->debug = debug_defaults;
dc->check_config = config_defaults;
---

I'll hold up the merge to decide what to do (we can just have a v2 if you want).

Thanks for calling that out. I'll send a second version.