From: Thierry Reding <thierry.reding@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH i-g-t 5/7] lib/drmtest: Support nouveau
Date: Thu, 12 Oct 2017 15:29:41 +0200 [thread overview]
Message-ID: <20171012132943.28316-5-thierry.reding@gmail.com> (raw)
In-Reply-To: <20171012132943.28316-1-thierry.reding@gmail.com>
From: Thierry Reding <treding@nvidia.com>
Add a driver definition for nouveau and wire up all the necessary pieces
to identify its devices.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
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
--
2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-12 13:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 13:29 [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 2/7] tools/aubdump: Avoid ISO C90 warning Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 3/7] lib: Fix compilation on non-x86 Thierry Reding
2017-10-12 13:44 ` Ville Syrjälä
2017-10-12 13:56 ` [Intel-gfx] " Thierry Reding
2017-10-17 22:05 ` Chris Wilson
2017-10-12 13:29 ` [PATCH i-g-t 4/7] lib/drmtest: Fix typo Thierry Reding
2017-10-12 13:29 ` Thierry Reding [this message]
2017-10-12 13:29 ` [PATCH i-g-t 6/7] lib/drmtest: Support Tegra Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 7/7] lib/drmtest: Allow the test device to be overridden Thierry Reding
2017-10-12 13:38 ` [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Lionel Landwerlin
2017-10-12 13:42 ` Ville Syrjälä
2017-10-12 14:08 ` ✓ Fi.CI.BAT: success for series starting with [1/7] " Patchwork
2017-10-12 19:55 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171012132943.28316-5-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox