dma-bug: heaps: Add Tegra VPR support
Subsystems (15)
Thierry Reding
maintainerv2 cover dma-bug: heaps: Add Tegra VPR support
From: Thierry Reding <[email protected]>
Hi,
This series adds support for the video protection region (VPR) used on Tegra SoC devices. It's a special region of memory that is protected from accesses by the CPU and used to store DRM protected content (both decrypted stream data as well as decoded video frames).
Patches 1 and 2 add DT binding documentation for the VPR and add the VPR to the list of memory-region items for display and host1x.
Patch 3 adds bitmap_allocate(), which is like bitmap_allocate_region() but works on sizes that are not a power of two.
Patch 4 introduces new APIs needed by the Tegra VPR implementation that allow CMA areas to be dynamically created at runtime rather than using the fixed, system-wide list. This is used in this driver specifically because it can use an arbitrary number of these areas (though they are currently limited to 4).
Patch 5 adds some infrastructure for DMA heap implementations to provide information through debugfs.
The Tegra VPR implementation is added in patch 6. See its commit message for more details about the specifics of this implementation.
Finally, patches 7-10 add the VPR placeholder node on Tegra234 and hook it up to the host1x and GPU nodes so that they can make use of this region.
Changes in v2:
- Tegra VPR implementation is now more optimized to reduce the number of (very slow) resize operations, and allows cross-chunk allocations
- dynamic CMA areas are now trackd separately from static ones, but the global number of CMA pages accounts for all areas
Thierry
Thierry Reding (10):
dt-bindings: reserved-memory: Document Tegra VPR
dt-bindings: display: tegra: Document memory regions
bitmap: Add bitmap_allocate() function mm/cma: Allow dynamically creating CMA areas
dma-buf: heaps: Add debugfs support
dma-buf: heaps: Add support for Tegra VPR
arm64: tegra: Add VPR placeholder node on Tegra234
arm64: tegra: Add GPU node on Tegra234
arm64: tegra: Hook up VPR to host1x
arm64: tegra: Hook up VPR to the GPU
.../display/tegra/nvidia,tegra186-dc.yaml | 10 + .../display/tegra/nvidia,tegra20-dc.yaml | 10 +- .../display/tegra/nvidia,tegra20-host1x.yaml | 7 + .../nvidia,tegra-video-protection-region.yaml | 55 + arch/arm/mm/dma-mapping.c | 2 +- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 60 + arch/s390/mm/init.c | 2 +- drivers/dma-buf/dma-heap.c | 56 + drivers/dma-buf/heaps/Kconfig | 7 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/cma_heap.c | 2 +- drivers/dma-buf/heaps/tegra-vpr.c | 1265 +++++++++++++++++ include/linux/bitmap.h | 25 +- include/linux/cma.h | 7 +- include/linux/dma-heap.h | 2 + include/trace/events/tegra_vpr.h | 57 + mm/cma.c | 187 ++- mm/cma.h | 5 +- 18 files changed, 1713 insertions(+), 47 deletions(-) create mode 100644 Documentation/devicetree/bindings/reserved-memory/nvidia,tegra-video-protection-region.yaml create mode 100644 drivers/dma-buf/heaps/tegra-vpr.c create mode 100644 include/trace/events/tegra_vpr.h
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 1/10 dt-bindings: reserved-memory: Document Tegra VPR
From: Thierry Reding <[email protected]>
The Video Protection Region (VPR) found on NVIDIA Tegra chips is a region of memory that is protected from CPU accesses. It is used to decode and play back DRM protected content.
It is a standard reserved memory region that can exist in two forms:
static VPR where the base address and size are fixed (uses the "reg" property to describe the memory) and a resizable VPR where only the size is known upfront and the OS can allocate it wherever it can be accomodated.
--- .../nvidia,tegra-video-protection-region.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/reserved-memory/nvidia,tegra-video-protection-region.yaml
Documentation/devicetree/bindings/reserved-memory/nvidia,tegra-video-protection-region.yaml new file +55 -0
@@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra Video Protection Region (VPR) + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +description: | + NVIDIA Tegra chips have long supported a mechanism to protect a single, + contiguous memory region from non-secure memory accesses. Typically this + region is used for decoding and playback of DRM protected content. Various + devices, such as the display controller and multimedia engines (video + decoder) can access this region in a secure way. Access from the CPU is + generally forbidden. + + Two variants exist for VPR: one is fixed in both the base address and size, + while the other is resizable. Fixed VPR can be described by just a "reg" + property specifying the base address and size, whereas the resizable VPR + is defined by a size/alignment pair of properties. For resizable VPR the + memory is reusable by the rest of the system when it's unused for VPR and + therefore the "reusable" property must be specified along with it. For a + fixed VPR, the memory is permanently protected, and therefore it's not + reusable and must also be marked as "no-map" to prevent any (including + speculative) accesses to it. + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: nvidia,tegra-video-protection-region + +dependencies: + size: [alignment, reusable] + alignment: [size, reusable] + reusable: [alignment, size] + + reg: [no-map] + no-map: [reg] + +unevaluatedProperties: false + +oneOf: + - required: + - compatible + - reg + + - required: + - compatible + - size
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 2/10 dt-bindings: display: tegra: Document memory regions
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add the memory-region and memory-region-names properties to the bindings for the display controllers and the host1x engine found on various Tegra generations. These memory regions are used to access firmware-provided framebuffer memory as well as the video protection region.
--- .../bindings/display/tegra/nvidia,tegra186-dc.yaml | 10 ++++++++++ .../bindings/display/tegra/nvidia,tegra20-dc.yaml | 10 +++++++++- .../bindings/display/tegra/nvidia,tegra20-host1x.yaml | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/tegra/nvidia,tegra186-dc.yaml +10 -0
@@ -57,6 +57,16 @@ properties: - const: dma-mem # read-0 - const: read-1 + memory-region: + minItems: 1 + maxItems: 2 + + memory-region-names: + items: + enum: [ framebuffer, protected ] + minItems: 1 + maxItems: 2 + nvidia,outputs: description: A list of phandles of outputs that this display controller can drive.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml +9 -1
@@ -65,7 +65,15 @@ properties: items: - description: phandle to the core power domain - memory-region: true + memory-region: + minItems: 1 + maxItems: 2 + + memory-region-names: + items: + enum: [ framebuffer, protected ] + minItems: 1 + maxitems: 2 nvidia,head: $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +7 -0
@@ -96,6 +96,13 @@ properties: items: - description: phandle to the HEG or core power domain + memory-region: + maxItems: 1 + + memory-region-names: + items: + - const: protected + required: - compatible - interrupts
Signature · 1 line
2.52.0
Rob Herring (Arm)
maintainerRe: [PATCH v2 02/10] dt-bindings: display: tegra: Document memory regions
Quoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Add the memory-region and memory-region-names properties to the bindings for the display controllers and the host1x engine found on various Tegra generations. These memory regions are used to access firmware-provided framebuffer memory as well as the video protection region.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/display/tegra/nvidia,tegra186-dc.yaml | 10 ++++++++++ .../bindings/display/tegra/nvidia,tegra20-dc.yaml | 10 +++++++++- .../bindings/display/tegra/nvidia,tegra20-host1x.yaml | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-)
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml: properties:memory-region-names: 'anyOf' conditional failed, one must be fixed:
'maxitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems'] 'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml: properties:memory-region-names:items: {'enum': ['framebuffer', 'protected']} is not of type 'array'
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml: properties:memory-region-names: Additional properties are not allowed ('maxitems' was unexpected)
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml: properties:memory-region-names:items: {'enum': ['framebuffer', 'protected']} is not of type 'array'
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-dc.yaml: properties:memory-region-names: Additional properties are not allowed ('maxitems' was unexpected)
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Thierry Reding
maintainerPATCH v2 3/10 bitmap: Add bitmap_allocate() function
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
This is similar to bitmap_allocate_region() but allows allocation of non-power of two pages/bits.
While at it, reimplement bitmap_allocate_region() in terms of this new helper to remove a sliver of code duplication.
--- include/linux/bitmap.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
include/linux/bitmap.h +20 -5
@@ -673,10 +673,10 @@ void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order) }/** -* bitmap_allocate_region - allocate bitmap region +* bitmap_allocate - allocate bitmap region * @bitmap: array of unsigned longs corresponding to the bitmap * @pos: beginning of bit region to allocate -* @order: region size (log base 2 of number of bits) to allocate +* @len: number of bits to allocate * * Allocate (set bits in) a specified region of a bitmap. *
@@ -684,16 +684,31 @@ void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order)* free (not all bits were zero). */ static __always_inline -int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order) +int bitmap_allocate(unsigned long *bitmap, unsigned int pos, unsigned int len) { -unsigned int len =BIT (order); -if (find_next_bit (bitmap, pos + len, pos) < pos + len)return -EBUSY ;bitmap_set (bitmap, pos, len);return 0 ; } +/** +* bitmap_allocate_region - allocate bitmap region +* @bitmap: array of unsigned longs corresponding to the bitmap +* @pos: beginning of bit region to allocate +* @order: region size (log base 2 of number of bits) to allocate +* +* Allocate (set bits in) a specified region of a bitmap. +* +* Returns: 0 on success, or %-EBUSY if specified region wasn't +* free (not all bits were zero). +*/ +static __always_inline +int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order) +{ +return bitmap_allocate (bitmap, pos,BIT (order)); +} +/** * bitmap_find_free_region - find a contiguous aligned mem region * @bitmap: array of unsigned longs corresponding to the bitmap
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 4/10 mm/cma: Allow dynamically creating CMA areas
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
There is no technical reason why there should be a limited number of CMA regions, so extract some code into helpers and use them to create extra functions (cma_create() and cma_free()) that allow creating and freeing, respectively, CMA regions dynamically at runtime.
The static array of CMA areas cannot be replaced by dynamically created areas because for many of them, allocation must not fail and some cases may need to initialize them before the slab allocator is even available. To account for this, keep these "early" areas in a separate list and track the dynamic areas in a separate list.
---
Changes in v2:
- rename fixed number of CMA areas to reflect their main use
- account for pages in dynamically allocated regions
--- arch/arm/mm/dma-mapping.c | 2 +- arch/s390/mm/init.c | 2 +- drivers/dma-buf/heaps/cma_heap.c | 2 +- include/linux/cma.h | 7 +- mm/cma.c | 187 +++++++++++++++++++++++++------ mm/cma.h | 5 +- 6 files changed, 164 insertions(+), 41 deletions(-)
arch/arm/mm/dma-mapping.c +1 -1
@@ -254,7 +254,7 @@ struct dma_contig_early_reserve {unsigned long size; }; -static struct dma_contig_early_reserve dma_mmu_remap[MAX_CMA_AREAS ]__initdata ; +static struct dma_contig_early_reserve dma_mmu_remap[MAX_EARLY_CMA_AREAS ]__initdata ;static int dma_mmu_remap_num__initdata ;
arch/s390/mm/init.c +1 -1
@@ -241,7 +241,7 @@ static int s390_cma_mem_notifier(struct notifier_block *nb, mem_data.start = arg->start_pfn <<PAGE_SHIFT ; mem_data.end = mem_data.start + (arg->nr_pages <<PAGE_SHIFT );if (action ==MEM_GOING_OFFLINE ) - rc =cma_for_each_area (s390_cma_check_range, &mem_data); + rc =cma_for_each_early_area (s390_cma_check_range, &mem_data);return notifier_from_errno (rc); }
drivers/dma-buf/heaps/cma_heap.c +1 -1
@@ -30,7 +30,7 @@#define DEFAULT_CMA_NAME "default_cma_region" -static struct cma *dma_areas[MAX_CMA_AREAS ]__initdata ; +static struct cma *dma_areas[MAX_EARLY_CMA_AREAS ]__initdata ;static unsigned int dma_areas_num__initdata ;int __init dma_heap_cma_register_heap (struct cma *cma)
include/linux/cma.h +6 -1
@@ -7,7 +7,7 @@#include <linux/numa.h> #ifdef CONFIG_CMA_AREAS -#define MAX_CMA_AREAS CONFIG_CMA_AREAS +#define MAX_EARLY_CMA_AREAS CONFIG_CMA_AREAS#endif #define CMA_MAX_NAME 64
@@ -57,9 +57,14 @@ struct page *cma_alloc_frozen_compound(struct cma *cma, unsigned int order);bool cma_release_frozen (struct cma *cma,const struct page *pages,unsigned long count); +extern int cma_for_each_early_area (int (*it)(struct cma *cma,void *data),void *data);extern int cma_for_each_area (int (*it)(struct cma *cma,void *data),void *data);extern bool cma_intersects (struct cma *cma,unsigned long start,unsigned long end);extern void cma_reserve_pages_on_error (struct cma *cma); +struct cma *cma_create (phys_addr_t base,phys_addr_t size, +unsigned int order_per_bit,const char *name); +void cma_free (struct cma *cma); +#endif
mm/cma.c +152 -35
265 lines not on this page · raw message
mm/cma.h +3 -2
@@ -41,6 +41,7 @@ struct cma {unsigned long available_count;unsigned int order_per_bit;/* Order of pages represented by one bit */ spinlock_t lock; +struct list_head node;struct mutex alloc_mutex;#ifdef CONFIG_CMA_DEBUGFS struct hlist_head mem_head;
@@ -71,8 +72,8 @@ enum cma_flags { CMA_ACTIVATED, }; -extern struct cma cma_areas[MAX_CMA_AREAS ]; -extern unsigned int cma_area_count; +extern struct cma cma_early_areas[MAX_EARLY_CMA_AREAS ]; +extern unsigned int cma_early_area_count;static inline unsigned long cma_bitmap_maxno (struct cma *cma,struct cma_memrange *cmr)
Signature · 1 line
2.52.0
kernel test robot
build botRe: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas
kernel test robot noticed the following build errors:
Hi Thierry,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20260122]
[cannot apply to drm-misc/drm-misc-next robh/for-next linus/master v6.19-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Thierry-Reding/dt-bindings-reserved-memory-Document-Tegra-VPR/20260123-001244 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122161009.3865888-5-thierry.reding%40kernel.org patch subject: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas config: openrisc-randconfig-r072-20260123 (https://download.01.org/0day-ci/archive/20260123/[email protected]/config) compiler: or1k-linux-gcc (GCC) 15.2.0 smatch version: v0.5.0-8994-gd50c5a4c reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260123/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
mm/cma_sysfs.c: In function 'cma_sysfs_init':
>> mm/cma_sysfs.c:119:25: error: 'cma_area_count' undeclared (first use in this function); did you mean 'cma_early_area_count'?
119 | for (i = 0; i < cma_area_count; i++) {
| ^~~~~~~~~~~~~~
| cma_early_area_count
mm/cma_sysfs.c:119:25: note: each undeclared identifier is reported only once for each function it appears in
>> mm/cma_sysfs.c:126:24: error: 'cma_areas' undeclared (first use in this function); did you mean 'cma_attrs'?
126 | cma = &cma_areas[i];
| ^~~~~~~~~
| cma_attrsvim +119 mm/cma_sysfs.c
43ca106fa8ec7d Minchan Kim 2021-05-04 107
43ca106fa8ec7d Minchan Kim 2021-05-04 108 static int __init cma_sysfs_init(void)
43ca106fa8ec7d Minchan Kim 2021-05-04 109 {
43ca106fa8ec7d Minchan Kim 2021-05-04 110 struct kobject *cma_kobj_root;
43ca106fa8ec7d Minchan Kim 2021-05-04 111 struct cma_kobject *cma_kobj;
43ca106fa8ec7d Minchan Kim 2021-05-04 112 struct cma *cma;
43ca106fa8ec7d Minchan Kim 2021-05-04 113 int i, err;
43ca106fa8ec7d Minchan Kim 2021-05-04 114
43ca106fa8ec7d Minchan Kim 2021-05-04 115 cma_kobj_root = kobject_create_and_add("cma", mm_kobj);
43ca106fa8ec7d Minchan Kim 2021-05-04 116 if (!cma_kobj_root)
43ca106fa8ec7d Minchan Kim 2021-05-04 117 return -ENOMEM;
43ca106fa8ec7d Minchan Kim 2021-05-04 118
43ca106fa8ec7d Minchan Kim 2021-05-04 @119 for (i = 0; i < cma_area_count; i++) {
43ca106fa8ec7d Minchan Kim 2021-05-04 120 cma_kobj = kzalloc(sizeof(*cma_kobj), GFP_KERNEL);
43ca106fa8ec7d Minchan Kim 2021-05-04 121 if (!cma_kobj) {
43ca106fa8ec7d Minchan Kim 2021-05-04 122 err = -ENOMEM;
43ca106fa8ec7d Minchan Kim 2021-05-04 123 goto out;
43ca106fa8ec7d Minchan Kim 2021-05-04 124 }43ca106fa8ec7d Minchan Kim 2021-05-04 12543ca106fa8ec7d Minchan Kim 2021-05-04 @126 cma = &cma_areas[i];
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas
In reply to Thierry Redingkernel test robot noticed the following build errors:
Hi Thierry,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20260122]
[cannot apply to drm-misc/drm-misc-next robh/for-next linus/master v6.19-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Thierry-Reding/dt-bindings-reserved-memory-Document-Tegra-VPR/20260123-001244 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122161009.3865888-5-thierry.reding%40kernel.org patch subject: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas config: i386-buildonly-randconfig-003-20260123 (https://download.01.org/0day-ci/archive/20260123/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260123/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
mm/cma_debug.c: In function 'cma_debugfs_init':
>> mm/cma_debug.c:207:25: error: 'cma_area_count' undeclared (first use in this function)
207 | for (i = 0; i < cma_area_count; i++)
| ^~~~~~~~~~~~~~
mm/cma_debug.c:207:25: note: each undeclared identifier is reported only once for each function it appears in
>> mm/cma_debug.c:208:38: error: 'cma_areas' undeclared (first use in this function); did you mean 'cma_free'?
208 | cma_debugfs_add_one(&cma_areas[i], cma_debugfs_root);
| ^~~~~~~~~
| cma_freevim +/cma_area_count +207 mm/cma_debug.c
28b24c1fc8c22c Sasha Levin 2015-04-14 199
28b24c1fc8c22c Sasha Levin 2015-04-14 200 static int __init cma_debugfs_init(void)
28b24c1fc8c22c Sasha Levin 2015-04-14 201 {
5a7f1b2f2fbeb4 Yue Hu 2019-03-05 202 struct dentry *cma_debugfs_root;
28b24c1fc8c22c Sasha Levin 2015-04-14 203 int i;
28b24c1fc8c22c Sasha Levin 2015-04-14 204
28b24c1fc8c22c Sasha Levin 2015-04-14 205 cma_debugfs_root = debugfs_create_dir("cma", NULL);
28b24c1fc8c22c Sasha Levin 2015-04-14 206 28b24c1fc8c22c Sasha Levin 2015-04-14 @207 for (i = 0; i < cma_area_count; i++)5a7f1b2f2fbeb4 Yue Hu 2019-03-05 @208 cma_debugfs_add_one(&cma_areas[i], cma_debugfs_root);
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas
In reply to Thierry RedingQuoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
There is no technical reason why there should be a limited number of CMA regions, so extract some code into helpers and use them to create extra functions (
cma_create()andcma_free()) that allow creating and freeing, respectively, CMA regions dynamically at runtime.
Quoted 7 lines
The static array of CMA areas cannot be replaced by dynamically created areas because for many of them, allocation must not fail and some cases may need to initialize them before the slab allocator is even available. To account for this, keep these "early" areas in a separate list and track the dynamic areas in a separate list.
Signed-off-by Thierry Reding <[email protected]>
AFAIU, this won't create a new cma heap when registering. This goes against the recent work we did to create one for every cma region.
I guess, since you have a driver that would explicitly handle that region, we should create some kind of opt-out mechanism, but by default, we should still create such a heap.
That being said, it's not clear to me why the heap driver uses CMA in the first place.
Maxime
Thierry Reding
maintainerRe: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas
Quoted 14 lines · Maxime Ripard
Quoted 13 lines · Thierry Reding
From: Thierry Reding <[email protected]>
There is no technical reason why there should be a limited number of CMA regions, so extract some code into helpers and use them to create extra functions (
cma_create()andcma_free()) that allow creating and freeing, respectively, CMA regions dynamically at runtime.The static array of CMA areas cannot be replaced by dynamically created areas because for many of them, allocation must not fail and some cases may need to initialize them before the slab allocator is even available. To account for this, keep these "early" areas in a separate list and track the dynamic areas in a separate list.
Quoted 8 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>AFAIU, this won't create a new cma heap when registering. This goes against the recent work we did to create one for every cma region.
I guess, since you have a driver that would explicitly handle that region, we should create some kind of opt-out mechanism, but by default, we should still create such a heap.
It sounds like there's a bit of a conflict between what you want to achieve and what this series attempts to do.
The way I see it, the CMA code is more of a helper that gives you a specific functionality set. Exposing each CMA area as a heap that userspace can allocate from seems like a bad idea to me.
Without knowing anything specific about a CMA area you don't know if it makes sense to expose it as a heap. Given that there is very little information associated with a CMA area there's only so much guessing that you can do. I think it'd be more sensible to make CMA areas opt-in to have a heap created for them rather than requiring opt-out. Exposing a heap publicly applies only to a (potentially) small subset of all CMA areas, albeit at the moment it may seem that that is what it's primarily used for.
In fact, for this particular driver nobody must allocate from any of the CMA regions associated with the heap driver outside of that heap driver, simply because the heap driver maintains meta data about these CMA regions for things to work. If we allow access to it from anywhere, things are eventually going to explode.
Quoted 2 lines
That being said, it's not clear to me why the heap driver uses CMA in the first place.
We use CMA as a way of reclaiming memory if needed. The heap that we create is meant to be resizable, so that when nothing uses the heap, the memory can be reused for other purposes. However, when memory is allocated from the heap, we need to reclaim that memory for the heap and relocate any buffers allocated from the region somewhere else. CMA does all of that for us, so it seemed like the logical choice for this.
Thierry
Re: [PATCH v2 04/10] mm/cma: Allow dynamically creating CMA areas
Quoted 20 lines · Thierry Reding
Quoted 19 lines · Maxime Ripard
Quoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
There is no technical reason why there should be a limited number of CMA regions, so extract some code into helpers and use them to create extra functions (
cma_create()andcma_free()) that allow creating and freeing, respectively, CMA regions dynamically at runtime.Quoted 7 lines
The static array of CMA areas cannot be replaced by dynamically created areas because for many of them, allocation must not fail and some cases may need to initialize them before the slab allocator is even available. To account for this, keep these "early" areas in a separate list and track the dynamic areas in a separate list.
Signed-off-by Thierry Reding <[email protected]>AFAIU, this won't create a new cma heap when registering. This goes against the recent work we did to create one for every cma region.
Quoted 6 lines
Quoted 3 lines
I guess, since you have a driver that would explicitly handle that region, we should create some kind of opt-out mechanism, but by default, we should still create such a heap.
It sounds like there's a bit of a conflict between what you want to achieve and what this series attempts to do.
It's not ongoing really, it's part of 6.19.
Quoted 4 lines
The way I see it, the CMA code is more of a helper that gives you a specific functionality set. Exposing each CMA area as a heap that userspace can allocate from seems like a bad idea to me.
Quoted 8 lines
Without knowing anything specific about a CMA area you don't know if it makes sense to expose it as a heap. Given that there is very little information associated with a CMA area there's only so much guessing that you can do. I think it'd be more sensible to make CMA areas opt-in to have a heap created for them rather than requiring opt-out. Exposing a heap publicly applies only to a (potentially) small subset of all CMA areas, albeit at the moment it may seem that that is what it's primarily used for.
Do you have any specific example in mind except for that driver?
So, the reason why we did that was, mostly, to allow proper cgroup memory accounting through dmem. In order to enable it in DRM and v4l2, it was agreed upon that we would switch the use of dma_alloc_* to rely on the heaps instead, where the memory accounting is greatly simplified.
So we want any reserved memory region a device can allocate from to have a heap.
So I do think we need the call to register a heap in rmem_cma_setup.
That being said...
Quoted 5 lines
In fact, for this particular driver nobody must allocate from any of the CMA regions associated with the heap driver outside of that heap driver, simply because the heap driver maintains meta data about these CMA regions for things to work. If we allow access to it from anywhere, things are eventually going to explode.
... I also agree that having it in dma_contiguous_reserve() might be overdoing it, and I assume it would solve the issue with your driver?
Quoted 9 lines
Quoted 2 lines
That being said, it's not clear to me why the heap driver uses CMA in the first place.
We use CMA as a way of reclaiming memory if needed. The heap that we create is meant to be resizable, so that when nothing uses the heap, the memory can be reused for other purposes. However, when memory is allocated from the heap, we need to reclaim that memory for the heap and relocate any buffers allocated from the region somewhere else. CMA does all of that for us, so it seemed like the logical choice for this.
Ack, thanks!
Maxime
Thierry Reding
maintainerPATCH v2 5/10 dma-buf: heaps: Add debugfs support
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add a callback to struct dma_heap_ops that heap providers can implement to show information about the state of the heap in debugfs. A top-level directory named "dma_heap" is created in debugfs and individual files will be named after the heaps.
--- drivers/dma-buf/dma-heap.c | 56 ++++++++++++++++++++++++++++++++++++++ include/linux/dma-heap.h | 2 ++ 2 files changed, 58 insertions(+)
drivers/dma-buf/dma-heap.c +56 -0
@@ -7,6 +7,7 @@*/ #include <linux/cdev.h> +#include <linux/debugfs.h> #include <linux/device.h> #include <linux/dma-buf.h> #include <linux/dma-heap.h>
@@ -223,6 +224,46 @@ const char *dma_heap_get_name(struct dma_heap *heap) }EXPORT_SYMBOL_NS_GPL (dma_heap_get_name,"DMA_BUF_HEAP" ); +#ifdef CONFIG_DEBUG_FS +static int dma_heap_debug_show (struct seq_file *s,void *unused) +{ +struct dma_heap *heap = s->private; +int err =0 ; + +if (heap->ops && heap->ops->show) + err = heap->ops->show (s, heap); + +return err; +} +DEFINE_SHOW_ATTRIBUTE (dma_heap_debug); + +static struct dentry *dma_heap_debugfs_dir; + +static void dma_heap_init_debugfs (void ) +{ +struct dentry *dir; + + dir =debugfs_create_dir ("dma_heap" ,NULL ); +if (IS_ERR (dir)) +return ; + + dma_heap_debugfs_dir = dir; +} + +static void dma_heap_exit_debugfs (void ) +{ +debugfs_remove_recursive (dma_heap_debugfs_dir); +} +#else +static void dma_heap_init_debugfs (void ) +{ +} + +static void dma_heap_exit_debugfs (void ) +{ +} +#endif +/** * dma_heap_add - adds a heap to dmabuf heaps * @exp_info: information needed to register this heap
@@ -297,6 +338,13 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)/* Add heap to the list */ list_add (&heap->list, &heap_list); + +#ifdef CONFIG_DEBUG_FS +if (heap->ops && heap->ops->show) +debugfs_create_file (heap->name,0444 , dma_heap_debugfs_dir, + heap, &dma_heap_debug_fops); +#endif +mutex_unlock (&heap_list_lock);return heap;
@@ -333,6 +381,14 @@ static int dma_heap_init(void) } dma_heap_class->devnode = dma_heap_devnode; +dma_heap_init_debugfs (); +return 0 ; }subsys_initcall (dma_heap_init); + +static void __exit dma_heap_exit(void) +{ +dma_heap_exit_debugfs (); +} +__exitcall (dma_heap_exit);
include/linux/dma-heap.h +2 -0
@@ -12,6 +12,7 @@#include <linux/types.h> struct dma_heap ; +struct seq_file ;/** * struct dma_heap_ops - ops to operate on a given heap
@@ -24,6 +25,7 @@ struct dma_heap_ops {unsigned long len, u32 fd_flags, u64 heap_flags); +int (*show)(struct seq_file *s,struct dma_heap *heap); };/**
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 6/10 dma-buf: heaps: Add support for Tegra VPR
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
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.
---
Changes in v2:
- cluster allocations to reduce the number of resize operations
- support cross-chunk allocation
--- drivers/dma-buf/heaps/Kconfig | 7 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/tegra-vpr.c | 1265 +++++++++++++++++++++++++++++ include/trace/events/tegra_vpr.h | 57 ++ 4 files changed, 1330 insertions(+) create mode 100644 drivers/dma-buf/heaps/tegra-vpr.c create mode 100644 include/trace/events/tegra_vpr.h
drivers/dma-buf/heaps/Kconfig +7 -0
@@ -12,3 +12,10 @@ config DMABUF_HEAPS_CMA Choose this option to enable dma-buf CMA heap. This heap is backed by the Contiguous Memory Allocator (CMA). If your system has these regions, you should say Y here. + +config DMABUF_HEAPS_TEGRA_VPR + bool "NVIDIA Tegra Video-Protected-Region DMA-BUF Heap" + depends on DMABUF_HEAPS && DMA_CMA + help + Choose this option to enable Video-Protected-Region (VPR) support on + a range of NVIDIA Tegra devices.
drivers/dma-buf/heaps/Makefile +1 -0
@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DMABUF_HEAPS_SYSTEM) += system_heap.o obj-$(CONFIG_DMABUF_HEAPS_CMA) += cma_heap.o +obj-$(CONFIG_DMABUF_HEAPS_TEGRA_VPR) += tegra-vpr.o
drivers/dma-buf/heaps/tegra-vpr.c new file +1265 -0
1,265 lines not on this page · raw message
include/trace/events/tegra_vpr.h new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
2.52.0
kernel test robot
build botRe: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
kernel test robot noticed the following build warnings:
Hi Thierry,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on next-20260122]
[cannot apply to drm-misc/drm-misc-next robh/for-next linus/master v6.19-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Thierry-Reding/dt-bindings-reserved-memory-Document-Tegra-VPR/20260123-001244 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260122161009.3865888-7-thierry.reding%40kernel.org patch subject: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20260123/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260123/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_protect_pages':
drivers/dma-buf/heaps/tegra-vpr.c:205:21: error: implicit declaration of function '__ptep_get'; did you mean 'ptep_get'? [-Wimplicit-function-declaration]
205 | pte_t pte = __ptep_get(ptep);
| ^~~~~~~~~~
| ptep_get
drivers/dma-buf/heaps/tegra-vpr.c:205:21: error: invalid initializer
drivers/dma-buf/heaps/tegra-vpr.c:207:15: error: implicit declaration of function 'clear_pte_bit'; did you mean 'clear_ptes'? [-Wimplicit-function-declaration]
207 | pte = clear_pte_bit(pte, __pgprot(PROT_NORMAL));
| ^~~~~~~~~~~~~
| clear_ptes
In file included from arch/x86/include/asm/paravirt_types.h:11,
from arch/x86/include/asm/ptrace.h:175,
from arch/x86/include/asm/math_emu.h:5,
from arch/x86/include/asm/processor.h:13,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/fs_dirent.h:5,
from include/linux/fs/super_types.h:5,
from include/linux/fs/super.h:5,
from include/linux/fs.h:5,
from include/linux/debugfs.h:15,
from drivers/dma-buf/heaps/tegra-vpr.c:12:
drivers/dma-buf/heaps/tegra-vpr.c:207:43: error: 'PROT_NORMAL' undeclared (first use in this function)
207 | pte = clear_pte_bit(pte, __pgprot(PROT_NORMAL));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable_types.h:202:48: note: in definition of macro '__pgprot'
202 | #define __pgprot(x) ((pgprot_t) { (x) } )
| ^
drivers/dma-buf/heaps/tegra-vpr.c:207:43: note: each undeclared identifier is reported only once for each function it appears in
207 | pte = clear_pte_bit(pte, __pgprot(PROT_NORMAL));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable_types.h:202:48: note: in definition of macro '__pgprot'
202 | #define __pgprot(x) ((pgprot_t) { (x) } )
| ^
drivers/dma-buf/heaps/tegra-vpr.c:208:15: error: implicit declaration of function 'set_pte_bit'; did you mean 'set_pte_at'? [-Wimplicit-function-declaration]
208 | pte = set_pte_bit(pte, __pgprot(PROT_DEVICE_nGnRnE));
| ^~~~~~~~~~~
| set_pte_at
drivers/dma-buf/heaps/tegra-vpr.c:208:41: error: 'PROT_DEVICE_nGnRnE' undeclared (first use in this function)
208 | pte = set_pte_bit(pte, __pgprot(PROT_DEVICE_nGnRnE));
| ^~~~~~~~~~~~~~~~~~
arch/x86/include/asm/pgtable_types.h:202:48: note: in definition of macro '__pgprot'
202 | #define __pgprot(x) ((pgprot_t) { (x) } )
| ^
drivers/dma-buf/heaps/tegra-vpr.c:210:9: error: implicit declaration of function '__set_pte'; did you mean 'set_pte'? [-Wimplicit-function-declaration]
210 | __set_pte(ptep, pte);
| ^~~~~~~~~
| set_pte
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_unprotect_pages':
drivers/dma-buf/heaps/tegra-vpr.c:218:21: error: invalid initializer
218 | pte_t pte = __ptep_get(ptep);
| ^~~~~~~~~~
drivers/dma-buf/heaps/tegra-vpr.c:220:43: error: 'PROT_DEVICE_nGnRnE' undeclared (first use in this function)
220 | pte = clear_pte_bit(pte, __pgprot(PROT_DEVICE_nGnRnE));
| ^~~~~~~~~~~~~~~~~~
arch/x86/include/asm/pgtable_types.h:202:48: note: in definition of macro '__pgprot'
202 | #define __pgprot(x) ((pgprot_t) { (x) } )
| ^
drivers/dma-buf/heaps/tegra-vpr.c:221:41: error: 'PROT_NORMAL' undeclared (first use in this function)
221 | pte = set_pte_bit(pte, __pgprot(PROT_NORMAL));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable_types.h:202:48: note: in definition of macro '__pgprot'
202 | #define __pgprot(x) ((pgprot_t) { (x) } )
| ^
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_buffer_allocate':
>> drivers/dma-buf/heaps/tegra-vpr.c:612:30: warning: variable 'last' set but not used [-Wunused-but-set-variable]
612 | unsigned long first, last;
| ^~~~
>> drivers/dma-buf/heaps/tegra-vpr.c:612:23: warning: variable 'first' set but not used [-Wunused-but-set-variable]
612 | unsigned long first, last;
| ^~~~~
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_buffer_release':
drivers/dma-buf/heaps/tegra-vpr.c:695:30: warning: variable 'last' set but not used [-Wunused-but-set-variable]
695 | unsigned long first, last;
| ^~~~
drivers/dma-buf/heaps/tegra-vpr.c:695:23: warning: variable 'first' set but not used [-Wunused-but-set-variable]
695 | unsigned long first, last;
| ^~~~~
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_setup_chunks':
>> drivers/dma-buf/heaps/tegra-vpr.c:8:21: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
8 | #define pr_fmt(fmt) "tegra-vpr: " fmt
| ^~~~~~~~~~~~~
include/linux/dynamic_debug.h:231:29: note: in expansion of macro 'pr_fmt'
231 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:259:9: note: in expansion of macro '__dynamic_func_call_cls'
259 | __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:261:9: note: in expansion of macro '_dynamic_func_call_cls'
261 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:280:9: note: in expansion of macro '_dynamic_func_call'
280 | _dynamic_func_call(fmt, __dynamic_pr_debug, \
| ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:636:9: note: in expansion of macro 'dynamic_pr_debug'
636 | dynamic_pr_debug(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~
drivers/dma-buf/heaps/tegra-vpr.c:1075:17: note: in expansion of macro 'pr_debug'
1075 | pr_debug(" %2u: %pap-%pap (%lu MiB)\n", i, &start, &end,
| ^~~~~~~~
drivers/dma-buf/heaps/tegra-vpr.c: In function 'tegra_vpr_add_heap':
drivers/dma-buf/heaps/tegra-vpr.c:1120:30: warning: variable 'last' set but not used [-Wunused-but-set-variable]
1120 | unsigned long first, last;
| ^~~~
drivers/dma-buf/heaps/tegra-vpr.c:1120:23: warning: variable 'first' set but not used [-Wunused-but-set-variable]
1120 | unsigned long first, last;
| ^~~~~vim +/last +612 drivers/dma-buf/heaps/tegra-vpr.c
605
606 static struct tegra_vpr_buffer *
607 tegra_vpr_buffer_allocate(struct tegra_vpr *vpr, size_t size)
608 {
609 unsigned int num_pages = size >> PAGE_SHIFT;
610 unsigned int order = get_order(size);
611 struct tegra_vpr_buffer *buffer;
> 612 unsigned long first, last;
613 int pageno, err;
614 pgoff_t i;
615
616 /*
617 * "order" defines the alignment and size, so this may result in
618 * fragmented memory depending on the allocation patterns. However,
619 * since this is used primarily for video frames, it is expected that
620 * a number of buffers of the same size will be allocated, so
621 * fragmentation should be negligible.
622 */
623 pageno = tegra_vpr_allocate_region(vpr, num_pages, 1);
624 if (pageno < 0)
625 return ERR_PTR(pageno);
626
627 first = find_first_bit(vpr->bitmap, vpr->num_pages);
628 last = find_last_bit(vpr->bitmap, vpr->num_pages);
629
630 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
631 if (!buffer) {
632 err = -ENOMEM;
633 goto release;
634 }
635
636 INIT_LIST_HEAD(&buffer->attachments);
637 INIT_LIST_HEAD(&buffer->list);
638 mutex_init(&buffer->lock);
639 buffer->start = vpr->base + (pageno << PAGE_SHIFT);
640 buffer->limit = buffer->start + size;
641 buffer->size = size;
642 buffer->num_pages = num_pages;
643 buffer->pageno = pageno;
644 buffer->order = order;
645
646 buffer->pages = kmalloc_array(buffer->num_pages,
647 sizeof(*buffer->pages),
648 GFP_KERNEL);
649 if (!buffer->pages) {
650 err = -ENOMEM;
651 goto free;
652 }
653
654 /* track which chunks this buffer overlaps */
655 if (vpr->num_chunks > 0) {
656 unsigned int limit = buffer->pageno + buffer->num_pages, i;
657
658 for (i = 0; i < vpr->num_chunks; i++) {
659 struct tegra_vpr_chunk *chunk = &vpr->chunks[i];
660
661 if (tegra_vpr_chunk_overlaps(chunk, pageno, limit))
662 set_bit(i, buffer->chunks);
663 }
664
665 /* activate chunks if necessary */
666 err = tegra_vpr_activate_chunks(vpr, buffer);
667 if (err < 0)
668 goto free;
669
670 /* track first and last allocated pages */
671 if (buffer->pageno < vpr->first)
672 vpr->first = buffer->pageno;
673
674 if (limit - 1 > vpr->last)
675 vpr->last = limit - 1;
676 }
677
678 for (i = 0; i < buffer->num_pages; i++)
679 buffer->pages[i] = &vpr->start_page[pageno + i];
680
681 return buffer;
682
683 free:
684 kfree(buffer->pages);
685 kfree(buffer);
686 release:
687 bitmap_release_region(vpr->bitmap, pageno, order);
688 return ERR_PTR(err);
689 }
690
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
In reply to Thierry RedingHi,
Quoted 30 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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.
Quoted 8 lines
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 <[email protected]>
Aside from the discussion on CMA, it doesn't look like the heap defines anywhere the attributes of the allocated buffers this heap provides.
Maxime
Thierry Reding
maintainerRe: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
Quoted 40 lines · Maxime Ripard
Hi,
Quoted 37 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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.
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>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?
Thierry
Re: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
Quoted 51 lines · Thierry Reding
Quoted 40 lines · Maxime Ripard
Hi,
Quoted 37 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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.
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>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_infothat sounds like what you expect, nor does the allocation ABI provide any means of reporting attributes.
Quoted 7 lines
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
Thierry Reding
maintainerRe: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
Quoted 58 lines · Maxime Ripard
Quoted 57 lines · Thierry Reding
Quoted 40 lines · Maxime Ripard
Hi,
Quoted 37 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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.
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>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_infothat 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.
Quoted 7 lines
Quoted 1 line
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
The CPU doesn't have access to the contents of these buffers, so cacheable or uncacheable aren't really meaningful, but I guess they are unmappable in that sense. The buffers are physically contiguous, but I think "protected" is the right name for the heap since it most accurately describes what the purpose (and access pattern) is.
Thierry
Re: [PATCH v2 06/10] dma-buf: heaps: Add support for Tegra VPR
Hi Thierry,
Quoted 64 lines · Thierry Reding
Quoted 63 lines · Maxime Ripard
Quoted 51 lines · Thierry Reding
Quoted 40 lines · Maxime Ripard
Hi,
Quoted 37 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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.
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>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_infothat sounds like what you expect, nor does the allocation ABI provide any means of reporting attributes.Quoted 7 lines
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.
Quoted 8 lines
Quoted 2 lines
See
https://docs.kernel.org/userspace-api/dma-buf-heaps.html#heapsThe CPU doesn't have access to the contents of these buffers, so cacheable or uncacheable aren't really meaningful, but I guess they are unmappable in that sense. The buffers are physically contiguous, but I think "protected" is the right name for the heap since it most accurately describes what the purpose (and access pattern) is.
Yeah, that's what panthor has been using too:
https://lore.kernel.org/r/[email protected]
Thierry Reding
maintainerPATCH v2 7/10 arm64: tegra: Add VPR placeholder node on Tegra234
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
This node contains two sets of properties, one for the case where the VPR is resizable (in which case the VPR region will be dynamically allocated at boot time) and another case where the VPR is fixed in size and initialized by early firmware.
The firmware running on the device is responsible for updating the node with the real physical address for the fixed VPR case and remove the properties needed only for resizable VPR. Similarly, if the VPR is resizable, the firmware should remove the "reg" property since it is no longer needed.
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +34 -0
@@ -29,6 +29,40 @@ aliases { i2c8 = &dp_aux_ch3_i2c; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + vpr: video-protection-region@0 { + compatible = "nvidia,tegra-video-protection-region"; + status = "disabled"; + no-map; + + /* + * Two variants exist for this. For fixed VPR, the + * firmware is supposed to update the "reg" property + * with the fixed memory region configured as VPR. + * + * For resizable VPR we don't care about the exact + * address and instead want a reserved region to be + * allocated with a certain size and alignment at + * boot time. + * + * The firmware is responsible for removing the + * unused set of properties. + */ + + /* fixed VPR */ + reg = <0x0 0x0 0x0 0x0>; + + /* resizable VPR */ + size = <0x0 0x70000000>; + alignment = <0x0 0x100000>; + reusable; + }; + }; + bus@0 { compatible = "simple-bus";
Signature · 1 line
2.52.0
Re: [PATCH v2 07/10] arm64: tegra: Add VPR placeholder node on Tegra234
Quoted 23 lines · Thierry Reding
From: Thierry Reding <[email protected]>
This node contains two sets of properties, one for the case where the VPR is resizable (in which case the VPR region will be dynamically allocated at boot time) and another case where the VPR is fixed in size and initialized by early firmware.
The firmware running on the device is responsible for updating the node with the real physical address for the fixed VPR case and remove the properties needed only for resizable VPR. Similarly, if the VPR is resizable, the firmware should remove the "reg" property since it is no longer needed.
Signed-off-by Thierry Reding <[email protected]>--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+)arch/arm64/boot/dts/nvidia/tegra234.dtsi +0
-0
arch/arm64/boot/dts/nvidia/tegra234.dtsi aliases { · line 38
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra234.dtsi +7
-0@@ -29,6 +29,40 @@ aliases { i2c8 = &dp_aux_ch3_i2c; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + vpr: video-protection-region@0 { + compatible = "nvidia,tegra-video-protection-region";
The heap name doesn't follow the documented convention, see
https://docs.kernel.org/userspace-api/dma-buf-heaps.html#naming-convention
Thierry Reding
maintainerRe: [PATCH v2 07/10] arm64: tegra: Add VPR placeholder node on Tegra234
Quoted 27 lines · Maxime Ripard
Quoted 26 lines · Thierry Reding
From: Thierry Reding <[email protected]>
This node contains two sets of properties, one for the case where the VPR is resizable (in which case the VPR region will be dynamically allocated at boot time) and another case where the VPR is fixed in size and initialized by early firmware.
The firmware running on the device is responsible for updating the node with the real physical address for the fixed VPR case and remove the properties needed only for resizable VPR. Similarly, if the VPR is resizable, the firmware should remove the "reg" property since it is no longer needed.
Signed-off-by Thierry Reding <[email protected]>--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+)arch/arm64/boot/dts/nvidia/tegra234.dtsi +0
-0@@ -29,6 +29,40 @@ aliases { i2c8 = &dp_aux_ch3_i2c; };
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra234.dtsi aliases { · line 38
Quoted 7 lines
arch/arm64/boot/dts/nvidia/tegra234.dtsi +7
-0+ reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + vpr: video-protection-region@0 { + compatible = "nvidia,tegra-video-protection-region";The heap name doesn't follow the documented convention, see
https://docs.kernel.org/userspace-api/dma-buf-heaps.html#naming-convention
I could change this to protected@0, which would make the name of the exported heap "protected".
Thierry
Re: [PATCH v2 07/10] arm64: tegra: Add VPR placeholder node on Tegra234
Quoted 39 lines · Thierry Reding
Quoted 27 lines · Maxime Ripard
Quoted 26 lines · Thierry Reding
From: Thierry Reding <[email protected]>
This node contains two sets of properties, one for the case where the VPR is resizable (in which case the VPR region will be dynamically allocated at boot time) and another case where the VPR is fixed in size and initialized by early firmware.
The firmware running on the device is responsible for updating the node with the real physical address for the fixed VPR case and remove the properties needed only for resizable VPR. Similarly, if the VPR is resizable, the firmware should remove the "reg" property since it is no longer needed.
Signed-off-by Thierry Reding <[email protected]>--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+)arch/arm64/boot/dts/nvidia/tegra234.dtsi +0
-0@@ -29,6 +29,40 @@ aliases { i2c8 = &dp_aux_ch3_i2c; };Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra234.dtsi aliases { · line 38
Quoted 7 lines
arch/arm64/boot/dts/nvidia/tegra234.dtsi +7
-0+ reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + vpr: video-protection-region@0 { + compatible = "nvidia,tegra-video-protection-region";The heap name doesn't follow the documented convention, see
https://docs.kernel.org/userspace-api/dma-buf-heaps.html#naming-convention
Quoted 2 lines
I could change this to protected@0, which would make the name of the exported heap "protected".
protected-video would work too, but yeah, as long as it's unique, this works.
Maxime
Thierry Reding
maintainerPATCH v2 8/10 arm64: tegra: Add GPU node on Tegra234
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +17 -0
@@ -5317,6 +5317,23 @@ pcie-ep@141e0000 { }; }; + gpu@17000000 { + compatible = "nvidia,ga10b"; + reg = <0x0 0x17000000 0x0 0x1000000>, + <0x0 0x18000000 0x0 0x1000000>; + interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "nonstall", "stall0", "stall1", "stall2"; + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_GPU>; + clocks = <&bpmp TEGRA234_CLK_GPUSYS>, + <&bpmp TEGRA234_CLK_GPC0CLK>, + <&bpmp TEGRA234_CLK_GPC1CLK>; + clock-names = "sys", "gpc0", "gpc1"; + resets = <&bpmp TEGRA234_RESET_GPU>; + }; + sram@40000000 { compatible = "nvidia,tegra234-sysram", "mmio-sram"; reg = <0x0 0x40000000 0x0 0x80000>;
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 9/10 arm64: tegra: Hook up VPR to host1x
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The host1x needs access to the VPR region, so make sure to reference it via the memory-region property.
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +6 -0
@@ -4474,6 +4474,9 @@ vic@15340000 { interconnect-names = "dma-mem", "write"; iommus = <&smmu_niso1 TEGRA234_SID_VIC>; dma-coherent; + + memory-region = <&vpr>; + memory-region-names = "protected"; }; nvdec@15480000 {
@@ -4492,6 +4495,9 @@ nvdec@15480000 { iommus = <&smmu_niso1 TEGRA234_SID_NVDEC>; dma-coherent; + memory-region = <&vpr>; + memory-region-names = "protected"; + nvidia,memory-controller = <&mc>; /*
Signature · 1 line
2.52.0
Thierry Reding
maintainerPATCH v2 10/10 arm64: tegra: Hook up VPR to the GPU
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The GPU needs to be idled before the VPR can be resized and unidled afterwards. Associate it with the VPR using the standard memory-region device tree property.
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +3 -0
@@ -5338,6 +5338,9 @@ gpu@17000000 { <&bpmp TEGRA234_CLK_GPC1CLK>; clock-names = "sys", "gpc0", "gpc1"; resets = <&bpmp TEGRA234_RESET_GPU>; + + memory-region-names = "protected"; + memory-region = <&vpr>; }; sram@40000000 {
Signature · 1 line
2.52.0
Rob Herring
maintainerQuoted 74 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Hi,
This series adds support for the video protection region (VPR) used on Tegra SoC devices. It's a special region of memory that is protected from accesses by the CPU and used to store DRM protected content (both decrypted stream data as well as decoded video frames).
Patches 1 and 2 add DT binding documentation for the VPR and add the VPR to the list of memory-region items for display and host1x.
Patch 3 adds
bitmap_allocate(), which is likebitmap_allocate_region()but works on sizes that are not a power of two.Patch 4 introduces new APIs needed by the Tegra VPR implementation that allow CMA areas to be dynamically created at runtime rather than using the fixed, system-wide list. This is used in this driver specifically because it can use an arbitrary number of these areas (though they are currently limited to 4).
Patch 5 adds some infrastructure for DMA heap implementations to provide information through debugfs.
The Tegra VPR implementation is added in patch 6. See its commit message for more details about the specifics of this implementation.
Finally, patches 7-10 add the VPR placeholder node on Tegra234 and hook it up to the host1x and GPU nodes so that they can make use of this region.
Changes in v2:
- Tegra VPR implementation is now more optimized to reduce the number of (very slow) resize operations, and allows cross-chunk allocations
- dynamic CMA areas are now trackd separately from static ones, but the global number of CMA pages accounts for all areasThierry
Thierry Reding (10):
dt-bindings: reserved-memory: Document Tegra VPR
dt-bindings: display: tegra: Document memory regions
bitmap: Addbitmap_allocate()function mm/cma: Allow dynamically creating CMA areas
dma-buf: heaps: Add debugfs support
dma-buf: heaps: Add support for Tegra VPR
arm64: tegra: Add VPR placeholder node on Tegra234
arm64: tegra: Add GPU node on Tegra234
arm64: tegra: Hook up VPR to host1x
arm64: tegra: Hook up VPR to the GPU.../display/tegra/nvidia,tegra186-dc.yaml | 10 + .../display/tegra/nvidia,tegra20-dc.yaml | 10 +- .../display/tegra/nvidia,tegra20-host1x.yaml | 7 + .../nvidia,tegra-video-protection-region.yaml | 55 + arch/arm/mm/dma-mapping.c | 2 +- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 60 + arch/s390/mm/init.c | 2 +- drivers/dma-buf/dma-heap.c | 56 + drivers/dma-buf/heaps/Kconfig | 7 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/cma_heap.c | 2 +- drivers/dma-buf/heaps/tegra-vpr.c | 1265 +++++++++++++++++ include/linux/bitmap.h | 25 +- include/linux/cma.h | 7 +- include/linux/dma-heap.h | 2 + include/trace/events/tegra_vpr.h | 57 + mm/cma.c | 187 ++- mm/cma.h | 5 +- 18 files changed, 1713 insertions(+), 47 deletions(-) create mode 100644 Documentation/devicetree/bindings/reserved-memory/nvidia,tegra-video-protection-region.yaml create mode 100644 drivers/dma-buf/heaps/tegra-vpr.c create mode 100644 include/trace/events/tegra_vpr.h
Quoted 5 lines
--
2.52.0
My bot found new DTB warnings on the .dts files added or changed in this series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/next-20260121 (exact match)
Base: tags/next-20260121 (use --merge-base to override)
If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/nvidia/' for [email protected]:
arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 263, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 263, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 263, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 263, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 248, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 248, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 248, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 248, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 260, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['reusable']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} should not be valid under {'required': ['no-map']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
{'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['size']}, {'required': ['reg']}arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): 'oneOf' conditional failed, one must be fixed:
'iommu-addresses' is a required property
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: video-protection-region@0 (nvidia,tegra-video-protection-region): {'compatible': ['nvidia,tegra-video-protection-region'], 'status': ['disabled'], 'no-map': True, 'reg': [[0, 0, 0, 0]], 'size': 1879048192, 'alignment': 1048576, 'reusable': True, 'phandle': 272, '$nodename': ['video-protection-region@0']} is valid under each of {'required': ['compatible', 'size']}, {'required': ['compatible', 'reg']}
from schema $id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra-video-protection-region.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: /bus@0/i2c@31e0000/audio-codec@1c: failed to match any schema with compatible: ['realtek,rt5640']arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'connector' is a dependency of 'usb-role-switch'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-sim-vdk.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: /bus@0/i2c@31c0000/audio-codec@1c: failed to match any schema with compatible: ['realtek,rt5640']arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'connector' is a dependency of 'usb-role-switch'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-1: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb3-0: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb3-1: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'connector' is a dependency of 'usb-role-switch'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): phy-mode: ['10gbase-r'] does not contain items matching the given schema
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'connector' is a dependency of 'usb-role-switch'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0005.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: /bus@0/i2c@31e0000/audio-codec@1c: failed to match any schema with compatible: ['realtek,rt5640']arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-0: 'connector' is a dependency of 'usb-role-switch'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb2-1: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb3-0: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: padctl@3520000 (nvidia,tegra234-xusb-padctl): ports:usb3-1: 'port' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra194-xusb-padctl.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: ethernet@6800000 (nvidia,tegra234-mgbe): phy-mode: ['10gbase-r'] does not contain items matching the given schema
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: ethernet@6900000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: ethernet@6a00000 (nvidia,tegra234-mgbe): 'snps,axi-config', 'stmmac-axi-config' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/net/nvidia,tegra234-mgbe.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: vic@15340000 (nvidia,tegra234-vic): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/display/tegra/nvidia,tegra124-vic.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: nvdec@15480000 (nvidia,tegra234-nvdec): 'memory-region', 'memory-region-names' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/host1x/nvidia,tegra234-nvdec.yamlarch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0008.dtb: /gpu@17000000: failed to match any schema with compatible: ['nvidia,ga10b']