Commit 46ea1688 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fbcon: bracket entrypoints with a per-device enabled check

We don't necessarily have fbcon on all devices these days.

Fixes suspend on (at least) Quadro NVS 450.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6d8d1631
...@@ -503,23 +503,30 @@ nouveau_fbcon_fini(struct drm_device *dev) ...@@ -503,23 +503,30 @@ nouveau_fbcon_fini(struct drm_device *dev)
drm->fbcon = NULL; drm->fbcon = NULL;
} }
void nouveau_fbcon_save_disable_accel(struct drm_device *dev) void
nouveau_fbcon_save_disable_accel(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->fbcon) {
drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags; drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags;
drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
}
} }
void nouveau_fbcon_restore_accel(struct drm_device *dev) void
nouveau_fbcon_restore_accel(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->fbcon) {
drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags; drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags;
}
} }
void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) void
nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->fbcon) {
console_lock(); console_lock();
if (state == 0) if (state == 0)
nouveau_fbcon_save_disable_accel(dev); nouveau_fbcon_save_disable_accel(dev);
...@@ -527,10 +534,14 @@ void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) ...@@ -527,10 +534,14 @@ void nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
if (state == 1) if (state == 1)
nouveau_fbcon_restore_accel(dev); nouveau_fbcon_restore_accel(dev);
console_unlock(); console_unlock();
}
} }
void nouveau_fbcon_zfill_all(struct drm_device *dev) void
nouveau_fbcon_zfill_all(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->fbcon) {
nouveau_fbcon_zfill(dev, drm->fbcon); nouveau_fbcon_zfill(dev, drm->fbcon);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment