drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c- Extension
.c- Size
- 39635 bytes
- Lines
- 1034
- 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
hdcp.hamdgpu.hhdcp_psp.h
Detected Declarations
function filesfunction remove_display_from_topology_v2function remove_display_from_topology_v3function add_display_to_topology_v2function add_display_to_topology_v3function mod_hdcp_remove_display_from_topologyfunction mod_hdcp_add_display_to_topologyfunction mod_hdcp_hdcp1_create_sessionfunction mod_hdcp_hdcp1_destroy_sessionfunction mod_hdcp_hdcp1_validate_rxfunction mod_hdcp_hdcp1_enable_encryptionfunction mod_hdcp_hdcp1_validate_ksvlist_vpfunction mod_hdcp_hdcp1_enable_dp_stream_encryptionfunction mod_hdcp_hdcp1_link_maintenancefunction mod_hdcp_hdcp2_create_sessionfunction mod_hdcp_hdcp2_destroy_sessionfunction mod_hdcp_hdcp2_prepare_ake_initfunction mod_hdcp_hdcp2_validate_ake_certfunction mod_hdcp_hdcp2_validate_h_primefunction mod_hdcp_hdcp2_prepare_lc_initfunction mod_hdcp_hdcp2_validate_l_primefunction mod_hdcp_hdcp2_prepare_eksfunction mod_hdcp_hdcp2_enable_encryptionfunction mod_hdcp_hdcp2_validate_rx_id_listfunction mod_hdcp_hdcp2_enable_dp_stream_encryptionfunction mod_hdcp_hdcp2_prepare_stream_managementfunction mod_hdcp_hdcp2_validate_stream_ready
Annotated Snippet
if (is_display_encryption_enabled(&hdcp->displays[i])) {
hdcp->displays[i].state =
MOD_HDCP_DISPLAY_ACTIVE;
HDCP_HDCP1_DISABLED_TRACE(
hdcp, hdcp->displays[i].index);
}
}
mutex_unlock(&psp->hdcp_context.mutex);
return status;
}
enum mod_hdcp_status mod_hdcp_hdcp1_validate_rx(struct mod_hdcp *hdcp)
{
struct psp_context *psp = hdcp->config.psp.handle;
struct ta_hdcp_shared_memory *hdcp_cmd;
enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS;
mutex_lock(&psp->hdcp_context.mutex);
hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf;
memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory));
hdcp_cmd->in_msg.hdcp1_first_part_authentication.session_handle = hdcp->auth.id;
memcpy(hdcp_cmd->in_msg.hdcp1_first_part_authentication.bksv_primary, hdcp->auth.msg.hdcp1.bksv,
TA_HDCP__HDCP1_KSV_SIZE);
hdcp_cmd->in_msg.hdcp1_first_part_authentication.r0_prime_primary = hdcp->auth.msg.hdcp1.r0p;
hdcp_cmd->in_msg.hdcp1_first_part_authentication.bcaps = hdcp->auth.msg.hdcp1.bcaps;
hdcp_cmd->cmd_id = TA_HDCP_COMMAND__HDCP1_FIRST_PART_AUTHENTICATION;
psp_hdcp_invoke(psp, hdcp_cmd->cmd_id);
if (hdcp_cmd->hdcp_status != TA_HDCP_STATUS__SUCCESS) {
status = MOD_HDCP_STATUS_HDCP1_VALIDATE_RX_FAILURE;
} else if (hdcp_cmd->out_msg.hdcp1_first_part_authentication.authentication_status ==
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_FIRST_PART_COMPLETE) {
/* needs second part of authentication */
hdcp->connection.is_repeater = 1;
} else if (hdcp_cmd->out_msg.hdcp1_first_part_authentication.authentication_status ==
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_AUTHENTICATED) {
hdcp->connection.is_repeater = 0;
} else if (hdcp_cmd->out_msg.hdcp1_first_part_authentication.authentication_status ==
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_KSV_REVOKED) {
hdcp->connection.is_hdcp1_revoked = 1;
status = MOD_HDCP_STATUS_HDCP1_BKSV_REVOKED;
} else
status = MOD_HDCP_STATUS_HDCP1_VALIDATE_RX_FAILURE;
mutex_unlock(&psp->hdcp_context.mutex);
return status;
}
enum mod_hdcp_status mod_hdcp_hdcp1_enable_encryption(struct mod_hdcp *hdcp)
{
struct psp_context *psp = hdcp->config.psp.handle;
struct ta_hdcp_shared_memory *hdcp_cmd;
struct mod_hdcp_display *display = get_first_active_display(hdcp);
enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS;
if (!display)
return MOD_HDCP_STATUS_DISPLAY_NOT_FOUND;
mutex_lock(&psp->hdcp_context.mutex);
hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf;
memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory));
hdcp_cmd->in_msg.hdcp1_enable_encryption.session_handle = hdcp->auth.id;
hdcp_cmd->cmd_id = TA_HDCP_COMMAND__HDCP1_ENABLE_ENCRYPTION;
psp_hdcp_invoke(psp, hdcp_cmd->cmd_id);
if (hdcp_cmd->hdcp_status != TA_HDCP_STATUS__SUCCESS) {
status = MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION_FAILURE;
} else if (!is_dp_mst_hdcp(hdcp)) {
display->state = MOD_HDCP_DISPLAY_ENCRYPTION_ENABLED;
HDCP_HDCP1_ENABLED_TRACE(hdcp, display->index);
}
mutex_unlock(&psp->hdcp_context.mutex);
return status;
}
enum mod_hdcp_status mod_hdcp_hdcp1_validate_ksvlist_vp(struct mod_hdcp *hdcp)
{
struct psp_context *psp = hdcp->config.psp.handle;
struct ta_hdcp_shared_memory *hdcp_cmd;
enum mod_hdcp_status status = MOD_HDCP_STATUS_SUCCESS;
mutex_lock(&psp->hdcp_context.mutex);
Annotation
- Immediate include surface: `hdcp.h`, `amdgpu.h`, `hdcp_psp.h`.
- Detected declarations: `function files`, `function remove_display_from_topology_v2`, `function remove_display_from_topology_v3`, `function add_display_to_topology_v2`, `function add_display_to_topology_v3`, `function mod_hdcp_remove_display_from_topology`, `function mod_hdcp_add_display_to_topology`, `function mod_hdcp_hdcp1_create_session`, `function mod_hdcp_hdcp1_destroy_session`, `function mod_hdcp_hdcp1_validate_rx`.
- 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.