sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * cmd_done() - Check of a command is done
 * 
 * @cmd_idx: Slot index of command to check
 *
 * This function is called in polling mode only.  The command
 * at cmd_idx is guaranteed to have been started on a CU.
 *
 * Return: %true if command is done, %false otherwise
 */
Check of a command is done

@cmd_idx: Slot index of command to check

This function is called in polling mode only.  The command
at cmd_idx is guaranteed to have been started on a CU.

%true if command is done, %false otherwise
Check of a command is done @cmd_idx : Slot index of command to check This function is called in polling mode only . The command at cmd_idx is guaranteed to have been started on a CU . %true if command is done %false otherwise
inline int
cmd_done(struct drm_xocl_dev *xdev, unsigned int cmd_idx)
{
	struct xocl_cmd *xcmd = xdev->exec.submitted_cmds[cmd_idx];
	u32 opc = 0;
	SCHED_DEBUGF("-> cmd_done(,%d)\n",cmd_idx);
	if (sched_error_on(xdev,!xcmd || xcmd->slot_idx!=cmd_idx,"no command or missing slot index"))
		return false;
	opc = opcode(xcmd);
	if (opc==ERT_START_CU) {
		int val = cu_done(xdev,get_cu_idx(xdev,cmd_idx));
		SCHED_DEBUGF("<- cmd_done (cu_done) returns %d\n",val);
		return val;
	}
	if (opc==ERT_CONFIGURE) {
		SCHED_DEBUG("<- cmd_done (configure) returns 1\n");
		return true;
	}
	SCHED_DEBUG("<- cmd_done returns 0\n");
	return false;
}
inline int cmd_done ( struct drm_xocl_dev * xdev , unsigned int cmd_idx ) { struct xocl_cmd * xcmd = xdev -> exec . submitted_cmds [ cmd_idx ] ; u32 opc = 0 ; SCHED_DEBUGF ( " \n " , cmd_idx ) ; if ( sched_error_on ( xdev , ! xcmd || xcmd -> slot_idx != cmd_idx , " " ) ) return false ; opc = opcode ( xcmd ) ; if ( opc == ERT_START_CU ) { int val = cu_done ( xdev , get_cu_idx ( xdev , cmd_idx ) ) ; SCHED_DEBUGF ( " \n " , val ) ; return val ; } if ( opc == ERT_CONFIGURE ) { SCHED_DEBUG ( " \n " ) ; return true ; } SCHED_DEBUG ( " \n " ) ; return false ; }
cmd_done() - Check of a command is done
cmd_done () - Check of a command is done