drm/radeon: remove r600_blit_suspend
authorChristian König <deathsimple@vodafone.de>
Thu, 5 Jul 2012 14:05:28 +0000 (16:05 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 17 Jul 2012 08:32:48 +0000 (10:32 +0200)
Just reinitialize the shader content on resume instead.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/evergreen_blit_kms.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_blit_kms.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/si.c

index 64e06e67facdeaf6dd272065a115f7af835d9fb6..82f7aea14a6eca3f52f85b81e8c9334a20e5e1f5 100644 (file)
@@ -3139,7 +3139,6 @@ int evergreen_suspend(struct radeon_device *rdev)
        struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX];
 
        r600_audio_fini(rdev);
-       r600_blit_suspend(rdev);
        r700_cp_stop(rdev);
        ring->ready = false;
        evergreen_irq_suspend(rdev);
index e512560ffc6fd2a14a2b9a707099dc1c88c8f692..89cb9feb5653938d92ccad8803c2bbbd11b18910 100644 (file)
@@ -634,10 +634,6 @@ int evergreen_blit_init(struct radeon_device *rdev)
 
        rdev->r600_blit.max_dim = 16384;
 
-       /* pin copy shader into vram if already initialized */
-       if (rdev->r600_blit.shader_obj)
-               goto done;
-
        rdev->r600_blit.state_offset = 0;
 
        if (rdev->family < CHIP_CAYMAN)
@@ -668,11 +664,26 @@ int evergreen_blit_init(struct radeon_device *rdev)
                obj_size += cayman_ps_size * 4;
        obj_size = ALIGN(obj_size, 256);
 
-       r = radeon_bo_create(rdev, obj_size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM,
-                            NULL, &rdev->r600_blit.shader_obj);
-       if (r) {
-               DRM_ERROR("evergreen failed to allocate shader\n");
-               return r;
+       /* pin copy shader into vram if not already initialized */
+       if (!rdev->r600_blit.shader_obj) {
+               r = radeon_bo_create(rdev, obj_size, PAGE_SIZE, true,
+                                    RADEON_GEM_DOMAIN_VRAM,
+                                    NULL, &rdev->r600_blit.shader_obj);
+               if (r) {
+                       DRM_ERROR("evergreen failed to allocate shader\n");
+                       return r;
+               }
+
+               r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
+               if (unlikely(r != 0))
+                       return r;
+               r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
+                                 &rdev->r600_blit.shader_gpu_addr);
+               radeon_bo_unreserve(rdev->r600_blit.shader_obj);
+               if (r) {
+                       dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
+                       return r;
+               }
        }
 
        DRM_DEBUG("evergreen blit allocated bo %08x vs %08x ps %08x\n",
@@ -714,17 +725,6 @@ int evergreen_blit_init(struct radeon_device *rdev)
        radeon_bo_kunmap(rdev->r600_blit.shader_obj);
        radeon_bo_unreserve(rdev->r600_blit.shader_obj);
 
-done:
-       r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
-       if (unlikely(r != 0))
-               return r;
-       r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
-                         &rdev->r600_blit.shader_gpu_addr);
-       radeon_bo_unreserve(rdev->r600_blit.shader_obj);
-       if (r) {
-               dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
-               return r;
-       }
        radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size);
        return 0;
 }
index fe553102df82e9319b8c1f66a997af333b6ee0b8..4004376362eec07d7c5646ca80157db156f94c36 100644 (file)
@@ -1316,7 +1316,6 @@ int cayman_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
        radeon_vm_manager_suspend(rdev);
-       r600_blit_suspend(rdev);
        cayman_cp_enable(rdev, false);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
        evergreen_irq_suspend(rdev);
index 9750f538cc86e323b726ad945b24c9dabd0c0d40..af2f74a27081fc58fa3177f2f295a48d795c7b12 100644 (file)
@@ -2307,20 +2307,6 @@ int r600_copy_blit(struct radeon_device *rdev,
        return 0;
 }
 
