From: jsg Date: Mon, 27 Mar 2023 03:31:40 +0000 (+0000) Subject: drm/amd/display: don't call dc_interrupt_set() for disabled crtcs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c436a7f3ea25fd8ddb894206005ea7cd197f42ed;p=openbsd drm/amd/display: don't call dc_interrupt_set() for disabled crtcs From Hamza Mahfooz 062024bf77e9a2dddc1da801360565e6ce3f7199 in linux-6.1.y/6.1.16 4936458bf989d168f5a89015dd81067c4c2bdc64 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 64dd0297029..b87f50e8fa6 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -77,6 +77,9 @@ int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable) struct amdgpu_device *adev = drm_to_adev(crtc->dev); int rc; + if (acrtc->otg_inst == -1) + return 0; + irq_source = IRQ_TYPE_VUPDATE + acrtc->otg_inst; rc = dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY; @@ -149,6 +152,9 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) struct vblank_control_work *work; int rc = 0; + if (acrtc->otg_inst == -1) + goto skip; + if (enable) { /* vblank irq on -> Only need vupdate irq in vrr mode */ if (amdgpu_dm_vrr_active(acrtc_state)) @@ -166,6 +172,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) if (!dc_interrupt_set(adev->dm.dc, irq_source, enable)) return -EBUSY; +skip: if (amdgpu_in_reset(adev)) return 0;