Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau: re-jig fbcon suspend/resume process a little

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+13 -16
+6 -16
drivers/gpu/drm/nouveau/nouveau_drv.c
··· 180 180 181 181 drm_kms_helper_poll_disable(dev); 182 182 183 - NV_INFO(dev, "Disabling fbcon acceleration...\n"); 184 - nouveau_fbcon_save_disable_accel(dev); 183 + NV_INFO(dev, "Disabling fbcon...\n"); 184 + nouveau_fbcon_set_suspend(dev, 1); 185 185 186 186 NV_INFO(dev, "Unpinning framebuffer(s)...\n"); 187 187 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { ··· 248 248 pci_set_power_state(pdev, PCI_D3hot); 249 249 } 250 250 251 - console_lock(); 252 - nouveau_fbcon_set_suspend(dev, 1); 253 - console_unlock(); 254 - nouveau_fbcon_restore_accel(dev); 255 251 return 0; 256 252 257 253 out_abort: ··· 272 276 273 277 if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) 274 278 return 0; 275 - 276 - nouveau_fbcon_save_disable_accel(dev); 277 279 278 280 NV_INFO(dev, "We're back, enabling device...\n"); 279 281 pci_set_power_state(pdev, PCI_D0); ··· 354 360 NV_ERROR(dev, "Could not pin/map cursor.\n"); 355 361 } 356 362 363 + nouveau_fbcon_set_suspend(dev, 0); 364 + nouveau_fbcon_zfill_all(dev); 365 + 357 366 engine->display.init(dev); 367 + drm_kms_helper_poll_enable(dev); 358 368 359 369 /* Force CLUT to get re-loaded during modeset */ 360 370 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { ··· 366 368 367 369 nv_crtc->lut.depth = 0; 368 370 } 369 - 370 - console_lock(); 371 - nouveau_fbcon_set_suspend(dev, 0); 372 - console_unlock(); 373 - 374 - nouveau_fbcon_zfill_all(dev); 375 371 376 372 drm_helper_resume_force_mode(dev); 377 373 ··· 378 386 nv_crtc->cursor_saved_y); 379 387 } 380 388 381 - nouveau_fbcon_restore_accel(dev); 382 - drm_kms_helper_poll_enable(dev); 383 389 return 0; 384 390 } 385 391
+7
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 36 36 #include <linux/init.h> 37 37 #include <linux/screen_info.h> 38 38 #include <linux/vga_switcheroo.h> 39 + #include <linux/console.h> 39 40 40 41 #include "drmP.h" 41 42 #include "drm.h" ··· 549 548 void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) 550 549 { 551 550 struct drm_nouveau_private *dev_priv = dev->dev_private; 551 + console_lock(); 552 + if (state == 0) 553 + nouveau_fbcon_save_disable_accel(dev); 552 554 fb_set_suspend(dev_priv->nfbdev->helper.fbdev, state); 555 + if (state == 1) 556 + nouveau_fbcon_restore_accel(dev); 557 + console_unlock(); 553 558 } 554 559 555 560 void nouveau_fbcon_zfill_all(struct drm_device *dev)