[PATCH] drm/amd/display: Force full frame updates on DP 38-ec-11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 38-ec-11 TCON contained in some AUO panels will hang when used
with PSR-SU and changing the brightness.

Forcing a full frame update works around the issue, so add a quirk
for this panel to do just that.

Reported-by: aaron.ma@xxxxxxxxxxxxx
Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
Cc: Hamza.Mahfooz@xxxxxxx
Cc: mpearson-lenovo@xxxxxxxxx

 drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 30 ++++++++++++++-----
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
index 3e243e407bb8..68c619b43cbf 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
@@ -36,6 +36,7 @@
 static const uint8_t DP_SINK_DEVICE_STR_ID_1[] = {7, 1, 8, 7, 3};
 static const uint8_t DP_SINK_DEVICE_STR_ID_2[] = {7, 1, 8, 7, 5};
 static const uint8_t DP_SINK_DEVICE_STR_ID_3[] = {0x42, 0x61, 0x6c, 0x73, 0x61};
+static const uint8_t DP_SINK_DEVICE_STR_ID_4[] = {0x0, 0x0, 0x0, 0x0, 0x0};
 
 /*
  * Convert dmcub psr state to dmcu psr state.
@@ -284,6 +285,25 @@ static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt
 	dc_wake_and_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
 }
 
+static bool dmub_psr_need_force_ffu(bool dsc_enable_status, struct dc_link *link)
+{
+	if (link->dpcd_caps.sink_dev_id != DP_DEVICE_ID_38EC11)
+		return false;
+
+	/**
+	 * WA for PSRSU+DSC on specific TCON, if DSC is enabled, force PSRSU as ffu mode(full frame update)
+	 * Note that PSRSU+DSC is still under development.
+	 */
+	if (dsc_enable_status &&
+	    !memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_1,
+		    sizeof(DP_SINK_DEVICE_STR_ID_1)))
+		return true;
+	if (!memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_4,
+		    sizeof(DP_SINK_DEVICE_STR_ID_4)))
+		return true;
+
+	return false;
+}
 /*
  * Setup PSR by programming phy registers and sending psr hw context values to firmware.
  */
@@ -378,14 +398,8 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub,
 	copy_settings_data->panel_inst = panel_inst;
 	copy_settings_data->dsc_enable_status = (pipe_ctx->stream->timing.flags.DSC == 1);
 
-	/**
-	 * WA for PSRSU+DSC on specific TCON, if DSC is enabled, force PSRSU as ffu mode(full frame update)
-	 * Note that PSRSU+DSC is still under development.
-	 */
-	if (copy_settings_data->dsc_enable_status &&
-		link->dpcd_caps.sink_dev_id == DP_DEVICE_ID_38EC11 &&
-		!memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_1,
-			sizeof(DP_SINK_DEVICE_STR_ID_1)))
+
+	if (dmub_psr_need_force_ffu(copy_settings_data->dsc_enable_status, link))
 		link->psr_settings.force_ffu_mode = 1;
 	else
 		link->psr_settings.force_ffu_mode = 0;
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux