drm/amd/display: don't call dc_interrupt_set() for disabled crtcs
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 03:31:40 +0000 (03:31 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 03:31:40 +0000 (03:31 +0000)
From Hamza Mahfooz
062024bf77e9a2dddc1da801360565e6ce3f7199 in linux-6.1.y/6.1.16
4936458bf989d168f5a89015dd81067c4c2bdc64 in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c

index 64dd029..b87f50e 100644 (file)
@@ -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;