drm/simpledrm: Support system memory framebuffers
Subsystems (5)
v4 cover drm/simpledrm: Support system memory framebuffers
From: Thierry Reding <[email protected]>
Hi,
this series of patches adds support for framebuffers residing in system memory to the simple-framebuffer DRM driver. To do this, the DT bindings are extended do accept the memory-region property in addition to the reg property for specifying the framebuffer memory. This is done because the framebuffer memory will typically also need to be marked as reserved so that the operating system will not reuse it and the memory-region property is the standard property to reference reserved memory regions.
A new compatible string is documented to annotate the framebuffer memory regions and the simpledrm driver has code added to bind such annotated regions to the simple-framebuffer device.
The second half of the series then adds support for the XB24 and AB24 formats and ties it all together to provide a simple-framebuffer on Jetson Xavier NX. It should be noted, though, that the Jetson Xavier NX device tree nodes are placeholders only and it is expected that firmware or a bootloader will fill these in at runtime, due to the variable nature of the values that they contain.
This example also uses (but doesn't depend on) the iommu-addresses property that has been proposed and which will hopefully be merged soon.
Version 3 of these patches can be found here:
https://lore.kernel.org/all/[email protected]/
Changes in v4:
- rebase onto latest format helper changes, add back AB24 support
- use drm_dbg() instead of drm_info() for some messages
- use consistent name for iosys_map structures
- collect Reviewed-bys from v3
Changes in v3:
- add new formats into conv_from_xrgb8888[] array to make it work after commit 6fdaed8c7988 ("drm/format-helper: Only advertise supported formats for conversion")
- extract iosys_map fix into a separate patch
- fix bogus increments in struct iosys_map usage
- simplify memory code
Changes in v2:
- DT fields are now cleared so that they can be filled in at runtime
- add XB24 support and treat AB24 the same (alpha bits are unused)
- consistently use struct iosys_map
- fix issues with DT bindings
I've tested these with a simple UEFI implementation that will fill in the placeholder values and set the simple-framebuffer's status property to "okay".
Thierry
Thierry Reding (8):
dt-bindings: display: simple-framebuffer: Support system memory
framebuffers
dt-bindings: display: simple-framebuffer: Document 32-bit BGR format
dt-bindings: reserved-memory: Support framebuffer reserved memory drm/simpledrm: Use struct iosys_map consistently drm/simpledrm: Add support for system memory framebuffers drm/format-helper: Support the AB24/XB24 formats drm/simpledrm: Support the XB24/AB24 format
arm64: tegra: Add simple framebuffer on Jetson Xavier NX
.../bindings/display/simple-framebuffer.yaml | 7 ++ .../bindings/reserved-memory/framebuffer.yaml | 52 +++++++++ .../nvidia/tegra194-p3509-0000+p3668-0001.dts | 43 +++++++ arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +- drivers/gpu/drm/drm_format_helper.c | 66 +++++++++++ drivers/gpu/drm/tiny/simpledrm.c | 110 +++++++++++++----- include/linux/platform_data/simplefb.h | 1 + 7 files changed, 251 insertions(+), 30 deletions(-) create mode 100644 Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml
Signature · 1 line
2.39.0
PATCH v4 1/8 dt-bindings: display: simple-framebuffer: Support system memory framebuffers
From: Thierry Reding <[email protected]>
In order to support framebuffers residing in system memory, allow the memory-region property to override the framebuffer memory specification in the "reg" property.
--- .../devicetree/bindings/display/simple-framebuffer.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/display/simple-framebuffer.yaml +5 -0
@@ -63,6 +63,11 @@ properties: reg: description: Location and size of the framebuffer memory + memory-region: + maxItems: 1 + description: Phandle to a node describing the memory to be used for the + framebuffer. If present, overrides the "reg" property (if one exists). + clocks: description: List of clocks used by the framebuffer.
Signature · 1 line
2.39.0
PATCH v4 2/8 dt-bindings: display: simple-framebuffer: Document 32-bit BGR format
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
This is a variant of the 32-bit RGB format where the red and blue components are swapped.
--- .../devicetree/bindings/display/simple-framebuffer.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/display/simple-framebuffer.yaml +2 -0
@@ -99,6 +99,7 @@ properties: * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b + * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g, d[7:0]=r enum: - a1r5g5b5 - a2r10g10b10
@@ -110,6 +111,7 @@ properties: - x1r5g5b5 - x2r10g10b10 - x8r8g8b8 + - x8b8g8r8 display: $ref: /schemas/types.yaml#/definitions/phandle
Signature · 1 line
2.39.0
PATCH v4 3/8 dt-bindings: reserved-memory: Support framebuffer reserved memory
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Document the "framebuffer" compatible string for reserved memory nodes to annotate reserved memory regions used for framebuffer carveouts.
---
Changes in v2:
- use four spaces for indentation in example (as recommended elsewhere)
- add explicit root node
- drop unneeded quotes
.../bindings/reserved-memory/framebuffer.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml
Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml new file +52 -0
@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/framebuffer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /reserved-memory framebuffer node bindings + +maintainers: + - [email protected] + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: framebuffer + description: > + This indicates a region of memory meant to be used as a framebuffer for + a set of display devices. It can be used by an operating system to keep + the framebuffer from being overwritten and use it as the backing memory + for a display device (such as simple-framebuffer). + +unevaluatedProperties: false + +examples: + - | + / { + compatible = "foo"; + model = "foo"; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + framebuffer { + compatible = "simple-framebuffer"; + memory-region = <&fb>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + fb: framebuffer@80000000 { + compatible = "framebuffer"; + reg = <0x80000000 0x007e9000>; + }; + }; + }; +...
Signature · 1 line
2.39.0
PATCH v4 4/8 drm/simpledrm: Use struct iosys_map consistently
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The majority of the driver already uses struct iosys_map to encapsulate accesses to I/O remapped vs. system memory. Accesses via the screen base pointer still use __iomem annotations, which can lead to inconsistencies and conflicts with subsequent patches.
Convert the screen base to a struct iosys_map as well for consistency and to avoid these issues.
---
Changes in v4:
- rename screen variable to dst for consistency with other drivers
- add Reviewed-by from Thomas
drivers/gpu/drm/tiny/simpledrm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +7 -6
@@ -208,7 +208,7 @@ struct simpledrm_device {unsigned int pitch;/* memory management */ -void __iomem *screen_base; +struct iosys_map screen_base;/* modesetting */ uint32_t formats[8 ];
@@ -473,15 +473,15 @@ static void simpledrm_primary_plane_helper_atomic_update(struct drm_plane *planedrm_atomic_helper_damage_iter_init (&iter, old_plane_state, plane_state);drm_atomic_for_each_plane_damage (&iter, &damage) { -struct iosys_map dst =IOSYS_MAP_INIT_VADDR (sdev->screen_base);struct drm_rect dst_clip = plane_state->dst; +struct iosys_map dst = sdev->screen_base;if (!drm_rect_intersect (&dst_clip, &damage))continue ;iosys_map_incr (&dst,drm_fb_clip_offset (sdev->pitch, sdev->format, &dst_clip)); -drm_fb_blit (&dst, &sdev->pitch, sdev->format->format, shadow_plane_state->data, fb, - &damage); +drm_fb_blit (&dst, &sdev->pitch, sdev->format->format, shadow_plane_state->data, + fb, &damage); }drm_dev_exit (idx);
@@ -500,7 +500,7 @@ static void simpledrm_primary_plane_helper_atomic_disable(struct drm_plane *planreturn ;/* Clear screen to black if disabled */ -memset_io (sdev->screen_base,0 , sdev->pitch * sdev->mode.vdisplay); +iosys_map_memset (&sdev->screen_base,0 ,0 , sdev->pitch * sdev->mode.vdisplay);drm_dev_exit (idx); }
@@ -703,7 +703,8 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, screen_base =devm_ioremap_wc (&pdev->dev, mem->start,resource_size (mem));if (!screen_base)return ERR_PTR (-ENOMEM ); - sdev->screen_base = screen_base; + +iosys_map_set_vaddr_iomem (&sdev->screen_base, screen_base);/* * Modesetting
Signature · 1 line
2.39.0
PATCH v4 5/8 drm/simpledrm: Add support for system memory framebuffers
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Simple framebuffers can be set up in system memory, which cannot be requested and/or I/O remapped using the I/O resource helpers. Add a separate code path that obtains system memory framebuffers from the reserved memory region referenced in the memory-region property.
---
Changes in v4:
- rebase onto latest format helper changes
- turn drm_info() into drm_dbg()
- add Reviewed-by from Thomas
Changes in v3:
- simplify memory code and move back to simpledrm_device_create()
- extract screen_base iosys_map fix into separate patch
Changes in v2:
- make screen base a struct iosys_map to avoid sparse warnings
drivers/gpu/drm/tiny/simpledrm.c | 99 ++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 24 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +75 -24
@@ -3,6 +3,7 @@#include <linux/clk.h> #include <linux/of_clk.h> #include <linux/minmax.h> +#include <linux/of_address.h> #include <linux/platform_data/simplefb.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h>
@@ -184,6 +185,31 @@ simplefb_get_format_of(struct drm_device *dev, struct device_node *of_node)return simplefb_get_validated_format (dev, format); } +static struct resource * +simplefb_get_memory_of (struct drm_device *dev,struct device_node *of_node) +{ +struct device_node *np; +struct resource *res; +int err; + + np =of_parse_phandle (of_node,"memory-region" ,0 ); +if (!np) +return NULL ; + + res =devm_kzalloc (dev->dev,sizeof (*res),GFP_KERNEL ); +if (!res) +return ERR_PTR (-ENOMEM ); + + err =of_address_to_resource (np,0 , res); +if (err) +return ERR_PTR (err); + +if (of_get_property (of_node,"reg" ,NULL )) +drm_warn (dev,"preferring \"memory-region\" over \"reg\" property\n" ); + +return res; +} +/* * Simple Framebuffer device */
@@ -604,8 +630,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,struct drm_device *dev;int width, height, stride;const struct drm_format_info *format; -struct resource *res, *mem; -void __iomem *screen_base; +struct resource *res, *mem =NULL ;struct drm_plane *primary_plane;struct drm_crtc *crtc;struct drm_encoder *encoder;
@@ -657,6 +682,9 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, format =simplefb_get_format_of (dev, of_node);if (IS_ERR (format))return ERR_CAST (format); + mem =simplefb_get_memory_of (dev, of_node); +if (IS_ERR (mem)) +return ERR_CAST (mem); }else {drm_err (dev,"no simplefb configuration found\n" );return ERR_PTR (-ENODEV );
@@ -679,32 +707,55 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,* Memory management */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return ERR_PTR (-EINVAL ); +if (mem) { +void *screen_base; - ret =devm_aperture_acquire_from_firmware (dev, res->start,resource_size (res)); -if (ret) { -drm_err (dev,"could not acquire memory range %pr: error %d\n" , res, ret); -return ERR_PTR (ret); - } + ret =devm_aperture_acquire_from_firmware (dev, mem->start,resource_size (mem)); +if (ret) { +drm_err (dev,"could not acquire memory range %pr: %d\n" , mem, ret); +return ERR_PTR (ret); + } - mem =devm_request_mem_region (&pdev->dev, res->start,resource_size (res), drv->name); -if (!mem) { -/* -* We cannot make this fatal. Sometimes this comes from magic -* spaces our resource handlers simply don't know about. Use -* the I/O-memory resource as-is and try to map that instead. -*/ -drm_warn (dev,"could not acquire memory region %pr\n" , res); - mem = res; - } +drm_dbg (dev,"using system memory framebuffer at %pr\n" , mem); - screen_base =devm_ioremap_wc (&pdev->dev, mem->start,resource_size (mem)); -if (!screen_base) -return ERR_PTR (-ENOMEM ); + screen_base =devm_memremap (dev->dev, mem->start,resource_size (mem),MEMREMAP_WC ); +if (!screen_base) +return ERR_PTR (-ENOMEM ); + +iosys_map_set_vaddr (&sdev->screen_base, screen_base); + }else { +void __iomem *screen_base; + + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!res) +return ERR_PTR (-EINVAL ); -iosys_map_set_vaddr_iomem (&sdev->screen_base, screen_base); + ret =devm_aperture_acquire_from_firmware (dev, res->start,resource_size (res)); +if (ret) { +drm_err (dev,"could not acquire memory range %pr: %d\n" , &res, ret); +return ERR_PTR (ret); + } + +drm_dbg (dev,"using I/O memory framebuffer at %pr\n" , res); + + mem =devm_request_mem_region (&pdev->dev, res->start,resource_size (res), + drv->name); +if (!mem) { +/* +* We cannot make this fatal. Sometimes this comes from magic +* spaces our resource handlers simply don't know about. Use +* the I/O-memory resource as-is and try to map that instead. +*/ +drm_warn (dev,"could not acquire memory region %pr\n" , res); + mem = res; + } + + screen_base =devm_ioremap_wc (&pdev->dev, mem->start,resource_size (mem)); +if (!screen_base) +return ERR_PTR (-ENOMEM ); + +iosys_map_set_vaddr_iomem (&sdev->screen_base, screen_base); + }/* * Modesetting
Signature · 1 line
2.39.0
PATCH v4 6/8 drm/format-helper: Support the AB24/XB24 formats
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add a conversion helper for the AB24 and XB24 formats to use in drm_fb_blit().
---
Changes in v4:
- rebased on top of latest drm-format-helper rework, add back AB24 support
- add Reviewed-by from Thomas
Changes in v3:
- rebase onto latest drm-next
Changes in v2:
- support XB24 format instead of AB24
drivers/gpu/drm/drm_format_helper.c | 66 +++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+)
drivers/gpu/drm/drm_format_helper.c +66 -0
@@ -649,6 +649,66 @@ void drm_fb_xrgb8888_to_argb8888(struct iosys_map *dst, const unsigned int *dst_ }EXPORT_SYMBOL (drm_fb_xrgb8888_to_argb8888); +static void drm_fb_xrgb8888_to_abgr8888_line (void *dbuf,const void *sbuf,unsigned int pixels) +{ +__le32 *dbuf32 = dbuf; +const __le32 *sbuf32 = sbuf; +unsigned int x; +u32 pix; + +for (x =0 ; x < pixels; x++) { + pix =le32_to_cpu (sbuf32[x]); + pix = ((pix &0x00ff0000 ) >>16 ) <<0 | + ((pix &0x0000ff00 ) >>8 ) <<8 | + ((pix &0x000000ff ) >>0 ) <<16 | +GENMASK (31 ,24 );/* fill alpha bits */ + *dbuf32++ =cpu_to_le32 (pix); + } +} + +static void drm_fb_xrgb8888_to_abgr8888 (struct iosys_map *dst,const unsigned int *dst_pitch, +const struct iosys_map *src, +const struct drm_framebuffer *fb, +const struct drm_rect *clip) +{ +static const u8 dst_pixsize[DRM_FORMAT_MAX_PLANES ] = { +4 , + }; + +drm_fb_xfrm (dst, dst_pitch, dst_pixsize, src, fb, clip, false, + drm_fb_xrgb8888_to_abgr8888_line); +} + +static void drm_fb_xrgb8888_to_xbgr8888_line (void *dbuf,const void *sbuf,unsigned int pixels) +{ +__le32 *dbuf32 = dbuf; +const __le32 *sbuf32 = sbuf; +unsigned int x; +u32 pix; + +for (x =0 ; x < pixels; x++) { + pix =le32_to_cpu (sbuf32[x]); + pix = ((pix &0x00ff0000 ) >>16 ) <<0 | + ((pix &0x0000ff00 ) >>8 ) <<8 | + ((pix &0x000000ff ) >>0 ) <<16 | + ((pix &0xff000000 ) >>24 ) <<24 ; + *dbuf32++ =cpu_to_le32 (pix); + } +} + +static void drm_fb_xrgb8888_to_xbgr8888 (struct iosys_map *dst,const unsigned int *dst_pitch, +const struct iosys_map *src, +const struct drm_framebuffer *fb, +const struct drm_rect *clip) +{ +static const u8 dst_pixsize[DRM_FORMAT_MAX_PLANES ] = { +4 , + }; + +drm_fb_xfrm (dst, dst_pitch, dst_pixsize, src, fb, clip, false, + drm_fb_xrgb8888_to_xbgr8888_line); +} +static void drm_fb_xrgb8888_to_xrgb2101010_line (void *dbuf,const void *sbuf,unsigned int pixels) {__le32 *dbuf32 = dbuf;
@@ -868,6 +928,12 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d }else if (dst_format ==DRM_FORMAT_ARGB8888 ) {drm_fb_xrgb8888_to_argb8888 (dst, dst_pitch, src, fb, clip);return 0 ; + }else if (dst_format ==DRM_FORMAT_XBGR8888 ) { +drm_fb_xrgb8888_to_xbgr8888 (dst, dst_pitch, src, fb, clip); +return 0 ; + }else if (dst_format ==DRM_FORMAT_ABGR8888 ) { +drm_fb_xrgb8888_to_abgr8888 (dst, dst_pitch, src, fb, clip); +return 0 ; }else if (dst_format ==DRM_FORMAT_XRGB2101010 ) {drm_fb_xrgb8888_to_xrgb2101010 (dst, dst_pitch, src, fb, clip);return 0 ;
Signature · 1 line
2.39.0
PATCH v4 7/8 drm/simpledrm: Support the XB24/AB24 format
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add XB24 and AB24 to the list of supported formats. The format helpers support conversion to these formats and they are documented in the simple-framebuffer device tree bindings.
---
Changes in v4:
- rebase on top of latest drm-format-helper rework
Changes in v2:
- treat AB24 as XB24 and support both at the same time
include/linux/platform_data/simplefb.h | 1 + 1 file changed, 1 insertion(+)
include/linux/platform_data/simplefb.h +1 -0
@@ -22,6 +22,7 @@ { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \ { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \ { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \ + { "x8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {0, 0}, DRM_FORMAT_XBGR8888 }, \ { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \ { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \ { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \
Signature · 1 line
2.39.0
Re: [PATCH v4 7/8] drm/simpledrm: Support the XB24/AB24 format
Hi
Am 20.01.23 um 18:31 schrieb Thierry Reding:
Quoted 7 lines
From: Thierry Reding <[email protected]>
Add XB24 and AB24 to the list of supported formats. The format helpers support conversion to these formats and they are documented in the simple-framebuffer device tree bindings.
Signed-off-by Thierry Reding <[email protected]>
Quoted 22 lines
---
Changes in v4:
- rebase on top of latest drm-format-helper reworkChanges in v2:
- treat AB24 as XB24 and support both at the same timeinclude/linux/platform_data/simplefb.h | 1 + 1 file changed, 1 insertion(+)include/linux/platform_data/simplefb.h +1
-0@@ -22,6 +22,7 @@ { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \ { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \ { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \ + { "x8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {0, 0}, DRM_FORMAT_XBGR8888 }, \ { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \ { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \ { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Re: [PATCH v4 7/8] drm/simpledrm: Support the XB24/AB24 format
Quoted 5 lines · Thomas Zimmermann
Hi
Am 20.01.23 um 18:31 schrieb Thierry Reding:
Quoted 2 lines
From: Thierry Reding <[email protected]>
Quoted 7 lines
Quoted 5 lines
Add XB24 and AB24 to the list of supported formats. The format helpers support conversion to these formats and they are documented in the simple-framebuffer device tree bindings.
Signed-off-by Thierry Reding <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>
Thanks. This was the last missing Reviewed-by and builds are successful, so I've pushed patches 1-7 to drm-misc-next.
Thierry
PATCH v4 8/8 arm64: tegra: Add simple framebuffer on Jetson Xavier NX
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add the framebuffer carveout reserved memory node as well as a simple- framebuffer node that is used to bind to the framebuffer that the bootloader has set up.
---
Changes in v2:
- clear out dynamic fields and leave it up to firmware to fill them in
- mark simple-framebuffer node as disabled by default
.../nvidia/tegra194-p3509-0000+p3668-0001.dts | 43 +++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dts +43 -0
@@ -7,4 +7,47 @@ / { model = "NVIDIA Jetson Xavier NX Developer Kit (eMMC)"; compatible = "nvidia,p3509-0000+p3668-0001", "nvidia,tegra194"; + + chosen { + framebuffer { + compatible = "simple-framebuffer"; + status = "disabled"; + memory-region = <&fb>; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_DISP>; + clocks = <&bpmp TEGRA194_CLK_SOR1_REF>, + <&bpmp TEGRA194_CLK_SOR1_OUT>, + <&bpmp TEGRA194_CLK_SOR1_PAD_CLKOUT>, + <&bpmp TEGRA194_CLK_PLLD2>, + <&bpmp TEGRA194_CLK_PLLDP>, + <&bpmp TEGRA194_CLK_NVDISPLAY_DISP>, + <&bpmp TEGRA194_CLK_NVDISPLAYHUB>, + <&bpmp TEGRA194_CLK_NVDISPLAY_P0>; + width = <0>; + height = <0>; + stride = <0>; + format = "x8b8g8r8"; + }; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + fb: framebuffer@0,0 { + compatible = "framebuffer"; + reg = <0x0 0x0 0x0 0x0>; + iommu-addresses = <&dc0 0x0 0x0 0x0 0x0>; + }; + }; + + bus@0 { + host1x@13e00000 { + display-hub@15200000 { + display@15200000 { + memory-region = <&fb>; + }; + }; + }; + }; };
arch/arm64/boot/dts/nvidia/tegra194.dtsi +1 -1
@@ -1975,7 +1975,7 @@ display-hub@15200000 { #size-cells = <2>; ranges = <0x0 0x15200000 0x0 0x15200000 0x0 0x40000>; - display@15200000 { + dc0: display@15200000 { compatible = "nvidia,tegra194-dc"; reg = <0x0 0x15200000 0x0 0x10000>; interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.0