From: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
To: "Tomeu Vizoso" <tomeu@tomeuvizoso.net>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Oded Gabbay" <ogabbay@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v2 6/7] accel/rocket: Add job submission IOCTL
Date: Fri, 21 Mar 2025 10:09:05 -0600 [thread overview]
Message-ID: <4d617199-191c-47d9-a0f1-5bf9c149d09d@oss.qualcomm.com> (raw)
In-Reply-To: <20250225-6-10-rocket-v2-6-d4dbcfafc141@tomeuvizoso.net>
On 2/25/2025 12:55 AM, Tomeu Vizoso wrote:
> +/**
> + * struct drm_rocket_task - A task to be run on the NPU
> + *
> + * A task is the smallest unit of work that can be run on the NPU.
> + */
> +struct drm_rocket_task {
> + /** DMA address to NPU mapping of register command buffer */
> + __u64 regcmd;
> +
> + /** Number of commands in the register command buffer */
> + __u32 regcmd_count;
> +};
> +
> +/**
> + * struct drm_rocket_job - A job to be run on the NPU
> + *
> + * The kernel will schedule the execution of this job taking into account its
> + * dependencies with other jobs. All tasks in the same job will be executed
> + * sequentially on the same core, to benefit from memory residency in SRAM.
> + */
> +struct drm_rocket_job {
> + /** Pointer to an array of struct drm_rocket_task. */
> + __u64 tasks;
> +
> + /** Pointer to a u32 array of the BOs that are read by the job. */
> + __u64 in_bo_handles;
> +
> + /** Pointer to a u32 array of the BOs that are written to by the job. */
> + __u64 out_bo_handles;
> +
> + /** Number of tasks passed in. */
> + __u32 task_count;
> +
> + /** Number of input BO handles passed in (size is that times 4). */
> + __u32 in_bo_handle_count;
> +
> + /** Number of output BO handles passed in (size is that times 4). */
> + __u32 out_bo_handle_count;
> +};
> +
> +/**
> + * struct drm_rocket_submit - ioctl argument for submitting commands to the NPU.
> + *
> + * The kernel will schedule the execution of these jobs in dependency order.
> + */
> +struct drm_rocket_submit {
> + /** Pointer to an array of struct drm_rocket_job. */
> + __u64 jobs;
> +
> + /** Number of jobs passed in. */
> + __u32 job_count;
> +};
These 3 structs will be different sizes in 32-bit env vs 64-bit env. Yes
the driver depends on ARM64, but compat (32-bit userspace with 64-bit
kernel) is still possible. They should all be padded out to 64-bit
alignment. When you do that, you should specify that the padding must
be zero, and check for that in the driver so that you have the option to
use the padding in the future.
next prev parent reply other threads:[~2025-03-21 16:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 7:55 [PATCH v2 0/7] New DRM accel driver for Rockchip's RKNN NPU Tomeu Vizoso
2025-02-25 7:55 ` [PATCH v2 1/7] dt-bindings: npu: rockchip,rknn: Add bindings Tomeu Vizoso
2025-02-25 16:02 ` Rob Herring
2025-05-14 16:26 ` Tomeu Vizoso
2025-04-25 18:50 ` Nicolas Frattaroli
2025-05-14 15:18 ` Tomeu Vizoso
2025-05-14 17:50 ` Nicolas Frattaroli
2025-05-15 8:30 ` Tomeu Vizoso
2025-05-16 10:25 ` Nicolas Frattaroli
2025-05-16 10:56 ` Tomeu Vizoso
2025-02-25 7:55 ` [PATCH v2 2/7] arm64: dts: rockchip: Add nodes for NPU and its MMU to rk3588s Tomeu Vizoso
2025-02-25 7:55 ` [PATCH v2 3/7] arm64: dts: rockchip: Enable the NPU on quartzpro64 Tomeu Vizoso
2025-02-25 7:55 ` [PATCH v2 4/7] accel/rocket: Add a new driver for Rockchip's NPU Tomeu Vizoso
2025-02-25 8:21 ` Thomas Zimmermann
2025-03-21 15:48 ` Jeff Hugo
2025-04-25 18:22 ` Nicolas Frattaroli
2025-05-16 9:15 ` Tomeu Vizoso
2025-04-29 9:39 ` Nicolas Frattaroli
2025-02-25 7:55 ` [PATCH v2 5/7] accel/rocket: Add IOCTL for BO creation Tomeu Vizoso
2025-02-25 8:35 ` Thomas Zimmermann
2025-03-21 15:56 ` Jeffrey Hugo
2025-02-25 7:55 ` [PATCH v2 6/7] accel/rocket: Add job submission IOCTL Tomeu Vizoso
2025-02-25 8:44 ` Thomas Zimmermann
2025-03-21 16:09 ` Jeff Hugo [this message]
2025-04-29 10:05 ` Nicolas Frattaroli
2025-02-25 7:55 ` [PATCH v2 7/7] accel/rocket: Add IOCTLs for synchronizing memory accesses Tomeu Vizoso
2025-03-21 16:15 ` Jeffrey Hugo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d617199-191c-47d9-a0f1-5bf9c149d09d@oss.qualcomm.com \
--to=jeff.hugo@oss.qualcomm.com \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=krzk+dt@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=ogabbay@kernel.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=tomeu@tomeuvizoso.net \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).