drm/amd/display: NULL pointer error during compliance test
[Why] Calls to disable/enable stream should be guarded with dc_lock. [How] Add dc_lock before calling into dc_link_handle_hpd_rx_irq. Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Eryk Brol <eryk.brol@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
983bcb4cbe
commit
c8ea79a8a2
1 changed files with 8 additions and 5 deletions
|
@ -2560,10 +2560,11 @@ static void handle_hpd_rx_irq(void *param)
|
||||||
struct drm_device *dev = connector->dev;
|
struct drm_device *dev = connector->dev;
|
||||||
struct dc_link *dc_link = aconnector->dc_link;
|
struct dc_link *dc_link = aconnector->dc_link;
|
||||||
bool is_mst_root_connector = aconnector->mst_mgr.mst_state;
|
bool is_mst_root_connector = aconnector->mst_mgr.mst_state;
|
||||||
|
bool result = false;
|
||||||
enum dc_connection_type new_connection_type = dc_connection_none;
|
enum dc_connection_type new_connection_type = dc_connection_none;
|
||||||
|
struct amdgpu_device *adev = drm_to_adev(dev);
|
||||||
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
||||||
union hpd_irq_data hpd_irq_data;
|
union hpd_irq_data hpd_irq_data;
|
||||||
struct amdgpu_device *adev = drm_to_adev(dev);
|
|
||||||
|
|
||||||
memset(&hpd_irq_data, 0, sizeof(hpd_irq_data));
|
memset(&hpd_irq_data, 0, sizeof(hpd_irq_data));
|
||||||
#endif
|
#endif
|
||||||
|
@ -2576,13 +2577,15 @@ static void handle_hpd_rx_irq(void *param)
|
||||||
if (dc_link->type != dc_connection_mst_branch)
|
if (dc_link->type != dc_connection_mst_branch)
|
||||||
mutex_lock(&aconnector->hpd_lock);
|
mutex_lock(&aconnector->hpd_lock);
|
||||||
|
|
||||||
|
mutex_lock(&adev->dm.dc_lock);
|
||||||
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
||||||
if (dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL) &&
|
result = dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL);
|
||||||
#else
|
#else
|
||||||
if (dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL) &&
|
result = dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
!is_mst_root_connector) {
|
mutex_unlock(&adev->dm.dc_lock);
|
||||||
|
|
||||||
|
if (result && !is_mst_root_connector) {
|
||||||
/* Downstream Port status changed. */
|
/* Downstream Port status changed. */
|
||||||
if (!dc_link_detect_sink(dc_link, &new_connection_type))
|
if (!dc_link_detect_sink(dc_link, &new_connection_type))
|
||||||
DRM_ERROR("KMS: Failed to detect connector\n");
|
DRM_ERROR("KMS: Failed to detect connector\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue