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 <[email protected]>

Ok, this actually makes sens now.

Reviewed-by: Daniel Vetter <[email protected]>

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to