XilinxProcessorIPLib/drivers/v_hdmitxss/examples/xhdmi_example/TxOnly/xhdcp.c
static void XHdcp_EnforceBlank(XHdcp_Repeater *InstancePtr)
{
  int Status;

  /* Verify arguments */
  Xil_AssertVoid(InstancePtr != NULL);


  /* Enforce downstream content blocking */
  for (int i = 0; (i < InstancePtr->DownstreamInstanceBinded); i++) {
      if (XV_HdmiTxSs_HdcpIsAuthenticated(InstancePtr->DownstreamInstancePtr[i])) {
        /* Check the downstream interface protocol */
        Status = XV_HdmiTxSs_HdcpGetProtocol(InstancePtr->DownstreamInstancePtr[i]);

        switch (Status) {

          /* HDCP 2.2
             Allow content under the following conditons:
             - Stream type is 0
             - Stream type is 1, and no HDCP 1.x devices are downstream,
               and no HDCP2 legacy devices are downstream. */
          case XV_HDMITXSS_HDCP_22:
            Status = XV_HdmiTxSs_HdcpGetTopologyField(
                       InstancePtr->DownstreamInstancePtr[i],
                       XV_HDMITXSS_HDCP_TOPOLOGY_HDCP2LEGACYDEVICEDOWNSTREAM);
            Status |= XV_HdmiTxSs_HdcpGetTopologyField(
                        InstancePtr->DownstreamInstancePtr[i],
                        XV_HDMITXSS_HDCP_TOPOLOGY_HDCP1DEVICEDOWNSTREAM);
            if ((InstancePtr->StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0) ||
                (Status == FALSE)) {
              XV_HdmiTxSs_HdcpDisableBlank(InstancePtr->DownstreamInstancePtr[i]);
            } else {
              Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
              if (Status != XST_SUCCESS) {
                xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
              }
            }
            break;

          /* HDCP 1.4
             Allow content when the stream type is 0 */
          case XV_HDMITXSS_HDCP_14:
            if (InstancePtr->StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0) {
              XV_HdmiTxSs_HdcpDisableBlank(InstancePtr->DownstreamInstancePtr[i]);
            } else {
              Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
              if (Status != XST_SUCCESS) {
                xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
              }
            }
            break;
        }
      } else {
        Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
        if (Status != XST_SUCCESS) {
          xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
        }
      }
  }
}
/*****************************************************************************/
/**
*
* This function enforces downstream content blocking based on the upstream
* encryption status and stream type information. When the content is required
* to be blocked, cipher output blanking is enabled.
*
* @param    HdcpInstancePtr is a pointer to the XHdcp_Repeater instance.
*
* @return   - XST_SUCCESS if blocking enforced successfully.
*           - XST_FAILURE if blocking could not be enforced.
*
* @note	    None.
*
******************************************************************************/
This function enforces downstream content blocking based on the upstream
encryption status and stream type information. When the content is required
to be blocked, cipher output blanking is enabled.
This function enforces downstream content blocking based on the upstream encryption status and stream type information . When the content is required to be blocked cipher output blanking is enabled .
static void XHdcp_EnforceBlank(XHdcp_Repeater *InstancePtr)
{
  int Status;
  Xil_AssertVoid(InstancePtr != NULL);
  for (int i = 0; (i < InstancePtr->DownstreamInstanceBinded); i++) {
      if (XV_HdmiTxSs_HdcpIsAuthenticated(InstancePtr->DownstreamInstancePtr[i])) {
        Status = XV_HdmiTxSs_HdcpGetProtocol(InstancePtr->DownstreamInstancePtr[i]);
        switch (Status) {
          case XV_HDMITXSS_HDCP_22:
            Status = XV_HdmiTxSs_HdcpGetTopologyField(
                       InstancePtr->DownstreamInstancePtr[i],
                       XV_HDMITXSS_HDCP_TOPOLOGY_HDCP2LEGACYDEVICEDOWNSTREAM);
            Status |= XV_HdmiTxSs_HdcpGetTopologyField(
                        InstancePtr->DownstreamInstancePtr[i],
                        XV_HDMITXSS_HDCP_TOPOLOGY_HDCP1DEVICEDOWNSTREAM);
            if ((InstancePtr->StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0) ||
                (Status == FALSE)) {
              XV_HdmiTxSs_HdcpDisableBlank(InstancePtr->DownstreamInstancePtr[i]);
            } else {
              Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
              if (Status != XST_SUCCESS) {
                xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
              }
            }
            break;
          case XV_HDMITXSS_HDCP_14:
            if (InstancePtr->StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0) {
              XV_HdmiTxSs_HdcpDisableBlank(InstancePtr->DownstreamInstancePtr[i]);
            } else {
              Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
              if (Status != XST_SUCCESS) {
                xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
              }
            }
            break;
        }
      } else {
        Status = XV_HdmiTxSs_HdcpEnableBlank(InstancePtr->DownstreamInstancePtr[i]);
        if (Status != XST_SUCCESS) {
          xdbg_printf(XDBG_DEBUG_GENERAL, "Error: Problem blocking downstream content.\r\n");
        }
      }
  }
}
static void XHdcp_EnforceBlank ( XHdcp_Repeater * InstancePtr ) { int Status ; Xil_AssertVoid ( InstancePtr != NULL ) ; for ( int i = 0 ; ( i < InstancePtr -> DownstreamInstanceBinded ) ; i ++ ) { if ( XV_HdmiTxSs_HdcpIsAuthenticated ( InstancePtr -> DownstreamInstancePtr [ i ] ) ) { Status = XV_HdmiTxSs_HdcpGetProtocol ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; switch ( Status ) { case XV_HDMITXSS_HDCP_22 : Status = XV_HdmiTxSs_HdcpGetTopologyField ( InstancePtr -> DownstreamInstancePtr [ i ] , XV_HDMITXSS_HDCP_TOPOLOGY_HDCP2LEGACYDEVICEDOWNSTREAM ) ; Status |= XV_HdmiTxSs_HdcpGetTopologyField ( InstancePtr -> DownstreamInstancePtr [ i ] , XV_HDMITXSS_HDCP_TOPOLOGY_HDCP1DEVICEDOWNSTREAM ) ; if ( ( InstancePtr -> StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0 ) || ( Status == FALSE ) ) { XV_HdmiTxSs_HdcpDisableBlank ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; } else { Status = XV_HdmiTxSs_HdcpEnableBlank ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; } } break ; case XV_HDMITXSS_HDCP_14 : if ( InstancePtr -> StreamType == XV_HDMITXSS_HDCP_STREAMTYPE_0 ) { XV_HdmiTxSs_HdcpDisableBlank ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; } else { Status = XV_HdmiTxSs_HdcpEnableBlank ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; } } break ; } } else { Status = XV_HdmiTxSs_HdcpEnableBlank ( InstancePtr -> DownstreamInstancePtr [ i ] ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \r \n " ) ; } } } }
This function enforces downstream content blocking based on the upstream
encryption status and stream type information.
This function enforces downstream content blocking based on the upstream encryption status and stream type information .
/* Verify arguments */ /* Enforce downstream content blocking */ /* Check the downstream interface protocol */ /* HDCP 2.2
             Allow content under the following conditons:
             - Stream type is 0
             - Stream type is 1, and no HDCP 1.x devices are downstream,
               and no HDCP2 legacy devices are downstream. */ /* HDCP 1.4
             Allow content when the stream type is 0 */