-void r600_blit_suspend(struct radeon_device *rdev)
-{
-       int r;
-
-       /* unpin shaders bo */
-       if (rdev->r600_blit.shader_obj) {
-               r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
-               if (!r) {
-                       radeon_bo_unpin(rdev->r600_blit.shader_obj);
-                       radeon_bo_unreserve(rdev->r600_blit.shader_obj);
-               }
-       }
-}
-
 int r600_set_surface_reg(struct radeon_device *rdev, int reg,
                         uint32_t tiling_flags, uint32_t pitch,
                         uint32_t offset, uint32_t obj_size)
@@ -2461,7 +2447,6 @@ int r600_resume(struct radeon_device *rdev)
 int r600_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
-       r600_blit_suspend(rdev);
        r600_cp_stop(rdev);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
        r600_irq_suspend(rdev);
index 2b8d6418a30cb1b50181e2045bdf46496be6b497..2bef8549ddfeb9236f826ed5a9fc49d3558c490e 100644 (file)
@@ -524,10 +524,6 @@ int r600_blit_init(struct radeon_device *rdev)
 
        rdev->r600_blit.max_dim = 8192;
 
-       /* pin copy shader into vram if already initialized */
-       if (rdev->r600_blit.shader_obj)
-               goto done;
-
        rdev->r600_blit.state_offset = 0;
 
        if (rdev->family >= CHIP_RV770)
@@ -552,11 +548,26 @@ int r600_blit_init(struct radeon_device *rdev)
        obj_size += r6xx_ps_size * 4;
        obj_size = ALIGN(obj_size, 256);
 
-       r = radeon_bo_create(rdev, obj_size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM,
-                            NULL, &rdev->r600_blit.shader_obj);
-       if (r) {
-               DRM_ERROR("r600 failed to allocate shader\n");
-               return r;
+       /* pin copy shader into vram if not already initialized */
+       if (rdev->r600_blit.shader_obj == NULL) {
+               r = radeon_bo_create(rdev, obj_size, PAGE_SIZE, true,
+                                    RADEON_GEM_DOMAIN_VRAM,
+                                    NULL, &rdev->r600_blit.shader_obj);
+               if (r) {
+                       DRM_ERROR("r600 failed to allocate shader\n");
+                       return r;
+               }
+
+               r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
+               if (unlikely(r != 0))
+                       return r;
+               r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
+                                 &rdev->r600_blit.shader_gpu_addr);
+               radeon_bo_unreserve(rdev->r600_blit.shader_obj);
+               if (r) {
+                       dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
+                       return r;
+               }
        }
 
        DRM_DEBUG("r6xx blit allocated bo %08x vs %08x ps %08x\n",
@@ -587,17 +598,6 @@ int r600_blit_init(struct radeon_device *rdev)
        radeon_bo_kunmap(rdev->r600_blit.shader_obj);
        radeon_bo_unreserve(rdev->r600_blit.shader_obj);
 
-done:
-       r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
-       if (unlikely(r != 0))
-               return r;
-       r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
-                         &rdev->r600_blit.shader_gpu_addr);
-       radeon_bo_unreserve(rdev->r600_blit.shader_obj);
-       if (r) {
-               dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
-               return r;
-       }
        radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size);
        return 0;
 }
index 7df76b9cc3af8eaa13006ec999f977cbb6b28ae2..8a8c3f82950e6ded0775c7be8f29b64d51a1c59f 100644 (file)
@@ -735,8 +735,6 @@ struct r600_blit {
        u32 state_len;
 };
 
-void r600_blit_suspend(struct radeon_device *rdev);
-
 /*
  * SI RLC stuff
  */
index cc0ffb9be2bdf0f207d5d485216bfa6430c16c61..2004f0d94f247b69d846232a94ed8299e494ad4b 100644 (file)
@@ -996,7 +996,6 @@ int rv770_resume(struct radeon_device *rdev)
 int rv770_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
-       r600_blit_suspend(rdev);
        r700_cp_stop(rdev);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
        r600_irq_suspend(rdev);
index 40405d30272333b4b9fb91b025e78814be16683f..7c2618b9aa346c144c51c811cc52cd4aec0faf22 100644 (file)
@@ -3810,9 +3810,6 @@ int si_resume(struct radeon_device *rdev)
 int si_suspend(struct radeon_device *rdev)
 {
        radeon_vm_manager_suspend(rdev);
-#if 0
-       r600_blit_suspend(rdev);
-#endif
        si_cp_enable(rdev, false);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
        rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = false;