From 6cad22853cb89da857ff636607dd0e9880172a43 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 5 Dec 2023 05:39:53 -0800 Subject: drm/xe/kunit: Add stub to read_gmdid Currently it's not possible to test the WAs for platforms using gmdid since they don't have the IP information on the descriptor struct. In order to allow that, add a stub function for read_gmdid() that is activated when the test executes, replacing the iomap and read of the real register. Reviewed-by: Matt Roper Link: https://lore.kernel.org/r/20231129232807.1499826-5-lucas.demarchi@intel.com Link: https://lore.kernel.org/r/20231205133954.2089546-3-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_pci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/drm/xe/xe_pci.c') diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index b85193d1dcc2..148890357313 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -5,6 +5,7 @@ #include "xe_pci.h" +#include #include #include #include @@ -456,6 +457,8 @@ static void read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, struct xe_reg gmdid_reg = GMD_ID; u32 val; + KUNIT_STATIC_STUB_REDIRECT(read_gmdid, xe, type, ver, revid); + if (type == GMDID_MEDIA) gmdid_reg.addr += MEDIA_GT_GSI_OFFSET; -- cgit