Skip to contentSkip to conversation

drm/amd/display: Convert 10kHz clks from PPLib into kHz for Vega

PATCH Superseded Harry Wentland 4 participants 8 messages Jul 12, 2018 4 messages not in the archive

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

PATCH 1/1 drm/amd/display: Convert 10kHz clks from PPLib into kHz for Vega

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

---

Alex, please pull this into drm-fixes-4.18.

Harry

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
 			DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
 
 	for (i = 0; i < clk_level_info->num_levels; i++) {
-		DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+		DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+		/* translate 10kHz to kHz */
+		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
 		clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
 	}
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180712133605.13625-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Fixing Nicholas's email.

Quoted 26 lines · Harry Wentland

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

---

Alex, please pull this into drm-fixes-4.18.

Harry

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +0 -0
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
 			DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c static void pp_to_dc_clock_levels_with_latency( · line 263

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
 
 	for (i = 0; i < clk_level_info->num_levels; i++) {
-		DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+		DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+		/* translate 10kHz to kHz */
+		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
 		clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
 	}
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 33db9a5d-1ed7-f051-48fe-84522751ac90-5C7GfCeVMHo@public.gmane.org

#4 lore raw
Quoted 16 lines · Harry Wentland

Fixing Nicholas's email.

Quoted 13 lines · Harry Wentland

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

---

Alex, please pull this into drm-fixes-4.18.

I assume this fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=107082 ?

Thanks,

Alex

Quoted 13 lines
Quoted 13 lines

Harry

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +0 -0
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
                      DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
 
Quoted 14 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c static void pp_to_dc_clock_levels_with_latency( · line 263

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
      for (i = 0; i < clk_level_info->num_levels; i++) {
-             DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-             clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+             DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+             /* translate 10kHz to kHz */
+             clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
              clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
      }
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_OFtLZbZEf6hZGjcN+MdtsAckqL=mBZ_L44VW-SSvaAjQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 12 lines · Alex Deucher
Quoted 11 lines · Harry Wentland

Fixing Nicholas's email.

Quoted 8 lines · Harry Wentland

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines

---

Alex, please pull this into drm-fixes-4.18.

I assume this fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=107082 ?

Correct, sending v2.

Harry

Quoted 31 lines

Thanks,

Alex

Quoted 27 lines
Quoted 13 lines

Harry

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +0 -0
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
                      DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c static void pp_to_dc_clock_levels_with_latency( · line 263

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
 
      for (i = 0; i < clk_level_info->num_levels; i++) {
-             DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-             clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+             DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+             /* translate 10kHz to kHz */
+             clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
              clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
      }
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw

PATCH v2 1/1 drm/amd/display: Convert 10kHz clks from PPLib into kHz for Vega

In reply to a message not in the archive

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

v2: Add Fixes tag

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
 			DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
 
 	for (i = 0; i < clk_level_info->num_levels; i++) {
-		DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+		DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+		/* translate 10kHz to kHz */
+		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
 		clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
 	}
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180712140909.15981-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#9 lore raw
Quoted 11 lines · Harry Wentland

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

v2: Add Fixes tag

Bugzilla: https://bugs.freedesktop.org/107082

With that fixed,

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#10 lore raw
In reply to a message not in the archive

This does get called from both dce120 and dce112, but it will also any fix any problems for dce112 as well. Looks fine to me.

Nicholas Kazlauskas

Quoted 25 lines · Harry Wentland

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

v2: Add Fixes tag

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +0 -0
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
  			DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c static void pp_to_dc_clock_levels_with_latency( · line 263

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
 
  	for (i = 0; i < clk_level_info->num_levels; i++) {
-		DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+		DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+		/* translate 10kHz to kHz */
+		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
  		clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
  	}
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#11 lore raw

PATCH v3 1/1 drm/amd/display: Convert 10kHz clks from PPLib into kHz for Vega

In reply to a message not in the archive

The driver is expecting clock frequency in kHz, while SMU returns the values in 10kHz, which causes the bandwidth validation to fail

4.18 has the faulty clock assignment in pp_to_dc_clock_levels_with_latency only, which is only used by Vega. Make sure we multiply these values by 10 here, as we do for other ASICs as powerplay assigned them wrong. 4.19 has the proper fix in powerplay.

v2: Add Fixes tag
v3: Fixes -> Bugzilla, with simplified link

Bugzilla: https://bugs.freedesktop.org/107082

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +3 -2
index 5a3346124a01..5a2e952c5bea 100644
@@ -255,8 +255,9 @@ static void pp_to_dc_clock_levels_with_latency(
 			DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
 
 	for (i = 0; i < clk_level_info->num_levels; i++) {
-		DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
-		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
+		DRM_DEBUG("DM_PPLIB:\t %d in 10kHz\n", pp_clks->data[i].clocks_in_khz);
+		/* translate 10kHz to kHz */
+		clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz * 10;
 		clk_level_info->data[i].latency_in_us = pp_clks->data[i].latency_in_us;
 	}
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx