drivers/gpu/drm/xlnx/zynqmp_dp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xlnx/zynqmp_dp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xlnx/zynqmp_dp.c- Extension
.c- Size
- 70202 bytes
- Lines
- 2529
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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
drm/display/drm_dp_helper.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_edid.hdrm/drm_fourcc.hdrm/drm_modes.hdrm/drm_of.hlinux/bitfield.hlinux/clk.hlinux/debugfs.hlinux/delay.hlinux/device.hlinux/io.hlinux/media-bus-format.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/phy/phy.hlinux/reset.hlinux/slab.hzynqmp_disp.hzynqmp_dp.hzynqmp_dpsub.hzynqmp_kms.h
Detected Declarations
struct zynqmp_dp_link_configstruct zynqmp_dp_modestruct zynqmp_dp_configstruct zynqmp_dp_teststruct zynqmp_dp_train_set_privstruct zynqmp_dpenum test_patternfunction zynqmp_dp_writefunction zynqmp_dp_readfunction zynqmp_dp_clrfunction zynqmp_dp_setfunction zynqmp_dp_resetfunction zynqmp_dp_phy_initfunction zynqmp_dp_phy_exitfunction zynqmp_dp_phy_probefunction zynqmp_dp_phy_readyfunction zynqmp_dp_max_ratefunction zynqmp_dp_mode_configurefunction zynqmp_dp_adjust_trainfunction drm_dp_dpcd_writefunction zynqmp_dp_link_train_crfunction zynqmp_dp_link_train_cefunction zynqmp_dp_setupfunction zynqmp_dp_trainfunction zynqmp_dp_train_loopfunction zynqmp_dp_aux_cmd_submitfunction zynqmp_dp_aux_transferfunction zynqmp_dp_aux_initfunction zynqmp_dp_aux_cleanupfunction zynqmp_dp_update_miscfunction zynqmp_dp_set_formatfunction zynqmp_dp_encoder_mode_set_transfer_unitfunction zynqmp_dp_encoder_mode_set_streamfunction zynqmp_dp_audio_set_channelsfunction zynqmp_dp_audio_enablefunction zynqmp_dp_audio_disablefunction zynqmp_dp_audio_write_n_mfunction zynqmp_dp_disp_connected_live_layerfunction zynqmp_dp_disp_enablefunction zynqmp_dp_disp_disablefunction zynqmp_dp_bridge_attachfunction zynqmp_dp_bridge_detachfunction zynqmp_dp_bridge_mode_validfunction zynqmp_dp_bridge_atomic_enablefunction zynqmp_dp_bridge_atomic_disablefunction zynqmp_dp_bridge_atomic_checkfunction __zynqmp_dp_bridge_detectfunction zynqmp_dp_bridge_detect
Annotated Snippet
static const struct file_operations fops_zynqmp_dp_pattern = {
.read = zynqmp_dp_pattern_read,
.write = zynqmp_dp_pattern_write,
.open = simple_open,
.llseek = noop_llseek,
};
static int zynqmp_dp_enhanced_get(void *data, u64 *val)
{
struct zynqmp_dp *dp = data;
guard(mutex)(&dp->lock);
*val = dp->test.enhanced;
return 0;
}
static int zynqmp_dp_enhanced_set(void *data, u64 val)
{
struct zynqmp_dp *dp = data;
guard(mutex)(&dp->lock);
dp->test.enhanced = val;
return dp->test.active ? zynqmp_dp_test_setup(dp) : 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_enhanced, zynqmp_dp_enhanced_get,
zynqmp_dp_enhanced_set, "%llu\n");
static int zynqmp_dp_downspread_get(void *data, u64 *val)
{
struct zynqmp_dp *dp = data;
guard(mutex)(&dp->lock);
*val = dp->test.downspread;
return 0;
}
static int zynqmp_dp_downspread_set(void *data, u64 val)
{
struct zynqmp_dp *dp = data;
guard(mutex)(&dp->lock);
dp->test.downspread = val;
return dp->test.active ? zynqmp_dp_test_setup(dp) : 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_downspread, zynqmp_dp_downspread_get,
zynqmp_dp_downspread_set, "%llu\n");
static int zynqmp_dp_active_get(void *data, u64 *val)
{
struct zynqmp_dp *dp = data;
guard(mutex)(&dp->lock);
*val = dp->test.active;
return 0;
}
static int zynqmp_dp_active_set(void *data, u64 val)
{
struct zynqmp_dp *dp = data;
int ret;
guard(mutex)(&dp->lock);
if (val) {
if (val < 2) {
ret = zynqmp_dp_test_setup(dp);
if (ret)
return ret;
}
ret = zynqmp_dp_set_test_pattern(dp, dp->test.pattern,
dp->test.custom);
if (ret)
return ret;
ret = zynqmp_dp_update_vs_emph(dp, dp->test.train_set);
if (ret)
return ret;
dp->test.active = true;
} else {
int err;
dp->test.active = false;
err = zynqmp_dp_set_test_pattern(dp, TEST_VIDEO, NULL);
if (err)
dev_warn(dp->dev, "could not clear test pattern: %d\n",
err);
Annotation
- Immediate include surface: `drm/display/drm_dp_helper.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`, `drm/drm_device.h`, `drm/drm_edid.h`, `drm/drm_fourcc.h`, `drm/drm_modes.h`, `drm/drm_of.h`.
- Detected declarations: `struct zynqmp_dp_link_config`, `struct zynqmp_dp_mode`, `struct zynqmp_dp_config`, `struct zynqmp_dp_test`, `struct zynqmp_dp_train_set_priv`, `struct zynqmp_dp`, `enum test_pattern`, `function zynqmp_dp_write`, `function zynqmp_dp_read`, `function zynqmp_dp_clr`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.