Skip to contentSkip to conversation

drm/amdgpu/dc: fill in missing call to atom cmd table for pll adjust v2

PATCH In review Alex Deucher 2 participants 2 messages Mar 3, 2021 – Mar 4, 2021

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/dc: fill in missing call to atom cmd table for pll adjust v2

We set up the parameters, but never called the atom table.

---
 .../drm/amd/display/dc/bios/command_table.c   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/command_table.c +21 -0
index afc10b954ffa..ad13e4e36d77 100644
@@ -1531,6 +1531,27 @@ static enum bp_result adjust_display_pll_v2(
 	params.ucEncodeMode =
 			(uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom(
 					bp_params->signal_type, false);
+
+	if (EXEC_BIOS_CMD_TABLE(AdjustDisplayPll, params)) {
+		/* Convert output pixel clock back 10KHz-->KHz: multiply
+		 * original pixel clock in KHz by ratio
+		 * [output pxlClk/input pxlClk] */
+		uint64_t pixel_clk_10_khz_out =
+				(uint64_t)le16_to_cpu(params.usPixelClock);
+		uint64_t pixel_clk = (uint64_t)bp_params->pixel_clock;
+
+		if (pixel_clock_10KHz_in != 0) {
+			bp_params->adjusted_pixel_clock =
+					div_u64(pixel_clk * pixel_clk_10_khz_out,
+							pixel_clock_10KHz_in);
+		} else {
+			bp_params->adjusted_pixel_clock = 0;
+			BREAK_TO_DEBUGGER();
+		}
+
+		result = BP_RESULT_OK;
+	}
+
 	return result;
 }
 
Signature · 6 lines
2.29.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Alex Deucher

We set up the parameters, but never called the atom table.

Harry

Quoted 27 lines
---
  .../drm/amd/display/dc/bios/command_table.c   | 21 +++++++++++++++++++
  1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/command_table.c +14 -0
index afc10b954ffa..ad13e4e36d77 100644
@@ -1531,6 +1531,27 @@ static enum bp_result adjust_display_pll_v2(
  	params.ucEncodeMode =
  			(uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom(
  					bp_params->signal_type, false);
+
+	if (EXEC_BIOS_CMD_TABLE(AdjustDisplayPll, params)) {
+		/* Convert output pixel clock back 10KHz-->KHz: multiply
+		 * original pixel clock in KHz by ratio
+		 * [output pxlClk/input pxlClk] */
+		uint64_t pixel_clk_10_khz_out =
+				(uint64_t)le16_to_cpu(params.usPixelClock);
+		uint64_t pixel_clk = (uint64_t)bp_params->pixel_clock;
+
+		if (pixel_clock_10KHz_in != 0) {
+			bp_params->adjusted_pixel_clock =
+					div_u64(pixel_clk * pixel_clk_10_khz_out,
+							pixel_clock_10KHz_in);
+		} else {

drivers/gpu/drm/amd/display/dc/bios/command_table.c static enum bp_result adjust_display_pll_v2( · line 1557

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/bios/command_table.c +7 -0
+			bp_params->adjusted_pixel_clock = 0;
+			BREAK_TO_DEBUGGER();
+		}
+
+		result = BP_RESULT_OK;
+	}
+
  	return result;
  }
 

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