summaryrefslogtreecommitdiff
path: root/lib/drmtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r--lib/drmtest.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 25eeab88..d31ade3f 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -93,7 +93,7 @@ static int __get_drm_device_name(int fd, char *name, int name_size)
static bool __is_device(int fd, const char *expect)
{
- char name[5] = "";
+ char name[12] = "";
if (__get_drm_device_name(fd, name, sizeof(name) - 1))
return false;
@@ -101,6 +101,11 @@ static bool __is_device(int fd, const char *expect)
return strcmp(expect, name) == 0;
}
+bool is_amdgpu_device(int fd)
+{
+ return __is_device(fd, "amdgpu");
+}
+
bool is_i915_device(int fd)
{
return __is_device(fd, "i915");
@@ -445,6 +450,11 @@ int drm_open_driver_render(int chipset)
return fd;
}
+void igt_require_amdgpu(int fd)
+{
+ igt_require(is_amdgpu_device(fd));
+}
+
void igt_require_intel(int fd)
{
igt_require(is_i915_device(fd) && has_known_intel_chipset(fd));