aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index c962f34c92af..a014ba4cc97c 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -564,6 +564,7 @@ int radeon_device_init(struct radeon_device *rdev,
564 mutex_init(&rdev->cp.mutex); 564 mutex_init(&rdev->cp.mutex);
565 if (rdev->family >= CHIP_R600) 565 if (rdev->family >= CHIP_R600)
566 spin_lock_init(&rdev->ih.lock); 566 spin_lock_init(&rdev->ih.lock);
567 mutex_init(&rdev->gem.mutex);
567 rwlock_init(&rdev->fence_drv.lock); 568 rwlock_init(&rdev->fence_drv.lock);
568 INIT_LIST_HEAD(&rdev->gem.objects); 569 INIT_LIST_HEAD(&rdev->gem.objects);
569 570
@@ -653,6 +654,7 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
653{ 654{
654 struct radeon_device *rdev = dev->dev_private; 655 struct radeon_device *rdev = dev->dev_private;
655 struct drm_crtc *crtc; 656 struct drm_crtc *crtc;
657 int r;
656 658
657 if (dev == NULL || rdev == NULL) { 659 if (dev == NULL || rdev == NULL) {
658 return -ENODEV; 660 return -ENODEV;
@@ -663,18 +665,22 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
663 /* unpin the front buffers */ 665 /* unpin the front buffers */
664 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 666 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
665 struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->fb); 667 struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->fb);
666 struct radeon_object *robj; 668 struct radeon_bo *robj;
667 669
668 if (rfb == NULL || rfb->obj == NULL) { 670 if (rfb == NULL || rfb->obj == NULL) {
669 continue; 671 continue;
670 } 672 }
671 robj = rfb->obj->driver_private; 673 robj = rfb->obj->driver_private;
672 if (robj != rdev->fbdev_robj) { 674 if (robj != rdev->fbdev_rbo) {
673 radeon_object_unpin(robj); 675 r = radeon_bo_reserve(robj, false);
676 if (unlikely(r == 0)) {
677 radeon_bo_unpin(robj);
678 radeon_bo_unreserve(robj);
679 }
674 } 680 }
675 } 681 }
676 /* evict vram memory */ 682 /* evict vram memory */
677 radeon_object_evict_vram(rdev); 683 radeon_bo_evict_vram(rdev);
678 /* wait for gpu to finish processing current batch */ 684 /* wait for gpu to finish processing current batch */
679 radeon_fence_wait_last(rdev); 685 radeon_fence_wait_last(rdev);
680 686
@@ -682,7 +688,7 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
682 688
683 radeon_suspend(rdev); 689 radeon_suspend(rdev);
684 /* evict remaining vram memory */ 690 /* evict remaining vram memory */
685 radeon_object_evict_vram(rdev); 691 radeon_bo_evict_vram(rdev);
686 692
687 pci_save_state(dev->pdev); 693 pci_save_state(dev->pdev);
688 if (state.event == PM_EVENT_SUSPEND) { 694 if (state.event == PM_EVENT_SUSPEND) {