drivers/gpu/drm/msm/dsi/dsi_manager.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/dsi_manager.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dsi/dsi_manager.c- Extension
.c- Size
- 16390 bytes
- Lines
- 617
- 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
drm/drm_bridge_connector.hmsm_kms.hdsi.h
Detected Declarations
struct msm_dsi_managerstruct dsi_bridgefunction dsi_mgr_parse_offunction dsi_mgr_setup_componentsfunction enable_phyfunction dsi_mgr_phy_enablefunction dsi_mgr_phy_disablefunction dsi_mgr_bridge_get_idfunction dsi_mgr_bridge_power_onfunction dsi_mgr_bridge_power_offfunction dsi_mgr_bridge_pre_enablefunction msm_dsi_manager_tpg_enablefunction dsi_mgr_bridge_post_disablefunction dsi_mgr_bridge_mode_setfunction dsi_mgr_bridge_mode_validfunction dsi_mgr_bridge_attachfunction msm_dsi_manager_connector_initfunction msm_dsi_manager_cmd_xferfunction msm_dsi_manager_cmd_xfer_triggerfunction msm_dsi_manager_registerfunction msm_dsi_manager_unregisterfunction msm_dsi_is_bonded_dsifunction msm_dsi_is_master_dsi
Annotated Snippet
struct msm_dsi_manager {
struct msm_dsi *dsi[DSI_MAX];
bool is_bonded_dsi;
bool is_sync_needed;
int master_dsi_link_id;
};
static struct msm_dsi_manager msm_dsim_glb;
#define IS_BONDED_DSI() (msm_dsim_glb.is_bonded_dsi)
#define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed)
#define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id == id)
static inline struct msm_dsi *dsi_mgr_get_dsi(int id)
{
return msm_dsim_glb.dsi[id];
}
static inline struct msm_dsi *dsi_mgr_get_other_dsi(int id)
{
return msm_dsim_glb.dsi[(id + 1) % DSI_MAX];
}
static int dsi_mgr_parse_of(struct device_node *np, int id)
{
struct msm_dsi_manager *msm_dsim = &msm_dsim_glb;
/* We assume 2 dsi nodes have the same information of bonded dsi and
* sync-mode, and only one node specifies master in case of bonded mode.
*/
if (!msm_dsim->is_bonded_dsi)
msm_dsim->is_bonded_dsi = of_property_read_bool(np, "qcom,dual-dsi-mode");
if (msm_dsim->is_bonded_dsi) {
if (of_property_read_bool(np, "qcom,master-dsi"))
msm_dsim->master_dsi_link_id = id;
if (!msm_dsim->is_sync_needed)
msm_dsim->is_sync_needed = of_property_read_bool(
np, "qcom,sync-dual-dsi");
}
return 0;
}
static int dsi_mgr_setup_components(int id)
{
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
struct msm_dsi *other_dsi = dsi_mgr_get_other_dsi(id);
struct msm_dsi *clk_master_dsi = dsi_mgr_get_dsi(DSI_CLOCK_MASTER);
struct msm_dsi *clk_slave_dsi = dsi_mgr_get_dsi(DSI_CLOCK_SLAVE);
int ret;
if (!IS_BONDED_DSI()) {
/*
* Set the usecase before calling msm_dsi_host_register(), which would
* already program the PLL source mux based on a default usecase.
*/
msm_dsi_phy_set_usecase(msm_dsi->phy, MSM_DSI_PHY_STANDALONE);
msm_dsi_host_set_phy_mode(msm_dsi->host, msm_dsi->phy);
ret = msm_dsi_host_register(msm_dsi->host);
if (ret)
return ret;
} else if (other_dsi) {
struct msm_dsi *master_link_dsi = IS_MASTER_DSI_LINK(id) ?
msm_dsi : other_dsi;
struct msm_dsi *slave_link_dsi = IS_MASTER_DSI_LINK(id) ?
other_dsi : msm_dsi;
/*
* PLL0 is to drive both DSI link clocks in bonded DSI mode.
*
* Set the usecase before calling msm_dsi_host_register(), which would
* already program the PLL source mux based on a default usecase.
*/
msm_dsi_phy_set_usecase(clk_master_dsi->phy,
MSM_DSI_PHY_MASTER);
msm_dsi_phy_set_usecase(clk_slave_dsi->phy,
MSM_DSI_PHY_SLAVE);
msm_dsi_host_set_phy_mode(msm_dsi->host, msm_dsi->phy);
msm_dsi_host_set_phy_mode(other_dsi->host, other_dsi->phy);
/* Register slave host first, so that slave DSI device
* has a chance to probe, and do not block the master
* DSI device's probe.
* Also, do not check defer for the slave host,
* because only master DSI device adds the panel to global
* panel list. The panel's device is the master DSI device.
*/
Annotation
- Immediate include surface: `drm/drm_bridge_connector.h`, `msm_kms.h`, `dsi.h`.
- Detected declarations: `struct msm_dsi_manager`, `struct dsi_bridge`, `function dsi_mgr_parse_of`, `function dsi_mgr_setup_components`, `function enable_phy`, `function dsi_mgr_phy_enable`, `function dsi_mgr_phy_disable`, `function dsi_mgr_bridge_get_id`, `function dsi_mgr_bridge_power_on`, `function dsi_mgr_bridge_power_off`.
- 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.