drivers/gpu/drm/i915/display/intel_dbuf_bw.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dbuf_bw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dbuf_bw.c- Extension
.c- Size
- 8027 bytes
- Lines
- 295
- 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
drm/drm_print.hintel_dbuf_bw.hintel_display_core.hintel_display_types.hskl_watermark.h
Detected Declarations
struct intel_dbuf_bwstruct intel_dbuf_bw_statefunction intel_atomic_get_old_dbuf_bw_statefunction intel_atomic_get_new_dbuf_bw_statefunction intel_atomic_get_dbuf_bw_statefunction intel_dbuf_bw_changedfunction for_each_dbuf_slicefunction intel_dbuf_bw_state_changedfunction for_each_pipefunction skl_plane_calc_dbuf_bwfunction skl_crtc_calc_dbuf_bwfunction for_each_plane_id_on_crtcfunction intel_dbuf_bw_min_cdclkfunction for_each_dbuf_slicefunction for_each_pipefunction intel_dbuf_bw_calc_min_cdclkfunction for_each_oldnew_intel_crtc_in_statefunction intel_dbuf_bw_update_hw_statefunction for_each_intel_crtcfunction intel_dbuf_bw_crtc_disable_noatomicfunction intel_dbuf_bw_duplicate_statefunction intel_dbuf_bw_destroy_statefunction intel_dbuf_bw_init
Annotated Snippet
struct intel_dbuf_bw {
unsigned int max_bw[I915_MAX_DBUF_SLICES];
u8 active_planes[I915_MAX_DBUF_SLICES];
};
struct intel_dbuf_bw_state {
struct intel_global_state base;
struct intel_dbuf_bw dbuf_bw[I915_MAX_PIPES];
};
struct intel_dbuf_bw_state *to_intel_dbuf_bw_state(struct intel_global_state *obj_state)
{
return container_of(obj_state, struct intel_dbuf_bw_state, base);
}
struct intel_dbuf_bw_state *
intel_atomic_get_old_dbuf_bw_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *dbuf_bw_state;
dbuf_bw_state = intel_atomic_get_old_global_obj_state(state, &display->dbuf_bw.obj);
return to_intel_dbuf_bw_state(dbuf_bw_state);
}
struct intel_dbuf_bw_state *
intel_atomic_get_new_dbuf_bw_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *dbuf_bw_state;
dbuf_bw_state = intel_atomic_get_new_global_obj_state(state, &display->dbuf_bw.obj);
return to_intel_dbuf_bw_state(dbuf_bw_state);
}
struct intel_dbuf_bw_state *
intel_atomic_get_dbuf_bw_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *dbuf_bw_state;
dbuf_bw_state = intel_atomic_get_global_obj_state(state, &display->dbuf_bw.obj);
if (IS_ERR(dbuf_bw_state))
return ERR_CAST(dbuf_bw_state);
return to_intel_dbuf_bw_state(dbuf_bw_state);
}
static bool intel_dbuf_bw_changed(struct intel_display *display,
const struct intel_dbuf_bw *old_dbuf_bw,
const struct intel_dbuf_bw *new_dbuf_bw)
{
enum dbuf_slice slice;
for_each_dbuf_slice(display, slice) {
if (old_dbuf_bw->max_bw[slice] != new_dbuf_bw->max_bw[slice] ||
old_dbuf_bw->active_planes[slice] != new_dbuf_bw->active_planes[slice])
return true;
}
return false;
}
static bool intel_dbuf_bw_state_changed(struct intel_display *display,
const struct intel_dbuf_bw_state *old_dbuf_bw_state,
const struct intel_dbuf_bw_state *new_dbuf_bw_state)
{
enum pipe pipe;
for_each_pipe(display, pipe) {
const struct intel_dbuf_bw *old_dbuf_bw =
&old_dbuf_bw_state->dbuf_bw[pipe];
const struct intel_dbuf_bw *new_dbuf_bw =
&new_dbuf_bw_state->dbuf_bw[pipe];
if (intel_dbuf_bw_changed(display, old_dbuf_bw, new_dbuf_bw))
return true;
}
return false;
}
static void skl_plane_calc_dbuf_bw(struct intel_dbuf_bw *dbuf_bw,
struct intel_crtc *crtc,
enum plane_id plane_id,
const struct skl_ddb_entry *ddb,
unsigned int data_rate)
{
Annotation
- Immediate include surface: `drm/drm_print.h`, `intel_dbuf_bw.h`, `intel_display_core.h`, `intel_display_types.h`, `skl_watermark.h`.
- Detected declarations: `struct intel_dbuf_bw`, `struct intel_dbuf_bw_state`, `function intel_atomic_get_old_dbuf_bw_state`, `function intel_atomic_get_new_dbuf_bw_state`, `function intel_atomic_get_dbuf_bw_state`, `function intel_dbuf_bw_changed`, `function for_each_dbuf_slice`, `function intel_dbuf_bw_state_changed`, `function for_each_pipe`, `function skl_plane_calc_dbuf_bw`.
- 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.