Commit d936622c authored by Michel Dänzer's avatar Michel Dänzer Committed by Dave Airlie

drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.

Fixes spurious warnings.
Tested-by: default avatarDave Jones <davej@redhat.com>
Tested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Tested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 88f50c80
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment