drivers/gpu/drm/i915/i915_initial_plane.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_initial_plane.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_initial_plane.c- Extension
.c- Size
- 7493 bytes
- Lines
- 284
- 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_print.hdrm/intel/display_parent_interface.hdisplay/intel_crtc.hdisplay/intel_display_types.hdisplay/intel_fb.hgem/i915_gem_lmem.hgem/i915_gem_region.hi915_bo.hi915_drv.hi915_initial_plane.h
Detected Declarations
function initial_plane_memory_typefunction initial_plane_physfunction initial_plane_vmafunction IS_ENABLEDfunction i915_alloc_initial_plane_objfunction i915_initial_plane_setupfunction i915_plane_config_fini
Annotated Snippet
if (drm_mm_node_allocated(&orig_mm)) {
drm_mm_remove_node(&orig_mm);
/*
* Try again, but this time pin
* it to its original location.
*/
base = plane_config->base;
goto retry;
}
goto err_obj;
}
if (i915_gem_object_is_tiled(obj) &&
!i915_vma_is_map_and_fenceable(vma))
goto err_obj;
if (drm_mm_node_allocated(&orig_mm))
drm_mm_remove_node(&orig_mm);
drm_dbg_kms(&i915->drm,
"Initial plane fb bound to 0x%x in the ggtt (original 0x%x)\n",
i915_ggtt_offset(vma), plane_config->base);
return vma;
err_obj:
if (drm_mm_node_allocated(&orig_mm))
drm_mm_remove_node(&orig_mm);
i915_gem_object_put(obj);
return NULL;
}
static struct drm_gem_object *
i915_alloc_initial_plane_obj(struct drm_device *drm,
struct intel_initial_plane_config *plane_config)
{
struct drm_i915_private *i915 = to_i915(drm);
struct drm_mode_fb_cmd2 mode_cmd = {};
struct drm_framebuffer *fb = plane_config->fb;
struct i915_vma *vma;
vma = initial_plane_vma(i915, plane_config);
if (!vma)
return NULL;
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;
if (intel_framebuffer_init(to_intel_framebuffer(fb),
intel_bo_to_drm_bo(vma->obj),
fb->format, &mode_cmd)) {
drm_dbg_kms(&i915->drm, "intel fb init failed\n");
goto err_vma;
}
plane_config->vma = vma;
return intel_bo_to_drm_bo(vma->obj);
err_vma:
i915_vma_put(vma);
return NULL;
}
static int
i915_initial_plane_setup(struct drm_plane_state *_plane_state,
struct intel_initial_plane_config *plane_config,
struct drm_framebuffer *fb,
struct i915_vma *vma)
{
struct intel_plane_state *plane_state = to_intel_plane_state(_plane_state);
struct drm_i915_private *dev_priv = to_i915(_plane_state->plane->dev);
__i915_vma_pin(vma);
plane_state->ggtt_vma = i915_vma_get(vma);
if (intel_plane_uses_fence(plane_state) &&
i915_vma_pin_fence(vma) == 0 && vma->fence)
plane_state->fence_id = vma->fence->id;
plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma);
if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
dev_priv->preserve_bios_swizzle = true;
return 0;
}
Annotation
- Immediate include surface: `drm/drm_print.h`, `drm/intel/display_parent_interface.h`, `display/intel_crtc.h`, `display/intel_display_types.h`, `display/intel_fb.h`, `gem/i915_gem_lmem.h`, `gem/i915_gem_region.h`, `i915_bo.h`.
- Detected declarations: `function initial_plane_memory_type`, `function initial_plane_phys`, `function initial_plane_vma`, `function IS_ENABLED`, `function i915_alloc_initial_plane_obj`, `function i915_initial_plane_setup`, `function i915_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.