All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Pavel Roskin <plroskin@gmail.com>
Cc: dri-devel@lists.freedesktop.org, Ben Skeggs <bskeggs@redhat.com>
Subject: Re: [PATCH] drm/nouveau/fbcon: fix oops without fbdev emulation
Date: Wed, 27 Sep 2017 10:51:59 +0200	[thread overview]
Message-ID: <20170927085159.vid7j2im6afxsxzr@phenom.ffwll.local> (raw)
In-Reply-To: <20170926192827.8458-1-plroskin@gmail.com>

On Tue, Sep 26, 2017 at 12:28:27PM -0700, Pavel Roskin wrote:
> 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>

Ok, this actually makes sens now.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I'll leave it to Ben or Dave to pick this up. I guess there's still a
regression somewhere with the monitor detection itself, but this should
stop the oops.

Longer-term we maybe want to rip the fbdev hw accel stuff out, not sure
there's any point in this really.
-Daniel

> ---
>  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
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-09-27  8:52 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
2017-09-27  8:51       ` Daniel Vetter [this message]
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=20170927085159.vid7j2im6afxsxzr@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=plroskin@gmail.com \
    /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.