drivers/gpu/drm/i915/display/intel_fbc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_fbc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_fbc.c- Extension
.c- Size
- 68542 bytes
- Lines
- 2481
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/debugfs.hlinux/string_helpers.hdrm/drm_blend.hdrm/drm_fourcc.hdrm/drm_print.hdrm/intel/step.hi9xx_plane_regs.hintel_de.hintel_display_device.hintel_display_regs.hintel_display_rpm.hintel_display_trace.hintel_display_types.hintel_display_utils.hintel_display_wa.hintel_fbc.hintel_fbc_regs.hintel_frontbuffer.hintel_parent.h
Detected Declarations
struct intel_fbc_funcsstruct intel_fbc_statestruct intel_fbcfunction intel_fbc_plane_stridefunction intel_fbc_cfb_cppfunction intel_fbc_plane_cfb_stridefunction skl_fbc_min_cfb_stridefunction _intel_fbc_cfb_stridefunction intel_fbc_cfb_stridefunction linesfunction _intel_fbc_cfb_sizefunction intel_fbc_cfb_sizefunction intel_fbc_override_cfb_stridefunction intel_fbc_has_fencesfunction i8xx_fbc_ctlfunction i965_fbc_ctl2function i8xx_fbc_deactivatefunction i8xx_fbc_activatefunction i8xx_fbc_is_activefunction i8xx_fbc_is_compressingfunction i8xx_fbc_nukefunction i8xx_fbc_program_cfbfunction i965_fbc_nukefunction g4x_dpfc_ctl_limitfunction g4x_dpfc_ctlfunction g4x_fbc_activatefunction g4x_fbc_deactivatefunction g4x_fbc_is_activefunction g4x_fbc_is_compressingfunction g4x_fbc_program_cfbfunction ilk_fbc_activatefunction fbc_compressor_clkgate_disable_wafunction ilk_fbc_deactivatefunction ilk_fbc_is_activefunction ilk_fbc_is_compressingfunction ilk_fbc_program_cfbfunction snb_fbc_program_fencefunction snb_fbc_activatefunction snb_fbc_nukefunction glk_fbc_program_cfb_stridefunction skl_fbc_program_cfb_stridefunction ivb_dpfc_ctlfunction ivb_fbc_activatefunction ivb_fbc_is_compressingfunction ivb_fbc_set_false_colorfunction intel_fbc_hw_is_activefunction intel_fbc_hw_activatefunction intel_fbc_hw_deactivate
Annotated Snippet
struct intel_fbc_funcs {
void (*activate)(struct intel_fbc *fbc);
void (*deactivate)(struct intel_fbc *fbc);
bool (*is_active)(struct intel_fbc *fbc);
bool (*is_compressing)(struct intel_fbc *fbc);
void (*nuke)(struct intel_fbc *fbc);
void (*program_cfb)(struct intel_fbc *fbc);
void (*set_false_color)(struct intel_fbc *fbc, bool enable);
};
struct intel_fbc_state {
struct intel_plane *plane;
unsigned int cfb_stride;
unsigned int cfb_size;
unsigned int fence_y_offset;
u16 override_cfb_stride;
u16 interval;
s8 fence_id;
struct drm_rect dirty_rect;
};
struct intel_fbc {
struct intel_display *display;
const struct intel_fbc_funcs *funcs;
/* This is always the outer lock when overlapping with stolen_lock */
struct mutex lock;
unsigned int busy_bits;
struct intel_stolen_node *compressed_fb;
struct intel_stolen_node *compressed_llb;
enum intel_fbc_id id;
u8 limit;
bool false_color;
bool active;
bool activated;
bool flip_pending;
bool underrun_detected;
struct work_struct underrun_work;
/*
* This structure contains everything that's relevant to program the
* hardware registers. When we want to figure out if we need to disable
* and re-enable FBC for a new configuration we just check if there's
* something different in the struct. The genx_fbc_activate functions
* are supposed to read from it in order to program the registers.
*/
struct intel_fbc_state state;
const char *no_fbc_reason;
};
static struct intel_fbc *intel_fbc_for_pipe(struct intel_display *display, enum pipe pipe)
{
struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
struct intel_plane *primary = NULL;
primary = to_intel_plane(crtc->base.primary);
if (drm_WARN_ON(display->drm, !primary))
return NULL;
return primary->fbc;
}
/* plane stride in pixels */
static unsigned int intel_fbc_plane_stride(const struct intel_plane_state *plane_state)
{
const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int stride;
stride = plane_state->view.color_plane[0].mapping_stride;
if (!drm_rotation_90_or_270(plane_state->hw.rotation))
stride /= fb->format->cpp[0];
return stride;
}
static unsigned int intel_fbc_cfb_cpp(const struct intel_plane_state *plane_state)
{
const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int cpp = fb->format->cpp[0];
return max(cpp, 4);
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/string_helpers.h`, `drm/drm_blend.h`, `drm/drm_fourcc.h`, `drm/drm_print.h`, `drm/intel/step.h`, `i9xx_plane_regs.h`, `intel_de.h`.
- Detected declarations: `struct intel_fbc_funcs`, `struct intel_fbc_state`, `struct intel_fbc`, `function intel_fbc_plane_stride`, `function intel_fbc_cfb_cpp`, `function intel_fbc_plane_cfb_stride`, `function skl_fbc_min_cfb_stride`, `function _intel_fbc_cfb_stride`, `function intel_fbc_cfb_stride`, `function lines`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.