From 0f8afeae08f313475c94e2d4cffd0aab0440d572 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 27 Mar 2023 07:46:03 +0000 Subject: [PATCH] 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 --- sys/dev/pci/drm/i915/display/intel_fbdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.20.1