[Intel-gfx] [PATCH] tests/gem_ctx_exec: properly test destroy_ctx ioctl

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Feb 5 11:26:49 CET 2013


Call context destroy with proper ioctl number and
add test to verify that we can't post batchbuffers
with destroyed context.

Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
 tests/gem_ctx_exec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
index 423f1ee..b0362cc 100644
--- a/tests/gem_ctx_exec.c
+++ b/tests/gem_ctx_exec.c
@@ -57,7 +57,7 @@ struct local_drm_i915_gem_context_destroy {
 };
 
 #define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create)
-#define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x23, struct local_drm_i915_gem_context_destroy)
+#define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2e, struct local_drm_i915_gem_context_destroy)
 
 static uint32_t context_create(int fd)
 {
@@ -135,5 +135,7 @@ int main(int argc, char *argv[])
 	assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
 	context_destroy(fd, ctx_id);
 
+	assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) < 0);
+
 	exit(EXIT_SUCCESS);
 }
-- 
1.7.9.5




More information about the Intel-gfx mailing list