drivers/gpu/drm/xe/tests/xe_pci.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/tests/xe_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/tests/xe_pci.c- Extension
.c- Size
- 13008 bytes
- Lines
- 419
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
tests/xe_pci_test.htests/xe_test.hkunit/test-bug.hkunit/test.hkunit/visibility.h
Detected Declarations
function xe_pci_fake_data_descfunction xe_ip_kunit_descfunction xe_pci_id_kunit_descfunction fake_init_devidfunction fake_xe_info_probe_tile_count
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0 AND MIT
/*
* Copyright © 2023 Intel Corporation
*/
#include "tests/xe_pci_test.h"
#include "tests/xe_test.h"
#include <kunit/test-bug.h>
#include <kunit/test.h>
#include <kunit/test-bug.h>
#include <kunit/visibility.h>
#define PLATFORM_CASE(platform__, graphics_step__) \
{ \
.platform = XE_ ## platform__, \
.subplatform = XE_SUBPLATFORM_NONE, \
.step = { .graphics = STEP_ ## graphics_step__ } \
}
#define SUBPLATFORM_CASE(platform__, subplatform__, graphics_step__) \
{ \
.platform = XE_ ## platform__, \
.subplatform = XE_SUBPLATFORM_ ## platform__ ## _ ## subplatform__, \
.step = { .graphics = STEP_ ## graphics_step__ } \
}
#define GMDID_CASE(platform__, graphics_verx100__, graphics_step__, \
media_verx100__, media_step__) \
{ \
.platform = XE_ ## platform__, \
.subplatform = XE_SUBPLATFORM_NONE, \
.graphics_verx100 = graphics_verx100__, \
.media_verx100 = media_verx100__, \
.step = { .graphics = STEP_ ## graphics_step__, \
.media = STEP_ ## media_step__ } \
}
static const struct xe_pci_fake_data cases[] = {
PLATFORM_CASE(TIGERLAKE, B0),
PLATFORM_CASE(DG1, A0),
PLATFORM_CASE(DG1, B0),
PLATFORM_CASE(ALDERLAKE_S, A0),
PLATFORM_CASE(ALDERLAKE_S, B0),
PLATFORM_CASE(ALDERLAKE_S, C0),
PLATFORM_CASE(ALDERLAKE_S, D0),
PLATFORM_CASE(ALDERLAKE_P, A0),
PLATFORM_CASE(ALDERLAKE_P, B0),
PLATFORM_CASE(ALDERLAKE_P, C0),
SUBPLATFORM_CASE(ALDERLAKE_S, RPLS, D0),
SUBPLATFORM_CASE(ALDERLAKE_P, RPLU, E0),
SUBPLATFORM_CASE(DG2, G10, C0),
SUBPLATFORM_CASE(DG2, G11, B1),
SUBPLATFORM_CASE(DG2, G12, A1),
GMDID_CASE(METEORLAKE, 1270, A0, 1300, A0),
GMDID_CASE(METEORLAKE, 1271, A0, 1300, A0),
GMDID_CASE(METEORLAKE, 1274, A0, 1300, A0),
GMDID_CASE(LUNARLAKE, 2004, A0, 2000, A0),
GMDID_CASE(LUNARLAKE, 2004, B0, 2000, A0),
GMDID_CASE(BATTLEMAGE, 2001, A0, 1301, A1),
GMDID_CASE(PANTHERLAKE, 3000, A0, 3000, A0),
};
KUNIT_ARRAY_PARAM(platform, cases, xe_pci_fake_data_desc);
/**
* xe_pci_fake_data_gen_params - Generate struct xe_pci_fake_data parameters
* @test: test context object
* @prev: the pointer to the previous parameter to iterate from or NULL
* @desc: output buffer with minimum size of KUNIT_PARAM_DESC_SIZE
*
* This function prepares struct xe_pci_fake_data parameter.
*
* To be used only as a parameter generator function in &KUNIT_CASE_PARAM.
*
* Return: pointer to the next parameter or NULL if no more parameters
*/
const void *xe_pci_fake_data_gen_params(struct kunit *test, const void *prev, char *desc)
{
return platform_gen_params(test, prev, desc);
}
EXPORT_SYMBOL_IF_KUNIT(xe_pci_fake_data_gen_params);
static const struct xe_device_desc *lookup_desc(enum xe_platform p)
{
const struct xe_device_desc *desc;
const struct pci_device_id *ids;
for (ids = pciidlist; ids->driver_data; ids++) {
Annotation
- Immediate include surface: `tests/xe_pci_test.h`, `tests/xe_test.h`, `kunit/test-bug.h`, `kunit/test.h`, `kunit/visibility.h`.
- Detected declarations: `function xe_pci_fake_data_desc`, `function xe_ip_kunit_desc`, `function xe_pci_id_kunit_desc`, `function fake_init_devid`, `function fake_xe_info_probe_tile_count`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.