drm/i915: Fix system suspend without fbdev being initialized
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:46:03 +0000 (07:46 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:46:03 +0000 (07:46 +0000)
From Imre Deak
27b5871abd5cc068c549fd23062c82e257fc0b9c in linux-6.1.y/6.1.18
8038510b1fe443ffbc0e356db5f47cbb8678a594 in mainline linux

sys/dev/pci/drm/i915/display/intel_fbdev.c

index 8d4659b..e979426 100644 (file)
@@ -679,7 +679,13 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
        struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;
        struct fb_info *info;
 
-       if (!ifbdev || !ifbdev->vma)
+       if (!ifbdev)
+               return;
+
+       if (drm_WARN_ON(&dev_priv->drm, !HAS_DISPLAY(dev_priv)))
+               return;
+
+       if (!ifbdev->vma)
                goto set_suspend;
 
        info = ifbdev->helper.fbdev;