drivers/gpu/drm/msm/dp/dp_panel.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dp/dp_panel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dp/dp_panel.c- Extension
.c- Size
- 21827 bytes
- Lines
- 765
- 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.
- 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
dp_panel.hdp_reg.hdp_utils.hdrm/drm_connector.hdrm/drm_edid.hdrm/drm_of.hdrm/drm_print.hlinux/io.hlinux/types.hasm/byteorder.h
Detected Declarations
struct msm_dp_panel_privatefunction msm_dp_read_linkfunction msm_dp_write_linkfunction msm_dp_write_p0function msm_dp_read_p0function msm_dp_panel_read_psr_capfunction msm_dp_panel_read_dpcdfunction msm_dp_panel_get_supported_bppfunction msm_dp_panel_read_sink_capsfunction msm_dp_panel_unpluggedfunction msm_dp_panel_get_mode_bppfunction msm_dp_panel_get_modesfunction msm_dp_panel_get_edid_checksumfunction msm_dp_panel_handle_sink_requestfunction msm_dp_panel_tpg_enablefunction msm_dp_panel_tpg_disablefunction msm_dp_panel_tpg_configfunction msm_dp_panel_clear_dsc_dtofunction msm_dp_panel_send_vsc_sdpfunction msm_dp_panel_update_sdpfunction msm_dp_panel_enable_vsc_sdpfunction msm_dp_panel_disable_vsc_sdpfunction msm_dp_panel_setup_vsc_sdp_yuv_420function msm_dp_panel_timing_cfgfunction msm_dp_panel_init_panel_infofunction msm_dp_panel_put
Annotated Snippet
struct msm_dp_panel_private {
struct device *dev;
struct drm_device *drm_dev;
struct msm_dp_panel msm_dp_panel;
struct drm_dp_aux *aux;
struct msm_dp_link *link;
void __iomem *link_base;
void __iomem *p0_base;
bool panel_on;
};
static inline u32 msm_dp_read_link(struct msm_dp_panel_private *panel, u32 offset)
{
return readl_relaxed(panel->link_base + offset);
}
static inline void msm_dp_write_link(struct msm_dp_panel_private *panel,
u32 offset, u32 data)
{
/*
* To make sure link reg writes happens before any other operation,
* this function uses writel() instread of writel_relaxed()
*/
writel(data, panel->link_base + offset);
}
static inline void msm_dp_write_p0(struct msm_dp_panel_private *panel,
u32 offset, u32 data)
{
/*
* To make sure interface reg writes happens before any other operation,
* this function uses writel() instread of writel_relaxed()
*/
writel(data, panel->p0_base + offset);
}
static inline u32 msm_dp_read_p0(struct msm_dp_panel_private *panel,
u32 offset)
{
/*
* To make sure interface reg writes happens before any other operation,
* this function uses writel() instread of writel_relaxed()
*/
return readl_relaxed(panel->p0_base + offset);
}
static void msm_dp_panel_read_psr_cap(struct msm_dp_panel_private *panel)
{
ssize_t rlen;
struct msm_dp_panel *msm_dp_panel;
msm_dp_panel = &panel->msm_dp_panel;
/* edp sink */
if (msm_dp_panel->dpcd[DP_EDP_CONFIGURATION_CAP]) {
rlen = drm_dp_dpcd_read(panel->aux, DP_PSR_SUPPORT,
&msm_dp_panel->psr_cap, sizeof(msm_dp_panel->psr_cap));
if (rlen == sizeof(msm_dp_panel->psr_cap)) {
drm_dbg_dp(panel->drm_dev,
"psr version: 0x%x, psr_cap: 0x%x\n",
msm_dp_panel->psr_cap.version,
msm_dp_panel->psr_cap.capabilities);
} else
DRM_ERROR("failed to read psr info, rlen=%zd\n", rlen);
}
}
static int msm_dp_panel_read_dpcd(struct msm_dp_panel *msm_dp_panel)
{
int rc, max_lttpr_lanes, max_lttpr_rate;
struct msm_dp_panel_private *panel;
struct msm_dp_link_info *link_info;
struct msm_dp_link *link;
u8 *dpcd, major, minor;
panel = container_of(msm_dp_panel, struct msm_dp_panel_private, msm_dp_panel);
dpcd = msm_dp_panel->dpcd;
rc = drm_dp_read_dpcd_caps(panel->aux, dpcd);
if (rc)
return rc;
msm_dp_panel->vsc_sdp_supported = drm_dp_vsc_sdp_supported(panel->aux, dpcd);
link_info = &msm_dp_panel->link_info;
link_info->revision = dpcd[DP_DPCD_REV];
major = (link_info->revision >> 4) & 0x0f;
minor = link_info->revision & 0x0f;
link = panel->link;
drm_dbg_dp(panel->drm_dev, "max_lanes=%d max_link_rate=%d\n",
link->max_dp_lanes, link->max_dp_link_rate);
Annotation
- Immediate include surface: `dp_panel.h`, `dp_reg.h`, `dp_utils.h`, `drm/drm_connector.h`, `drm/drm_edid.h`, `drm/drm_of.h`, `drm/drm_print.h`, `linux/io.h`.
- Detected declarations: `struct msm_dp_panel_private`, `function msm_dp_read_link`, `function msm_dp_write_link`, `function msm_dp_write_p0`, `function msm_dp_read_p0`, `function msm_dp_panel_read_psr_cap`, `function msm_dp_panel_read_dpcd`, `function msm_dp_panel_get_supported_bpp`, `function msm_dp_panel_read_sink_caps`, `function msm_dp_panel_unplugged`.
- 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.