From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8E9030C177 for ; Sat, 5 Sep 2026 00:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788569030; cv=none; b=Ov4gdQhe4mcGhyQ2YL1ihJOzuOfFJVuF9OBpU2IQsnYzfr+PzuJZZHUyyYGBz5PqrlFKurW5EQID+mvQdF1apbgKA/Ds45sMbLxFTXEYbjVqNZzbXvVYXFjTX5RVXwo5qK/nt6WMIf+dDtlNWYkANSTaxdupyKvIDLJCBKsvnRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788569030; c=relaxed/simple; bh=7eUBDLudMkGkT63X+Dx93W3Wqkc9rmjtXvjtp4sc9FU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mQ6Z+J1fcTndoVMa4eh5445z6EryOTnDLpGxpiNpXFDfb42sCx0MTjjlv8IK2V8RQCyfhKszYQgWAPKvk8T/Cc0XbS4kyrmgFE1UavOVQtmGPlNwNtNgfje58vXtln/ik3Qupn+vlpFJA0pr8bOO1xR27NylTKiCzfNLLfMOk8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BVCu0lFz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BVCu0lFz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56EBA1F00A3E; Sat, 5 Sep 2026 00:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788569028; bh=mTQURhigd+JG9LmMdZx3Ar/nyO0G3Iv5Sv1pMVcbF2I=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BVCu0lFzOAo5srtX0gxb4xUVdOYxgIqnnaIMuHABL+VjHPT6SEP54HOKxQJL4T2Rl ijIWtfPDeyrTDAVO+5d+idRbFYb8E1TVQCdaNZZfAv811MF+eXaPDaOed27N/8aNz3 T2N4V2Jl5xStO3wE3WbBHvszOxhPjNAS4Zpu31FEixsdQ004QO+vWB5Kr26h9JTo5I jA89TUfes6C4VA2wtx3S75jjWL2L1L9LmFHryPSDBEjKABkRu9p6H52nRTPMT+zQUO qKp3qxUjqqzRgU5QxwiHZRsiIjREB7n+5wuZ4b/x3ty8D4mpwbe0jCWkSkceI2TcOS WGptfxh2uBoAA== From: "Rob Herring (Arm)" Date: Fri, 04 Sep 2026 19:43:24 -0500 Subject: [PATCH v2 05/19] accel: ethosu: Move DMA mode to src/dst struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260904-ethosu-fixes-v2-5-3767738756a4@kernel.org> References: <20260904-ethosu-fixes-v2-0-3767738756a4@kernel.org> In-Reply-To: <20260904-ethosu-fixes-v2-0-3767738756a4@kernel.org> To: Tomeu Vizoso , Oded Gabbay , Frank Li , Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16-dev The DMA mode setting is independent for source and destination, so it should be part of the src/dst struct dma rather than the global DMA state. Signed-off-by: Rob Herring (Arm) --- drivers/accel/ethosu/ethosu_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 9afe2549ec84..408b93350dd7 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -100,6 +100,7 @@ int ethosu_gem_create_with_handle(struct drm_file *file, struct dma { s8 region; + s8 mode; u64 len; u64 offset; s64 stride[2]; @@ -108,7 +109,6 @@ struct dma { struct dma_state { u16 size0; u16 size1; - s8 mode; struct dma src; struct dma dst; }; @@ -161,7 +161,7 @@ static u64 cmd_to_addr(u32 *cmd) static u64 dma_length(struct ethosu_validated_cmdstream_info *info, struct dma_state *dma_st, struct dma *dma) { - s8 mode = dma_st->mode; + s8 mode = dma->mode; u64 len = dma->len; if (len == U64_MAX) @@ -654,13 +654,14 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, st.dma.src.region = -1; else st.dma.src.region = param & 0x7; - st.dma.mode = (param >> 9) & 0x3; + st.dma.src.mode = (param >> 9) & 0x3; break; case NPU_SET_DMA0_DST_REGION: if (param & 0x100) st.dma.dst.region = -1; else st.dma.dst.region = param & 0x7; + st.dma.dst.mode = (param >> 9) & 0x3; break; case NPU_SET_DMA0_SIZE0: st.dma.size0 = param; -- 2.53.0