From: jsg Date: Mon, 27 Mar 2023 07:46:03 +0000 (+0000) Subject: drm/i915: Fix system suspend without fbdev being initialized X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0f8afeae08f313475c94e2d4cffd0aab0440d572;p=openbsd drm/i915: Fix system suspend without fbdev being initialized From Imre Deak 27b5871abd5cc068c549fd23062c82e257fc0b9c in linux-6.1.y/6.1.18 8038510b1fe443ffbc0e356db5f47cbb8678a594 in mainline linux --- diff --git a/sys/dev/pci/drm/i915/display/intel_fbdev.c b/sys/dev/pci/drm/i915/display/intel_fbdev.c index 8d4659b458a..e9794266ae3 100644 --- a/sys/dev/pci/drm/i915/display/intel_fbdev.c +++ b/sys/dev/pci/drm/i915/display/intel_fbdev.c @@ -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;