drivers/gpu/drm/tegra/output.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/output.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/output.c- Extension
.c- Size
- 6433 bytes
- Lines
- 283
- 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/i2c.hlinux/of.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_of.hdrm/drm_panel.hdrm/drm_simple_kms_helper.hdrm.hdc.hmedia/cec-notifier.h
Detected Declarations
function Copyrightfunction tegra_output_connector_detectfunction tegra_output_connector_destroyfunction hpd_irqfunction tegra_output_probefunction tegra_output_removefunction tegra_output_initfunction tegra_output_exitfunction tegra_output_find_possible_crtcsfunction drm_for_each_crtcfunction tegra_output_suspendfunction tegra_output_resume
Annotated Snippet
if (!output->ddc) {
err = -EPROBE_DEFER;
return err;
}
}
edid = of_get_property(output->of_node, "nvidia,edid", &size);
output->drm_edid = drm_edid_alloc(edid, size);
output->hpd_gpio = devm_fwnode_gpiod_get(output->dev,
of_fwnode_handle(output->of_node),
"nvidia,hpd",
GPIOD_IN,
"HDMI hotplug detect");
if (IS_ERR(output->hpd_gpio)) {
if (PTR_ERR(output->hpd_gpio) != -ENOENT) {
err = PTR_ERR(output->hpd_gpio);
goto put_i2c;
}
output->hpd_gpio = NULL;
}
if (output->hpd_gpio) {
err = gpiod_to_irq(output->hpd_gpio);
if (err < 0) {
dev_err(output->dev, "gpiod_to_irq(): %d\n", err);
goto put_i2c;
}
output->hpd_irq = err;
flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
IRQF_ONESHOT;
err = request_threaded_irq(output->hpd_irq, NULL, hpd_irq,
flags, "hpd", output);
if (err < 0) {
dev_err(output->dev, "failed to request IRQ#%u: %d\n",
output->hpd_irq, err);
goto put_i2c;
}
output->connector.polled = DRM_CONNECTOR_POLL_HPD;
/*
* Disable the interrupt until the connector has been
* initialized to avoid a race in the hotplug interrupt
* handler.
*/
disable_irq(output->hpd_irq);
}
return 0;
put_i2c:
if (output->ddc)
i2c_put_adapter(output->ddc);
drm_edid_free(output->drm_edid);
return err;
}
void tegra_output_remove(struct tegra_output *output)
{
if (output->hpd_gpio)
free_irq(output->hpd_irq, output);
if (output->ddc)
i2c_put_adapter(output->ddc);
drm_edid_free(output->drm_edid);
}
int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
{
int connector_type;
/*
* The connector is now registered and ready to receive hotplug events
* so the hotplug interrupt can be enabled.
*/
if (output->hpd_gpio)
enable_irq(output->hpd_irq);
connector_type = output->connector.connector_type;
/*
* Create a CEC notifier for HDMI connector.
*/
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/of.h`, `drm/drm_atomic_helper.h`, `drm/drm_edid.h`, `drm/drm_of.h`, `drm/drm_panel.h`, `drm/drm_simple_kms_helper.h`, `drm.h`.
- Detected declarations: `function Copyright`, `function tegra_output_connector_detect`, `function tegra_output_connector_destroy`, `function hpd_irq`, `function tegra_output_probe`, `function tegra_output_remove`, `function tegra_output_init`, `function tegra_output_exit`, `function tegra_output_find_possible_crtcs`, `function drm_for_each_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.
- 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.