From 1c1023d80780ac1311032cb1456d3da6a3dc76cf Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 27 Jan 2022 22:46:54 +0000 Subject: [PATCH] drm/amd/display: Fix bug in debugfs crc_win_update entry From Wayne Lin 6dcc6706dab10744d277bdc2613fb135c6a632dd in linux 5.15.y/5.15.17 4bef85d4c9491415b7931407b07f24841c1e0390 in mainline linux --- sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index de9ec5ddb6c..e94ddd5e7b6 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -2908,10 +2908,13 @@ static int crc_win_update_set(void *data, u64 val) struct amdgpu_device *adev = drm_to_adev(new_crtc->dev); struct crc_rd_work *crc_rd_wrk = adev->dm.crc_rd_wrk; + if (!crc_rd_wrk) + return 0; + if (val) { spin_lock_irq(&adev_to_drm(adev)->event_lock); spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock); - if (crc_rd_wrk && crc_rd_wrk->crtc) { + if (crc_rd_wrk->crtc) { old_crtc = crc_rd_wrk->crtc; old_acrtc = to_amdgpu_crtc(old_crtc); } -- 2.20.1