drivers/gpu/drm/omapdrm/dss/hdmi4.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/dss/hdmi4.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/dss/hdmi4.c- Extension
.c- Size
- 19171 bytes
- Lines
- 857
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/err.hlinux/io.hlinux/interrupt.hlinux/mutex.hlinux/delay.hlinux/string.hlinux/platform_device.hlinux/pm_runtime.hlinux/clk.hlinux/regulator/consumer.hlinux/component.hlinux/of.hlinux/of_graph.hsound/omap-hdmi-audio.hmedia/cec.hdrm/drm_atomic.hdrm/drm_atomic_state_helper.hdrm/drm_edid.homapdss.hhdmi4_core.hhdmi4_cec.hdss.hhdmi.h
Detected Declarations
function Copyrightfunction hdmi_runtime_putfunction hdmi_irq_handlerfunction hdmi_power_on_corefunction hdmi_power_off_corefunction hdmi_power_on_fullfunction hdmi_power_off_fullfunction hdmi_dump_regsfunction hdmi_start_audio_streamfunction hdmi_stop_audio_streamfunction hdmi4_core_enablefunction hdmi4_core_disablefunction hdmi4_bridge_attachfunction hdmi4_bridge_mode_setfunction hdmi4_bridge_enablefunction hdmi4_bridge_disablefunction hdmi4_bridge_hpd_notifyfunction hdmi4_bridge_initfunction hdmi4_bridge_cleanupfunction hdmi_audio_startupfunction hdmi_audio_shutdownfunction hdmi_audio_startfunction hdmi_audio_stopfunction hdmi_audio_configfunction hdmi_audio_registerfunction hdmi4_bindfunction hdmi4_unbindfunction hdmi4_init_outputfunction hdmi4_uninit_outputfunction hdmi4_probe_offunction hdmi4_probefunction hdmi4_remove
Annotated Snippet
if (ret) {
DSSERR("Error restoring audio configuration: %d", ret);
hdmi->audio_abort_cb(&hdmi->pdev->dev);
hdmi->audio_configured = false;
}
}
spin_lock_irqsave(&hdmi->audio_playing_lock, flags);
if (hdmi->audio_configured && hdmi->audio_playing)
hdmi_start_audio_stream(hdmi);
hdmi->display_enabled = true;
spin_unlock_irqrestore(&hdmi->audio_playing_lock, flags);
done:
mutex_unlock(&hdmi->lock);
}
static void hdmi4_bridge_disable(struct drm_bridge *bridge,
struct drm_atomic_commit *state)
{
struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
unsigned long flags;
mutex_lock(&hdmi->lock);
spin_lock_irqsave(&hdmi->audio_playing_lock, flags);
hdmi_stop_audio_stream(hdmi);
hdmi->display_enabled = false;
spin_unlock_irqrestore(&hdmi->audio_playing_lock, flags);
hdmi_power_off_full(hdmi);
mutex_unlock(&hdmi->lock);
}
static void hdmi4_bridge_hpd_notify(struct drm_bridge *bridge,
struct drm_connector *connector,
enum drm_connector_status status)
{
struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
if (status == connector_status_disconnected)
hdmi4_cec_set_phys_addr(&hdmi->core, CEC_PHYS_ADDR_INVALID);
}
static const struct drm_edid *hdmi4_bridge_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector)
{
struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
const struct drm_edid *drm_edid = NULL;
unsigned int cec_addr;
bool need_enable;
int r;
need_enable = hdmi->core_enabled == false;
if (need_enable) {
r = hdmi4_core_enable(&hdmi->core);
if (r)
return NULL;
}
mutex_lock(&hdmi->lock);
r = hdmi_runtime_get(hdmi);
BUG_ON(r);
r = hdmi4_core_ddc_init(&hdmi->core);
if (r)
goto done;
drm_edid = drm_edid_read_custom(connector, hdmi4_core_ddc_read, &hdmi->core);
done:
hdmi_runtime_put(hdmi);
mutex_unlock(&hdmi->lock);
if (drm_edid) {
/*
* FIXME: The CEC physical address should be set using
* hdmi4_cec_set_phys_addr(&hdmi->core,
* connector->display_info.source_physical_address) from a path
* that has read the EDID and called
* drm_edid_connector_update().
*/
const struct edid *edid = drm_edid_raw(drm_edid);
unsigned int len = (edid->extensions + 1) * EDID_LENGTH;
cec_addr = cec_get_edid_phys_addr((u8 *)edid, len, NULL);
} else {
cec_addr = CEC_PHYS_ADDR_INVALID;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/err.h`, `linux/io.h`, `linux/interrupt.h`, `linux/mutex.h`, `linux/delay.h`, `linux/string.h`.
- Detected declarations: `function Copyright`, `function hdmi_runtime_put`, `function hdmi_irq_handler`, `function hdmi_power_on_core`, `function hdmi_power_off_core`, `function hdmi_power_on_full`, `function hdmi_power_off_full`, `function hdmi_dump_regs`, `function hdmi_start_audio_stream`, `function hdmi_stop_audio_stream`.
- 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.