Re: [PATCH v4 00/25] accel/qda: Qualcomm DSP Accelerator driver
From: Tomeu Vizoso
Date: Mon Nov 30 2026 - 13:06:49 EST
Hi Ekansh,
On Mon, Nov 30, 2026 at 10:17 AM Ekansh Gupta
<ekansh.gupta@xxxxxxxxxxxxxxxx> wrote:
>
> On 06-11-2026 14:41, Tomeu Vizoso wrote:
> > On Mon, Nov 02, 2026 at 03:51 AM, Ekansh Gupta <ekansh.gupta@xxxxxxxxxxxxxxxx> wrote:
> >> User space
> >> ==========
> >>
> >> - FastRPC library: https://github.com/qualcomm/fastrpc
> >> (accel support: https://github.com/qualcomm/fastrpc/tree/accel/staging)
> >> - QAIC compiler: https://github.com/qualcomm/QAIC
> >
> > Hi Ekansh,
> >
> > I'm still confused on how userspace gets to execute its compute kernels
> > with this uAPI. Let's say I have a compiler and have compiled a function
> > that reads some values from a buffer and writes to another buffer. Could
> > you explain to me how should I use the uAPI so this kernel executes and
> > I get the expected results in the buffers?
> >
> > Regards,
> >
> > Tomeu
>
> The driver doesn't take machine code directly. It carries FastRPC calls
> to a Hexagon process on the DSP.
>
> 1. Open the accel node (find the right one with the DSP-name query).
> 2. Create a DSP process with
> 3. THe signed or unsigned Hexagon shared object/ELF is loaded(a "skel"
> containing your function).
Thanks. It looks like 2 got cut off, and I would need some help to
understand 3: who loads the shared object, and through which ioctl?
Do you think you could write something like the below for QDA, with
every ioctl a client issues? That would help me understand how the
pieces fit together.
---- ioctl usage in Thames (proposed driver for TI's C7x DSP) ---
code = BO_CREATE(EXECUTABLE);
params = BO_CREATE();
in = BO_CREATE();
out = BO_CREATE();
BO_BIND(code, VA_CODE); /* addresses the client chooses */
BO_BIND(params, VA_PARAMS);
BO_BIND(in, VA_IN);
BO_BIND(out, VA_OUT);
mmap and write: machine code -> code
{ VA_IN, VA_OUT } -> params
values -> in
job = JOB_CREATE(code, params);
/* the DSP calls VA_CODE(VA_PARAMS); returns without waiting */
JOB_SUBMIT(job, reads = in, writes = out);
BO_PREP(out); /* waits for the job's fence */
read results from out
---- end of pseudocode ---
> 4. Allocate input/output buffers with GEM_CREATE (mmap them via
> GEM_MMAP_OFFSET) or import DMA-BUFs with PRIME.
> 5. Run the function with REMOTE_INVOKE: the remote handle of the loaded
> module, sc encoding the method and argument counts, and one (GEM handle,
> offset, length) entry per buffer argument. The DSP reads and writes the
> buffers in place, and the call returns when the DSP replies.
>
> So your compiled function runs on the DSP via the module-loading flow
> and the QAIC-generated stubs.
>
> Srini is working on opening up a minimal example that can be built with
> complete open-source tools.
Sounds interesting as well, thanks.
Regards,
Tomeu