drivers/gpu/drm/xe/xe_step.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_step.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_step.c- Extension
.c- Size
- 8411 bytes
- Lines
- 291
- 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
xe_step.hdrm/drm_print.hkunit/visibility.hlinux/bitfield.hxe_device_types.hxe_platform_types.h
Detected Declarations
function xe_step_platform_getfunction xe_step_pre_gmdid_getfunction steppings
Annotated Snippet
if (revid < size) {
drm_dbg(&xe->drm, "Using steppings for revid 0x%02x\n",
revid);
graphics = revids[revid].graphics;
media = revids[revid].media;
basedie = revids[revid].basedie;
} else {
drm_dbg(&xe->drm, "Using future steppings\n");
graphics = STEP_FUTURE;
}
}
drm_WARN_ON(&xe->drm, graphics == STEP_NONE);
if (basedie_info && basedie_size) {
if (baseid < basedie_size && basedie_info[baseid] != STEP_NONE) {
basedie = basedie_info[baseid];
} else {
drm_warn(&xe->drm, "Unknown baseid 0x%02x\n", baseid);
basedie = STEP_FUTURE;
}
}
done:
xe->info.step.graphics = graphics;
xe->info.step.media = media;
xe->info.step.basedie = basedie;
}
/**
* xe_step_gmdid_get - Determine IP steppings from GMD_ID revid fields
* @xe: Xe device
* @graphics_gmdid_revid: value of graphics GMD_ID register's revid field
* @media_gmdid_revid: value of media GMD_ID register's revid field
*
* Convert the revid fields of the GMD_ID registers into proper IP steppings.
*
* GMD_ID revid values are currently expected to have consistent meanings on
* all platforms: major steppings (A0, B0, etc.) are 4 apart, with minor
* steppings (A1, A2, etc.) taking the values in between.
*/
void xe_step_gmdid_get(struct xe_device *xe,
u32 graphics_gmdid_revid,
u32 media_gmdid_revid)
{
u8 graphics = STEP_A0 + graphics_gmdid_revid;
u8 media = STEP_A0 + media_gmdid_revid;
if (graphics >= STEP_FUTURE) {
graphics = STEP_FUTURE;
drm_dbg(&xe->drm, "Graphics GMD_ID revid value %d treated as future stepping\n",
graphics_gmdid_revid);
}
if (media >= STEP_FUTURE) {
media = STEP_FUTURE;
drm_dbg(&xe->drm, "Media GMD_ID revid value %d treated as future stepping\n",
media_gmdid_revid);
}
xe->info.step.graphics = graphics;
xe->info.step.media = media;
}
#define STEP_NAME_CASE(name) \
case STEP_##name: \
return #name;
const char *xe_step_name(enum intel_step step)
{
switch (step) {
STEP_NAME_LIST(STEP_NAME_CASE);
default:
return "**";
}
}
EXPORT_SYMBOL_IF_KUNIT(xe_step_name);
Annotation
- Immediate include surface: `xe_step.h`, `drm/drm_print.h`, `kunit/visibility.h`, `linux/bitfield.h`, `xe_device_types.h`, `xe_platform_types.h`.
- Detected declarations: `function xe_step_platform_get`, `function xe_step_pre_gmdid_get`, `function steppings`.
- 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.