[PATCH i-g-t v2 4/5] tests/prime_udl: Fix i915 device opening

Kamil Konieczny
2026-04-22T15:45:34Z

There are now Intel cards handled by Xe driver so make sure we
open one handled by i915.

Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
---
tests/prime_udl.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index 5d2c952d5..db83152fc 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -49,6 +49,11 @@ static int find_and_open_devices(void)
intel_fd = open(path, O_RDWR);
if (intel_fd == -1)
return -1;
+
+ if (!is_i915_device(intel_fd)) {
+ close(intel_fd);
+ intel_fd = -1;
+ }
} else if (venid == 0x17e9 && udl_fd == -1) {
udl_fd = open(path, O_RDWR);
if (udl_fd == -1)
--
2.54.0