From: Dave Airlie <airl...@linux.ie>

a) don't zero gart table on gart enable
b) move pinning shader object into resume path
c) unpin shader object on suspend
d) set cp ready to false after cp shutdown on suspend.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 drivers/gpu/drm/radeon/r600.c          |   26 +++++++++++++++++++-------
 drivers/gpu/drm/radeon/r600_blit_kms.c |   11 ++---------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index aafdb8e..15c2d68 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -141,8 +141,7 @@ int r600_pcie_gart_enable(struct radeon_device *rdev)
        r = radeon_gart_table_vram_pin(rdev);
        if (r)
                return r;
-       for (i = 0; i < rdev->gart.num_gpu_pages; i++)
-               r600_gart_clear_page(rdev, i);
+
        /* Setup L2 cache */
        WREG32(VM_L2_CNTL, ENABLE_L2_CACHE | ENABLE_L2_FRAGMENT_PROCESSING |
                                ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE |
@@ -1477,6 +1476,14 @@ int r600_resume(struct radeon_device *rdev)
        if (r)
                return r;
        r600_gpu_init(rdev);
+
+       r = radeon_object_pin(rdev->r600_blit.shader_obj, 
RADEON_GEM_DOMAIN_VRAM,
+                             &rdev->r600_blit.shader_gpu_addr);
+       if (r) {
+               DRM_ERROR("failed to pin blit object %d\n", r);
+               return r;
+       }
+
        r = radeon_ring_init(rdev, rdev->cp.ring_size);
        if (r)
                return r;
@@ -1496,7 +1503,11 @@ int r600_suspend(struct radeon_device *rdev)
 {
        /* FIXME: we should wait for ring to be empty */
        r600_cp_stop(rdev);
+       rdev->cp.ready = false;
+
        r600_pcie_gart_disable(rdev);
+       /* unpin shaders bo */
+       radeon_object_unpin(rdev->r600_blit.shader_obj);
        return 0;
 }
 
@@ -1579,6 +1590,12 @@ int r600_init(struct radeon_device *rdev)
                return r;
 
        rdev->accel_working = true;
+       r = r600_blit_init(rdev);
+       if (r) {
+               DRM_ERROR("radeon: failled blitter (%d).\n", r);
+               return r;
+       }
+
        r = r600_resume(rdev);
        if (r) {
                if (rdev->flags & RADEON_IS_AGP) {
@@ -1595,11 +1612,6 @@ int r600_init(struct radeon_device *rdev)
                        DRM_ERROR("radeon: failled initializing IB pool 
(%d).\n", r);
                        rdev->accel_working = false;
                }
-               r = r600_blit_init(rdev);
-               if (r) {
-                       DRM_ERROR("radeon: failled blitter (%d).\n", r);
-                       rdev->accel_working = false;
-               }
                r = radeon_ib_test(rdev);
                if (r) {
                        DRM_ERROR("radeon: failled testing IB (%d).\n", r);
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c 
b/drivers/gpu/drm/radeon/r600_blit_kms.c
index 1287f4d..0a6f468 100644
--- a/drivers/gpu/drm/radeon/r600_blit_kms.c
+++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
@@ -481,15 +481,8 @@ int r600_blit_init(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_object_pin(rdev->r600_blit.shader_obj, 
RADEON_GEM_DOMAIN_VRAM,
-                            &rdev->r600_blit.shader_gpu_addr);
-       if (r) {
-               DRM_ERROR("failed to pin blit object %d\n", r);
-               return r;
-       }
-
-       DRM_DEBUG("r6xx blit allocated bo @ 0x%16llx %08x vs %08x ps %08x\n",
-                 rdev->r600_blit.shader_gpu_addr, obj_size,
+       DRM_DEBUG("r6xx blit allocated bo %08x vs %08x ps %08x\n",
+                 obj_size,
                  rdev->r600_blit.vs_offset, rdev->r600_blit.ps_offset);
 
        r = radeon_object_kmap(rdev->r600_blit.shader_obj, &ptr);
-- 
1.6.4.2


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to