Commit 45f673e6 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher
Browse files

drm/amd/display: add mod hdcp interface for supporting encryption state query

parent 4fe1fdcc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -314,6 +314,9 @@ enum mod_hdcp_status mod_hdcp_add_display(struct mod_hdcp *hdcp,
		goto out;
	}

	/* save current encryption states to restore after next authentication */
	mod_hdcp_save_current_encryption_states(hdcp);

	/* reset existing authentication status */
	status = reset_authentication(hdcp, output);
	if (status != MOD_HDCP_STATUS_SUCCESS)
@@ -360,6 +363,9 @@ enum mod_hdcp_status mod_hdcp_remove_display(struct mod_hdcp *hdcp,
		goto out;
	}

	/* save current encryption states to restore after next authentication */
	mod_hdcp_save_current_encryption_states(hdcp);

	/* stop current authentication */
	status = reset_authentication(hdcp, output);
	if (status != MOD_HDCP_STATUS_SUCCESS)
+2 −2
Original line number Diff line number Diff line
@@ -331,6 +331,8 @@ enum mod_hdcp_status mod_hdcp_add_display_to_topology(
		struct mod_hdcp *hdcp, struct mod_hdcp_display *display);
enum mod_hdcp_status mod_hdcp_remove_display_from_topology(
		struct mod_hdcp *hdcp, uint8_t index);
bool mod_hdcp_is_link_encryption_enabled(struct mod_hdcp *hdcp);
void mod_hdcp_save_current_encryption_states(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_create_session(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_destroy_session(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_validate_rx(struct mod_hdcp *hdcp);
@@ -339,8 +341,6 @@ enum mod_hdcp_status mod_hdcp_hdcp1_validate_ksvlist_vp(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_enable_dp_stream_encryption(
	struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_link_maintenance(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp1_get_link_encryption_status(struct mod_hdcp *hdcp,
							       enum mod_hdcp_encryption_status *encryption_status);
enum mod_hdcp_status mod_hdcp_hdcp2_create_session(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp2_destroy_session(struct mod_hdcp *hdcp);
enum mod_hdcp_status mod_hdcp_hdcp2_prepare_ake_init(struct mod_hdcp *hdcp);
+22 −15
Original line number Diff line number Diff line
@@ -256,10 +256,12 @@ static enum mod_hdcp_status authenticated(struct mod_hdcp *hdcp,
		goto out;
	}

	if (!mod_hdcp_execute_and_set(mod_hdcp_hdcp1_link_maintenance,
	mod_hdcp_execute_and_set(mod_hdcp_hdcp1_link_maintenance,
			&input->link_maintenance, &status,
			hdcp, "link_maintenance"))
		goto out;
			hdcp, "link_maintenance");

	if (status != MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_save_current_encryption_states(hdcp);
out:
	return status;
}
@@ -425,19 +427,24 @@ static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp,
		event_ctx->unexpected_event = 1;
		goto out;
	}
	if (!mod_hdcp_is_link_encryption_enabled(hdcp))
		goto out;

	if (!mod_hdcp_execute_and_set(mod_hdcp_read_bstatus,
	if (status == MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_execute_and_set(mod_hdcp_read_bstatus,
				&input->bstatus_read, &status,
			hdcp, "bstatus_read"))
		goto out;
	if (!mod_hdcp_execute_and_set(check_link_integrity_dp,
				hdcp, "bstatus_read");
	if (status == MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_execute_and_set(check_link_integrity_dp,
				&input->link_integrity_check, &status,
			hdcp, "link_integrity_check"))
		goto out;
	if (!mod_hdcp_execute_and_set(check_no_reauthentication_request_dp,
				hdcp, "link_integrity_check");
	if (status == MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_execute_and_set(check_no_reauthentication_request_dp,
				&input->reauth_request_check, &status,
			hdcp, "reauth_request_check"))
		goto out;
				hdcp, "reauth_request_check");

	if (status != MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_save_current_encryption_states(hdcp);
out:
	return status;
}
+3 −3
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ enum mod_hdcp_status mod_hdcp_hdcp1_transition(struct mod_hdcp *hdcp,
		}
		break;
	case H1_A45_AUTHENTICATED:
		if (input->link_maintenance != PASS) {
		if (input->link_maintenance == FAIL) {
			/* 1A-07: consider invalid ri' a failure */
			/* 1A-07a: consider read ri' not returned a failure */
			fail_and_restart_in_ms(0, &status, output);
@@ -243,8 +243,8 @@ enum mod_hdcp_status mod_hdcp_hdcp1_dp_transition(struct mod_hdcp *hdcp,
		}
		break;
	case D1_A4_AUTHENTICATED:
		if (input->link_integrity_check != PASS ||
				input->reauth_request_check != PASS) {
		if (input->link_integrity_check == FAIL ||
				input->reauth_request_check == FAIL) {
			/* 1A-07: restart hdcp on a link integrity failure */
			fail_and_restart_in_ms(0, &status, output);
			break;
+6 −4
Original line number Diff line number Diff line
@@ -564,11 +564,13 @@ static enum mod_hdcp_status authenticated(struct mod_hdcp *hdcp,
		event_ctx->unexpected_event = 1;
		goto out;
	}

	if (!process_rxstatus(hdcp, event_ctx, input, &status))
		goto out;
	if (event_ctx->rx_id_list_ready)
	if (!mod_hdcp_is_link_encryption_enabled(hdcp))
		goto out;

	process_rxstatus(hdcp, event_ctx, input, &status);

	if (status != MOD_HDCP_STATUS_SUCCESS)
		mod_hdcp_save_current_encryption_states(hdcp);
out:
	return status;
}
Loading