From patchwork Wed Feb 18 17:06:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5845471 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B9409F36A for ; Wed, 18 Feb 2015 17:06:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EF0920149 for ; Wed, 18 Feb 2015 17:06:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 96D1C20225 for ; Wed, 18 Feb 2015 17:06:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63F9E6E53C; Wed, 18 Feb 2015 09:06:24 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by gabe.freedesktop.org (Postfix) with ESMTP id B3FAD6E078 for ; Wed, 18 Feb 2015 09:06:22 -0800 (PST) Received: by mail-wg0-f54.google.com with SMTP id y19so2314805wgg.13 for ; Wed, 18 Feb 2015 09:06:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=lKayUC1jxPv3es2OB8VyL50aWaFQn2p6kji5V60Ct5I=; b=dHwrANyQ96O/cXGKX7ZxphfLSDLA9q22JnK2AVn0uhI9Ooyp6WyPKtgMwMVMynVJcY mZKPCaVmM8ZZd/7Hwj5C4+/lbqSPD8LESPcXr1MMH4p8hSmQyp1y3JmhC+/VOce8UVqo v6wICY1MLFOaHUstBAV1EIgaDfcRnKgDtd1sHYq9cv0AMze3Ud9RZbKe6C4JwblsH8a1 hcQSxzASePwHd3/c2WIHjA3g9616123MJR5uvDgOaWqwlewvd0FTcUfMDmysBN93jpYN qH5T+CGrteHpU5FOzXokLmfHsdXjh19s+v1El0NoCKlse8nSqvgumvmIhp496a2MDTUr 5ztQ== X-Gm-Message-State: ALoCoQmlgOg2aoeqq6EKmbS1Q7aTH80+hLnBvW6yPJQzKJt8O4E2HntoCb2yN7GUr8LXwQSKkxDw X-Received: by 10.194.79.226 with SMTP id m2mr612579wjx.60.1424279182080; Wed, 18 Feb 2015 09:06:22 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ub1sm33474610wjc.43.2015.02.18.09.06.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 09:06:21 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Feb 2015 17:06:16 +0000 Message-Id: <1424279176-5000-4-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424279176-5000-1-git-send-email-thomas.wood@intel.com> References: <1424279176-5000-1-git-send-email-thomas.wood@intel.com> MIME-Version: 1.0 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t 4/4] tests: remove extra file X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove a file accidentally added in commit 6f582f7 (tests: Add gem_ctx_param_basic). Cc: Daniel Vetter Signed-off-by: Thomas Wood --- tests/gem_ctx_param_basic. | 172 --------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 tests/gem_ctx_param_basic. diff --git a/tests/gem_ctx_param_basic. b/tests/gem_ctx_param_basic. deleted file mode 100644 index 2d866b3..0000000 --- a/tests/gem_ctx_param_basic. +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright © 2011 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Ben Widawsky - * - */ - -/* - * This test is useful for finding memory and refcount leaks. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" -#include "intel_io.h" -#include "intel_chipset.h" - -IGT_TEST_DESCRIPTION("Basic test for memory and refcount leaks."); - -/* options */ -int num_contexts = 10; -int uncontexted = 0; /* test only context create/destroy */ -int multiple_fds = 1; -int iter = 10000; - -/* globals */ -pthread_t *threads; -int devid; -int fd; - -static void init_buffer(drm_intel_bufmgr *bufmgr, - struct igt_buf *buf, - uint32_t size) -{ - buf->bo = drm_intel_bo_alloc(bufmgr, "", size, 4096); - buf->size = size; - igt_assert(buf->bo); - buf->tiling = I915_TILING_NONE; - buf->stride = 4096; -} - -static void *work(void *arg) -{ - struct intel_batchbuffer *batch; - igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid); - drm_intel_context *context; - drm_intel_bufmgr *bufmgr; - int td_fd; - int i; - - if (multiple_fds) - td_fd = fd = drm_open_any_render(); - else - td_fd = fd; - - igt_assert(td_fd >= 0); - - bufmgr = drm_intel_bufmgr_gem_init(td_fd, 4096); - batch = intel_batchbuffer_alloc(bufmgr, devid); - context = drm_intel_gem_context_create(bufmgr); - igt_require(context); - - for (i = 0; i < iter; i++) { - struct igt_buf src, dst; - - init_buffer(bufmgr, &src, 4096); - init_buffer(bufmgr, &dst, 4096); - - - if (uncontexted) { - igt_assert(rendercopy); - rendercopy(batch, NULL, &src, 0, 0, 0, 0, &dst, 0, 0); - } else { - int ret; - ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer); - igt_assert(ret == 0); - intel_batchbuffer_flush_with_context(batch, context); - } - } - - drm_intel_gem_context_destroy(context); - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(bufmgr); - - if (multiple_fds) - close(td_fd); - - pthread_exit(NULL); -} - -static int opt_handler(int opt, int opt_index) -{ - switch (opt) { - case 'i': - iter = atoi(optarg); - break; - case 'c': - num_contexts = atoi(optarg); - break; - case 'm': - multiple_fds = 1; - break; - case 'u': - uncontexted = 1; - break; - } - - return 0; -} - -int main(int argc, char *argv[]) -{ - int i; - - igt_simple_init_parse_opts(argc, argv, "i:c:n:mu", NULL, NULL, - opt_handler); - - fd = drm_open_any_render(); - devid = intel_get_drm_devid(fd); - - if (igt_run_in_simulation()) { - num_contexts = 2; - iter = 4; - } - - threads = calloc(num_contexts, sizeof(*threads)); - - for (i = 0; i < num_contexts; i++) - pthread_create(&threads[i], NULL, work, &i); - - for (i = 0; i < num_contexts; i++) { - void *retval; - igt_assert(pthread_join(threads[i], &retval) == 0); - } - - free(threads); - close(fd); - - igt_exit(); -}