]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/kunit: Set SR-IOV mode of the fake device
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 18 Dec 2023 19:06:23 +0000 (20:06 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 21:31:29 +0000 (16:31 -0500)
We want to add code that will check the driver's SR-IOV mode.

Update xe_pci_fake_device_init() and struct xe_pci_fake_data to
either explicitly specify desired SR-IOV mode of the fake device
or fallback to the default bare-metal mode.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20231218190629.502-5-michal.wajdeczko@intel.com
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
drivers/gpu/drm/xe/tests/xe_pci.c
drivers/gpu/drm/xe/tests/xe_pci_test.h

index 602793644f61d7145010feaaee2e36cee338fc40..f62809ca8b51f56dd97985f9034df7f81f2ac192 100644 (file)
@@ -156,6 +156,9 @@ int xe_pci_fake_device_init(struct xe_device *xe)
                return -ENODEV;
 
 done:
+       xe->sriov.__mode = data && data->sriov_mode ?
+                          data->sriov_mode : XE_SRIOV_MODE_NONE;
+
        kunit_activate_static_stub(test, read_gmdid, fake_read_gmdid);
 
        xe_info_init_early(xe, desc, subplatform_desc);
index 811ffe5bd9fd2e0bb0c1eb5739c4ddca25fbdd30..f40dcec8399291a737cc9200bc59ad4b3c3511c4 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/types.h>
 
 #include "xe_platform_types.h"
+#include "xe_sriov_types.h"
 
 struct xe_device;
 struct xe_graphics_desc;
@@ -23,6 +24,7 @@ void xe_call_for_each_graphics_ip(xe_graphics_fn xe_fn);
 void xe_call_for_each_media_ip(xe_media_fn xe_fn);
 
 struct xe_pci_fake_data {
+       enum xe_sriov_mode sriov_mode;
        enum xe_platform platform;
        enum xe_subplatform subplatform;
        u32 graphics_verx100;