Skip to content

Commit 4813766

Browse files
proskiBen Skeggs
authored andcommitted
drm/nouveau/fbcon: fix oops without fbdev emulation
This is similar to an earlier commit 52dfcc5 ("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> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 227f66d commit 4813766

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_fbcon.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void
223223
nouveau_fbcon_accel_save_disable(struct drm_device *dev)
224224
{
225225
struct nouveau_drm *drm = nouveau_drm(dev);
226-
if (drm->fbcon) {
226+
if (drm->fbcon && drm->fbcon->helper.fbdev) {
227227
drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags;
228228
drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
229229
}
@@ -233,7 +233,7 @@ void
233233
nouveau_fbcon_accel_restore(struct drm_device *dev)
234234
{
235235
struct nouveau_drm *drm = nouveau_drm(dev);
236-
if (drm->fbcon) {
236+
if (drm->fbcon && drm->fbcon->helper.fbdev) {
237237
drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags;
238238
}
239239
}
@@ -245,7 +245,8 @@ nouveau_fbcon_accel_fini(struct drm_device *dev)
245245
struct nouveau_fbdev *fbcon = drm->fbcon;
246246
if (fbcon && drm->channel) {
247247
console_lock();
248-
fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
248+
if (fbcon->helper.fbdev)
249+
fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
249250
console_unlock();
250251
nouveau_channel_idle(drm->channel);
251252
nvif_object_fini(&fbcon->twod);

0 commit comments

Comments
 (0)