Wed Jul 24 03:20:52 2013 UTC ()
Omit Linux framebuffer stuff from i915_drv.c.


(riastradh)
diff -r1.1.1.1.2.7 -r1.1.1.1.2.8 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c

cvs diff -r1.1.1.1.2.7 -r1.1.1.1.2.8 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c 2013/07/24 03:20:37 1.1.1.1.2.7
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c 2013/07/24 03:20:52 1.1.1.1.2.8
@@ -498,29 +498,31 @@ static int i915_drm_freeze(struct drm_de @@ -498,29 +498,31 @@ static int i915_drm_freeze(struct drm_de
498 498
499 intel_modeset_disable(dev); 499 intel_modeset_disable(dev);
500 500
501 drm_irq_uninstall(dev); 501 drm_irq_uninstall(dev);
502 } 502 }
503 503
504 i915_save_state(dev); 504 i915_save_state(dev);
505 505
506 intel_opregion_fini(dev); 506 intel_opregion_fini(dev);
507 507
508 /* Modeset on resume, not lid events */ 508 /* Modeset on resume, not lid events */
509 dev_priv->modeset_on_lid = 0; 509 dev_priv->modeset_on_lid = 0;
510 510
 511#ifndef __NetBSD__ /* XXX fb */
511 console_lock(); 512 console_lock();
512 intel_fbdev_set_suspend(dev, 1); 513 intel_fbdev_set_suspend(dev, 1);
513 console_unlock(); 514 console_unlock();
 515#endif
514 516
515 return 0; 517 return 0;
516} 518}
517 519
518int i915_suspend(struct drm_device *dev, pm_message_t state) 520int i915_suspend(struct drm_device *dev, pm_message_t state)
519{ 521{
520 int error; 522 int error;
521 523
522 if (!dev || !dev->dev_private) { 524 if (!dev || !dev->dev_private) {
523 DRM_ERROR("dev: %p\n", dev); 525 DRM_ERROR("dev: %p\n", dev);
524 DRM_ERROR("DRM not initialized, aborting suspend.\n"); 526 DRM_ERROR("DRM not initialized, aborting suspend.\n");
525 return -ENODEV; 527 return -ENODEV;
526 } 528 }
@@ -535,37 +537,39 @@ int i915_suspend(struct drm_device *dev, @@ -535,37 +537,39 @@ int i915_suspend(struct drm_device *dev,
535 error = i915_drm_freeze(dev); 537 error = i915_drm_freeze(dev);
536 if (error) 538 if (error)
537 return error; 539 return error;
538 540
539 if (state.event == PM_EVENT_SUSPEND) { 541 if (state.event == PM_EVENT_SUSPEND) {
540 /* Shut down the device */ 542 /* Shut down the device */
541 pci_disable_device(dev->pdev); 543 pci_disable_device(dev->pdev);
542 pci_set_power_state(dev->pdev, PCI_D3hot); 544 pci_set_power_state(dev->pdev, PCI_D3hot);
543 } 545 }
544 546
545 return 0; 547 return 0;
546} 548}
547 549
 550#ifndef __NetBSD__ /* XXX fb */
548void intel_console_resume(struct work_struct *work) 551void intel_console_resume(struct work_struct *work)
549{ 552{
550 struct drm_i915_private *dev_priv = 553 struct drm_i915_private *dev_priv =
551 container_of(work, struct drm_i915_private, 554 container_of(work, struct drm_i915_private,
552 console_resume_work); 555 console_resume_work);
553 struct drm_device *dev = dev_priv->dev; 556 struct drm_device *dev = dev_priv->dev;
554 557
555 console_lock(); 558 console_lock();
556 intel_fbdev_set_suspend(dev, 0); 559 intel_fbdev_set_suspend(dev, 0);
557 console_unlock(); 560 console_unlock();
558} 561}
 562#endif
559 563
560static int __i915_drm_thaw(struct drm_device *dev) 564static int __i915_drm_thaw(struct drm_device *dev)
561{ 565{
562 struct drm_i915_private *dev_priv = dev->dev_private; 566 struct drm_i915_private *dev_priv = dev->dev_private;
563 int error = 0; 567 int error = 0;
564 568
565 i915_restore_state(dev); 569 i915_restore_state(dev);
566 intel_opregion_setup(dev); 570 intel_opregion_setup(dev);
567 571
568 /* KMS EnterVT equivalent */ 572 /* KMS EnterVT equivalent */
569 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 573 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
570 intel_init_pch_refclk(dev); 574 intel_init_pch_refclk(dev);
571 575
@@ -574,37 +578,39 @@ static int __i915_drm_thaw(struct drm_de @@ -574,37 +578,39 @@ static int __i915_drm_thaw(struct drm_de
574 578
575 error = i915_gem_init_hw(dev); 579 error = i915_gem_init_hw(dev);
576 mutex_unlock(&dev->struct_mutex); 580 mutex_unlock(&dev->struct_mutex);
577 581
578 intel_modeset_init_hw(dev); 582 intel_modeset_init_hw(dev);
579 intel_modeset_setup_hw_state(dev, false); 583 intel_modeset_setup_hw_state(dev, false);
580 drm_irq_install(dev); 584 drm_irq_install(dev);
581 } 585 }
582 586
583 intel_opregion_init(dev); 587 intel_opregion_init(dev);
584 588
585 dev_priv->modeset_on_lid = 0; 589 dev_priv->modeset_on_lid = 0;
586 590
 591#ifndef __NetBSD__ /* XXX fb */
587 /* 592 /*
588 * The console lock can be pretty contented on resume due 593 * The console lock can be pretty contented on resume due
589 * to all the printk activity. Try to keep it out of the hot 594 * to all the printk activity. Try to keep it out of the hot
590 * path of resume if possible. 595 * path of resume if possible.
591 */ 596 */
592 if (console_trylock()) { 597 if (console_trylock()) {
593 intel_fbdev_set_suspend(dev, 0); 598 intel_fbdev_set_suspend(dev, 0);
594 console_unlock(); 599 console_unlock();
595 } else { 600 } else {
596 schedule_work(&dev_priv->console_resume_work); 601 schedule_work(&dev_priv->console_resume_work);
597 } 602 }
 603#endif
598 604
599 return error; 605 return error;
600} 606}
601 607
602static int i915_drm_thaw(struct drm_device *dev) 608static int i915_drm_thaw(struct drm_device *dev)
603{ 609{
604 int error = 0; 610 int error = 0;
605 611
606 intel_gt_reset(dev); 612 intel_gt_reset(dev);
607 613
608 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 614 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
609 mutex_lock(&dev->struct_mutex); 615 mutex_lock(&dev->struct_mutex);
610 i915_gem_restore_gtt_mappings(dev); 616 i915_gem_restore_gtt_mappings(dev);