drivers/gpu/drm/display/drm_dp_mst_topology.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_dp_mst_topology.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_dp_mst_topology.c- Extension
.c- Size
- 179669 bytes
- Lines
- 6206
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
linux/bitfield.hlinux/delay.hlinux/errno.hlinux/export.hlinux/i2c.hlinux/init.hlinux/kernel.hlinux/random.hlinux/sched.hlinux/seq_file.hlinux/stacktrace.hlinux/sort.hlinux/timekeeping.hlinux/math64.hdrm/display/drm_dp_mst_helper.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_drv.hdrm/drm_edid.hdrm/drm_fixed.hdrm/drm_print.hdrm/drm_probe_helper.hdrm_dp_helper_internal.hdrm_dp_mst_topology_internal.h
Detected Declarations
struct drm_dp_pending_up_reqfunction drm_dp_mst_get_ufp_num_at_lct_from_radfunction drm_dp_mst_rad_to_strfunction drm_dp_msg_header_crc4function drm_dp_msg_data_crc4function drm_dp_calc_sb_hdr_sizefunction drm_dp_encode_sideband_msg_hdrfunction drm_dp_decode_sideband_msg_hdrfunction drm_dp_encode_sideband_reqfunction drm_dp_decode_sideband_reqfunction drm_dp_dump_sideband_msg_req_bodyfunction drm_dp_mst_dump_sideband_msg_txfunction drm_dp_crc_sideband_chunk_reqfunction drm_dp_encode_sideband_replyfunction drm_dp_sideband_msg_set_headerfunction drm_dp_sideband_append_payloadfunction drm_dp_sideband_parse_link_addressfunction drm_dp_sideband_parse_remote_dpcd_readfunction drm_dp_sideband_parse_remote_dpcd_writefunction drm_dp_sideband_parse_remote_i2c_read_ackfunction drm_dp_sideband_parse_enum_path_resources_ackfunction drm_dp_sideband_parse_allocate_payload_ackfunction drm_dp_sideband_parse_query_payload_ackfunction drm_dp_sideband_parse_power_updown_phy_ackfunction drm_dp_sideband_parse_query_stream_enc_statusfunction drm_dp_sideband_parse_replyfunction drm_dp_sideband_parse_connection_status_notifyfunction drm_dp_sideband_parse_resource_status_notifyfunction drm_dp_sideband_parse_reqfunction build_dpcd_writefunction build_link_addressfunction build_clear_payload_id_tablefunction build_enum_path_resourcesfunction build_allocate_payloadfunction build_power_updown_phyfunction build_query_stream_enc_statusfunction check_txmsg_statefunction drm_dp_mst_wait_tx_replyfunction drm_dp_free_mst_branch_devicefunction drm_dp_mst_get_mstb_mallocfunction drm_dp_mst_put_mstb_mallocfunction drm_dp_free_mst_portfunction drm_dp_mst_get_port_mallocfunction drm_dp_mst_put_port_mallocfunction __topology_ref_savefunction topology_ref_history_cmpfunction topology_ref_type_to_strfunction __dump_topology_ref_history
Annotated Snippet
struct drm_dp_pending_up_req {
struct drm_dp_sideband_msg_hdr hdr;
struct drm_dp_sideband_msg_req_body msg;
struct list_head next;
};
static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr,
char *buf);
static void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port);
static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
int offset, int size, u8 *bytes);
static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
int offset, int size, u8 *bytes);
static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_branch *mstb);
static void
drm_dp_send_clear_payload_id_table(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_branch *mstb);
static int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_branch *mstb,
struct drm_dp_mst_port *port);
static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr,
guid_t *guid);
static int drm_dp_mst_register_i2c_bus(struct drm_dp_mst_port *port);
static void drm_dp_mst_unregister_i2c_bus(struct drm_dp_mst_port *port);
static void drm_dp_mst_kick_tx(struct drm_dp_mst_topology_mgr *mgr);
static bool drm_dp_mst_port_downstream_of_branch(struct drm_dp_mst_port *port,
struct drm_dp_mst_branch *branch);
#define DBG_PREFIX "[dp_mst]"
#define DP_STR(x) [DP_ ## x] = #x
static const char *drm_dp_mst_req_type_str(u8 req_type)
{
static const char * const req_type_str[] = {
DP_STR(GET_MSG_TRANSACTION_VERSION),
DP_STR(LINK_ADDRESS),
DP_STR(CONNECTION_STATUS_NOTIFY),
DP_STR(ENUM_PATH_RESOURCES),
DP_STR(ALLOCATE_PAYLOAD),
DP_STR(QUERY_PAYLOAD),
DP_STR(RESOURCE_STATUS_NOTIFY),
DP_STR(CLEAR_PAYLOAD_ID_TABLE),
DP_STR(REMOTE_DPCD_READ),
DP_STR(REMOTE_DPCD_WRITE),
DP_STR(REMOTE_I2C_READ),
DP_STR(REMOTE_I2C_WRITE),
DP_STR(POWER_UP_PHY),
DP_STR(POWER_DOWN_PHY),
DP_STR(SINK_EVENT_NOTIFY),
DP_STR(QUERY_STREAM_ENC_STATUS),
};
if (req_type >= ARRAY_SIZE(req_type_str) ||
!req_type_str[req_type])
return "unknown";
return req_type_str[req_type];
}
#undef DP_STR
#define DP_STR(x) [DP_NAK_ ## x] = #x
static const char *drm_dp_mst_nak_reason_str(u8 nak_reason)
{
static const char * const nak_reason_str[] = {
DP_STR(WRITE_FAILURE),
DP_STR(INVALID_READ),
DP_STR(CRC_FAILURE),
DP_STR(BAD_PARAM),
DP_STR(DEFER),
DP_STR(LINK_FAILURE),
DP_STR(NO_RESOURCES),
DP_STR(DPCD_FAIL),
DP_STR(I2C_NAK),
DP_STR(ALLOCATE_FAIL),
};
if (nak_reason >= ARRAY_SIZE(nak_reason_str) ||
!nak_reason_str[nak_reason])
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/delay.h`, `linux/errno.h`, `linux/export.h`, `linux/i2c.h`, `linux/init.h`, `linux/kernel.h`, `linux/random.h`.
- Detected declarations: `struct drm_dp_pending_up_req`, `function drm_dp_mst_get_ufp_num_at_lct_from_rad`, `function drm_dp_mst_rad_to_str`, `function drm_dp_msg_header_crc4`, `function drm_dp_msg_data_crc4`, `function drm_dp_calc_sb_hdr_size`, `function drm_dp_encode_sideband_msg_hdr`, `function drm_dp_decode_sideband_msg_hdr`, `function drm_dp_encode_sideband_req`, `function drm_dp_decode_sideband_req`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.