aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Auld <[email protected]>2022-06-29 18:43:44 +0100
committerMatthew Auld <[email protected]>2022-07-01 08:30:00 +0100
commitd42a738e5ae5a73212a83414648a4fae524117f3 (patch)
tree8ed35cee3731fe159ed1e609a5b83761ca85eac0
parent525e93f6317a08a03cc42847b3e075c92a382c99 (diff)
drm/i915/error: skip non-mappable pages
Skip capturing any lmem pages that can't be copied using the CPU. This in now only best effort on platforms that have small BAR. Testcase: igt@gem-exec-capture@capture-invisible Signed-off-by: Matthew Auld <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: Lionel Landwerlin <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Jon Bloomfield <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jordan Justen <[email protected]> Cc: Kenneth Graunke <[email protected]> Cc: Akeem G Abodunrin <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/i915/i915_gpu_error.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index f9b1969ed7ed..52ea13fee015 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1129,11 +1129,15 @@ i915_vma_coredump_create(const struct intel_gt *gt,
dma_addr_t dma;
for_each_sgt_daddr(dma, iter, vma_res->bi.pages) {
+ dma_addr_t offset = dma - mem->region.start;
void __iomem *s;
- s = io_mapping_map_wc(&mem->iomap,
- dma - mem->region.start,
- PAGE_SIZE);
+ if (offset + PAGE_SIZE > mem->io_size) {
+ ret = -EINVAL;
+ break;
+ }
+
+ s = io_mapping_map_wc(&mem->iomap, offset, PAGE_SIZE);
ret = compress_page(compress,
(void __force *)s, dst,
true);