/* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD *
*/
if (is_hdcp1(hdcp)) {
hdcp->connection.hdcp1_retry_count++; if (hdcp->connection.hdcp1_retry_count == MAX_NUM_OF_ATTEMPTS)
hdcp->connection.link.adjust.hdcp1.disable = 1;
} elseif (is_hdcp2(hdcp)) {
hdcp->connection.hdcp2_retry_count++; if (hdcp->connection.hdcp2_retry_count == MAX_NUM_OF_ATTEMPTS)
hdcp->connection.link.adjust.hdcp2.disable = 1;
}
}
static uint8_t is_cp_desired_hdcp1(struct mod_hdcp *hdcp)
{ int i, is_auth_needed = 0;
/* if all displays on the link don't need authentication, * hdcp is not desired
*/ for (i = 0; i < MAX_NUM_OF_DISPLAYS; i++) { if (hdcp->displays[i].state != MOD_HDCP_DISPLAY_INACTIVE &&
hdcp->displays[i].adjust.disable != MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION) {
is_auth_needed = 1; break;
}
}
static uint8_t is_cp_desired_hdcp2(struct mod_hdcp *hdcp)
{ int i, is_auth_needed = 0;
/* if all displays on the link don't need authentication, * hdcp is not desired
*/ for (i = 0; i < MAX_NUM_OF_DISPLAYS; i++) { if (hdcp->displays[i].state != MOD_HDCP_DISPLAY_INACTIVE &&
hdcp->displays[i].adjust.disable != MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION) {
is_auth_needed = 1; break;
}
}
if (is_hdcp1(hdcp)) { if (hdcp->auth.trans_input.hdcp1.create_session != UNKNOWN) { /* TODO - update psp to unify create session failure * recovery between hdcp1 and 2.
*/
mod_hdcp_hdcp1_destroy_session(hdcp);
/* set new adjustment */
hdcp->connection.link.adjust = *link_adjust;
display->adjust = *display_adjust;
/* request authentication when connection is not reset */ if (current_state(hdcp) != HDCP_UNINITIALIZED) /* wait 100ms to debounce simultaneous updates for different indices */
callback_in_ms(100, output);
out: if (status != MOD_HDCP_STATUS_SUCCESS)
push_error_status(hdcp, status); return status;
}
/* execute and transition */
exec_status = execution(hdcp, &event_ctx, &hdcp->auth.trans_input);
trans_status = transition(
hdcp, &event_ctx, &hdcp->auth.trans_input, output); if (trans_status == MOD_HDCP_STATUS_SUCCESS) {
status = MOD_HDCP_STATUS_SUCCESS;
} elseif (exec_status == MOD_HDCP_STATUS_SUCCESS) {
status = MOD_HDCP_STATUS_INTERNAL_POLICY_FAILURE;
push_error_status(hdcp, status);
} else {
status = exec_status;
push_error_status(hdcp, status);
}
/* reset authentication if needed */ if (trans_status == MOD_HDCP_STATUS_RESET_NEEDED) {
mod_hdcp_log_ddc_trace(hdcp);
reset_status = reset_authentication(hdcp, output); if (reset_status != MOD_HDCP_STATUS_SUCCESS)
push_error_status(hdcp, reset_status);
}
/* Clear CP_IRQ status if needed */ if (event_ctx.event == MOD_HDCP_EVENT_CPIRQ) {
status = mod_hdcp_clear_cp_irq_status(hdcp); if (status != MOD_HDCP_STATUS_SUCCESS)
push_error_status(hdcp, status);
}
switch (signal) { case SIGNAL_TYPE_DVI_SINGLE_LINK: case SIGNAL_TYPE_HDMI_TYPE_A:
mode = MOD_HDCP_MODE_DEFAULT; break; case SIGNAL_TYPE_EDP: case SIGNAL_TYPE_DISPLAY_PORT: case SIGNAL_TYPE_DISPLAY_PORT_MST:
mode = MOD_HDCP_MODE_DP; break; default: break;
}
return mode;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.