Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Add workaround for a panel

Implement w/a for a panel which requires 10s delay after link detect.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Aurabindo Pillai and committed by
Alex Deucher
41b83047 d4c60219

+35 -3
+26 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 3330 3330 } 3331 3331 } 3332 3332 3333 + static void apply_delay_after_dpcd_poweroff(struct amdgpu_device *adev, 3334 + struct dc_sink *sink) 3335 + { 3336 + struct dc_panel_patch *ppatch = NULL; 3337 + 3338 + if (!sink) 3339 + return; 3340 + 3341 + ppatch = &sink->edid_caps.panel_patch; 3342 + if (ppatch->wait_after_dpcd_poweroff_ms) { 3343 + msleep(ppatch->wait_after_dpcd_poweroff_ms); 3344 + drm_dbg_driver(adev_to_drm(adev), 3345 + "%s: adding a %ds delay as w/a for panel\n", 3346 + __func__, 3347 + ppatch->wait_after_dpcd_poweroff_ms / 1000); 3348 + } 3349 + } 3350 + 3333 3351 static int dm_resume(struct amdgpu_ip_block *ip_block) 3334 3352 { 3335 3353 struct amdgpu_device *adev = ip_block->adev; ··· 3469 3451 /* Do detection*/ 3470 3452 drm_connector_list_iter_begin(ddev, &iter); 3471 3453 drm_for_each_connector_iter(connector, &iter) { 3454 + bool ret; 3472 3455 3473 3456 if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) 3474 3457 continue; ··· 3495 3476 } else { 3496 3477 guard(mutex)(&dm->dc_lock); 3497 3478 dc_exit_ips_for_hw_access(dm->dc); 3498 - dc_link_detect(aconnector->dc_link, DETECT_REASON_RESUMEFROMS3S4); 3479 + ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_RESUMEFROMS3S4); 3480 + if (ret) { 3481 + /* w/a delay for certain panels */ 3482 + apply_delay_after_dpcd_poweroff(adev, aconnector->dc_sink); 3483 + } 3499 3484 } 3500 3485 3501 3486 if (aconnector->fake_enable && aconnector->dc_link->local_sink) ··· 3865 3842 ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); 3866 3843 } 3867 3844 if (ret) { 3845 + /* w/a delay for certain panels */ 3846 + apply_delay_after_dpcd_poweroff(adev, aconnector->dc_sink); 3868 3847 amdgpu_dm_update_connector_after_detect(aconnector); 3869 3848 3870 3849 drm_modeset_lock_all(dev);
+8 -2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
··· 55 55 (u32)EDID_PRODUCT_ID(edid); 56 56 } 57 57 58 - static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps) 58 + static void apply_edid_quirks(struct drm_device *dev, struct edid *edid, struct dc_edid_caps *edid_caps) 59 59 { 60 60 uint32_t panel_id = edid_extract_panel_id(edid); 61 61 62 62 switch (panel_id) { 63 + /* Workaround for monitors that need a delay after detecting the link */ 64 + case drm_edid_encode_panel_id('G', 'B', 'T', 0x3215): 65 + drm_dbg_driver(dev, "Add 10s delay for link detection for panel id %X\n", panel_id); 66 + edid_caps->panel_patch.wait_after_dpcd_poweroff_ms = 10000; 67 + break; 63 68 /* Workaround for some monitors which does not work well with FAMS */ 64 69 case drm_edid_encode_panel_id('S', 'A', 'M', 0x0E5E): 65 70 case drm_edid_encode_panel_id('S', 'A', 'M', 0x7053): ··· 106 101 { 107 102 struct amdgpu_dm_connector *aconnector = link->priv; 108 103 struct drm_connector *connector = &aconnector->base; 104 + struct drm_device *dev = connector->dev; 109 105 struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL; 110 106 struct cea_sad *sads; 111 107 int sad_count = -1; ··· 136 130 137 131 edid_caps->edid_hdmi = connector->display_info.is_hdmi; 138 132 139 - apply_edid_quirks(edid_buf, edid_caps); 133 + apply_edid_quirks(dev, edid_buf, edid_caps); 140 134 141 135 sad_count = drm_edid_to_sad((struct edid *) edid->raw_edid, &sads); 142 136 if (sad_count <= 0)
+1
drivers/gpu/drm/amd/display/dc/dc_types.h
··· 181 181 uint8_t blankstream_before_otg_off; 182 182 bool oled_optimize_display_on; 183 183 unsigned int force_mst_blocked_discovery; 184 + unsigned int wait_after_dpcd_poweroff_ms; 184 185 }; 185 186 186 187 struct dc_edid_caps {