drivers/gpu/drm/rockchip/cdn-dp-reg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/rockchip/cdn-dp-reg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/rockchip/cdn-dp-reg.c- Extension
.c- Size
- 21995 bytes
- Lines
- 965
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/device.hlinux/delay.hlinux/io.hlinux/iopoll.hlinux/reset.hdrm/drm_print.hcdn-dp-core.hcdn-dp-reg.h
Detected Declarations
function Copyrightfunction cdn_dp_clock_resetfunction cdn_dp_mailbox_readfunction cdp_dp_mailbox_writefunction cdn_dp_mailbox_validate_receivefunction cdn_dp_mailbox_read_receivefunction cdn_dp_mailbox_sendfunction cdn_dp_reg_writefunction cdn_dp_reg_write_bitfunction cdn_dp_dpcd_readfunction cdn_dp_dpcd_writefunction cdn_dp_load_firmwarefunction cdn_dp_set_firmware_activefunction cdn_dp_set_host_capfunction cdn_dp_event_configfunction cdn_dp_get_eventfunction cdn_dp_get_hpd_statusfunction cdn_dp_get_edid_blockfunction cdn_dp_training_startfunction cdn_dp_get_training_statusfunction cdn_dp_train_linkfunction cdn_dp_set_video_statusfunction cdn_dp_get_msa_miscfunction cdn_dp_config_videofunction cdn_dp_audio_stopfunction cdn_dp_audio_mutefunction cdn_dp_audio_config_i2sfunction cdn_dp_audio_config_spdiffunction cdn_dp_audio_config
Annotated Snippet
if (tu_size_reg > 64) {
ret = -EINVAL;
DRM_DEV_ERROR(dp->dev,
"tu error, clk:%d, lanes:%d, rate:%d\n",
mode->clock, dp->max_lanes, link_rate);
goto err_config_video;
}
} while ((symbol <= 1) || (tu_size_reg - symbol < 4) ||
(rem > 850) || (rem < 100));
val = symbol + (tu_size_reg << 8);
val |= TU_CNT_RST_EN;
ret = cdn_dp_reg_write(dp, DP_FRAMER_TU, val);
if (ret)
goto err_config_video;
/* set the FIFO Buffer size */
val = div_u64(mode->clock * (symbol + 1), 1000) + link_rate;
val /= (dp->max_lanes * link_rate);
val = div_u64(8 * (symbol + 1), bit_per_pix) - val;
val += 2;
ret = cdn_dp_reg_write(dp, DP_VC_TABLE(15), val);
if (ret)
goto err_config_video;
switch (video->color_depth) {
case 6:
val = BCS_6;
break;
case 8:
val = BCS_8;
break;
case 10:
val = BCS_10;
break;
case 12:
val = BCS_12;
break;
case 16:
val = BCS_16;
break;
}
val += video->color_fmt << 8;
ret = cdn_dp_reg_write(dp, DP_FRAMER_PXL_REPR, val);
if (ret)
goto err_config_video;
val = video->h_sync_polarity ? DP_FRAMER_SP_HSP : 0;
val |= video->v_sync_polarity ? DP_FRAMER_SP_VSP : 0;
ret = cdn_dp_reg_write(dp, DP_FRAMER_SP, val);
if (ret)
goto err_config_video;
val = (mode->hsync_start - mode->hdisplay) << 16;
val |= mode->htotal - mode->hsync_end;
ret = cdn_dp_reg_write(dp, DP_FRONT_BACK_PORCH, val);
if (ret)
goto err_config_video;
val = mode->hdisplay * bit_per_pix / 8;
ret = cdn_dp_reg_write(dp, DP_BYTE_COUNT, val);
if (ret)
goto err_config_video;
val = mode->htotal | ((mode->htotal - mode->hsync_start) << 16);
ret = cdn_dp_reg_write(dp, MSA_HORIZONTAL_0, val);
if (ret)
goto err_config_video;
val = mode->hsync_end - mode->hsync_start;
val |= (mode->hdisplay << 16) | (video->h_sync_polarity << 15);
ret = cdn_dp_reg_write(dp, MSA_HORIZONTAL_1, val);
if (ret)
goto err_config_video;
val = mode->vtotal;
val |= (mode->vtotal - mode->vsync_start) << 16;
ret = cdn_dp_reg_write(dp, MSA_VERTICAL_0, val);
if (ret)
goto err_config_video;
val = mode->vsync_end - mode->vsync_start;
val |= (mode->vdisplay << 16) | (video->v_sync_polarity << 15);
ret = cdn_dp_reg_write(dp, MSA_VERTICAL_1, val);
if (ret)
goto err_config_video;
val = cdn_dp_get_msa_misc(video, mode);
ret = cdn_dp_reg_write(dp, MSA_MISC, val);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/delay.h`, `linux/io.h`, `linux/iopoll.h`, `linux/reset.h`, `drm/drm_print.h`, `cdn-dp-core.h`.
- Detected declarations: `function Copyright`, `function cdn_dp_clock_reset`, `function cdn_dp_mailbox_read`, `function cdp_dp_mailbox_write`, `function cdn_dp_mailbox_validate_receive`, `function cdn_dp_mailbox_read_receive`, `function cdn_dp_mailbox_send`, `function cdn_dp_reg_write`, `function cdn_dp_reg_write_bit`, `function cdn_dp_dpcd_read`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.