XilinxProcessorIPLib/drivers/v_hdmitxss1/src/xv_hdmitxss1_hdcp.c
int XV_HdmiTxSs1_HdcpAuthRequest(XV_HdmiTxSs1 *InstancePtr)
{
  /* Verify argument. */
  Xil_AssertNonvoid(InstancePtr != NULL);

  int Status = XST_FAILURE;

  /* Always disable encryption */
  if (XV_HdmiTxSs1_HdcpDisableEncryption(InstancePtr) != XST_SUCCESS) {
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
    return XST_FAILURE;
  }

  /* Verify if sink is attached */
  if (!XV_HdmiTx1_IsStreamConnected(InstancePtr->HdmiTx1Ptr)) {
    xdbg_printf(XDBG_DEBUG_GENERAL, "No sink is attached\r\n");
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
    return XST_FAILURE;
  }

#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
  /* Authenticate HDCP 2.2, takes priority */
  if ((InstancePtr->Hdcp22Ptr) &&
      (InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_22 ||
       InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_BOTH)) {
    if (XV_HdmiTxSs1_IsSinkHdcp22Capable(InstancePtr)) {
      xdbg_printf(XDBG_DEBUG_GENERAL, "Starting HDCP 2.2 authentication\r\n");
#ifdef XV_HDMITXSS1_LOG_ENABLE
      XV_HdmiTxSs1_LogWrite(InstancePtr, XV_HDMITXSS1_LOG_EVT_HDCP22_AUTHREQ, 0);
#endif
	  Status = XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_22);
      Status |= XHdcp22Tx_Authenticate(InstancePtr->Hdcp22Ptr);
    }
    else {
      Status = XST_FAILURE;
      xdbg_printf(XDBG_DEBUG_GENERAL, "Sink is not HDCP 2.2 capable\r\n");
    }
  }
#endif

#ifdef XPAR_XHDCP_NUM_INSTANCES
  /* Authenticate HDCP 1.4 */
  if ((InstancePtr->Hdcp14Ptr) && (Status == XST_FAILURE) &&
      (InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_14 ||
       InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_BOTH)) {
    if (XV_HdmiTxSs1_IsSinkHdcp14Capable(InstancePtr)) {
      xdbg_printf(XDBG_DEBUG_GENERAL, "Starting HDCP 1.4 authentication\r\n");
#ifdef XV_HDMITXSS1_LOG_ENABLE
      XV_HdmiTxSs1_LogWrite(InstancePtr, XV_HDMITXSS1_LOG_EVT_HDCP14_AUTHREQ, 0);
#endif
      Status = XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_14);
      Status |= XHdcp1x_Authenticate(InstancePtr->Hdcp14Ptr);
    }
    else {
      Status = XST_FAILURE;
      xdbg_printf(XDBG_DEBUG_GENERAL, "Sink is not HDCP 1.4 capable\r\n");
    }
  }
#endif

  /* Set protocol to None */
  if (Status == XST_FAILURE) {
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
  }

  return (Status == XST_SUCCESS) ? XST_SUCCESS : XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function sends an authentication request to the connected receiver.
* The HDCP protocol is determined automatically by checking the capabilities
* of the connected device. When the connected device supports both HDCP 1.4
* and HDCP 2.2, then HDCP 2.2 is given priority.
*
* @param InstancePtr is a pointer to the XV_HdmiTxSs1 instance.
*
* @return
*  - XST_SUCCESS if authentication started successfully
*  - XST_FAILURE if authentication did not start successfully
*
* @note   None.
*
******************************************************************************/
This function sends an authentication request to the connected receiver.
The HDCP protocol is determined automatically by checking the capabilities
of the connected device. When the connected device supports both HDCP 1.4
and HDCP 2.2, then HDCP 2.2 is given priority.
This function sends an authentication request to the connected receiver . The HDCP protocol is determined automatically by checking the capabilities of the connected device . When the connected device supports both HDCP 1 . 4 and HDCP 2 . 2 then HDCP 2 . 2 is given priority .
int XV_HdmiTxSs1_HdcpAuthRequest(XV_HdmiTxSs1 *InstancePtr)
{
  Xil_AssertNonvoid(InstancePtr != NULL);
  int Status = XST_FAILURE;
  if (XV_HdmiTxSs1_HdcpDisableEncryption(InstancePtr) != XST_SUCCESS) {
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
    return XST_FAILURE;
  }
  if (!XV_HdmiTx1_IsStreamConnected(InstancePtr->HdmiTx1Ptr)) {
    xdbg_printf(XDBG_DEBUG_GENERAL, "No sink is attached\r\n");
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
    return XST_FAILURE;
  }
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
  if ((InstancePtr->Hdcp22Ptr) &&
      (InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_22 ||
       InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_BOTH)) {
    if (XV_HdmiTxSs1_IsSinkHdcp22Capable(InstancePtr)) {
      xdbg_printf(XDBG_DEBUG_GENERAL, "Starting HDCP 2.2 authentication\r\n");
#ifdef XV_HDMITXSS1_LOG_ENABLE
      XV_HdmiTxSs1_LogWrite(InstancePtr, XV_HDMITXSS1_LOG_EVT_HDCP22_AUTHREQ, 0);
#endif
	  Status = XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_22);
      Status |= XHdcp22Tx_Authenticate(InstancePtr->Hdcp22Ptr);
    }
    else {
      Status = XST_FAILURE;
      xdbg_printf(XDBG_DEBUG_GENERAL, "Sink is not HDCP 2.2 capable\r\n");
    }
  }
