sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * mb_query() - Check command status of argument command
 *
 * @xcmd: Command to check
 *
 * This function is for ERT mode.  In polling mode, check the command status
 * register containing the slot assigned to the command.  In interrupt mode
 * check the interrupting status register.  The function checks all commands in
 * the same command status register as argument command so more than one
 * command may be marked complete by this function.
 */
Check command status of argument command
@xcmd: Command to check

This function is for ERT mode.  In polling mode, check the command status
register containing the slot assigned to the command.  In interrupt mode
check the interrupting status register.  The function checks all commands in
the same command status register as argument command so more than one
command may be marked complete by this function.
Check command status of argument command @xcmd : Command to check This function is for ERT mode . In polling mode check the command status register containing the slot assigned to the command . In interrupt mode check the interrupting status register . The function checks all commands in the same command status register as argument command so more than one command may be marked complete by this function .
static void
mb_query(struct xocl_cmd *xcmd)
{
	struct drm_xocl_dev *xdev = xcmd->xdev;
	unsigned int cmd_mask_idx = slot_mask_idx(xcmd->slot_idx);
	SCHED_DEBUGF("-> mb_query slot_idx=%d, cmd_mask_idx=%d\n",xcmd->slot_idx,cmd_mask_idx);
	if (xdev->exec.polling_mode
	    || (cmd_mask_idx==0 && atomic_read(&xdev->exec.sr0))
	    || (cmd_mask_idx==1 && atomic_read(&xdev->exec.sr1))
	    || (cmd_mask_idx==2 && atomic_read(&xdev->exec.sr2))
	    || (cmd_mask_idx==3 && atomic_read(&xdev->exec.sr3))) {
		u32 csr_addr = ERT_STATUS_REGISTER_ADDR + (cmd_mask_idx<<2);
		u32 mask = ioread32(xcmd->xdev->user_bar + csr_addr);
		if (mask)
			mark_mask_complete(xcmd->xdev,mask,cmd_mask_idx);
		SCHED_DEBUGF("++ mb_query csr_addr=0x%x mask=0x%x\n",csr_addr,mask);
	}
	SCHED_DEBUGF("<- mb_query\n");
}
static void mb_query ( struct xocl_cmd * xcmd ) { struct drm_xocl_dev * xdev = xcmd -> xdev ; unsigned int cmd_mask_idx = slot_mask_idx ( xcmd -> slot_idx ) ; SCHED_DEBUGF ( " \n " , xcmd -> slot_idx , cmd_mask_idx ) ; if ( xdev -> exec . polling_mode || ( cmd_mask_idx == 0 && atomic_read ( & xdev -> exec . sr0 ) ) || ( cmd_mask_idx == 1 && atomic_read ( & xdev -> exec . sr1 ) ) || ( cmd_mask_idx == 2 && atomic_read ( & xdev -> exec . sr2 ) ) || ( cmd_mask_idx == 3 && atomic_read ( & xdev -> exec . sr3 ) ) ) { u32 csr_addr = ERT_STATUS_REGISTER_ADDR + ( cmd_mask_idx << 2 ) ; u32 mask = ioread32 ( xcmd -> xdev -> user_bar + csr_addr ) ; if ( mask ) mark_mask_complete ( xcmd -> xdev , mask , cmd_mask_idx ) ; SCHED_DEBUGF ( " \n " , csr_addr , mask ) ; } SCHED_DEBUGF ( " \n " ) ; }
mb_query() - Check command status of argument command
 @xcmd: Command to check
mb_query () - Check command status of argument command @xcmd : Command to check