drivers/gpu/drm/i915/display/intel_fbdev.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_fbdev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_fbdev.c- Extension
.c- Size
- 15755 bytes
- Lines
- 569
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/console.hlinux/delay.hlinux/errno.hlinux/fb.hlinux/init.hlinux/kernel.hlinux/mm.hlinux/module.hlinux/string.hlinux/sysrq.hlinux/tty.hlinux/vga_switcheroo.hdrm/clients/drm_client_setup.hdrm/intel/display_parent_interface.hdrm/drm_crtc.hdrm/drm_crtc_helper.hdrm/drm_fb_helper.hdrm/drm_fourcc.hdrm/drm_gem.hdrm/drm_gem_framebuffer_helper.hdrm/drm_managed.hdrm/drm_print.hintel_bo.hintel_display_core.hintel_display_rpm.hintel_display_types.hintel_fb.hintel_fbdev.hintel_frontbuffer.hintel_parent.hintel_plane.h
Detected Declarations
struct intel_fbdevfunction intel_fbdev_invalidatefunction intel_fbdev_set_parfunction intel_fbdev_blankfunction intel_fbdev_pan_displayfunction intel_fbdev_mmapfunction intel_fbdev_fb_destroyfunction intelfb_dirtyfunction intelfb_restorefunction intelfb_set_suspendfunction intel_fbdev_fill_mode_cmdfunction __intel_fbdev_fb_allocfunction intel_fbdev_driver_fbdev_probefunction bootfunction intel_fbdev_color_modefunction intel_fbdev_setupfunction intel_fbdev_get_map
Annotated Snippet
struct intel_fbdev {
struct intel_framebuffer *fb;
struct i915_vma *vma;
};
static struct intel_fbdev *to_intel_fbdev(struct drm_fb_helper *fb_helper)
{
struct intel_display *display = to_intel_display(fb_helper->client.dev);
return display->fbdev.fbdev;
}
static struct intel_frontbuffer *to_frontbuffer(struct intel_fbdev *ifbdev)
{
return ifbdev->fb->frontbuffer;
}
static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
{
intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
}
FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(intel_fbdev,
drm_fb_helper_damage_range,
drm_fb_helper_damage_area)
static int intel_fbdev_set_par(struct fb_info *info)
{
struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
int ret;
ret = drm_fb_helper_set_par(info);
if (ret == 0)
intel_fbdev_invalidate(ifbdev);
return ret;
}
static int intel_fbdev_blank(int blank, struct fb_info *info)
{
struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
int ret;
ret = drm_fb_helper_blank(blank, info);
if (ret == 0)
intel_fbdev_invalidate(ifbdev);
return ret;
}
static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
int ret;
ret = drm_fb_helper_pan_display(var, info);
if (ret == 0)
intel_fbdev_invalidate(ifbdev);
return ret;
}
static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_gem_object *obj = drm_gem_fb_get_obj(fb_helper->fb, 0);
return intel_bo_fb_mmap(obj, vma);
}
static void intel_fbdev_fb_destroy(struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
struct intel_display *display = to_intel_display(fb_helper->client.dev);
struct intel_fbdev *ifbdev = to_intel_fbdev(fb_helper);
drm_fb_helper_fini(fb_helper);
/*
* We rely on the object-free to release the VMA pinning for
* the info->screen_base mmaping. Leaking the VMA is simpler than
* trying to rectify all the possible error paths leading here.
*/
intel_parent_fb_pin_ggtt_unpin(display, ifbdev->vma, -1);
drm_framebuffer_remove(fb_helper->fb);
drm_client_release(&fb_helper->client);
}
Annotation
- Immediate include surface: `linux/console.h`, `linux/delay.h`, `linux/errno.h`, `linux/fb.h`, `linux/init.h`, `linux/kernel.h`, `linux/mm.h`, `linux/module.h`.
- Detected declarations: `struct intel_fbdev`, `function intel_fbdev_invalidate`, `function intel_fbdev_set_par`, `function intel_fbdev_blank`, `function intel_fbdev_pan_display`, `function intel_fbdev_mmap`, `function intel_fbdev_fb_destroy`, `function intelfb_dirty`, `function intelfb_restore`, `function intelfb_set_suspend`.
- 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.