From 0c096c65b1df2709c6f57214d48ed308e9345afe Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Sat, 22 Aug 2020 18:37:52 -0400 Subject: Add amdgpu.dp_cll_status parameter amdgpu.dp_cll_status (default: on) controls whether connector "status" is overridden by the call to check_link_level_status for DisplayPort in drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c. In cases where the max resolution advertised by the GPU+Display cannot be displayed (likely due to misbehaving hardware), this function call appears to prevent the ability to choose a different mode at run time, or at boot time (via the video= kernel param). In these cases, setting amdgpu.dp_cll_status=0 will no longer rely upon this call, and therefore will allow the user to manually set a reliable mode in Xorg as well as by using video= on the kernel boot command line. Signed-off-by: Coleman Kane --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 ++++++++++++ drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 26127c7d2f32..eb3d6d24966f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -765,6 +765,18 @@ module_param_named(tmz, amdgpu_tmz, int, 0444); MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco)"); module_param_named(reset_method, amdgpu_reset_method, int, 0444); +/** + * DOC: dp_cll_status (bool) + * Controls whether the module uses check_link_loss_status to determine a DisplayPort + * connection. Default to "on", but if hardware is misbehaving resulting in a GPU or + * display that advertise a mode/refresh rate that won't display, disabling this will + * help fix problems where the module fails to report a monitor connected, resulting in + * a display that doesn't display, or possibly only offers limited VESA video modes. + */ +bool amdgpu_dp_cll_status = true; +MODULE_PARM_DESC(dp_cll_status, "Control use of check_link_level_status for DisplayPort detection. (default = on)"); +module_param_named(dp_cll_status, amdgpu_dp_cll_status, bool, 0444); + static const struct pci_device_id pciidlist[] = { #ifdef CONFIG_DRM_AMDGPU_SI {0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 9bc03f26efda..4eeb3513b503 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -1577,7 +1577,8 @@ enum link_training_result dc_link_dp_perform_link_training( */ if (link->connector_signal != SIGNAL_TYPE_EDP && status == LINK_TRAINING_SUCCESS) { msleep(5); - status = check_link_loss_status(link, <_settings); + if (amdgpu_dp_cll_status) + status = check_link_loss_status(link, <_settings); } /* 6. print status message*/ diff --git a/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h b/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h index b970a32177af..bf305be2f435 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +++ b/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h @@ -31,6 +31,8 @@ #define LINK_AUX_DEFAULT_LTTPR_TIMEOUT_PERIOD 3200 /*us*/ #define LINK_AUX_DEFAULT_TIMEOUT_PERIOD 552 /*us*/ +extern bool amdgpu_dp_cll_status; + struct dc_link; struct dc_stream_state; struct dc_link_settings; -- 2.28.0