Files
linux/drivers/gpu/drm/xe/tests/xe_pci_test.h
Matt Roper 3713ed52ef drm/xe: Add KUnit test for xe_pci.c IP engine lists
Add a simple KUnit test to ensure that the hardware engine lists for
GMD_ID IP definitions are sensible (i.e., no graphics engines defined
for the media IP and vice versa).

Only the IP descriptors for GMD_ID platforms are checked for now.
Presumably the engine lists on older pre-GMD_ID platforms shouldn't be
changing.  We can extend the KUnit testing in the future if we decide we
want to check those as well.

v2:
 - Add missing 'const' in xe_call_for_each_media_ip to avoid compiler
   warning.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20230406235621.1914492-9-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-12-19 18:31:40 -05:00

38 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 AND MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_PCI_TEST_H_
#define _XE_PCI_TEST_H_
#include "xe_platform_types.h"
struct xe_device;
struct xe_graphics_desc;
struct xe_media_desc;
/*
* Some defines just for clarity: these mean the test doesn't care about what
* platform it will get since it doesn't depend on any platform-specific bits
*/
#define XE_TEST_PLATFORM_ANY XE_PLATFORM_UNINITIALIZED
#define XE_TEST_SUBPLATFORM_ANY XE_SUBPLATFORM_UNINITIALIZED
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);
int xe_pci_fake_device_init(struct xe_device *xe, enum xe_platform platform,
enum xe_subplatform subplatform);
#define xe_pci_fake_device_init_any(xe__) \
xe_pci_fake_device_init(xe__, XE_TEST_PLATFORM_ANY, \
XE_TEST_SUBPLATFORM_ANY)
#endif