]> Git Repo - linux.git/commitdiff
drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.
authorMichel Dänzer <[email protected]>
Wed, 28 Mar 2012 06:52:32 +0000 (08:52 +0200)
committerDave Airlie <[email protected]>
Wed, 28 Mar 2012 12:50:05 +0000 (13:50 +0100)
Fixes spurious warnings.

Tested-by: Dave Jones <[email protected]>
Tested-by: Steven Rostedt <[email protected]>
Tested-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Michel Dänzer <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
drivers/gpu/drm/radeon/radeon_object.c

index 91541e63d582706416b8bba9365c4930c6dadf29..6f70158d34e41f979ade9268cadeab8905ea4e81 100644 (file)
@@ -233,7 +233,17 @@ int radeon_bo_pin_restricted(struct radeon_bo *bo, u32 domain, u64 max_offset,
                bo->pin_count++;
                if (gpu_addr)
                        *gpu_addr = radeon_bo_gpu_offset(bo);
-               WARN_ON_ONCE(max_offset != 0);
+
+               if (max_offset != 0) {
+                       u64 domain_start;
+
+                       if (domain == RADEON_GEM_DOMAIN_VRAM)
+                               domain_start = bo->rdev->mc.vram_start;
+                       else
+                               domain_start = bo->rdev->mc.gtt_start;
+                       WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset);
+               }
+
                return 0;
        }
        radeon_ttm_placement_from_domain(bo, domain);
This page took 0.058337 seconds and 4 git commands to generate.