Skip to content

Commit 3cf7cd3

Browse files
Hersen Wualexdeucher
authored andcommitted
drm/amd/display: fix access hdcp_workqueue assert
[Why] hdcp are enabled for asics from raven. for old asics which hdcp are not enabled, hdcp_workqueue are null. some access to hdcp work queue are not guarded with pointer check. [How] add hdcp_workqueue pointer check before access workqueue. Fixes: 82986fd ("drm/amd/display: save restore hdcp state when display is unplugged from mst hub") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2444 Reported-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com> Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Hersen Wu <hersenxs.wu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 0c0463f commit 3cf7cd3

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8559,6 +8559,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
85598559
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
85608560
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
85618561

8562+
if (!adev->dm.hdcp_workqueue)
8563+
continue;
8564+
85628565
pr_debug("[HDCP_DM] -------------- i : %x ----------\n", i);
85638566

85648567
if (!connector)
@@ -8607,6 +8610,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
86078610
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
86088611
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
86098612

8613+
if (!adev->dm.hdcp_workqueue)
8614+
continue;
8615+
86108616
new_crtc_state = NULL;
86118617
old_crtc_state = NULL;
86128618

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,17 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)
379379
if (aconnector->dc_sink && connector->state) {
380380
struct drm_device *dev = connector->dev;
381381
struct amdgpu_device *adev = drm_to_adev(dev);
382-
struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue;
383-
struct hdcp_workqueue *hdcp_w = &hdcp_work[aconnector->dc_link->link_index];
384382

385-
connector->state->hdcp_content_type =
386-
hdcp_w->hdcp_content_type[connector->index];
387-
connector->state->content_protection =
388-
hdcp_w->content_protection[connector->index];
383+
if (adev->dm.hdcp_workqueue) {
384+
struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue;
385+
struct hdcp_workqueue *hdcp_w =
386+
&hdcp_work[aconnector->dc_link->link_index];
387+
388+
connector->state->hdcp_content_type =
389+
hdcp_w->hdcp_content_type[connector->index];
390+
connector->state->content_protection =
391+
hdcp_w->content_protection[connector->index];
392+
}
389393
}
390394

391395
if (aconnector->dc_sink) {

0 commit comments

Comments
 (0)