drm/radeon/kms: make sure mc is initialized before mapping blit bo
authorAlex Deucher <alexdeucher@gmail.com>
Tue, 15 Dec 2009 22:15:07 +0000 (17:15 -0500)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Dec 2009 05:39:24 +0000 (15:39 +1000)
We need to make sure the the MC is intialized before we map the
blit shader object on r6xx+.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/rv770.c

index f5cf874dc62a0080dea9813f8a9177006e75a8b3..e145faac990408573ce15169afafca0c7977c7eb 100644 (file)
@@ -1863,6 +1863,14 @@ int r600_startup(struct radeon_device *rdev)
        }
        r600_gpu_init(rdev);
 
+       if (!rdev->r600_blit.shader_obj) {
+               r = r600_blit_init(rdev);
+               if (r) {
+                       DRM_ERROR("radeon: failed blitter (%d).\n", r);
+                       return r;
+               }
+       }
+
        r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
        if (unlikely(r != 0))
                return r;
@@ -2038,12 +2046,6 @@ int r600_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = r600_blit_init(rdev);
-       if (r) {
-               DRM_ERROR("radeon: failed blitter (%d).\n", r);
-               return r;
-       }
-
        rdev->accel_working = true;
        r = r600_startup(rdev);
        if (r) {
index 2d124bb57762c93ec5d93922a4a3214558da3fda..f58dc671080232e1fb7dc7224e1c62ca29d5e072 100644 (file)
@@ -892,6 +892,14 @@ static int rv770_startup(struct radeon_device *rdev)
        }
        rv770_gpu_init(rdev);
 
+       if (!rdev->r600_blit.shader_obj) {
+               r = r600_blit_init(rdev);
+               if (r) {
+                       DRM_ERROR("radeon: failed blitter (%d).\n", r);
+                       return r;
+               }
+       }
+
        r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
        if (unlikely(r != 0))
                return r;
@@ -1051,12 +1059,6 @@ int rv770_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = r600_blit_init(rdev);
-       if (r) {
-               DRM_ERROR("radeon: failed blitter (%d).\n", r);
-               return r;
-       }
-
        rdev->accel_working = true;
        r = rv770_startup(rdev);
        if (r) {