drivers/gpu/drm/i915/display/intel_lvds.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_lvds.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_lvds.c- Extension
.c- Size
- 29955 bytes
- Lines
- 1016
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
acpi/button.hlinux/acpi.hlinux/dmi.hlinux/i2c.hlinux/slab.hlinux/vga_switcheroo.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_edid.hdrm/drm_print.hdrm/drm_probe_helper.hintel_atomic.hintel_backlight.hintel_connector.hintel_de.hintel_display_types.hintel_dpll.hintel_fdi.hintel_gmbus.hintel_link_bw.hintel_lvds.hintel_lvds_regs.hintel_panel.hintel_pfit.hintel_pfit_regs.hintel_pps_regs.h
Detected Declarations
struct intel_lvds_ppsstruct intel_lvds_encoderfunction intel_lvds_port_enabledfunction intel_lvds_get_hw_statefunction intel_lvds_get_configfunction intel_lvds_pps_get_hw_statefunction intel_lvds_pps_init_hwfunction intel_pre_enable_lvdsfunction intel_enable_lvdsfunction intel_disable_lvdsfunction gmch_disable_lvdsfunction pch_disable_lvdsfunction pch_post_disable_lvdsfunction intel_lvds_shutdownfunction intel_lvds_mode_validfunction intel_lvds_compute_configfunction intel_lvds_get_modesfunction intel_no_lvds_dmi_callbackfunction intel_dual_link_lvds_callbackfunction for_each_intel_encoderfunction intel_is_dual_link_lvdsfunction compute_is_dual_link_lvdsfunction intel_lvds_add_propertiesfunction panel
Annotated Snippet
struct intel_lvds_pps {
struct intel_pps_delays delays;
int divider;
int port;
bool powerdown_on_reset;
};
struct intel_lvds_encoder {
struct intel_encoder base;
bool is_dual_link;
intel_reg_t reg;
u32 a3_power;
struct intel_lvds_pps init_pps;
u32 init_lvds_val;
struct intel_connector *attached_connector;
};
static struct intel_lvds_encoder *to_lvds_encoder(struct intel_encoder *encoder)
{
return container_of(encoder, struct intel_lvds_encoder, base);
}
bool intel_lvds_port_enabled(struct intel_display *display,
intel_reg_t lvds_reg, enum pipe *pipe)
{
u32 val;
val = intel_de_read(display, lvds_reg);
/* asserts want to know the pipe even if the port is disabled */
if (HAS_PCH_CPT(display))
*pipe = REG_FIELD_GET(LVDS_PIPE_SEL_MASK_CPT, val);
else
*pipe = REG_FIELD_GET(LVDS_PIPE_SEL_MASK, val);
return val & LVDS_PORT_EN;
}
static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct intel_display *display = to_intel_display(encoder);
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
struct ref_tracker *wakeref;
bool ret;
wakeref = intel_display_power_get_if_enabled(display, encoder->power_domain);
if (!wakeref)
return false;
ret = intel_lvds_port_enabled(display, lvds_encoder->reg, pipe);
intel_display_power_put(display, encoder->power_domain, wakeref);
return ret;
}
static void intel_lvds_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(encoder);
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
u32 tmp, flags = 0;
crtc_state->output_types |= BIT(INTEL_OUTPUT_LVDS);
tmp = intel_de_read(display, lvds_encoder->reg);
if (tmp & LVDS_HSYNC_POLARITY)
flags |= DRM_MODE_FLAG_NHSYNC;
else
flags |= DRM_MODE_FLAG_PHSYNC;
if (tmp & LVDS_VSYNC_POLARITY)
flags |= DRM_MODE_FLAG_NVSYNC;
else
flags |= DRM_MODE_FLAG_PVSYNC;
crtc_state->hw.adjusted_mode.flags |= flags;
if (DISPLAY_VER(display) < 5)
crtc_state->gmch_pfit.lvds_border_bits =
tmp & LVDS_BORDER_ENABLE;
/* gen2/3 store dither state in pfit control, needs to match */
if (DISPLAY_VER(display) < 4) {
tmp = intel_de_read(display, PFIT_CONTROL(display));
Annotation
- Immediate include surface: `acpi/button.h`, `linux/acpi.h`, `linux/dmi.h`, `linux/i2c.h`, `linux/slab.h`, `linux/vga_switcheroo.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`.
- Detected declarations: `struct intel_lvds_pps`, `struct intel_lvds_encoder`, `function intel_lvds_port_enabled`, `function intel_lvds_get_hw_state`, `function intel_lvds_get_config`, `function intel_lvds_pps_get_hw_state`, `function intel_lvds_pps_init_hw`, `function intel_pre_enable_lvds`, `function intel_enable_lvds`, `function intel_disable_lvds`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.