From patchwork Sat Nov 2 12:04:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3130131 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B6909F3C4 for ; Sat, 2 Nov 2013 12:05:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1735C20498 for ; Sat, 2 Nov 2013 12:05:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7DF6F2045E for ; Sat, 2 Nov 2013 12:04:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E98DAF08B9; Sat, 2 Nov 2013 05:04:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com [74.125.83.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E9E9F08B0 for ; Sat, 2 Nov 2013 05:04:50 -0700 (PDT) Received: by mail-ee0-f46.google.com with SMTP id c1so238878eek.19 for ; Sat, 02 Nov 2013 05:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=rcR26xCSKOoAJwvBZlOa7Sy3jLXJrOQFbyhIr70Gq/E=; b=bj8GyzTwNw3NZp6MaP+3VmkadkrZ8/PQatFy0cK8eqbFY1nKBs7/1reChG9U0UFLiF Q9cTcYZU5xSflJGfPDqKBAAWgQEb3ssWBnXW2YtSKVHyB3qRTUwxusY0GqJaAAS4YgMb EIwxGI6yNSq34kdNugpTKZIyrX53Od3SDqMc8= 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=rcR26xCSKOoAJwvBZlOa7Sy3jLXJrOQFbyhIr70Gq/E=; b=kp2ZLxDwW8+4cYj49SKJBjPrAtjxawJIsCqr7iemcXuHHiEk+9eqSsYf897ViXUJtB c6egJRZhpkZUe143M9redSWEK0Ypv5vO2PFGHK0enXNPrZBnDsH+EDleKPKnHRsdyTYU YxoCknbuyPF8rjrbb/tvT7cItgB0j7m0uNB61FQJOIH4IrHK15aU8GgvvuZ95/5mHcaK Ns52BsKSPY82lwsAtYewu5qpkgXA7u0QgOXUmYnLGyR81K6jEHCsoUPRxaLEpA9QxpvJ xM8B7qokslooWjw2sCQ8XjUUhrW9X9FTGief0zsOffmI6v+8qUrDI2Wlgxw9b13MVV6h b86g== X-Gm-Message-State: ALoCoQkBzfForTJM5p+dfFp6FVG0qq2yQjLnpCj8F8iStu1BqpsWjojIe7mPi+tgiUG5KYRjmlUz X-Received: by 10.15.34.9 with SMTP id d9mr1151648eev.99.1383393890406; Sat, 02 Nov 2013 05:04:50 -0700 (PDT) Received: from gina.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id r48sm19769796eev.14.2013.11.02.05.04.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2013 05:04:49 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sat, 2 Nov 2013 13:04:36 +0100 Message-Id: <1383393876-2921-6-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1383393876-2921-1-git-send-email-daniel.vetter@ffwll.ch> References: <1383393876-2921-1-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 5/5] tests: establish core_ prefix 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: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Signed-off-by: Daniel Vetter --- tests/Makefile.am | 6 ++--- tests/NAMING-CONVENTION | 2 ++ tests/core_getclient.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/core_getstats.c | 50 ++++++++++++++++++++++++++++++++++++++++ tests/core_getversion.c | 49 +++++++++++++++++++++++++++++++++++++++ tests/getclient.c | 61 ------------------------------------------------- tests/getstats.c | 50 ---------------------------------------- tests/getversion.c | 49 --------------------------------------- 8 files changed, 165 insertions(+), 163 deletions(-) create mode 100644 tests/core_getclient.c create mode 100644 tests/core_getstats.c create mode 100644 tests/core_getversion.c delete mode 100644 tests/getclient.c delete mode 100644 tests/getstats.c delete mode 100644 tests/getversion.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 807a67c09a45..a9bd8b2a3d90 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -63,6 +63,9 @@ TESTS_progs_M = \ $(NULL) TESTS_progs = \ + core_getclient \ + core_getstats \ + core_getversion \ drm_get_client_auth \ drm_vma_limiter \ drm_vma_limiter_cached \ @@ -116,9 +119,6 @@ TESTS_progs = \ gen3_render_mixed_blits \ gen3_render_tiledx_blits \ gen3_render_tiledy_blits \ - getclient \ - getstats \ - getversion \ prime_udl \ pm_rc6_residency \ pm_rps \ diff --git a/tests/NAMING-CONVENTION b/tests/NAMING-CONVENTION index f57033c0a6cc..f08e2828022a 100644 --- a/tests/NAMING-CONVENTION +++ b/tests/NAMING-CONVENTION @@ -7,6 +7,8 @@ naming scheme for tests and subtests. Test Prefixes ------------- +core_: Test for core drm ioctls and behaviour. + kms_: Used for modesetting tests. drm_: Tests for libdrm behaviour, currently just testing the buffer cache diff --git a/tests/core_getclient.c b/tests/core_getclient.c new file mode 100644 index 000000000000..dcb7b326820d --- /dev/null +++ b/tests/core_getclient.c @@ -0,0 +1,61 @@ +/* + * Copyright © 2007 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: + * Eric Anholt + * + */ + +#include +#include +#include "drmtest.h" + +/** + * Checks DRM_IOCTL_GET_CLIENT. + */ +int main(int argc, char **argv) +{ + int fd, ret; + drm_client_t client; + + fd = drm_open_any(); + + /* Look for client index 0. This should exist whether we're operating + * on an otherwise unused drm device, or the X Server is running on + * the device. + */ + client.idx = 0; + ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); + igt_assert(ret == 0); + + /* Look for some absurd client index and make sure it's invalid. + * The DRM drivers currently always return data, so the user has + * no real way to detect when the list has terminated. That's bad, + * and this test is XFAIL as a result. + */ + client.idx = 0x7fffffff; + ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); + igt_assert(ret == -1 && errno == EINVAL); + + close(fd); + return 0; +} diff --git a/tests/core_getstats.c b/tests/core_getstats.c new file mode 100644 index 000000000000..7975257d74da --- /dev/null +++ b/tests/core_getstats.c @@ -0,0 +1,50 @@ +/* + * Copyright © 2007 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: + * Eric Anholt + * + */ + +#include +#include +#include "drmtest.h" + +/** + * Checks DRM_IOCTL_GET_STATS. + * + * I don't care too much about the actual contents, just that the kernel + * doesn't crash. + */ +int main(int argc, char **argv) +{ + int fd, ret; + drm_stats_t stats; + + fd = drm_open_any(); + + ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats); + igt_assert(ret == 0); + + close(fd); + return 0; +} diff --git a/tests/core_getversion.c b/tests/core_getversion.c new file mode 100644 index 000000000000..d6da2ad6e8a8 --- /dev/null +++ b/tests/core_getversion.c @@ -0,0 +1,49 @@ +/* + * Copyright © 2007 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: + * Eric Anholt + * + */ + +#include +#include +#include "drmtest.h" + +/** + * Checks DRM_IOCTL_GET_VERSION and libdrm's drmGetVersion() interface to it. + */ +int main(int argc, char **argv) +{ + int fd; + drmVersionPtr v; + + fd = drm_open_any(); + v = drmGetVersion(fd); + igt_assert(strlen(v->name) != 0); + igt_assert(strlen(v->date) != 0); + igt_assert(strlen(v->desc) != 0); + igt_assert(v->version_major >= 1); + drmFree(v); + close(fd); + return 0; +} diff --git a/tests/getclient.c b/tests/getclient.c deleted file mode 100644 index dcb7b326820d..000000000000 --- a/tests/getclient.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2007 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: - * Eric Anholt - * - */ - -#include -#include -#include "drmtest.h" - -/** - * Checks DRM_IOCTL_GET_CLIENT. - */ -int main(int argc, char **argv) -{ - int fd, ret; - drm_client_t client; - - fd = drm_open_any(); - - /* Look for client index 0. This should exist whether we're operating - * on an otherwise unused drm device, or the X Server is running on - * the device. - */ - client.idx = 0; - ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); - igt_assert(ret == 0); - - /* Look for some absurd client index and make sure it's invalid. - * The DRM drivers currently always return data, so the user has - * no real way to detect when the list has terminated. That's bad, - * and this test is XFAIL as a result. - */ - client.idx = 0x7fffffff; - ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client); - igt_assert(ret == -1 && errno == EINVAL); - - close(fd); - return 0; -} diff --git a/tests/getstats.c b/tests/getstats.c deleted file mode 100644 index 7975257d74da..000000000000 --- a/tests/getstats.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright © 2007 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: - * Eric Anholt - * - */ - -#include -#include -#include "drmtest.h" - -/** - * Checks DRM_IOCTL_GET_STATS. - * - * I don't care too much about the actual contents, just that the kernel - * doesn't crash. - */ -int main(int argc, char **argv) -{ - int fd, ret; - drm_stats_t stats; - - fd = drm_open_any(); - - ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats); - igt_assert(ret == 0); - - close(fd); - return 0; -} diff --git a/tests/getversion.c b/tests/getversion.c deleted file mode 100644 index d6da2ad6e8a8..000000000000 --- a/tests/getversion.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2007 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: - * Eric Anholt - * - */ - -#include -#include -#include "drmtest.h" - -/** - * Checks DRM_IOCTL_GET_VERSION and libdrm's drmGetVersion() interface to it. - */ -int main(int argc, char **argv) -{ - int fd; - drmVersionPtr v; - - fd = drm_open_any(); - v = drmGetVersion(fd); - igt_assert(strlen(v->name) != 0); - igt_assert(strlen(v->date) != 0); - igt_assert(strlen(v->desc) != 0); - igt_assert(v->version_major >= 1); - drmFree(v); - close(fd); - return 0; -}