drm/radeon/kms: setup MC/VRAM the same way for suspend/resume
authorDave Airlie <airlied@linux.ie>
Fri, 7 Aug 2009 01:03:26 +0000 (11:03 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 7 Aug 2009 10:33:11 +0000 (20:33 +1000)
we should align the GTT after VRAM no matter what, as we can
come back from resume and put in a different place and bad things happen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_device.c

index a162ade..9ff6dcb 100644 (file)
@@ -152,7 +152,9 @@ int radeon_mc_setup(struct radeon_device *rdev)
                }
        } else {
                rdev->mc.vram_location = 0;
-               rdev->mc.gtt_location = rdev->mc.mc_vram_size;
+               tmp = rdev->mc.mc_vram_size;
+               tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1);
+               rdev->mc.gtt_location = tmp;
        }
        DRM_INFO("radeon: VRAM %uM\n", rdev->mc.real_vram_size >> 20);
        DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n",