From patchwork Tue Feb 5 10:26:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 2097231 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 721C33FC23 for ; Tue, 5 Feb 2013 10:27:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41EDCE62DD for ; Tue, 5 Feb 2013 02:27:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id CAAA7E608E for ; Tue, 5 Feb 2013 02:27:21 -0800 (PST) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 05 Feb 2013 02:27:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,602,1355126400"; d="scan'208";a="198819311" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.72.66]) by AZSMGA002.ch.intel.com with ESMTP; 05 Feb 2013 02:27:03 -0800 Received: by gaia (Postfix, from userid 1000) id 9956240C14; Tue, 5 Feb 2013 12:26:52 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Tue, 5 Feb 2013 12:26:49 +0200 Message-Id: <1360060009-17707-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20130204162725.GG5843@phenom.ffwll.local> References: <20130204162725.GG5843@phenom.ffwll.local> Subject: [Intel-gfx] [PATCH] tests/gem_ctx_exec: properly test destroy_ctx ioctl X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org 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 --- 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); }