Commit c065e463 authored by Lizhi Hou's avatar Lizhi Hou
Browse files

accel/amdxdna: Support submit commands without arguments



The latest userspace runtime allows generating commands which do not
have any argument. Remove the corresponding check in driver IOCTL to
enable this use case.

Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarLizhi Hou <lizhi.hou@amd.com>
Link: https://lore.kernel.org/r/20250507161500.2339701-1-lizhi.hou@amd.com
Link: https://lore.kernel.org/r/20250507161500.2339701-1-lizhi.hou@amd.com
parent 4fca6849
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -496,11 +496,11 @@ static int amdxdna_drm_submit_execbuf(struct amdxdna_client *client,
				      struct amdxdna_drm_exec_cmd *args)
{
	struct amdxdna_dev *xdna = client->xdna;
	u32 *arg_bo_hdls;
	u32 *arg_bo_hdls = NULL;
	u32 cmd_bo_hdl;
	int ret;

	if (!args->arg_count || args->arg_count > MAX_ARG_COUNT) {
	if (args->arg_count > MAX_ARG_COUNT) {
		XDNA_ERR(xdna, "Invalid arg bo count %d", args->arg_count);
		return -EINVAL;
	}
@@ -512,6 +512,7 @@ static int amdxdna_drm_submit_execbuf(struct amdxdna_client *client,
	}

	cmd_bo_hdl = (u32)args->cmd_handles;
	if (args->arg_count) {
		arg_bo_hdls = kcalloc(args->arg_count, sizeof(u32), GFP_KERNEL);
		if (!arg_bo_hdls)
			return -ENOMEM;
@@ -521,6 +522,7 @@ static int amdxdna_drm_submit_execbuf(struct amdxdna_client *client,
			ret = -EFAULT;
			goto free_cmd_bo_hdls;
		}
	}

	ret = amdxdna_cmd_submit(client, cmd_bo_hdl, arg_bo_hdls,
				 args->arg_count, args->hwctx, &args->seq);