drivers/gpu/drm/i915/display/intel_modeset_verify.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_modeset_verify.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_modeset_verify.c- Extension
.c- Size
- 7852 bytes
- Lines
- 257
- 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
drm/drm_atomic_state_helper.hdrm/drm_print.hintel_atomic.hintel_crtc.hintel_crtc_state_dump.hintel_cx0_phy.hintel_display.hintel_display_core.hintel_display_types.hintel_fdi.hintel_lt_phy.hintel_modeset_verify.hintel_snps_phy.hskl_watermark.h
Detected Declarations
function trackingfunction verify_connector_statefunction for_each_new_connector_in_statefunction intel_pipe_config_sanity_checkfunction verify_encoder_statefunction for_each_intel_encoderfunction for_each_oldnew_connector_in_statefunction verify_crtc_statefunction for_each_encoder_on_crtcfunction intel_modeset_verify_crtcfunction intel_modeset_verify_disabled
Annotated Snippet
if (!encoder->base.crtc) {
bool active;
active = encoder->get_hw_state(encoder, &pipe);
INTEL_DISPLAY_STATE_WARN(display, active,
"encoder detached but still enabled on pipe %c.\n",
pipe_name(pipe));
}
}
}
static void
verify_crtc_state(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
struct intel_display *display = to_intel_display(state);
const struct intel_crtc_state *sw_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
struct intel_crtc_state *hw_crtc_state;
struct intel_crtc *primary_crtc;
struct intel_encoder *encoder;
hw_crtc_state = intel_crtc_state_alloc(crtc);
if (!hw_crtc_state)
return;
drm_dbg_kms(display->drm, "[CRTC:%d:%s]\n", crtc->base.base.id,
crtc->base.name);
hw_crtc_state->hw.enable = sw_crtc_state->hw.enable;
intel_crtc_get_pipe_config(hw_crtc_state);
/* we keep both pipes enabled on 830 */
if (display->platform.i830 && hw_crtc_state->hw.active)
hw_crtc_state->hw.active = sw_crtc_state->hw.active;
INTEL_DISPLAY_STATE_WARN(display,
sw_crtc_state->hw.active != hw_crtc_state->hw.active,
"crtc active state doesn't match with hw state (expected %i, found %i)\n",
sw_crtc_state->hw.active, hw_crtc_state->hw.active);
INTEL_DISPLAY_STATE_WARN(display, crtc->active != sw_crtc_state->hw.active,
"transitional active state does not match atomic hw state (expected %i, found %i)\n",
sw_crtc_state->hw.active, crtc->active);
primary_crtc = intel_primary_crtc(sw_crtc_state);
for_each_encoder_on_crtc(display->drm, &primary_crtc->base, encoder) {
enum pipe pipe;
bool active;
active = encoder->get_hw_state(encoder, &pipe);
INTEL_DISPLAY_STATE_WARN(display, active != sw_crtc_state->hw.active,
"[ENCODER:%i] active %i with crtc active %i\n",
encoder->base.base.id, active,
sw_crtc_state->hw.active);
INTEL_DISPLAY_STATE_WARN(display, active && primary_crtc->pipe != pipe,
"Encoder connected to wrong pipe %c\n",
pipe_name(pipe));
if (active)
intel_encoder_get_config(encoder, hw_crtc_state);
}
if (!sw_crtc_state->hw.active)
goto destroy_state;
intel_pipe_config_sanity_check(hw_crtc_state);
if (!intel_pipe_config_compare(sw_crtc_state,
hw_crtc_state, false)) {
INTEL_DISPLAY_STATE_WARN(display, 1, "pipe state doesn't match!\n");
intel_crtc_state_dump(hw_crtc_state, NULL, "hw state");
intel_crtc_state_dump(sw_crtc_state, NULL, "sw state");
}
destroy_state:
intel_crtc_destroy_state(&crtc->base, &hw_crtc_state->uapi);
}
void intel_modeset_verify_crtc(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
const struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
if (!intel_crtc_needs_modeset(new_crtc_state) &&
!intel_crtc_needs_fastset(new_crtc_state))
Annotation
- Immediate include surface: `drm/drm_atomic_state_helper.h`, `drm/drm_print.h`, `intel_atomic.h`, `intel_crtc.h`, `intel_crtc_state_dump.h`, `intel_cx0_phy.h`, `intel_display.h`, `intel_display_core.h`.
- Detected declarations: `function tracking`, `function verify_connector_state`, `function for_each_new_connector_in_state`, `function intel_pipe_config_sanity_check`, `function verify_encoder_state`, `function for_each_intel_encoder`, `function for_each_oldnew_connector_in_state`, `function verify_crtc_state`, `function for_each_encoder_on_crtc`, `function intel_modeset_verify_crtc`.
- 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.