/**
* This function disables a HDCP port device.
*
* @param	InstancePtr is the device to disable.
*
* @return
*		- XST_SUCCESS if successful.
*
* @note		None.
*
******************************************************************************/
static int XHdcp1x_PortDpRxDisable(XHdcp1x *InstancePtr)
{
	XDprx *HwDp = InstancePtr->Port.PhyIfPtr;
	u32 IntMask = 0;
	u8 Offset = 0;
	u8 Value = 0;
	int NumLeft = 0;
	int Status = XST_SUCCESS;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->Port.PhyIfPtr != NULL);

	/* Disable interrupts */
	IntMask  = XDP_RX_INTERRUPT_MASK_HDCP_AKSV_WRITE_MASK;
	IntMask |= XDP_RX_INTERRUPT_MASK_HDCP_RO_READ_MASK;
	IntMask |= XDP_RX_INTERRUPT_MASK_HDCP_BINFO_READ_MASK;
	XDp_RxInterruptDisable(HwDp, IntMask);

	/* Clear hdcp registers */
	Value = 0;
	Offset = 0;
	NumLeft = 256;
	while (NumLeft-- > 0) {
		XHdcp1x_PortDpRxWrite(InstancePtr, Offset++, &Value,
								sizeof(Value));
	}

	return (Status);
}
/**
*
* This function is the callback function for when a vertical blank interrupt
* occurs.
*
* @param	InstancePtr is a pointer to the XDpRxSs instance.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
void DpRxSs_VerticalBlankHandler(void *InstancePtr)
{
	XDpRxSs *DpRxSsPtr = (XDpRxSs *)InstancePtr;
	u32 Status;

	if (DpRxSsPtr->VBlankEnable) {
		DpRxSsPtr->VBlankCount++;
		xil_printf("Interrupt: vertical blanking (frame %d).\n",
						DpRxSsPtr->VBlankCount);

		/* Wait until 20 frames have been received before forwarding or
		 * outputting any video stream. */
		if (DpRxSsPtr->VBlankCount >= 20) {
			DpRxSsPtr->VBlankEnable = 0;
			DpRxSsPtr->VBlankCount = 0;
			XDp_RxInterruptDisable(DpRxSsPtr->DpPtr,
					XDP_RX_INTERRUPT_MASK_VBLANK_MASK);

			Status = XDpRxSs_CheckLinkStatus(InstancePtr);
			if (Status == XST_SUCCESS) {
				/* User is responsible for resetting the video
				 * pipe.
				 */

				/* Detect resolution */
				DpRxSs_DetectResolution(InstancePtr);
			}
		}
	}
}
示例#3
0
/**
 * This function is the callback function for when a vertical blanking interrupt
 * occurs.
 *
 * @param	InstancePtr is a pointer to the XDp instance.
 *
 * @return	None.
 *
 * @note	None.
 *
*******************************************************************************/
static void Dprx_InterruptHandlerVBlank(void *InstancePtr)
{
    u32 Status;

    if (VBlankEnable) {
        VBlankCount++;

        xil_printf("> Interrupt: vertical blanking (frame %d).\n",
                   VBlankCount);

        /* Wait until 20 frames have been received before forwarding or
         * outputting any video stream. */
        if (VBlankCount >= 20) {
            VBlankEnable = 0;
            XDp_RxInterruptDisable(InstancePtr,
                                   XDP_RX_INTERRUPT_MASK_VBLANK_MASK);

            Status = XDp_RxCheckLinkStatus(InstancePtr);
            if (Status == XST_SUCCESS) {
                Dprx_ResetVideoOutput(InstancePtr);
                Dprx_DetectResolution(InstancePtr);
            }
        }
    }
}