2019-02-15 16:43:28

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: [PATCH v1 0/3] Add Vivante GPU support on STM32MP157c

Add and enable Vivante GPU on stm32mp157c for ED1, DK1 and DK2 boards.

Pierre-Yves MORDRET (3):
ARM: dts: stm32: Add Vivante GPU support on STM32MP157c
ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-ed1 board
ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-dk1 board

arch/arm/boot/dts/stm32mp157a-dk1.dts | 16 ++++++++++++++++
arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
arch/arm/boot/dts/stm32mp157c.dtsi | 10 ++++++++++
3 files changed, 42 insertions(+)

--
2.7.4



2019-02-15 16:41:55

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: [PATCH v1 1/3] ARM: dts: stm32: Add Vivante GPU support on STM32MP157c

Append Vivante GPU DT configuration.

Signed-off-by: Pierre-Yves MORDRET <[email protected]>
---
arch/arm/boot/dts/stm32mp157c.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
index f8bbfff..29540bc 100644
--- a/arch/arm/boot/dts/stm32mp157c.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c.dtsi
@@ -1106,6 +1106,16 @@
status = "disabled";
};

+ gpu: gpu@59000000 {
+ compatible = "vivante,gc";
+ reg = <0x59000000 0x800>;
+ interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc GPU>, <&rcc GPU_K>;
+ clock-names = "bus" ,"core";
+ resets = <&rcc GPU_R>;
+ status = "disabled";
+ };
+
dsi: dsi@5a000000 {
compatible = "st,stm32-dsi";
reg = <0x5a000000 0x800>;
--
2.7.4


2019-02-15 16:42:23

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: [PATCH v1 2/3] ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-ed1 board

Enable Vivante GPU driver for stm32mp157c-ed1 board.

Signed-off-by: Pierre-Yves MORDRET <[email protected]>
---
arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 98ef7a0..792f402 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -20,6 +20,17 @@
reg = <0xC0000000 0x40000000>;
};

+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ gpu_reserved: gpu@f8000000 {
+ reg = <0xf8000000 0x8000000>;
+ no-map;
+ };
+ };
+
aliases {
serial0 = &uart4;
};
@@ -53,6 +64,11 @@
status = "okay";
};

+&gpu {
+ contiguous-area = <&gpu_reserved>;
+ status = "okay";
+};
+
&i2c4 {
pinctrl-names = "default";
pinctrl-0 = <&i2c4_pins_a>;
--
2.7.4


2019-02-15 16:42:39

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: [PATCH v1 3/3] ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-dk1 board

Enable Vivante GPU driver for stm32mp157c-dk1 and dk2 boards.

Signed-off-by: Pierre-Yves MORDRET <[email protected]>
---
arch/arm/boot/dts/stm32mp157a-dk1.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts/stm32mp157a-dk1.dts
index 873a80e..fb2ee06 100644
--- a/arch/arm/boot/dts/stm32mp157a-dk1.dts
+++ b/arch/arm/boot/dts/stm32mp157a-dk1.dts
@@ -27,6 +27,17 @@
reg = <0xc0000000 0x20000000>;
};

+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ gpu_reserved: gpu@dc000000 {
+ reg = <0xdc000000 0x4000000>;
+ no-map;
+ };
+ };
+
led {
compatible = "gpio-leds";
blue {
@@ -57,6 +68,11 @@
};
};

+&gpu {
+ contiguous-area = <&gpu_reserved>;
+ status = "okay";
+};
+
&iwdg2 {
timeout-sec = <32>;
status = "okay";
--
2.7.4


2019-02-15 16:58:03

by Lucas Stach

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] ARM: dts: stm32: Add Vivante GPU support on STM32MP157c

Hi Pierre-Yves,

