From patchwork Thu Oct 12 13:29:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10002005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A8546028A for ; Thu, 12 Oct 2017 13:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BAB925F3E for ; Thu, 12 Oct 2017 13:30:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10E4928DD9; Thu, 12 Oct 2017 13:30:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D125225F3E for ; Thu, 12 Oct 2017 13:30:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C11D6E85B; Thu, 12 Oct 2017 13:30:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64D9A6E855; Thu, 12 Oct 2017 13:29:57 +0000 (UTC) Received: by mail-qk0-x244.google.com with SMTP id 17so1204121qkq.8; Thu, 12 Oct 2017 06:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CG21Zk+uHKLtjkB4FTsKJQjiWQbn0BmQQ7toddPvSBY=; b=dSr2AZrd7/qSaFuId6/AnTn/logOE1+b/9N5ZuA8v8rVJe6HB+ejMyQqWbn/+eScr8 mXrtmhh912Ztrv7dZup1CGTPnLHQx36J9HSui3gkFLvv0muYVobVYwcgIDja5xQytKjp kK/KITFJijjuFk6uYL3eoLdNo+ejbWBQqFgqmuZ57eCUP5LKbi3EHfw1fj26JMbA80LI JeOqWi528S/cBNLn+cOhL4k3WHoK+mFIV9Rpb54Yp6vJPRyCTxpJKdJPYf2j+oaXMco2 gXB79qLqZqPqWFAbf9qMD6bO9kXpSPop/PoGqNKH2z+vp1odidRcfgVFqTkn32XdaevI m6Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CG21Zk+uHKLtjkB4FTsKJQjiWQbn0BmQQ7toddPvSBY=; b=kWHfaBR2uFHiFTtk+KaSW0GE1K2fMk3p7VSFXYVp9XwYStabBdQcMMCWC/8e7KsWto S3phxWtf0SN98T+PsN7LQPOmLtHCuZ2dDPewHvXI5xM/GFQWswX82XifE9YzX14tbem/ 4r6aq4jUOGylSm2/lrfXj0+CyXpgqj4Wy9oJ0c/JqyUD1AaYAxZdgsZdvBA8daIQSd2B 73ySNnWwa//GJLDpo9rKpGH8seGvKDplmnDd6vcz88vblWFTkpHjxDI6n+iEqXTWITDw xg58zT44FMGshL5O67jv5VDowDPzeQP5Lh6Jy+vJ0VpcvhK8M+jl3q7aTIDrLh2W6iRv n0mw== X-Gm-Message-State: AMCzsaWLKzkHYtoPH5gg1RRA5VXMnf0JMZcz3fejydXcFAimIhlwnOl3 nKLofTEYUX/JFOG0xJ26Tb0v1A== X-Google-Smtp-Source: AOwi7QBgBAr8MrLFnAXuXNGwhuYHIL/G1l/NgR3D9nFdHPWfWsUsslJfRj62mP82ARqckMagJpC+XA== X-Received: by 10.233.220.196 with SMTP id q187mr449361qkf.344.1507814996133; Thu, 12 Oct 2017 06:29:56 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id g81sm9776540qkh.24.2017.10.12.06.29.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 06:29:55 -0700 (PDT) From: Thierry Reding To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2017 15:29:41 +0200 Message-Id: <20171012132943.28316-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171012132943.28316-1-thierry.reding@gmail.com> References: <20171012132943.28316-1-thierry.reding@gmail.com> Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 5/7] lib/drmtest: Support nouveau 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Add a driver definition for nouveau and wire up all the necessary pieces to identify its devices. Signed-off-by: Thierry Reding --- lib/drmtest.c | 14 ++++++++++++-- lib/drmtest.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 24a5ea0f6a0f..f46419ec36cf 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -80,7 +80,7 @@ static int __get_drm_device_name(int fd, char *name) drm_version_t version; memset(&version, 0, sizeof(version)); - version.name_len = 4; + version.name_len = 8; version.name = name; if (!drmIoctl(fd, DRM_IOCTL_VERSION, &version)){ @@ -92,7 +92,7 @@ static int __get_drm_device_name(int fd, char *name) static bool __is_device(int fd, const char *expect) { - char name[5] = ""; + char name[9] = ""; if (__get_drm_device_name(fd, name)) return false; @@ -125,6 +125,11 @@ static bool is_amd_device(int fd) return __is_device(fd, "amdg"); } +static bool is_nouveau_device(int fd) +{ + return __is_device(fd, "nouveau"); +} + static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; @@ -277,6 +282,9 @@ int __drm_open_driver(int chipset) if (chipset & DRIVER_AMDGPU && is_amd_device(fd)) return fd; + if (chipset & DRIVER_NOUVEAU && is_nouveau_device(fd)) + return fd; + /* Only VGEM-specific tests should be run on VGEM */ if (chipset == DRIVER_ANY && !is_vgem_device(fd)) return fd; @@ -352,6 +360,8 @@ static const char *chipset_to_str(int chipset) return "virtio"; case DRIVER_AMDGPU: return "amdgpu"; + case DRIVER_NOUVEAU: + return "nouveau"; case DRIVER_ANY: return "any"; default: diff --git a/lib/drmtest.h b/lib/drmtest.h index a86799d54834..e54e1b6756af 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -43,6 +43,7 @@ #define DRIVER_VGEM (1 << 2) #define DRIVER_VIRTIO (1 << 3) #define DRIVER_AMDGPU (1 << 4) +#define DRIVER_NOUVEAU (1 << 5) /* * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system * with vgem as well as a supported driver, you can end up with a