drivers/gpu/drm/sti/sti_hdmi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sti/sti_hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sti/sti_hdmi.c- Extension
.c- Size
- 42332 bytes
- Lines
- 1494
- 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
linux/clk.hlinux/component.hlinux/debugfs.hlinux/hdmi.hlinux/i2c.hlinux/module.hlinux/io.hlinux/platform_device.hlinux/reset.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_debugfs.hdrm/drm_drv.hdrm/drm_edid.hdrm/drm_file.hdrm/drm_print.hdrm/drm_probe_helper.hsound/hdmi-codec.hsti_hdmi.hsti_hdmi_tx3g4c28phy.hsti_vtg.h
Detected Declarations
struct sti_hdmi_connectorfunction hdmi_readfunction hdmi_writefunction hdmi_irq_threadfunction hdmi_irqfunction hdmi_active_areafunction hdmi_configfunction hdmi_infoframe_resetfunction hdmi_infoframe_subpackfunction hdmi_infoframe_write_infopackfunction hdmi_avi_infoframe_configfunction hdmi_audio_infoframe_configfunction hdmi_vendor_infoframe_configfunction hdmi_swresetfunction hdmi_readfunction hdmi_dbg_stafunction hdmi_dbg_sw_di_cfgfunction hdmi_dbg_showfunction hdmi_debugfs_initfunction sti_hdmi_disablefunction sti_hdmi_audio_get_non_coherent_nfunction hdmi_audio_configurefunction sti_hdmi_pre_enablefunction sti_hdmi_set_modefunction sti_hdmi_bridge_nopefunction sti_hdmi_connector_get_modesfunction sti_hdmi_connector_mode_validfunction sti_hdmi_connector_detectfunction sti_hdmi_connector_init_propertyfunction sti_hdmi_connector_set_propertyfunction sti_hdmi_connector_get_propertyfunction sti_hdmi_late_registerfunction list_for_each_entryfunction hdmi_audio_shutdownfunction hdmi_audio_hw_paramsfunction hdmi_audio_mutefunction hdmi_audio_get_eldfunction sti_hdmi_register_audio_driverfunction sti_hdmi_bindfunction sti_hdmi_unbindfunction sti_hdmi_probefunction sti_hdmi_remove
Annotated Snippet
struct sti_hdmi_connector {
struct drm_connector drm_connector;
struct drm_encoder *encoder;
struct sti_hdmi *hdmi;
struct drm_property *colorspace_property;
};
#define to_sti_hdmi_connector(x) \
container_of(x, struct sti_hdmi_connector, drm_connector)
static struct sti_hdmi *drm_bridge_to_sti_hdmi(struct drm_bridge *bridge)
{
return container_of(bridge, struct sti_hdmi, bridge);
}
static const struct drm_prop_enum_list colorspace_mode_names[] = {
{ HDMI_COLORSPACE_RGB, "rgb" },
{ HDMI_COLORSPACE_YUV422, "yuv422" },
{ HDMI_COLORSPACE_YUV444, "yuv444" },
};
u32 hdmi_read(struct sti_hdmi *hdmi, int offset)
{
return readl(hdmi->regs + offset);
}
void hdmi_write(struct sti_hdmi *hdmi, u32 val, int offset)
{
writel(val, hdmi->regs + offset);
}
/*
* HDMI interrupt handler threaded
*
* @irq: irq number
* @arg: connector structure
*/
static irqreturn_t hdmi_irq_thread(int irq, void *arg)
{
struct sti_hdmi *hdmi = arg;
/* Hot plug/unplug IRQ */
if (hdmi->irq_status & HDMI_INT_HOT_PLUG) {
hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG;
if (hdmi->drm_dev)
drm_helper_hpd_irq_event(hdmi->drm_dev);
}
/* Sw reset and PLL lock are exclusive so we can use the same
* event to signal them
*/
if (hdmi->irq_status & (HDMI_INT_SW_RST | HDMI_INT_DLL_LCK)) {
hdmi->event_received = true;
wake_up_interruptible(&hdmi->wait_event);
}
/* Audio FIFO underrun IRQ */
if (hdmi->irq_status & HDMI_INT_AUDIO_FIFO_XRUN)
DRM_INFO("Warning: audio FIFO underrun occurs!\n");
return IRQ_HANDLED;
}
/*
* HDMI interrupt handler
*
* @irq: irq number
* @arg: connector structure
*/
static irqreturn_t hdmi_irq(int irq, void *arg)
{
struct sti_hdmi *hdmi = arg;
/* read interrupt status */
hdmi->irq_status = hdmi_read(hdmi, HDMI_INT_STA);
/* clear interrupt status */
hdmi_write(hdmi, hdmi->irq_status, HDMI_INT_CLR);
/* force sync bus write */
hdmi_read(hdmi, HDMI_INT_STA);
return IRQ_WAKE_THREAD;
}
/*
* Set hdmi active area depending on the drm display mode selected
*
* @hdmi: pointer on the hdmi internal structure
*/
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/debugfs.h`, `linux/hdmi.h`, `linux/i2c.h`, `linux/module.h`, `linux/io.h`, `linux/platform_device.h`.
- Detected declarations: `struct sti_hdmi_connector`, `function hdmi_read`, `function hdmi_write`, `function hdmi_irq_thread`, `function hdmi_irq`, `function hdmi_active_area`, `function hdmi_config`, `function hdmi_infoframe_reset`, `function hdmi_infoframe_subpack`, `function hdmi_infoframe_write_infopack`.
- 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.