drivers/gpu/drm/i915/display/i9xx_wm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/i9xx_wm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/i9xx_wm.c- Extension
.c- Size
- 125423 bytes
- Lines
- 4186
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iopoll.hdrm/drm_print.hdrm/intel/intel_gmd_misc_regs.hi9xx_wm.hi9xx_wm_regs.hintel_atomic.hintel_bo.hintel_de.hintel_display.hintel_display_regs.hintel_display_trace.hintel_display_utils.hintel_dram.hintel_fb.hintel_mchbar.hintel_wm.hskl_watermark.hvlv_sideband.h
Detected Declarations
struct intel_watermark_paramsstruct intel_wm_configstruct cxsr_latencystruct ilk_wm_maximumsfunction chv_set_memory_dvfsfunction chv_set_memory_pm5function _intel_set_memory_cxsrfunction planefunction vlv_get_fifo_sizefunction i9xx_get_fifo_sizefunction i830_get_fifo_sizefunction i845_get_fifo_sizefunction intel_wm_method1function intel_wm_method2function levelfunction is_disablingfunction is_enablingfunction intel_crtc_activefunction for_each_intel_crtcfunction pnv_update_wmfunction i9xx_wm_need_updatefunction i9xx_wm_computefunction i9xx_compute_watermarksfunction for_each_oldnew_intel_plane_in_statefunction g4x_tlb_miss_wafunction g4x_write_wm_valuesfunction vlv_write_wm_valuesfunction for_each_pipefunction g4x_setup_wm_latencyfunction g4x_plane_fifo_sizefunction g4x_fbc_fifo_sizefunction g4x_compute_wmfunction g4x_raw_plane_wm_setfunction g4x_raw_fbc_wm_setfunction g4x_raw_plane_wm_computefunction g4x_raw_plane_wm_is_validfunction g4x_raw_crtc_wm_is_validfunction g4x_invalidate_wmsfunction g4x_compute_fbc_enfunction _g4x_compute_pipe_wmfunction g4x_compute_pipe_wmfunction for_each_oldnew_intel_plane_in_statefunction g4x_compute_intermediate_wmfunction for_each_plane_id_on_crtcfunction g4x_compute_watermarksfunction g4x_merge_wmfunction for_each_intel_crtcfunction for_each_intel_crtc
Annotated Snippet
struct intel_watermark_params {
u16 fifo_size;
u16 max_wm;
u8 default_wm;
u8 guard_size;
u8 cacheline_size;
};
/* used in computing the new watermarks state */
struct intel_wm_config {
unsigned int num_pipes_active;
bool sprites_enabled;
bool sprites_scaled;
};
struct cxsr_latency {
bool is_desktop : 1;
bool is_ddr3 : 1;
u16 fsb_freq;
u16 mem_freq;
u16 display_sr;
u16 display_hpll_disable;
u16 cursor_sr;
u16 cursor_hpll_disable;
};
static const struct cxsr_latency cxsr_latency_table[] = {
{1, 0, 800, 400, 3382, 33382, 3983, 33983}, /* DDR2-400 SC */
{1, 0, 800, 667, 3354, 33354, 3807, 33807}, /* DDR2-667 SC */
{1, 0, 800, 800, 3347, 33347, 3763, 33763}, /* DDR2-800 SC */
{1, 1, 800, 667, 6420, 36420, 6873, 36873}, /* DDR3-667 SC */
{1, 1, 800, 800, 5902, 35902, 6318, 36318}, /* DDR3-800 SC */
{1, 0, 667, 400, 3400, 33400, 4021, 34021}, /* DDR2-400 SC */
{1, 0, 667, 667, 3372, 33372, 3845, 33845}, /* DDR2-667 SC */
{1, 0, 667, 800, 3386, 33386, 3822, 33822}, /* DDR2-800 SC */
{1, 1, 667, 667, 6438, 36438, 6911, 36911}, /* DDR3-667 SC */
{1, 1, 667, 800, 5941, 35941, 6377, 36377}, /* DDR3-800 SC */
{1, 0, 400, 400, 3472, 33472, 4173, 34173}, /* DDR2-400 SC */
{1, 0, 400, 667, 3443, 33443, 3996, 33996}, /* DDR2-667 SC */
{1, 0, 400, 800, 3430, 33430, 3946, 33946}, /* DDR2-800 SC */
{1, 1, 400, 667, 6509, 36509, 7062, 37062}, /* DDR3-667 SC */
{1, 1, 400, 800, 5985, 35985, 6501, 36501}, /* DDR3-800 SC */
{0, 0, 800, 400, 3438, 33438, 4065, 34065}, /* DDR2-400 SC */
{0, 0, 800, 667, 3410, 33410, 3889, 33889}, /* DDR2-667 SC */
{0, 0, 800, 800, 3403, 33403, 3845, 33845}, /* DDR2-800 SC */
{0, 1, 800, 667, 6476, 36476, 6955, 36955}, /* DDR3-667 SC */
{0, 1, 800, 800, 5958, 35958, 6400, 36400}, /* DDR3-800 SC */
{0, 0, 667, 400, 3456, 33456, 4103, 34106}, /* DDR2-400 SC */
{0, 0, 667, 667, 3428, 33428, 3927, 33927}, /* DDR2-667 SC */
{0, 0, 667, 800, 3443, 33443, 3905, 33905}, /* DDR2-800 SC */
{0, 1, 667, 667, 6494, 36494, 6993, 36993}, /* DDR3-667 SC */
{0, 1, 667, 800, 5998, 35998, 6460, 36460}, /* DDR3-800 SC */
{0, 0, 400, 400, 3528, 33528, 4255, 34255}, /* DDR2-400 SC */
{0, 0, 400, 667, 3500, 33500, 4079, 34079}, /* DDR2-667 SC */
{0, 0, 400, 800, 3487, 33487, 4029, 34029}, /* DDR2-800 SC */
{0, 1, 400, 667, 6566, 36566, 7145, 37145}, /* DDR3-667 SC */
{0, 1, 400, 800, 6042, 36042, 6584, 36584}, /* DDR3-800 SC */
};
static const struct cxsr_latency *pnv_get_cxsr_latency(struct intel_display *display)
{
const struct dram_info *dram_info = intel_dram_info(display);
bool is_ddr3 = dram_info->type == INTEL_DRAM_DDR3;
int i;
for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) {
const struct cxsr_latency *latency = &cxsr_latency_table[i];
bool is_desktop = !display->platform.mobile;
if (is_desktop == latency->is_desktop &&
is_ddr3 == latency->is_ddr3 &&
DIV_ROUND_CLOSEST(dram_info->fsb_freq, 1000) == latency->fsb_freq &&
DIV_ROUND_CLOSEST(dram_info->mem_freq, 1000) == latency->mem_freq)
return latency;
}
drm_dbg_kms(display->drm,
"Could not find CxSR latency for %s, FSB %u kHz, MEM %u kHz\n",
intel_dram_type_str(dram_info->type),
dram_info->fsb_freq, dram_info->mem_freq);
return NULL;
}
static void chv_set_memory_dvfs(struct intel_display *display, bool enable)
Annotation
- Immediate include surface: `linux/iopoll.h`, `drm/drm_print.h`, `drm/intel/intel_gmd_misc_regs.h`, `i9xx_wm.h`, `i9xx_wm_regs.h`, `intel_atomic.h`, `intel_bo.h`, `intel_de.h`.
- Detected declarations: `struct intel_watermark_params`, `struct intel_wm_config`, `struct cxsr_latency`, `struct ilk_wm_maximums`, `function chv_set_memory_dvfs`, `function chv_set_memory_pm5`, `function _intel_set_memory_cxsr`, `function plane`, `function vlv_get_fifo_size`, `function i9xx_get_fifo_size`.
- 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.