From: Maxime Ripard <mripard@redhat.com>
To: Thierry Reding <thierry.reding@kernel.org>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Sumit Semwal <sumit.semwal@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Brian Starkey <Brian.Starkey@arm.com>,
John Stultz <jstultz@google.com>,
"T . J . Mercier" <tjmercier@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Mike Rapoport <rppt@kernel.org>,
Sumit Garg <sumit.garg@kernel.org>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-tegra@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
linux-mm@kvack.org
Subject: Re: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
Date: Wed, 18 Feb 2026 10:42:22 +0100 [thread overview]
Message-ID: <20260218-voracious-orchid-malamute-febce0@houat> (raw)
In-Reply-To: <aY3nov29aBGWw93Y@orome>
[-- Attachment #1: Type: text/plain, Size: 3478 bytes --]
On Thu, Feb 12, 2026 at 03:50:09PM +0100, Thierry Reding wrote:
> On Fri, Jan 23, 2026 at 02:30:14PM +0100, Maxime Ripard wrote:
> > Hi,
> >
> > On Thu, Jan 22, 2026 at 05:10:05PM +0100, Thierry Reding wrote:
> > > From: Thierry Reding <treding@nvidia.com>
> > >
> > > NVIDIA Tegra SoCs commonly define a Video-Protection-Region, which is a
> > > region of memory dedicated to content-protected video decode and
> > > playback. This memory cannot be accessed by the CPU and only certain
> > > hardware devices have access to it.
> > >
> > > Expose the VPR as a DMA heap so that applications and drivers can
> > > allocate buffers from this region for use-cases that require this kind
> > > of protected memory.
> > >
> > > VPR has a few very critical peculiarities. First, it must be a single
> > > contiguous region of memory (there is a single pair of registers that
> > > set the base address and size of the region), which is configured by
> > > calling back into the secure monitor. The memory region also needs to
> > > quite large for some use-cases because it needs to fit multiple video
> > > frames (8K video should be supported), so VPR sizes of ~2 GiB are
> > > expected. However, some devices cannot afford to reserve this amount
> > > of memory for a particular use-case, and therefore the VPR must be
> > > resizable.
> > >
> > > Unfortunately, resizing the VPR is slightly tricky because the GPU found
> > > on Tegra SoCs must be in reset during the VPR resize operation. This is
> > > currently implemented by freezing all userspace processes and calling
> > > invoking the GPU's freeze() implementation, resizing and the thawing the
> > > GPU and userspace processes. This is quite heavy-handed, so eventually
> > > it might be better to implement thawing/freezing in the GPU driver in
> > > such a way that they block accesses to the GPU so that the VPR resize
> > > operation can happen without suspending all userspace.
> > >
> > > In order to balance the memory usage versus the amount of resizing that
> > > needs to happen, the VPR is divided into multiple chunks. Each chunk is
> > > implemented as a CMA area that is completely allocated on first use to
> > > guarantee the contiguity of the VPR. Once all buffers from a chunk have
> > > been freed, the CMA area is deallocated and the memory returned to the
> > > system.
> > >
> > > Signed-off-by: Thierry Reding <treding@nvidia.com>
> >
> > Aside from the discussion on CMA, it doesn't look like the heap defines
> > anywhere the attributes of the allocated buffers this heap provides.
>
> Attributes like what? Where would you expect the driver to define this?
> I don't see anything in struct drm_heap_export_info that sounds like
> what you expect, nor does the allocation ABI provide any means of
> reporting attributes.
>
> There's also not a whole lot to this, other than that the memory
> allocated by this can't be accessed by anything other than a select set
> of devices. You can't have any CPU access to these buffers (the hardware
> will refuse to let the CPU read from this memory) either, which is
> hinted at by the fact that no mmap() operations are allowed.
>
> Can you elaborate what you're looking for?
Are the buffers you're getting when allocating cacheable? uncacheable?
mappable? physically or virtually contiguous? etc.
See
https://docs.kernel.org/userspace-api/dma-buf-heaps.html#heaps
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2026-02-18 9:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 16:09 [PATCH v2 00/10] dma-bug: heaps: Add Tegra VPR support Thierry Reding
2026-01-22 16:10 ` [PATCH v2 01/10] dt-bindings: reserved-memory: Document Tegra VPR Thierry Reding
2026-01-22 16:10 ` [PATCH v2 02/10] dt-bindings: display: tegra: Document memory regions Thierry Reding
2026-01-22 17:36 ` Rob Herring (Arm)
2026-01-22 16:10 ` [PATCH v2 03/10] bitmap: Add bitmap_allocate() function Thierry Reding
2026-01-22 16:10 ` [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas Thierry Reding
2026-01-23 2:11 ` kernel test robot
2026-01-23 2:43 ` kernel test robot
2026-01-23 13:25 ` Maxime Ripard
2026-02-12 14:44 ` Thierry Reding
2026-02-18 8:55 ` Maxime Ripard
2026-01-22 16:10 ` [PATCH v2 05/10] dma-buf: heaps: Add debugfs support Thierry Reding
2026-01-22 16:10 ` [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR Thierry Reding
2026-01-23 3:25 ` kernel test robot
2026-01-23 13:30 ` Maxime Ripard
2026-02-12 14:50 ` Thierry Reding
2026-02-18 9:42 ` Maxime Ripard [this message]
2026-01-22 16:10 ` [PATCH v2 07/10] arm64: tegra: Add VPR placeholder node on Tegra234 Thierry Reding
2026-01-23 13:28 ` Maxime Ripard
2026-02-12 14:51 ` Thierry Reding
2026-02-18 10:56 ` Maxime Ripard
2026-01-22 16:10 ` [PATCH v2 08/10] arm64: tegra: Add GPU " Thierry Reding
2026-01-22 16:10 ` [PATCH v2 09/10] arm64: tegra: Hook up VPR to host1x Thierry Reding
2026-01-22 16:10 ` [PATCH v2 10/10] arm64: tegra: Hook up VPR to the GPU Thierry Reding
2026-01-22 18:07 ` [PATCH v2 00/10] dma-bug: heaps: Add Tegra VPR support Rob Herring
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=20260218-voracious-orchid-malamute-febce0@houat \
--to=mripard@redhat.com \
--cc=Brian.Starkey@arm.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=benjamin.gaignard@collabora.com \
--cc=conor+dt@kernel.org \
--cc=david@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jstultz@google.com \
--cc=krzk+dt@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-mm@kvack.org \
--cc=linux-tegra@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rppt@kernel.org \
--cc=simona@ffwll.ch \
--cc=sumit.garg@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=thierry.reding@kernel.org \
--cc=tjmercier@google.com \
/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