drivers/gpu/drm/i915/display/intel_dvo.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dvo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dvo.c- Extension
.c- Size
- 16278 bytes
- Lines
- 560
- 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/i2c.hlinux/slab.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_edid.hdrm/drm_print.hdrm/drm_probe_helper.hintel_connector.hintel_de.hintel_display_driver.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_dvo.hintel_dvo_dev.hintel_dvo_regs.hintel_gmbus.hintel_panel.h
Detected Declarations
struct intel_dvofunction intel_dvo_connector_get_hw_statefunction intel_dvo_get_hw_statefunction intel_dvo_get_configfunction intel_disable_dvofunction intel_enable_dvofunction intel_dvo_mode_validfunction intel_dvo_compute_configfunction intel_dvo_pre_enablefunction intel_dvo_detectfunction intel_dvo_get_modesfunction intel_dvo_enc_destroyfunction intel_dvo_encoder_typefunction intel_dvo_connector_typefunction intel_dvo_init_devfunction intel_dvo_probefunction intel_dvo_init
Annotated Snippet
struct intel_dvo {
struct intel_encoder base;
struct intel_dvo_device dev;
struct intel_connector *attached_connector;
};
static struct intel_dvo *enc_to_dvo(struct intel_encoder *encoder)
{
return container_of(encoder, struct intel_dvo, base);
}
static struct intel_dvo *intel_attached_dvo(struct intel_connector *connector)
{
return enc_to_dvo(intel_attached_encoder(connector));
}
static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector)
{
struct intel_display *display = to_intel_display(connector);
struct intel_encoder *encoder = intel_attached_encoder(connector);
struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
enum port port = encoder->port;
u32 tmp;
tmp = intel_de_read(display, DVO(port));
if (!(tmp & DVO_ENABLE))
return false;
return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev);
}
static bool intel_dvo_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct intel_display *display = to_intel_display(encoder);
enum port port = encoder->port;
u32 tmp;
tmp = intel_de_read(display, DVO(port));
*pipe = REG_FIELD_GET(DVO_PIPE_SEL_MASK, tmp);
return tmp & DVO_ENABLE;
}
static void intel_dvo_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config)
{
struct intel_display *display = to_intel_display(encoder);
enum port port = encoder->port;
u32 tmp, flags = 0;
pipe_config->output_types |= BIT(INTEL_OUTPUT_DVO);
tmp = intel_de_read(display, DVO(port));
if (tmp & DVO_HSYNC_ACTIVE_HIGH)
flags |= DRM_MODE_FLAG_PHSYNC;
else
flags |= DRM_MODE_FLAG_NHSYNC;
if (tmp & DVO_VSYNC_ACTIVE_HIGH)
flags |= DRM_MODE_FLAG_PVSYNC;
else
flags |= DRM_MODE_FLAG_NVSYNC;
pipe_config->hw.adjusted_mode.flags |= flags;
pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock;
}
static void intel_disable_dvo(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
{
struct intel_display *display = to_intel_display(encoder);
struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
enum port port = encoder->port;
intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false);
intel_de_rmw(display, DVO(port), DVO_ENABLE, 0);
intel_de_posting_read(display, DVO(port));
}
static void intel_enable_dvo(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config,
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/slab.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`, `drm/drm_edid.h`, `drm/drm_print.h`, `drm/drm_probe_helper.h`, `intel_connector.h`.
- Detected declarations: `struct intel_dvo`, `function intel_dvo_connector_get_hw_state`, `function intel_dvo_get_hw_state`, `function intel_dvo_get_config`, `function intel_disable_dvo`, `function intel_enable_dvo`, `function intel_dvo_mode_valid`, `function intel_dvo_compute_config`, `function intel_dvo_pre_enable`, `function intel_dvo_detect`.
- 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.