Skip to content

Commit d936622

Browse files
Michel Dänzerairlied
authored andcommitted
drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.
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]>
1 parent 88f50c8 commit d936622

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/gpu/drm/radeon/radeon_object.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,17 @@ int radeon_bo_pin_restricted(struct radeon_bo *bo, u32 domain, u64 max_offset,
233233
bo->pin_count++;
234234
if (gpu_addr)
235235
*gpu_addr = radeon_bo_gpu_offset(bo);
236-
WARN_ON_ONCE(max_offset != 0);
236+
237+
if (max_offset != 0) {
238+
u64 domain_start;
239+
240+
if (domain == RADEON_GEM_DOMAIN_VRAM)
241+
domain_start = bo->rdev->mc.vram_start;
242+
else
243+
domain_start = bo->rdev->mc.gtt_start;
244+
WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset);
245+
}
246+
237247
return 0;
238248
}
239249
radeon_ttm_placement_from_domain(bo, domain);

0 commit comments

Comments
 (0)