Re: [PATCH v2 05/12] media: iris: Route buffers to the matching context bank device

Dmitry Baryshkov <[email protected]> Thu, 6 Aug 2026 12:03:39 +0300
Newsgroups org.kernel.vger.linux-media,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <y7idhuok7ndyo43imqg6vo46ybrjkbqjwifufxxjmijsayb56m@6q2u6sxhsiyw>
On Fri, Jul 31, 2026 at 11:52:20PM +0530, Vikash Garodia wrote:
> The VPU issues DMA through several SMMU streams, and the hardware does
> not give every stream the same addressable range. The non-pixel stream
> is restricted to use 0-600MB of IOVA space, while the pixel stream can
> address the full range. With a context bank device per stream, every
> allocation has to be made against the device whose IOMMU domain can
> address it: allocating a non-pixel buffer against the pixel device, or
> against the parent, places it in a domain that carries no restriction and
> the VPU faults when it later accesses that address.
> 
> Add iris_get_cb_dev(), which maps a buffer type to the owning context
> bank device. Bitstream and internal buffers (BIN, ARP, COMV, LINE,
> NON_COMV, PERSIST) belong to the non-pixel device, and uncompressed
> buffers (DPB, PARTIAL, SCRATCH_1, SCRATCH_2, VPSS) to the pixel device.
> BUF_INPUT and BUF_OUTPUT depend on direction and are resolved from
> inst->domain: for a decoder the input is non-pixel and the output pixel,
> and the other way round for an encoder.
> 
> Use it for internal buffer alloc and free, for the vb2 queue devices, and
> for the HFI queue and SFR allocations, which are non-pixel.
> 
> Fall back to core->dev whenever the relevant context bank device is
> absent, so platforms still describing "iommus" on the parent iris node
> behave exactly as before and can be converted one at a time.
> 
> Backports are intended since the first DTS of 8550 binding schema.
> 
> Fixes: 41661853ae8e ("arm64: dts: qcom: sm8550: add iris DT node")

Drop both lines.

> Cc: [email protected]
> Co-developed-by: Vishnu Reddy <[email protected]>
> Signed-off-by: Vishnu Reddy <[email protected]>
> Tested-by: Daniel J Blueman <[email protected]>
> Signed-off-by: Vikash Garodia <[email protected]>
> ---
>  drivers/media/platform/qcom/iris/iris_buffer.c    |  8 ++---
>  drivers/media/platform/qcom/iris/iris_core.h      |  4 +++
>  drivers/media/platform/qcom/iris/iris_hfi_queue.c | 16 +++++----
>  drivers/media/platform/qcom/iris/iris_resources.c | 41 +++++++++++++++++++++++
>  drivers/media/platform/qcom/iris/iris_resources.h |  1 +
>  drivers/media/platform/qcom/iris/iris_vidc.c      |  4 +--
>  6 files changed, 61 insertions(+), 13 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <[email protected]>


-- 
With best wishes
Dmitry