All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <plroskin@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>, Ben Skeggs <bskeggs@redhat.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/nouveau/fbcon: fix oops without fbdev emulation
Date: Tue, 26 Sep 2017 12:28:27 -0700	[thread overview]
Message-ID: <20170926192827.8458-1-plroskin@gmail.com> (raw)
In-Reply-To: <CAN_72e04=Le7MAFSXnhYy4M6t=8MMjqfT69qm9SyMhCf+4HC1A@mail.gmail.com>

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

I see an oops in nouveau_fbcon_accel_save_disable() called from
nouveau_fbcon_set_suspend_work() on Linux 4.13 and 4.14-rc2 when
CONFIG_DRM_FBDEV_EMULATION option is disabled. It happens during gdm
login.

Linux 4.14-rc2 is affected even if CONFIG_DRM_FBDEV_EMULATION is enabled,
but no monitors are connected to the dock on a laptop with a discrete
NVIDIA card.

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

  reply	other threads:[~2017-09-26 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-09-27  8:51       ` Daniel Vetter
2017-10-17 18:06         ` Pavel Roskin
2017-10-17 18:18           ` Ben Skeggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170926192827.8458-1-plroskin@gmail.com \
    --to=plroskin@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.