mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sidong Yang <sidong.yang@furiosa.ai>
To: Ross Cawston <ross@r-sc.ca>
Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	Oded Gabbay <ogabbay@kernel.org>,
	 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>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] accel/rocket: Add per-task flags and interrupt mask to UAPI and kernel
Date: Sat, 5 Sep 2026 00:00:16 +0900	[thread overview]
Message-ID: <aprXAS8mkycmfM2n@rock-5b-plus> (raw)
In-Reply-To: <20260217-accel-rocket-clean-base-v1-3-d72354325a25@r-sc.ca>

On Tue, Feb 17, 2026 at 01:39:51PM -0800, Ross Cawston wrote:
> Add two new fields to struct drm_rocket_task (UAPI) and struct rocket_task
> (kernel):
> 
> - u32 int_mask: which block completion interrupt(s) should signal task done
> - u32 flags: currently only ROCKET_TASK_SKIP_CNA_CORE
> 
> In rocket_copy_tasks():
> - copy the new fields
> - default int_mask to DPU_0 | DPU_1 when userspace passes zero (backward compatible)
> 
> No functional change yet - old userspace continues to work unchanged.
> 
> Signed-off-by: Ross Cawston <ross@r-sc.ca>
> ---
>  drivers/accel/rocket/rocket_job.c |  8 ++++++++
>  drivers/accel/rocket/rocket_job.h |  2 ++
>  include/uapi/drm/rocket_accel.h   | 25 +++++++++++++++++++++++++
>  3 files changed, 35 insertions(+)
> 
> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> index 369b60805d5f..34898084cc56 100644
> --- a/drivers/accel/rocket/rocket_job.c
> +++ b/drivers/accel/rocket/rocket_job.c
> @@ -96,6 +96,14 @@ rocket_copy_tasks(struct drm_device *dev,
>  
>  		rjob->tasks[i].regcmd = task.regcmd;
>  		rjob->tasks[i].regcmd_count = task.regcmd_count;
> +		rjob->tasks[i].int_mask = task.int_mask;
> +		rjob->tasks[i].flags = task.flags;
> +
> +		/* Default to DPU completion if no mask specified */
> +		if (!rjob->tasks[i].int_mask) {
> +			rjob->tasks[i].int_mask = PC_INTERRUPT_MASK_DPU_0 |
> +									PC_INTERRUPT_MASK_DPU_1;
> +		}
>  	}
>  
>  	return 0;
> diff --git a/drivers/accel/rocket/rocket_job.h b/drivers/accel/rocket/rocket_job.h
> index 4ae00feec3b9..6931dfed8615 100644
> --- a/drivers/accel/rocket/rocket_job.h
> +++ b/drivers/accel/rocket/rocket_job.h
> @@ -13,6 +13,8 @@
>  struct rocket_task {
>  	u64 regcmd;
>  	u32 regcmd_count;
> +	u32 int_mask;
> +	u32 flags;

Hi Ross,

This patch grows sizeof struct drm_rocket_task, and it would make error in
checking if it is bigger than job->task_struct_size in rocket_copy_tasks().
So, Old userspace application would get error.

Thanks,
Sidong

>  };
>  
>  struct rocket_job {
> diff --git a/include/uapi/drm/rocket_accel.h b/include/uapi/drm/rocket_accel.h
> index d0685e372b79..ae0d8e48afcd 100644
> --- a/include/uapi/drm/rocket_accel.h
> +++ b/include/uapi/drm/rocket_accel.h
> @@ -90,6 +90,11 @@ struct drm_rocket_fini_bo {
>  	__u32 reserved;
>  };
>  
> +/**
> + * Flags for drm_rocket_task.flags
> + */
> +#define ROCKET_TASK_SKIP_CNA_CORE		0x1
> +
>  /**
>   * struct drm_rocket_task - A task to be run on the NPU
>   *
> @@ -106,6 +111,26 @@ struct drm_rocket_task {
>  	 * buffer
>  	 */
>  	__u32 regcmd_count;
> +
> +	/**
> +	 * Input: Interrupt mask specifying which block completion signals
> +	 * that this task is done. Uses PC_INTERRUPT_MASK_* bits.
> +	 *
> +	 * For conv/DPU tasks: DPU_0 | DPU_1 (0x0300)
> +	 * For PPU tasks:      PPU_0 | PPU_1 (0x0C00)
> +	 *
> +	 * If zero, defaults to DPU_0 | DPU_1 for backwards compatibility.
> +	 */
> +	__u32 int_mask;
> +
> +	/**
> +	 * Input: Task flags.
> +	 *
> +	 * ROCKET_TASK_SKIP_CNA_CORE: Skip CNA and Core S_POINTER MMIO
> +	 * writes for this task. Used for standalone DPU element-wise
> +	 * and PPU pooling tasks that don't use CNA/Core.
> +	 */
> +	__u32 flags;
>  };
>  
>  /**
> 
> -- 
> 2.52.0
> 

  reply	other threads:[~2026-09-04 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 21:39 [PATCH 0/5] accel/rocket: Support standalone DPU/PPU tasks and pipelined workloads Ross Cawston
2026-02-17 21:39 ` [PATCH 1/5] accel/rocket: Fix error path in BO creation Ross Cawston
2026-02-17 21:39 ` [PATCH 2/5] accel/rocket: Enable ping-pong mode only for multi-task jobs Ross Cawston
2026-02-17 21:39 ` [PATCH 3/5] accel/rocket: Add per-task flags and interrupt mask to UAPI and kernel Ross Cawston
2026-09-04 15:00   ` Sidong Yang [this message]
2026-02-17 21:39 ` [PATCH 4/5] accel/rocket: Skip CNA/Core S_POINTER initialization for standalone tasks Ross Cawston
2026-02-17 21:39 ` [PATCH 5/5] accel/rocket: Use per-task interrupt mask and handle PPU completion interrupts Ross Cawston
2026-07-06 19:27 ` [PATCH 0/5] accel/rocket: Support standalone DPU/PPU tasks and pipelined workloads Heiko Stübner

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=aprXAS8mkycmfM2n@rock-5b-plus \
    --to=sidong.yang@furiosa.ai \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=ross@r-sc.ca \
    --cc=simona@ffwll.ch \
    --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

all inboxes | Powered by JetHome®