drivers/gpu/drm/xe/tests/xe_wa_test.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/tests/xe_wa_test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/tests/xe_wa_test.c- Extension
.c- Size
- 1688 bytes
- Lines
- 84
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_drv.hdrm/drm_kunit_helpers.hkunit/test.hxe_device.hxe_gt.hxe_gt_mcr.hxe_kunit_helpers.hxe_pci_test.hxe_reg_sr.hxe_tuning.hxe_wa.h
Detected Declarations
function xe_wa_test_initfunction xe_wa_gtfunction for_each_gt
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright © 2023 Intel Corporation
*/
#include <drm/drm_drv.h>
#include <drm/drm_kunit_helpers.h>
#include <kunit/test.h>
#include "xe_device.h"
#include "xe_gt.h"
#include "xe_gt_mcr.h"
#include "xe_kunit_helpers.h"
#include "xe_pci_test.h"
#include "xe_reg_sr.h"
#include "xe_tuning.h"
#include "xe_wa.h"
static int xe_wa_test_init(struct kunit *test)
{
const struct xe_pci_fake_data *param = test->param_value;
struct xe_pci_fake_data data = *param;
struct device *dev;
struct xe_device *xe;
struct xe_gt *gt;
int id;
int ret;
dev = drm_kunit_helper_alloc_device(test);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
xe = xe_kunit_helper_alloc_xe_device(test, dev);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe);
test->priv = &data;
ret = xe_pci_fake_device_init(xe);
KUNIT_ASSERT_EQ(test, ret, 0);
/* Needed for sanitize_mcr(). */
for_each_gt(gt, xe, id) {
xe_gt_mcr_init_early(gt);
xe_gt_mmio_init(gt);
}
if (!param->graphics_verx100)
xe->info.step = param->step;
/* TODO: init hw engines for engine/LRC WAs */
xe->drm.dev = dev;
test->priv = xe;
return 0;
}
static void xe_wa_gt(struct kunit *test)
{
struct xe_device *xe = test->priv;
struct xe_gt *gt;
int id;
for_each_gt(gt, xe, id) {
xe_reg_sr_init(>->reg_sr, "GT", xe);
xe_wa_process_gt(gt);
xe_tuning_process_gt(gt);
KUNIT_EXPECT_EQ(test, gt->reg_sr.errors, 0);
}
}
static struct kunit_case xe_wa_tests[] = {
KUNIT_CASE_PARAM(xe_wa_gt, xe_pci_fake_data_gen_params),
{}
};
static struct kunit_suite xe_rtp_test_suite = {
.name = "xe_wa",
.init = xe_wa_test_init,
.test_cases = xe_wa_tests,
};
kunit_test_suite(xe_rtp_test_suite);
Annotation
- Immediate include surface: `drm/drm_drv.h`, `drm/drm_kunit_helpers.h`, `kunit/test.h`, `xe_device.h`, `xe_gt.h`, `xe_gt_mcr.h`, `xe_kunit_helpers.h`, `xe_pci_test.h`.
- Detected declarations: `function xe_wa_test_init`, `function xe_wa_gt`, `function for_each_gt`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.