[PATCH 5/6] drm/xe/kunit: Use default GMDID version if none provided

Michal Wajdeczko michal.wajdeczko at intel.com
Fri Aug 1 18:13:49 UTC 2025


For pre-GMDID platforms it is sufficient to provide platform enum
or platform/subplatform enum pair to get full fake Xe device for use
in KUnit tests. But if we specify GMDID platform without providing
explicit verx100 values, we might get incomplete device test object
that lacks any GTs.

To relax tests from specifying full device config, use some default
(or first available or defined) GMDID version if none was provided.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
---
 drivers/gpu/drm/xe/tests/xe_pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c
index e78d10df8359..90c55f72d687 100644
--- a/drivers/gpu/drm/xe/tests/xe_pci.c
+++ b/drivers/gpu/drm/xe/tests/xe_pci.c
@@ -262,10 +262,10 @@ static void fake_read_gmdid(struct xe_device *xe, enum xe_gmdid_type type,
 	struct xe_pci_fake_data *data = test->priv;
 
 	if (type == GMDID_MEDIA) {
-		*ver = data->media_verx100;
+		*ver = data->media_verx100 ?: media_ips[0].verx100;
 		*revid = xe_step_to_gmdid(data->step.media);
 	} else {
-		*ver = data->graphics_verx100;
+		*ver = data->graphics_verx100 ?: graphics_ips[0].verx100;
 		*revid = xe_step_to_gmdid(data->step.graphics);
 	}
 }
-- 
2.47.1



More information about the Intel-xe mailing list