summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-03-28 08:52:32 +0200
committerDave Airlie <airlied@redhat.com>2012-03-28 13:50:05 +0100
commitd936622c36273a9ecfbb4aacf26cd29405995159 (patch)
treef843bbce85385560288ace9402db14f772337044 /drivers/gpu
parent88f50c80748bf5238c88e70ee26c68ac48b94e68 (diff)
downloadlinux-d936622c36273a9ecfbb4aacf26cd29405995159.tar.bz2
drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.
Fixes spurious warnings. Tested-by: Dave Jones <davej@redhat.com> Tested-by: Steven Rostedt <rostedt@goodmis.org> Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 91541e63d582..6f70158d34e4 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -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);