Am Freitag, den 15.02.2019, 16:58 +0100 schrieb Pierre-Yves MORDRET:
> Append Vivante GPU DT configuration.
>
> Signed-off-by: Pierre-Yves MORDRET <[email protected]>
> ---
>  arch/arm/boot/dts/stm32mp157c.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
> index f8bbfff..29540bc 100644
> --- a/arch/arm/boot/dts/stm32mp157c.dtsi
> +++ b/arch/arm/boot/dts/stm32mp157c.dtsi
> @@ -1106,6 +1106,16 @@
> >   status = "disabled";
> >   };
>  
> + gpu: gpu@59000000 {
> + compatible = "vivante,gc";
> + reg = <0x59000000 0x800>;
> + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&rcc GPU>, <&rcc GPU_K>;
> + clock-names = "bus" ,"core";

Is this a 2D only core? If it is also 3D capable the binding says you
need to specify the shader clock (may be the same clock feeding the
core).

Regards,
Lucas

> + resets = <&rcc GPU_R>;
> + status = "disabled";
> + };
> +
>   dsi: dsi@5a000000 {
>   compatible = "st,stm32-dsi";
>   reg = <0x5a000000 0x800>;

2019-02-15 17:02:04

by Lucas Stach

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-ed1 board

Am Freitag, den 15.02.2019, 16:58 +0100 schrieb Pierre-Yves MORDRET:
> Enable Vivante GPU driver for stm32mp157c-ed1 board.
>
> Signed-off-by: Pierre-Yves MORDRET <[email protected]>
> ---
>  arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts
> b/arch/arm/boot/dts/stm32mp157c-ed1.dts
> index 98ef7a0..792f402 100644
> --- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
> +++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
> @@ -20,6 +20,17 @@
>   reg = <0xC0000000 0x40000000>;
>   };
>  
> + reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + gpu_reserved: gpu@f8000000 {
> + reg = <0xf8000000 0x8000000>;
> + no-map;
> + };
> + };
> +

I don't think you need this. The GPU driver uses very little contig dma
memory. Most of the GPU memory is ordinary paged memory, so setting
aside a private memory region of this size is a waste of memory. Most
likely you can just allow the GPU driver to use the system global CMA
region.

Regards,
Lucas


>   aliases {
>   serial0 = &uart4;
>   };
> @@ -53,6 +64,11 @@
>   status = "okay";
>  };
>  
> +&gpu {
> + contiguous-area = <&gpu_reserved>;
> + status = "okay";
> +};
> +
>  &i2c4 {
>   pinctrl-names = "default";
>   pinctrl-0 = <&i2c4_pins_a>;

2019-02-25 15:49:34

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] ARM: dts: stm32: Add Vivante GPU support on STM32MP157c

Hi Lucas

sorry for the delay : winter season :)

On 2/15/19 5:11 PM, Lucas Stach wrote:
> Hi Pierre-Yves,
>
> Am Freitag, den 15.02.2019, 16:58 +0100 schrieb Pierre-Yves MORDRET:
>> Append Vivante GPU DT configuration.
>>
>> Signed-off-by: Pierre-Yves MORDRET <[email protected]>
>> ---
>>  arch/arm/boot/dts/stm32mp157c.dtsi | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
>> index f8bbfff..29540bc 100644
>> --- a/arch/arm/boot/dts/stm32mp157c.dtsi
>> +++ b/arch/arm/boot/dts/stm32mp157c.dtsi
>> @@ -1106,6 +1106,16 @@
>>>   status = "disabled";
>>>   };
>>  
>> + gpu: gpu@59000000 {
>> + compatible = "vivante,gc";
>> + reg = <0x59000000 0x800>;
>> + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
>> + clocks = <&rcc GPU>, <&rcc GPU_K>;
>> + clock-names = "bus" ,"core";
>
> Is this a 2D only core? If it is also 3D capable the binding says you
> need to specify the shader clock (may be the same clock feeding the
> core).

Yes, this is a 3D core.
As for "shader" clock both "core" and "shader" are connected internally. This is
why no "shader" input clock is seen.
Nonetheless we may add it for bindings compliance but from STM32MP1 pov this
won't make any changes.

Hope it clarifies.

Regards
>
> Regards,
> Lucas
>
>> + resets = <&rcc GPU_R>;
>> + status = "disabled";
>> + };
>> +
>>   dsi: dsi@5a000000 {
>>   compatible = "st,stm32-dsi";
>>   reg = <0x5a000000 0x800>;

2019-02-25 15:59:04

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-ed1 board

Hi again,

On 2/15/19 5:14 PM, Lucas Stach wrote:
> Am Freitag, den 15.02.2019, 16:58 +0100 schrieb Pierre-Yves MORDRET:
>> Enable Vivante GPU driver for stm32mp157c-ed1 board.
>>
>> Signed-off-by: Pierre-Yves MORDRET <[email protected]>
>> ---
>>  arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts
>> b/arch/arm/boot/dts/stm32mp157c-ed1.dts
>> index 98ef7a0..792f402 100644
>> --- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
>> +++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
>> @@ -20,6 +20,17 @@
>>   reg = <0xC0000000 0x40000000>;
>>   };
>>  
>> + reserved-memory {
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + ranges;
>> +
>> + gpu_reserved: gpu@f8000000 {
>> + reg = <0xf8000000 0x8000000>;
>> + no-map;
>> + };
>> + };
>> +
>
> I don't think you need this. The GPU driver uses very little contig dma
> memory. Most of the GPU memory is ordinary paged memory, so setting
> aside a private memory region of this size is a waste of memory. Most
> likely you can just allow the GPU driver to use the system global CMA
> region.

