devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
@ 2024-08-27 14:24 Alexander Stein
  2024-08-27 14:32 ` Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Stein @ 2024-08-27 14:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: Alexander Stein, linux, devicetree, imx, linux-arm-kernel,
	linux-kernel

Default CMA size is too small for HDMI output and VPU usage. Increase the
default size by providing a CMA memory area.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Smallest RAM variant has 512MiB.

 arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
index d03f7065ddfd7..8ba3ec27bee07 100644
--- a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
@@ -106,6 +106,20 @@ reg_vcc3v3_audio: regulator-vcc3v3-audio {
 		vin-supply = <&reg_mba6_3p3v>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			size = <0x14000000>;
+			alloc-ranges = <0x10000000 0x20000000>;
+			linux,cma-default;
+		};
+	};
+
 	sound {
 		compatible = "fsl,imx-audio-tlv320aic32x4";
 		pinctrl-names = "default";
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
  2024-08-27 14:24 [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory Alexander Stein
@ 2024-08-27 14:32 ` Fabio Estevam
  2024-08-28  6:12   ` Alexander Stein
  2024-08-28  7:49 ` Alexander Stein
  2024-10-08  8:50 ` Shawn Guo
  2 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2024-08-27 14:32 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, linux, devicetree, imx,
	linux-arm-kernel, linux-kernel

Hi Alexander,

On Tue, Aug 27, 2024 at 11:25 AM Alexander Stein
<alexander.stein@ew.tq-group.com> wrote:
>
> Default CMA size is too small for HDMI output and VPU usage. Increase the
> default size by providing a CMA memory area.
....
> +               linux,cma {
> +                       compatible = "shared-dma-pool";
> +                       reusable;
> +                       size = <0x14000000>;

Just curious: how did you calculate that this is a suitable CMA memory
area size?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
  2024-08-27 14:32 ` Fabio Estevam
@ 2024-08-28  6:12   ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2024-08-28  6:12 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, linux, devicetree, imx,
	linux-arm-kernel, linux-kernel

Am Dienstag, 27. August 2024, 16:32:10 CEST schrieb Fabio Estevam:
> Hi Alexander,
> 
> On Tue, Aug 27, 2024 at 11:25 AM Alexander Stein
> <alexander.stein@ew.tq-group.com> wrote:
> >
> > Default CMA size is too small for HDMI output and VPU usage. Increase the
> > default size by providing a CMA memory area.
> ....
> > +               linux,cma {
> > +                       compatible = "shared-dma-pool";
> > +                       reusable;
> > +                       size = <0x14000000>;
> 
> Just curious: how did you calculate that this is a suitable CMA memory
> area size?

Just after startup and a simple weston running on a 1080 HDMI output I habe
this CMA status:
> # grep Cma /proc/meminfo
> CmaTotal:         327680 kB
> CmaFree:          137764 kB

AFAIK also DMA setup is using CMA memory.

When playing (and decoding) bbb_sunflower_1080p_30fps_normal.mp4 free CMA memory
shrinks down to ~60MiB
> # grep Cma /proc/meminfo
> CmaTotal:         327680 kB
> CmaFree:           63144 kB

So, 260MiB should be enough (but just barely). But to give some spare memory
it has been increased to 320MiB.

Best regards,
Alexander
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
  2024-08-27 14:24 [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory Alexander Stein
  2024-08-27 14:32 ` Fabio Estevam
@ 2024-08-28  7:49 ` Alexander Stein
  2024-09-09 14:11   ` Alexander Stein
  2024-10-08  8:50 ` Shawn Guo
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Stein @ 2024-08-28  7:49 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux, devicetree, imx, linux-arm-kernel, linux-kernel

Am Dienstag, 27. August 2024, 16:24:58 CEST schrieb Alexander Stein:
> Default CMA size is too small for HDMI output and VPU usage. Increase the
> default size by providing a CMA memory area.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Smallest RAM variant has 512MiB.
> 
>  arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> index d03f7065ddfd7..8ba3ec27bee07 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> +++ b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> @@ -106,6 +106,20 @@ reg_vcc3v3_audio: regulator-vcc3v3-audio {
>  		vin-supply = <&reg_mba6_3p3v>;
>  	};
>  
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		linux,cma {
> +			compatible = "shared-dma-pool";
> +			reusable;
> +			size = <0x14000000>;
> +			alloc-ranges = <0x10000000 0x20000000>;
> +			linux,cma-default;
> +		};
> +	};
> +

Please do not merge yet.
I just noticed that this breaks mmap'ed fbdev usage. It only works when CMA
area is in HighMem.

Best regards,
Alexander

>  	sound {
>  		compatible = "fsl,imx-audio-tlv320aic32x4";
>  		pinctrl-names = "default";
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
  2024-08-28  7:49 ` Alexander Stein
@ 2024-09-09 14:11   ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2024-09-09 14:11 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux, devicetree, imx, linux-arm-kernel, linux-kernel

Am Mittwoch, 28. August 2024, 09:49:36 CEST schrieb Alexander Stein:
> Am Dienstag, 27. August 2024, 16:24:58 CEST schrieb Alexander Stein:
> > Default CMA size is too small for HDMI output and VPU usage. Increase the
> > default size by providing a CMA memory area.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > Smallest RAM variant has 512MiB.
> > 
> >  arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> > index d03f7065ddfd7..8ba3ec27bee07 100644
> > --- a/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> > +++ b/arch/arm/boot/dts/nxp/imx/imx6qdl-mba6.dtsi
> > @@ -106,6 +106,20 @@ reg_vcc3v3_audio: regulator-vcc3v3-audio {
> >  		vin-supply = <&reg_mba6_3p3v>;
> >  	};
> >  
> > +	reserved-memory {
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +		ranges;
> > +
> > +		linux,cma {
> > +			compatible = "shared-dma-pool";
> > +			reusable;
> > +			size = <0x14000000>;
> > +			alloc-ranges = <0x10000000 0x20000000>;
> > +			linux,cma-default;
> > +		};
> > +	};
> > +
> 
> Please do not merge yet.
> I just noticed that this breaks mmap'ed fbdev usage. It only works when CMA
> area is in HighMem.

Okay, now that commit 5a498d4d06d6d ("drm/fbdev-dma: Only install deferred
I/O if necessary") has been applied, the mentioned problem is gone.
This patch can be applied if there are no concerns.

Best regards,
Alexander
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory
  2024-08-27 14:24 [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory Alexander Stein
  2024-08-27 14:32 ` Fabio Estevam
  2024-08-28  7:49 ` Alexander Stein
@ 2024-10-08  8:50 ` Shawn Guo
  2 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2024-10-08  8:50 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, linux,
	devicetree, imx, linux-arm-kernel, linux-kernel

On Tue, Aug 27, 2024 at 04:24:58PM +0200, Alexander Stein wrote:
> Default CMA size is too small for HDMI output and VPU usage. Increase the
> default size by providing a CMA memory area.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Changed subject prefix to "ARM: dts: imx6qdl-mba6: "

Applied, thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-08  8:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 14:24 [PATCH 1/1] ARM: dts: imx6qdl: Add reserved memory area for CMA memory Alexander Stein
2024-08-27 14:32 ` Fabio Estevam
2024-08-28  6:12   ` Alexander Stein
2024-08-28  7:49 ` Alexander Stein
2024-09-09 14:11   ` Alexander Stein
2024-10-08  8:50 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).