drivers/gpu/drm/i915/display/intel_dp_hdcp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dp_hdcp.c- Extension
.c- Size
- 25387 bytes
- Lines
- 909
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/display/drm_dp_helper.hdrm/display/drm_dp_mst_helper.hdrm/display/drm_hdcp_helper.hdrm/drm_print.hintel_ddi.hintel_de.hintel_display_regs.hintel_display_types.hintel_dp.hintel_dp_hdcp.hintel_hdcp.hintel_hdcp_regs.hintel_hdcp_shim.h
Detected Declarations
struct hdcp2_dp_errata_stream_typestruct hdcp2_dp_msg_datafunction Copyrightfunction intel_dp_hdcp_wait_for_cp_irqfunction intel_dp_hdcp_write_an_aksvfunction intel_dp_hdcp_read_bksvfunction intel_dp_hdcp_read_bstatusfunction intel_dp_hdcp_read_bcapsfunction intel_dp_hdcp_repeater_presentfunction intel_dp_hdcp_read_ri_primefunction intel_dp_hdcp_read_ksv_readyfunction intel_dp_hdcp_read_ksv_fifofunction intel_dp_hdcp_read_v_prime_partfunction intel_dp_hdcp_toggle_signallingfunction intel_dp_hdcp_check_linkfunction intel_dp_hdcp_get_capabilityfunction intel_dp_hdcp2_read_rx_statusfunction hdcp2_detect_msg_availabilityfunction intel_dp_hdcp2_wait_for_msgfunction intel_dp_hdcp2_write_msgfunction get_receiver_id_list_rx_infofunction intel_dp_hdcp2_read_msgfunction intel_dp_hdcp2_config_stream_typefunction intel_dp_hdcp2_check_linkfunction _intel_dp_hdcp2_get_capabilityfunction intel_dp_hdcp2_get_capabilityfunction intel_dp_hdcp_get_remote_capabilityfunction intel_dp_mst_toggle_hdcp_stream_selectfunction intel_dp_mst_hdcp_stream_encryptionfunction intel_dp_mst_hdcp2_stream_encryptionfunction intel_dp_mst_hdcp2_check_linkfunction intel_dp_hdcp_init
Annotated Snippet
struct hdcp2_dp_errata_stream_type {
u8 msg_id;
u8 stream_type;
} __packed;
struct hdcp2_dp_msg_data {
u8 msg_id;
u32 offset;
bool msg_detectable;
u32 timeout;
u32 timeout2; /* Added for non_paired situation */
/* Timeout to read entire msg */
u32 msg_read_timeout;
};
static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = {
{ HDCP_2_2_AKE_INIT, DP_HDCP_2_2_AKE_INIT_OFFSET, false, 0, 0, 0},
{ HDCP_2_2_AKE_SEND_CERT, DP_HDCP_2_2_AKE_SEND_CERT_OFFSET,
false, HDCP_2_2_CERT_TIMEOUT_MS, 0, HDCP_2_2_DP_CERT_READ_TIMEOUT_MS},
{ HDCP_2_2_AKE_NO_STORED_KM, DP_HDCP_2_2_AKE_NO_STORED_KM_OFFSET,
false, 0, 0, 0 },
{ HDCP_2_2_AKE_STORED_KM, DP_HDCP_2_2_AKE_STORED_KM_OFFSET,
false, 0, 0, 0 },
{ HDCP_2_2_AKE_SEND_HPRIME, DP_HDCP_2_2_AKE_SEND_HPRIME_OFFSET,
true, HDCP_2_2_HPRIME_PAIRED_TIMEOUT_MS,
HDCP_2_2_HPRIME_NO_PAIRED_TIMEOUT_MS, HDCP_2_2_DP_HPRIME_READ_TIMEOUT_MS},
{ HDCP_2_2_AKE_SEND_PAIRING_INFO,
DP_HDCP_2_2_AKE_SEND_PAIRING_INFO_OFFSET, true,
HDCP_2_2_PAIRING_TIMEOUT_MS, 0, HDCP_2_2_DP_PAIRING_READ_TIMEOUT_MS },
{ HDCP_2_2_LC_INIT, DP_HDCP_2_2_LC_INIT_OFFSET, false, 0, 0, 0 },
{ HDCP_2_2_LC_SEND_LPRIME, DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET,
false, HDCP_2_2_DP_LPRIME_TIMEOUT_MS, 0, 0 },
{ HDCP_2_2_SKE_SEND_EKS, DP_HDCP_2_2_SKE_SEND_EKS_OFFSET, false,
0, 0, 0 },
{ HDCP_2_2_REP_SEND_RECVID_LIST,
DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET, true,
HDCP_2_2_RECVID_LIST_TIMEOUT_MS, 0, 0 },
{ HDCP_2_2_REP_SEND_ACK, DP_HDCP_2_2_REP_SEND_ACK_OFFSET, false,
0, 0, 0 },
{ HDCP_2_2_REP_STREAM_MANAGE,
DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET, false,
0, 0, 0},
{ HDCP_2_2_REP_STREAM_READY, DP_HDCP_2_2_REP_STREAM_READY_OFFSET,
false, HDCP_2_2_STREAM_READY_TIMEOUT_MS, 0, 0 },
/* local define to shovel this through the write_2_2 interface */
#define HDCP_2_2_ERRATA_DP_STREAM_TYPE 50
{ HDCP_2_2_ERRATA_DP_STREAM_TYPE,
DP_HDCP_2_2_REG_STREAM_TYPE_OFFSET, false,
0, 0 },
};
static int
intel_dp_hdcp2_read_rx_status(struct intel_connector *connector,
u8 *rx_status)
{
struct intel_display *display = to_intel_display(connector);
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_dp_aux *aux = &dig_port->dp.aux;
ssize_t ret;
ret = drm_dp_dpcd_read(aux,
DP_HDCP_2_2_REG_RXSTATUS_OFFSET, rx_status,
HDCP_2_2_DP_RXSTATUS_LEN);
if (ret != HDCP_2_2_DP_RXSTATUS_LEN) {
drm_dbg_kms(display->drm,
"Read bstatus from DP/AUX failed (%zd)\n", ret);
return ret >= 0 ? -EIO : ret;
}
return 0;
}
static
int hdcp2_detect_msg_availability(struct intel_connector *connector,
u8 msg_id, bool *msg_ready)
{
u8 rx_status;
int ret;
*msg_ready = false;
ret = intel_dp_hdcp2_read_rx_status(connector, &rx_status);
if (ret < 0)
return ret;
switch (msg_id) {
case HDCP_2_2_AKE_SEND_HPRIME:
if (HDCP_2_2_DP_RXSTATUS_H_PRIME(rx_status))
*msg_ready = true;
break;
case HDCP_2_2_AKE_SEND_PAIRING_INFO:
Annotation
- Immediate include surface: `drm/display/drm_dp_helper.h`, `drm/display/drm_dp_mst_helper.h`, `drm/display/drm_hdcp_helper.h`, `drm/drm_print.h`, `intel_ddi.h`, `intel_de.h`, `intel_display_regs.h`, `intel_display_types.h`.
- Detected declarations: `struct hdcp2_dp_errata_stream_type`, `struct hdcp2_dp_msg_data`, `function Copyright`, `function intel_dp_hdcp_wait_for_cp_irq`, `function intel_dp_hdcp_write_an_aksv`, `function intel_dp_hdcp_read_bksv`, `function intel_dp_hdcp_read_bstatus`, `function intel_dp_hdcp_read_bcaps`, `function intel_dp_hdcp_repeater_present`, `function intel_dp_hdcp_read_ri_prime`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.