summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests
diff options
context:
space:
mode:
authorChris Wilson2018-07-06 12:19:23 +0200
committerChris Wilson2018-07-06 15:05:23 +0200
commit0fdbe58c4a0f8c2fa67e38a740ce6ff3cffa8c86 (patch)
treec323f83cc4e0cd598fa943ca8661060f123ca7eb /drivers/gpu/drm/i915/selftests
parentdrm/i915: Record logical context support in driver caps (diff)
downloadkernel-qcow2-linux-0fdbe58c4a0f8c2fa67e38a740ce6ff3cffa8c86.tar.gz
kernel-qcow2-linux-0fdbe58c4a0f8c2fa67e38a740ce6ff3cffa8c86.tar.xz
kernel-qcow2-linux-0fdbe58c4a0f8c2fa67e38a740ce6ff3cffa8c86.zip
drm/i915/selftests: Skip live context execution test without logical contexts
If the HW (or driver) doesn't support logical contexts, don't pretend we gain anything from trying to execute GPU commands with them. At best it reports -ENODEV, which is an unhelpful failure that we should just skip. v2: Be more specific and check the driver/engine caps for logical (HW) context support. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180706101923.28548-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r--drivers/gpu/drm/i915/selftests/i915_gem_context.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index 0b36265a0f96..0d8e719802fa 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -336,11 +336,15 @@ static int igt_ctx_exec(void *arg)
bool first_shared_gtt = true;
int err = -ENODEV;
- /* Create a few different contexts (with different mm) and write
+ /*
+ * Create a few different contexts (with different mm) and write
* through each ctx/mm using the GPU making sure those writes end
* up in the expected pages of our obj.
*/
+ if (!DRIVER_CAPS(i915)->has_logical_contexts)
+ return 0;
+
file = mock_file(i915);
if (IS_ERR(file))
return PTR_ERR(file);
@@ -367,6 +371,9 @@ static int igt_ctx_exec(void *arg)
}
for_each_engine(engine, i915, id) {
+ if (!engine->context_size)
+ continue; /* No logical context support in HW */
+
if (!intel_engine_can_store_dword(engine))
continue;