mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 12:32:31 -04:00
Instead of iterating over available Xe devices within a testcase,
without being able to distinguish potential failures from different
devices on system with many Xe devices, introduce helpers that will
allow to treat each Xe device as a parameter for the testcase like:
static void bar(struct kunit *test)
{
struct xe_device *xe = test->priv;
...
}
struct kunit_case foo_live_tests[] = {
KUNIT_CASE_PARAM(bar, xe_pci_live_device_gen_param),
{}
};
struct kunit_suite foo_suite = {
.name = "foo_live",
.test_cases = foo_live_tests,
.init = xe_kunit_helper_xe_device_live_test_init,
};
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240720142528.530-3-michal.wajdeczko@intel.com
41 lines
963 B
C
41 lines
963 B
C
/* SPDX-License-Identifier: GPL-2.0 AND MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_PCI_TEST_H_
|
|
#define _XE_PCI_TEST_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "xe_platform_types.h"
|
|
#include "xe_sriov_types.h"
|
|
|
|
struct xe_device;
|
|
struct xe_graphics_desc;
|
|
struct xe_media_desc;
|
|
|
|
typedef int (*xe_device_fn)(struct xe_device *);
|
|
typedef void (*xe_graphics_fn)(const struct xe_graphics_desc *);
|
|
typedef void (*xe_media_fn)(const struct xe_media_desc *);
|
|
|
|
int xe_call_for_each_device(xe_device_fn xe_fn);
|
|
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;
|
|
u32 media_verx100;
|
|
u32 graphics_step;
|
|
u32 media_step;
|
|
};
|
|
|
|
int xe_pci_fake_device_init(struct xe_device *xe);
|
|
|
|
const void *xe_pci_live_device_gen_param(const void *prev, char *desc);
|
|
|
|
#endif
|