From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org, zbigniew.kempczynski@intel.com
Subject: [igt-dev] [i-g-t V2 1/5] lib/drmtest: Add helpers to check and require the XE driver
Date: Tue, 14 Mar 2023 21:34:59 +0530 [thread overview]
Message-ID: <20230314160503.2237121-2-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230314160503.2237121-1-bhanuprakash.modem@intel.com>
In order to add support for features specific to the XE driver, add
helpers for checking and requiring the driver.
This patch will also update igt_require_intel() to support XE, and
create new helper igt_require_i915() as both i915 & XE belongs to
intel.
V2: - Re-use existing helpers for igt_require_intel (Mauro)
Credits-to: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
lib/drmtest.c | 20 ++++++++++++++++++++
lib/drmtest.h | 4 ++++
2 files changed, 24 insertions(+)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 0ceab1038..3f669740b 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -139,6 +139,16 @@ bool is_vc4_device(int fd)
return __is_device(fd, "vc4");
}
+bool is_xe_device(int fd)
+{
+ return __is_device(fd, "xe");
+}
+
+bool is_intel_device(int fd)
+{
+ return is_i915_device(fd) || is_xe_device(fd);
+}
+
static char _forced_driver[16] = "";
/**
@@ -645,6 +655,11 @@ void igt_require_amdgpu(int fd)
}
void igt_require_intel(int fd)
+{
+ igt_require(is_intel_device(fd));
+}
+
+void igt_require_i915(int fd)
{
igt_require(is_i915_device(fd));
}
@@ -658,3 +673,8 @@ void igt_require_vc4(int fd)
{
igt_require(is_vc4_device(fd));
}
+
+void igt_require_xe(int fd)
+{
+ igt_require(is_xe_device(fd));
+}
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 448ac03b4..392470ac0 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -99,8 +99,10 @@ int __drm_open_driver_render(int chipset);
void igt_require_amdgpu(int fd);
void igt_require_intel(int fd);
+void igt_require_i915(int fd);
void igt_require_nouveau(int fd);
void igt_require_vc4(int fd);
+void igt_require_xe(int fd);
bool is_amdgpu_device(int fd);
bool is_i915_device(int fd);
@@ -108,6 +110,8 @@ bool is_mtk_device(int fd);
bool is_msm_device(int fd);
bool is_nouveau_device(int fd);
bool is_vc4_device(int fd);
+bool is_xe_device(int fd);
+bool is_intel_device(int fd);
/**
* do_or_die:
--
2.39.1
next prev parent reply other threads:[~2023-03-14 16:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 16:04 [igt-dev] [i-g-t V2 0/5] Add basic helpers to support display in XE Bhanuprakash Modem
2023-03-14 16:04 ` Bhanuprakash Modem [this message]
2023-03-14 16:05 ` [igt-dev] [i-g-t V2 2/5] i915: s/igt_require_intel/igt_require_i915 Bhanuprakash Modem
2023-03-14 16:05 ` [igt-dev] [i-g-t V2 3/5] lib/xe/xe_query: Add dev_id() interface Bhanuprakash Modem
2023-03-14 16:05 ` [igt-dev] [i-g-t V2 4/5] lib/intel_chipset: Add support to XE driver to get devid Bhanuprakash Modem
2023-03-14 16:05 ` [igt-dev] [i-g-t V2 5/5] lib/igt_kms: Cache xe_device info for kms tests Bhanuprakash Modem
2023-03-14 17:00 ` [igt-dev] ✓ Fi.CI.BAT: success for Add basic helpers to support display in XE (rev2) Patchwork
2023-03-15 20:30 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230314160503.2237121-2-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=zbigniew.kempczynski@intel.com \
/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