drivers/gpu/drm/xe/display/xe_initial_plane.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/display/xe_initial_plane.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/display/xe_initial_plane.c- Extension
.c- Size
- 4215 bytes
- Lines
- 169
- 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/intel/display_parent_interface.hregs/xe_gtt_defs.hintel_fb.hintel_display_types.hxe_bo.hxe_display_bo.hxe_display_vma.hxe_fb_pin.hxe_ggtt.hxe_mmio.hxe_vram_types.h
Detected Declarations
function initial_plane_bofunction xe_alloc_initial_plane_objfunction xe_initial_plane_setupfunction xe_plane_config_fini
Annotated Snippet
if (!(pte & XE_GGTT_PTE_DM)) {
drm_err(&xe->drm,
"Initial plane programming missing DM bit\n");
return NULL;
}
phys_base = pte & ~(page_size - 1);
flags |= XE_BO_FLAG_VRAM0;
/*
* We don't currently expect this to ever be placed in the
* stolen portion.
*/
if (phys_base >= xe_vram_region_usable_size(tile0->mem.vram)) {
drm_err(&xe->drm,
"Initial plane programming using invalid range, phys_base=%pa\n",
&phys_base);
return NULL;
}
drm_dbg(&xe->drm,
"Using phys_base=%pa, based on initial plane programming\n",
&phys_base);
} else {
struct ttm_resource_manager *stolen = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
if (!stolen)
return NULL;
phys_base = base;
flags |= XE_BO_FLAG_STOLEN;
if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) &&
!xe_display_bo_fbdev_prefer_stolen(xe, plane_config->size)) {
drm_info(&xe->drm, "Initial FB size exceeds half of stolen, discarding\n");
return NULL;
}
}
size = round_up(plane_config->base + plane_config->size,
page_size);
size -= base;
bo = xe_bo_create_pin_map_at_novm(xe, tile0, size, phys_base,
ttm_bo_type_kernel, flags, 0, false);
if (IS_ERR(bo)) {
drm_dbg(&xe->drm,
"Failed to create bo phys_base=%pa size %u with flags %x: %li\n",
&phys_base, size, flags, PTR_ERR(bo));
return NULL;
}
return bo;
}
static struct drm_gem_object *
xe_alloc_initial_plane_obj(struct drm_device *drm,
struct intel_initial_plane_config *plane_config)
{
struct xe_device *xe = to_xe_device(drm);
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
struct drm_framebuffer *fb = plane_config->fb;
struct xe_bo *bo;
mode_cmd.pixel_format = fb->format->format;
mode_cmd.width = fb->width;
mode_cmd.height = fb->height;
mode_cmd.pitches[0] = fb->pitches[0];
mode_cmd.modifier[0] = fb->modifier;
mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
bo = initial_plane_bo(xe, plane_config);
if (!bo)
return NULL;
if (intel_framebuffer_init(to_intel_framebuffer(fb),
&bo->ttm.base, fb->format, &mode_cmd)) {
drm_dbg_kms(&xe->drm, "intel fb init failed\n");
goto err_bo;
}
/* Reference handed over to fb */
xe_bo_put(bo);
return &bo->ttm.base;
err_bo:
xe_bo_unpin_map_no_vm(bo);
return NULL;
}
Annotation
- Immediate include surface: `drm/intel/display_parent_interface.h`, `regs/xe_gtt_defs.h`, `intel_fb.h`, `intel_display_types.h`, `xe_bo.h`, `xe_display_bo.h`, `xe_display_vma.h`, `xe_fb_pin.h`.
- Detected declarations: `function initial_plane_bo`, `function xe_alloc_initial_plane_obj`, `function xe_initial_plane_setup`, `function xe_plane_config_fini`.
- 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.