Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Casanova <detlev.casanova@collabora.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Daniel Golle <daniel@makrotopia.org>
Cc: Paul Kocialkowski <paulk@sys-base.io>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Michael Riesch <michael.riesch@collabora.com>,
	Mehdi Djait <mehdi.djait@linux.intel.com>,
	Gerald Loacker <gerald.loacker@wolfvision.net>,
	Dustin Lundquist <dustin@null-ptr.net>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [RFC PATCH 0/6] media: rockchip: RKVENC v1 H.264/HEVC encoder for the RV1126
Date: Wed, 02 Dec 2026 13:34:13 -0500	[thread overview]
Message-ID: <LLbdZnDpR_Ocos6pPUNxeA@collabora.com> (raw)
In-Reply-To: <aw7daSLpIzp5eKtc@makrotopia.org>

Hi Daniel,

On Tuesday, 1 December 2026 09:44:57 EST Daniel Golle wrote:
> Hi Nicolas, Detlev,
> 
> A follow-up on question 3 of this RFC, after reading the VEPU510
> thread [1] again. There the deciding criterion was memory protection:
> an encoder that can confine its DMA through an IOMMU gets the
> DRM-style driver with Vulkan Video in Mesa, and the V4L2 stateless
> interface is for hardware that cannot. RKVENC v1 has its own IOMMU
> (two MMU instances, venc_mmu in patch 5/6), so by that criterion it
> belongs on your side, not under a V4L2 interface. My cover letter did
> not take that into account. 

It is not that set in he stone, encoders with an IOMMU can have a v4l2 driver, 
but the DRM-style driver requires an IOMMU for security reasons.

That being said, because of how device tree influence the IOMMU subsystem, it 
is possible that both v4l2 and DRM-style driver can't live together easily, 
because the DRM-style driver will probably have to manage the IOMMU itself, 
whereas the v4l2 driver can just rely on the IOMMU subsystem.

> So, more precisely than question 3:
> 
> 1. Is RKVENC v1 (RV1109/RV1126 "vepu541", RK3566/RK3568 "vepu540") in
>    scope for the DRM and Vulkan Video work, or is that limited to the
>    VEPU5xx generation (VEPU510/VEPU580) for the foreseeable future?

I see no reason why they wouldn't qualify for the DRM-style driver, as long as 
they have an IOMMU.

> 2. If it is in scope: is there a branch or a description of the
>    kernel interface I could start from? The RV1126 back end (register
>    image builder, recovery, devfreq and cooling) would carry over, and
>    I would rather contribute it there than build a V4L2 driver you
>    would then have to retire. One practical point for that path: the
>    RV1126 is a Cortex-A7 camera SoC without a GPU, typically running
>    OpenWrt or Buildroot with GStreamer serving RTSP. Is a GPU-less
>    Vulkan Video device in Mesa something you expect to be practical on
>    such targets?

My current working branch is at [1] (rust kernel driver) and [2] (mesa UMD).
Make sure to always have both synced as the uAPI is not stable yet. There is a 
preliminary Variant support (vepu580 + vepu510) in the kernel (same repo but 
branch detlev/tyr-dev/rkvenc-variants), but not in mesa yet.

Part of the work was to create the mesa vkcodec vulkan video driver, to have 
an UMD only for video, not linked to any GPU.

The kernel driver manages iommu/clock/power/reset... While mesa translates 
Vulkan Video commands to register values for each HW.

The interface allows userspace programs to send register values to the driver 
for writing (the driver also validates values and ranges). Address registers, 
in the uAPI are passed as BO handle + offset in that BO and the driver 
translates that to a DMA address.

Userspace is then signalled by a fence when the work is done and gets the 
register values it requested to be read back (like the output bitstream 
length)

> 3. If it is not in scope: would a V4L2 driver be acceptable for it?
>    Paul's stateless encoder series needs a second implementation from
>    another vendor [2], and RKVENC v1 would be one; I have offered it to
>    him in that thread [3]. Your concern in [1] was that an exposed API
>    cannot be transitioned later. Without DRM work planned for this
>    block, the V4L2 driver would be its only interface, not an interim
>    one.

As mentioned, there is work (close to an RFC) on the DRM side. Using the DRM 
subsystem is more future-proof (beacuse of the move of complexity to user-
space and simpler uAPI to maintain. e.g.: FFMpeg officially still has no support 
for v4l2 stateless decoder)

> On the rest of the RFC: the Sashiko findings and the Media CI checks
> are being worked through, the bitstream overflow handling in
> particular. Question 5 is settled: I have an RK3568 board and will
> test the vepu540 variant before the next version. The next version
> waits for your answer here, since it decides its shape.
> 
> Dustin, thanks for testing this on the Comet. Noted that your
> Tested-by covers H.264 only.

Detlev,

[1]: https://gitlab.collabora.com/detlev/linux
[2]: https://gitlab.freedesktop.org/detlev.c/mesa



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

      reply	other threads:[~2026-12-02 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 14:54 [RFC PATCH 0/6] media: rockchip: RKVENC v1 H.264/HEVC encoder for the RV1126 Daniel Golle
2026-11-14 14:54 ` [RFC PATCH 1/6] dt-bindings: media: Add Rockchip RKVENC v1 video encoder Daniel Golle
2026-11-14 14:54 ` [RFC PATCH 2/6] clk: rockchip: rv1126: Add PD_VEPU clock tree Daniel Golle
2026-11-14 14:54 ` [RFC PATCH 3/6] media: rockchip: Add RKVENC v1 video encoder driver Daniel Golle
2026-11-14 14:55 ` [RFC PATCH 4/6] media: rockchip: rkvenc: Add frequency scaling and cooling Daniel Golle
2026-11-14 14:55 ` [RFC PATCH 5/6] ARM: dts: rockchip: Add RKVENC encoder to RV1126 Daniel Golle
2026-11-14 14:55 ` [RFC PATCH 6/6] ARM: dts: rockchip: Add RKVENC operating points " Daniel Golle
2026-12-01  4:27 ` [RFC PATCH 0/6] media: rockchip: RKVENC v1 H.264/HEVC encoder for the RV1126 Dustin Lundquist
2026-12-01 14:44 ` Daniel Golle
2026-12-02 18:34   ` Detlev Casanova [this message]

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=LLbdZnDpR_Ocos6pPUNxeA@collabora.com \
    --to=detlev.casanova@collabora.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dustin@null-ptr.net \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gerald.loacker@wolfvision.net \
    --cc=heiko@sntech.de \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=michael.riesch@collabora.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=paulk@sys-base.io \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sboyd@kernel.org \
    /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