That's correct, but this memory area is also used for U-BOOT splash screen
rendering.
Moreover, even if we lack of proof as for today, it turns out performances are
better with this region as reduces MMU accesses (with Vivante driver)
Eventually using Android framework application is started more gently whatever
previous application and CMA status(fragmentation).
Provided this memory, CMA region is decreased accordingly.

Hope it clarifies.

Regards
>
> Regards,
> Lucas
>
>
>>   aliases {
>>   serial0 = &uart4;
>>   };
>> @@ -53,6 +64,11 @@
>>   status = "okay";
>>  };
>>  
>> +&gpu {
>> + contiguous-area = <&gpu_reserved>;
>> + status = "okay";
>> +};
>> +
>>  &i2c4 {
>>   pinctrl-names = "default";
>>   pinctrl-0 = <&i2c4_pins_a>;

2019-03-18 09:22:50

by Pierre-Yves MORDRET

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] ARM: dts: stm32: enable Vivante GPU support on stm32mp157c-ed1 board

Hi Lucas,

I'm going to resend a new version on this DT. I have to move this region elsewhere.

However I didn't get your feedback about statement I did.
Would it be possible to have your feelings ?

Thanks :)

On 2/25/19 4:57 PM, Pierre Yves MORDRET wrote:
> Hi again,
>
> On 2/15/19 5:14 PM, Lucas Stach wrote:
>> Am Freitag, den 15.02.2019, 16:58 +0100 schrieb Pierre-Yves MORDRET:
>>> Enable Vivante GPU driver for stm32mp157c-ed1 board.
>>>
>>> Signed-off-by: Pierre-Yves MORDRET <[email protected]>
>>> ---
>>>  arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
>>>  1 file changed, 16 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts
>>> b/arch/arm/boot/dts/stm32mp157c-ed1.dts
>>> index 98ef7a0..792f402 100644
>>> --- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
>>> +++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
>>> @@ -20,6 +20,17 @@
>>>   reg = <0xC0000000 0x40000000>;
>>>   };
>>>  
>>> + reserved-memory {
>>> + #address-cells = <1>;
>>> + #size-cells = <1>;
>>> + ranges;
>>> +
>>> + gpu_reserved: gpu@f8000000 {
>>> + reg = <0xf8000000 0x8000000>;
>>> + no-map;
>>> + };
>>> + };
>>> +
>>
>> I don't think you need this. The GPU driver uses very little contig dma
>> memory. Most of the GPU memory is ordinary paged memory, so setting
>> aside a private memory region of this size is a waste of memory. Most
>> likely you can just allow the GPU driver to use the system global CMA
>> region.
>
> That's correct, but this memory area is also used for U-BOOT splash screen
> rendering.
> Moreover, even if we lack of proof as for today, it turns out performances are
> better with this region as reduces MMU accesses (with Vivante driver)
> Eventually using Android framework application is started more gently whatever
> previous application and CMA status(fragmentation).
> Provided this memory, CMA region is decreased accordingly.
>
> Hope it clarifies.
>
> Regards
>>
>> Regards,
>> Lucas
>>
>>
>>>   aliases {
>>>   serial0 = &uart4;
>>>   };
>>> @@ -53,6 +64,11 @@
>>>   status = "okay";
>>>  };
>>>  
>>> +&gpu {
>>> + contiguous-area = <&gpu_reserved>;
>>> + status = "okay";
>>> +};
>>> +
>>>  &i2c4 {
>>>   pinctrl-names = "default";
>>>   pinctrl-0 = <&i2c4_pins_a>;
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>