All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/fbcon: fix oops without fbdev emulation
@ 2017-09-23 20:10 Pavel Roskin
  2017-09-26  8:05 ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Roskin @ 2017-09-23 20:10 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, dri-devel

This is similar to an earlier commit 52dfcc5ccfbb ("drm/nouveau: fix for
disabled fbdev emulation"), but protects all occurrences of helper.fbdev
in the source.

I see oops in nouveau_fbcon_accel_save_disable() called from
nouveau_fbcon_set_suspend_work() on Linux 3.13 when
CONFIG_DRM_FBDEV_EMULATION option is disabled.

Signed-off-by: Pavel Roskin <plroskin@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_fbcon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index f7707849bb53..698b8b10b646 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -223,7 +223,7 @@ void
 nouveau_fbcon_accel_save_disable(struct drm_device *dev)
 {
     struct nouveau_drm *drm = nouveau_drm(dev);
-    if (drm->fbcon) {
+    if (drm->fbcon && drm->fbcon->helper.fbdev) {
         drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags;
         drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
     }
@@ -233,9 +233,8 @@ void
 nouveau_fbcon_accel_restore(struct drm_device *dev)
 {
     struct nouveau_drm *drm = nouveau_drm(dev);
-    if (drm->fbcon) {
+    if (drm->fbcon && drm->fbcon->helper.fbdev)
         drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags;
-    }
 }

 static void
@@ -245,7 +244,8 @@ nouveau_fbcon_accel_fini(struct drm_device *dev)
     struct nouveau_fbdev *fbcon = drm->fbcon;
     if (fbcon && drm->channel) {
         console_lock();
-        fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
+        if (drm->fbcon->helper.fbdev)
+            fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
         console_unlock();
         nouveau_channel_idle(drm->channel);
         nvif_object_fini(&fbcon->twod);
-- 
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-17 18:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-23 20:10 [PATCH] drm/nouveau/fbcon: fix oops without fbdev emulation Pavel Roskin
2017-09-26  8:05 ` Daniel Vetter
2017-09-26 17:36   ` Pavel Roskin
2017-09-26 19:28     ` Pavel Roskin
2017-09-27  8:51       ` Daniel Vetter
2017-10-17 18:06         ` Pavel Roskin
2017-10-17 18:18           ` Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.