#endif
#ifdef XPAR_XHDCP_NUM_INSTANCES
  if ((InstancePtr->Hdcp14Ptr) && (Status == XST_FAILURE) &&
      (InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_14 ||
       InstancePtr->HdcpCapability == XV_HDMITXSS1_HDCP_BOTH)) {
    if (XV_HdmiTxSs1_IsSinkHdcp14Capable(InstancePtr)) {
      xdbg_printf(XDBG_DEBUG_GENERAL, "Starting HDCP 1.4 authentication\r\n");
#ifdef XV_HDMITXSS1_LOG_ENABLE
      XV_HdmiTxSs1_LogWrite(InstancePtr, XV_HDMITXSS1_LOG_EVT_HDCP14_AUTHREQ, 0);
#endif
      Status = XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_14);
      Status |= XHdcp1x_Authenticate(InstancePtr->Hdcp14Ptr);
    }
    else {
      Status = XST_FAILURE;
      xdbg_printf(XDBG_DEBUG_GENERAL, "Sink is not HDCP 1.4 capable\r\n");
    }
  }
#endif
  if (Status == XST_FAILURE) {
    XV_HdmiTxSs1_HdcpSetProtocol(InstancePtr, XV_HDMITXSS1_HDCP_NONE);
  }
  return (Status == XST_SUCCESS) ? XST_SUCCESS : XST_FAILURE;
}
int XV_HdmiTxSs1_HdcpAuthRequest ( XV_HdmiTxSs1 * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; int Status = XST_FAILURE ; if ( XV_HdmiTxSs1_HdcpDisableEncryption ( InstancePtr ) != XST_SUCCESS ) { XV_HdmiTxSs1_HdcpSetProtocol ( InstancePtr , XV_HDMITXSS1_HDCP_NONE ) ; return XST_FAILURE ; } if ( ! XV_HdmiTx1_IsStreamConnected ( InstancePtr -> HdmiTx1Ptr ) ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; XV_HdmiTxSs1_HdcpSetProtocol ( InstancePtr , XV_HDMITXSS1_HDCP_NONE ) ; return XST_FAILURE ; } #ifdef XPAR_XHDCP22_TX_NUM_INSTANCES if ( ( InstancePtr -> Hdcp22Ptr ) && ( InstancePtr -> HdcpCapability == XV_HDMITXSS1_HDCP_22 || InstancePtr -> HdcpCapability == XV_HDMITXSS1_HDCP_BOTH ) ) { if ( XV_HdmiTxSs1_IsSinkHdcp22Capable ( InstancePtr ) ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; #ifdef XV_HDMITXSS1_LOG_ENABLE XV_HdmiTxSs1_LogWrite ( InstancePtr , XV_HDMITXSS1_LOG_EVT_HDCP22_AUTHREQ , 0 ) ; #endif Status = XV_HdmiTxSs1_HdcpSetProtocol ( InstancePtr , XV_HDMITXSS1_HDCP_22 ) ; Status |= XHdcp22Tx_Authenticate ( InstancePtr -> Hdcp22Ptr ) ; } else { Status = XST_FAILURE ; xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; } } #endif #ifdef XPAR_XHDCP_NUM_INSTANCES if ( ( InstancePtr -> Hdcp14Ptr ) && ( Status == XST_FAILURE ) && ( InstancePtr -> HdcpCapability == XV_HDMITXSS1_HDCP_14 || InstancePtr -> HdcpCapability == XV_HDMITXSS1_HDCP_BOTH ) ) { if ( XV_HdmiTxSs1_IsSinkHdcp14Capable ( InstancePtr ) ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; #ifdef XV_HDMITXSS1_LOG_ENABLE XV_HdmiTxSs1_LogWrite ( InstancePtr , XV_HDMITXSS1_LOG_EVT_HDCP14_AUTHREQ , 0 ) ; #endif Status = XV_HdmiTxSs1_HdcpSetProtocol ( InstancePtr , XV_HDMITXSS1_HDCP_14 ) ; Status |= XHdcp1x_Authenticate ( InstancePtr -> Hdcp14Ptr ) ; } else { Status = XST_FAILURE ; xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; } } #endif if ( Status == XST_FAILURE ) { XV_HdmiTxSs1_HdcpSetProtocol ( InstancePtr , XV_HDMITXSS1_HDCP_NONE ) ; } return ( Status == XST_SUCCESS ) ? XST_SUCCESS : XST_FAILURE ; }
This function sends an authentication request to the connected receiver.
This function sends an authentication request to the connected receiver .
/* Verify argument. */ /* Always disable encryption */ /* Verify if sink is attached */ /* Authenticate HDCP 2.2, takes priority */ /* Authenticate HDCP 1.4 */ /* Set protocol to None */