drivers/gpu/drm/xe/xe_rtp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_rtp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_rtp.c- Extension
.c- Size
- 12809 bytes
- Lines
- 472
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_rtp.hkunit/visibility.huapi/drm/xe_drm.hxe_configfs.hxe_device.hxe_gt.hxe_gt_topology.hxe_reg_sr.hxe_sriov.htests/xe_rtp.c
Detected Declarations
struct rule_match_ctxfunction has_samediafunction rule_is_itemfunction rule_match_itemfunction rulesfunction rulesfunction rule_matches_with_errfunction rule_matchesfunction rtp_add_sr_entryfunction rtp_process_one_srfunction rtp_get_contextfunction xe_rtp_process_ctx_enable_active_trackingfunction rtp_mark_activefunction xe_rtp_process_to_srfunction xe_rtp_process_ctx_enable_active_trackingfunction xe_rtp_match_alwaysfunction xe_rtp_match_even_instancefunction xe_rtp_match_first_render_or_computefunction xe_rtp_match_not_sriov_vffunction xe_rtp_match_psmi_enabledfunction xe_rtp_match_gt_has_discontiguous_dss_groupsfunction xe_rtp_match_has_flat_ccsfunction xe_rtp_match_has_msix
Annotated Snippet
struct rule_match_ctx {
const struct xe_device *xe;
struct xe_gt *gt;
struct xe_hw_engine *hwe;
const struct xe_rtp_rule *rules;
const unsigned int n_rules;
unsigned int head;
int err;
};
static bool rule_is_item(const struct xe_rtp_rule *r)
{
return r->match_type != XE_RTP_MATCH_OR;
}
static bool rule_match_item(struct rule_match_ctx *match_ctx)
{
const struct xe_device *xe = match_ctx->xe;
struct xe_gt *gt = match_ctx->gt;
struct xe_hw_engine *hwe = match_ctx->hwe;
const struct xe_rtp_rule *r = &match_ctx->rules[match_ctx->head];
switch (r->match_type) {
case XE_RTP_MATCH_PLATFORM:
return xe->info.platform == r->platform;
case XE_RTP_MATCH_SUBPLATFORM:
return xe->info.platform == r->platform &&
xe->info.subplatform == r->subplatform;
case XE_RTP_MATCH_PLATFORM_STEP:
if (drm_WARN_ON(&xe->drm, xe->info.step.platform == STEP_NONE))
return false;
return xe->info.step.platform >= r->step_start &&
xe->info.step.platform < r->step_end;
case XE_RTP_MATCH_GRAPHICS_VERSION:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.graphics_verx100 == r->ver_start &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
case XE_RTP_MATCH_GRAPHICS_VERSION_RANGE:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.graphics_verx100 >= r->ver_start &&
xe->info.graphics_verx100 <= r->ver_end &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
case XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.graphics_verx100 == r->ver_start;
case XE_RTP_MATCH_GRAPHICS_STEP:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.step.graphics >= r->step_start &&
xe->info.step.graphics < r->step_end &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
case XE_RTP_MATCH_MEDIA_VERSION:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.media_verx100 == r->ver_start &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
case XE_RTP_MATCH_MEDIA_VERSION_RANGE:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.media_verx100 >= r->ver_start &&
xe->info.media_verx100 <= r->ver_end &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
case XE_RTP_MATCH_MEDIA_STEP:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.step.media >= r->step_start &&
xe->info.step.media < r->step_end &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
case XE_RTP_MATCH_MEDIA_VERSION_ANY_GT:
if (drm_WARN_ON(&xe->drm, !gt))
return false;
return xe->info.media_verx100 == r->ver_start;
case XE_RTP_MATCH_INTEGRATED:
return !xe->info.is_dgfx;
case XE_RTP_MATCH_DISCRETE:
return xe->info.is_dgfx;
case XE_RTP_MATCH_ENGINE_CLASS:
if (drm_WARN_ON(&xe->drm, !hwe))
Annotation
- Immediate include surface: `xe_rtp.h`, `kunit/visibility.h`, `uapi/drm/xe_drm.h`, `xe_configfs.h`, `xe_device.h`, `xe_gt.h`, `xe_gt_topology.h`, `xe_reg_sr.h`.
- Detected declarations: `struct rule_match_ctx`, `function has_samedia`, `function rule_is_item`, `function rule_match_item`, `function rules`, `function rules`, `function rule_matches_with_err`, `function rule_matches`, `function rtp_add_sr_entry`, `function rtp_process_one_sr`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.