Skip to content

Commit 71b1669

Browse files
committed
drm/i915/uapi: tweak error capture on recoverable contexts
A non-recoverable context must be used if the user wants proper error capture on discrete platforms. In the future the kernel may want to blit the contents of some objects when later doing the capture stage. Also extend to newer integrated platforms. v2(Thomas): - Also extend to newer integrated platforms, for capture buffer memory allocation purposes. v3 (Reported-by: kernel test robot <[email protected]>): - Fix build on !CONFIG_DRM_I915_CAPTURE_ERROR Testcase: igt@gem_exec_capture@capture-recoverable 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: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d42a738 commit 71b1669

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ eb_find_first_request_added(struct i915_execbuffer *eb)
19511951
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
19521952

19531953
/* Stage with GFP_KERNEL allocations before we enter the signaling critical path */
1954-
static void eb_capture_stage(struct i915_execbuffer *eb)
1954+
static int eb_capture_stage(struct i915_execbuffer *eb)
19551955
{
19561956
const unsigned int count = eb->buffer_count;
19571957
unsigned int i = count, j;
@@ -1964,6 +1964,10 @@ static void eb_capture_stage(struct i915_execbuffer *eb)
19641964
if (!(flags & EXEC_OBJECT_CAPTURE))
19651965
continue;
19661966

1967+
if (i915_gem_context_is_recoverable(eb->gem_context) &&
1968+
(IS_DGFX(eb->i915) || GRAPHICS_VER_FULL(eb->i915) > IP_VER(12, 0)))
1969+
return -EINVAL;
1970+
19671971
for_each_batch_create_order(eb, j) {
19681972
struct i915_capture_list *capture;
19691973

@@ -1976,6 +1980,8 @@ static void eb_capture_stage(struct i915_execbuffer *eb)
19761980
eb->capture_lists[j] = capture;
19771981
}
19781982
}
1983+
1984+
return 0;
19791985
}
19801986

19811987
/* Commit once we're in the critical path */
@@ -2017,8 +2023,9 @@ static void eb_capture_list_clear(struct i915_execbuffer *eb)
20172023

20182024
#else
20192025

2020-
static void eb_capture_stage(struct i915_execbuffer *eb)
2026+
static int eb_capture_stage(struct i915_execbuffer *eb)
20212027
{
2028+
return 0;
20222029
}
20232030

20242031
static void eb_capture_commit(struct i915_execbuffer *eb)
@@ -3410,7 +3417,9 @@ i915_gem_do_execbuffer(struct drm_device *dev,
34103417
}
34113418

34123419
ww_acquire_done(&eb.ww.ctx);
3413-
eb_capture_stage(&eb);
3420+
err = eb_capture_stage(&eb);
3421+
if (err)
3422+
goto err_vma;
34143423

34153424
out_fence = eb_requests_create(&eb, in_fence, out_fence_fd);
34163425
if (IS_ERR(out_fence)) {

0 commit comments

Comments
 (0)