[PATCH 1/6] drm/xe/kunit: Update struct xe_pci_fake_data step declarations
Lucas De Marchi
lucas.demarchi at intel.com
Mon Aug 18 15:58:34 UTC 2025
On Fri, Aug 01, 2025 at 08:13:45PM +0200, Michal Wajdeczko wrote:
>The struct xe_pci_fake_data has fields that specify graphics and
>media stepping of the fake PCI device used during KUnit testing.
>
>Change definitions of those separate step fields and use existing
>struct xe_step_info definition that already have required fields.
>
>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 ++--
> drivers/gpu/drm/xe/tests/xe_pci_test.h | 4 ++--
> drivers/gpu/drm/xe/tests/xe_wa_test.c | 6 ++++--
> 3 files changed, 8 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c
>index 9c715e59f030..81bc86647499 100644
>--- a/drivers/gpu/drm/xe/tests/xe_pci.c
>+++ b/drivers/gpu/drm/xe/tests/xe_pci.c
>@@ -94,10 +94,10 @@ static void fake_read_gmdid(struct xe_device *xe, enum xe_gmdid_type type,
>
> if (type == GMDID_MEDIA) {
> *ver = data->media_verx100;
>- *revid = xe_step_to_gmdid(data->media_step);
>+ *revid = xe_step_to_gmdid(data->step.media);
> } else {
> *ver = data->graphics_verx100;
>- *revid = xe_step_to_gmdid(data->graphics_step);
>+ *revid = xe_step_to_gmdid(data->step.graphics);
> }
> }
>
>diff --git a/drivers/gpu/drm/xe/tests/xe_pci_test.h b/drivers/gpu/drm/xe/tests/xe_pci_test.h
>index ce4d2b86b778..32452bd65bff 100644
>--- a/drivers/gpu/drm/xe/tests/xe_pci_test.h
>+++ b/drivers/gpu/drm/xe/tests/xe_pci_test.h
>@@ -10,6 +10,7 @@
>
> #include "xe_platform_types.h"
> #include "xe_sriov_types.h"
>+#include "xe_step_types.h"
>
> struct xe_device;
>
>@@ -17,10 +18,9 @@ struct xe_pci_fake_data {
> enum xe_sriov_mode sriov_mode;
> enum xe_platform platform;
> enum xe_subplatform subplatform;
>+ struct xe_step_info step;
> u32 graphics_verx100;
> u32 media_verx100;
>- u32 graphics_step;
>- u32 media_step;
> };
>
> int xe_pci_fake_device_init(struct xe_device *xe);
>diff --git a/drivers/gpu/drm/xe/tests/xe_wa_test.c b/drivers/gpu/drm/xe/tests/xe_wa_test.c
>index c96d1fe34151..a97d42b72d44 100644
>--- a/drivers/gpu/drm/xe/tests/xe_wa_test.c
>+++ b/drivers/gpu/drm/xe/tests/xe_wa_test.c
>@@ -92,8 +92,10 @@ static int xe_wa_test_init(struct kunit *test)
> .subplatform = param->subplatform,
> .graphics_verx100 = param->graphics_verx100,
> .media_verx100 = param->media_verx100,
>- .graphics_step = param->step.graphics,
>- .media_step = param->step.media,
>+ .step = {
>+ .graphics = param->step.graphics,
>+ .media = param->step.media,
>+ },
could simply be
.step = param->step
to avoid needing to update it in future? Anyway,
Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
Lucas De Marchi
> };
> struct xe_device *xe;
> struct device *dev;
>--
>2.47.1
>
More information about the Intel-xe
mailing list