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.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 72f6262ea73..633acf71400 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -156,6 +156,10 @@ int radeon_mc_setup(struct radeon_device *rdev)
156 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1); 156 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1);
157 rdev->mc.gtt_location = tmp; 157 rdev->mc.gtt_location = tmp;
158 } 158 }
159 rdev->mc.vram_start = rdev->mc.vram_location;
160 rdev->mc.vram_end = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
161 rdev->mc.gtt_start = rdev->mc.gtt_location;
162 rdev->mc.gtt_end = rdev->mc.gtt_location + rdev->mc.gtt_size - 1;
159 DRM_INFO("radeon: VRAM %uM\n", (unsigned)(rdev->mc.mc_vram_size >> 20)); 163 DRM_INFO("radeon: VRAM %uM\n", (unsigned)(rdev->mc.mc_vram_size >> 20));
160 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n", 164 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n",
161 (unsigned)rdev->mc.vram_location, 165 (unsigned)rdev->mc.vram_location,
@@ -171,7 +175,7 @@ int radeon_mc_setup(struct radeon_device *rdev)
171/* 175/*
172 * GPU helpers function. 176 * GPU helpers function.
173 */ 177 */
174static bool radeon_card_posted(struct radeon_device *rdev) 178bool radeon_card_posted(struct radeon_device *rdev)
175{ 179{
176 uint32_t reg; 180 uint32_t reg;
177 181
@@ -483,6 +487,7 @@ int radeon_device_init(struct radeon_device *rdev,
483 487
484 DRM_INFO("radeon: Initializing kernel modesetting.\n"); 488 DRM_INFO("radeon: Initializing kernel modesetting.\n");
485 rdev->shutdown = false; 489 rdev->shutdown = false;
490 rdev->dev = &pdev->dev;
486 rdev->ddev = ddev; 491 rdev->ddev = ddev;
487 rdev->pdev = pdev; 492 rdev->pdev = pdev;
488 rdev->flags = flags; 493 rdev->flags = flags;
@@ -497,6 +502,7 @@ int radeon_device_init(struct radeon_device *rdev,
497 mutex_init(&rdev->ib_pool.mutex); 502 mutex_init(&rdev->ib_pool.mutex);
498 mutex_init(&rdev->cp.mutex); 503 mutex_init(&rdev->cp.mutex);
499 rwlock_init(&rdev->fence_drv.lock); 504 rwlock_init(&rdev->fence_drv.lock);
505 INIT_LIST_HEAD(&rdev->gem.objects);
500 506
501 if (radeon_agpmode == -1) { 507 if (radeon_agpmode == -1) {
502 rdev->flags &= ~RADEON_IS_AGP; 508 rdev->flags &= ~RADEON_IS_AGP;
@@ -736,15 +742,14 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
736 if (!rdev->new_init_path) { 742 if (!rdev->new_init_path) {
737 radeon_cp_disable(rdev); 743 radeon_cp_disable(rdev);
738 radeon_gart_disable(rdev); 744 radeon_gart_disable(rdev);
745 rdev->irq.sw_int = false;
746 radeon_irq_set(rdev);
739 } else { 747 } else {
740 radeon_suspend(rdev); 748 radeon_suspend(rdev);
741 } 749 }
742 /* evict remaining vram memory */ 750 /* evict remaining vram memory */
743 radeon_object_evict_vram(rdev); 751 radeon_object_evict_vram(rdev);
744 752
745 rdev->irq.sw_int = false;
746 radeon_irq_set(rdev);
747
748 pci_save_state(dev->pdev); 753 pci_save_state(dev->pdev);
749 if (state.event == PM_EVENT_SUSPEND) { 754 if (state.event == PM_EVENT_SUSPEND) {
750 /* Shut down the device */ 755 /* Shut down the device */
@@ -771,10 +776,10 @@ int radeon_resume_kms(struct drm_device *dev)
771 } 776 }
772 pci_set_master(dev->pdev); 777 pci_set_master(dev->pdev);
773 /* Reset gpu before posting otherwise ATOM will enter infinite loop */ 778 /* Reset gpu before posting otherwise ATOM will enter infinite loop */
774 if (radeon_gpu_reset(rdev)) {
775 /* FIXME: what do we want to do here ? */
776 }
777 if (!rdev->new_init_path) { 779 if (!rdev->new_init_path) {
780 if (radeon_gpu_reset(rdev)) {
781 /* FIXME: what do we want to do here ? */
782 }
778 /* post card */ 783 /* post card */
779 if (rdev->is_atom_bios) { 784 if (rdev->is_atom_bios) {
780 atom_asic_init(rdev->mode_info.atom_context); 785 atom_asic_init(rdev->mode_info.atom_context);