2024-02-29 02:36:01

by Jason-JH.Lin

[permalink] [raw]
Subject: [PATCH 0/3] Add GAMMA 12-bit LUT support for MT8188

From: Jason-jh Lin <[email protected]>

Since MT8195 supports GAMMA 12-bit LUT after the landing of [1] series,
we can now add support for MT8188.

[1] MediaTek DDP GAMMA - 12-bit LUT support
- https://patchwork.kernel.org/project/linux-mediatek/list/?series=792516

Jason-JH.Lin (3):
dt-bindings: display: mediatek: gamma: Change MT8195 to single enum
group
dt-bindings: display: mediatek: gamma: Add support for MT8188
drm/mediatek: Add gamma support for MT8195

.../bindings/display/mediatek/mediatek,gamma.yaml | 6 +++++-
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)

--
2.18.0



2024-02-29 02:36:12

by Jason-JH.Lin

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: display: mediatek: gamma: Add support for MT8188

The gamma LUT setting of MT8188 and MT8195 are the same, so we create
a one of items for MT8188 to reuse the driver data settings of MT8195.

Signed-off-by: Jason-JH.Lin <[email protected]>
---
.../devicetree/bindings/display/mediatek/mediatek,gamma.yaml | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
index 3e6cb8f48bcc..90c454eea06f 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
@@ -29,6 +29,10 @@ properties:
- enum:
- mediatek,mt6795-disp-gamma
- const: mediatek,mt8173-disp-gamma
+ - items:
+ - enum:
+ - mediatek,mt8188-disp-gamma
+ - const: mediatek,mt8195-disp-gamma
- items:
- enum:
- mediatek,mt8186-disp-gamma
--
2.18.0


2024-02-29 02:37:37

by Jason-JH.Lin

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: display: mediatek: gamma: Change MT8195 to single enum group

Since MT8195 gamma has multiple bank for 12 bits LUT and it is
different from any other SoC LUT setting.

So we move MT8195 compatible from the one of items to the
single enum group.

Signed-off-by: Jason-JH.Lin <[email protected]>
---
.../devicetree/bindings/display/mediatek/mediatek,gamma.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
index c6641acd75d6..3e6cb8f48bcc 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
@@ -24,6 +24,7 @@ properties:
- enum:
- mediatek,mt8173-disp-gamma
- mediatek,mt8183-disp-gamma
+ - mediatek,mt8195-disp-gamma
- items:
- enum:
- mediatek,mt6795-disp-gamma
@@ -33,7 +34,6 @@ properties:
- mediatek,mt8186-disp-gamma
- mediatek,mt8188-disp-gamma
- mediatek,mt8192-disp-gamma
- - mediatek,mt8195-disp-gamma
- const: mediatek,mt8183-disp-gamma

reg:
--
2.18.0


2024-02-29 08:27:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: display: mediatek: gamma: Add support for MT8188

On 29/02/2024 03:35, Jason-JH.Lin wrote:
> The gamma LUT setting of MT8188 and MT8195 are the same, so we create
> a one of items for MT8188 to reuse the driver data settings of MT8195.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>
> ---
> .../devicetree/bindings/display/mediatek/mediatek,gamma.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> index 3e6cb8f48bcc..90c454eea06f 100644
> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> @@ -29,6 +29,10 @@ properties:
> - enum:
> - mediatek,mt6795-disp-gamma
> - const: mediatek,mt8173-disp-gamma
> + - items:
> + - enum:
> + - mediatek,mt8188-disp-gamma
> + - const: mediatek,mt8195-disp-gamma
> - items:
> - enum:
> - mediatek,mt8186-disp-gamma

Please keep this ordered by fallback compatible, so your list with 8195
fallback should go below the list here.

Best regards,
Krzysztof


2024-02-29 08:27:56

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: display: mediatek: gamma: Change MT8195 to single enum group

On 29/02/2024 03:35, Jason-JH.Lin wrote:
> Since MT8195 gamma has multiple bank for 12 bits LUT and it is
> different from any other SoC LUT setting.
>
> So we move MT8195 compatible from the one of items to the
> single enum group.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>
> ---

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


Subject: Re: [PATCH 2/3] dt-bindings: display: mediatek: gamma: Add support for MT8188

Il 29/02/24 03:35, Jason-JH.Lin ha scritto:
> The gamma LUT setting of MT8188 and MT8195 are the same, so we create
> a one of items for MT8188 to reuse the driver data settings of MT8195.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>



2024-02-29 09:13:57

by Jason-JH.Lin

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: display: mediatek: gamma: Add support for MT8188

Hi Krzysztof,

Thanks for the reviews.

On Thu, 2024-02-29 at 09:27 +0100, Krzysztof Kozlowski wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On 29/02/2024 03:35, Jason-JH.Lin wrote:
> > The gamma LUT setting of MT8188 and MT8195 are the same, so we
> create
> > a one of items for MT8188 to reuse the driver data settings of
> MT8195.
> >
> > Signed-off-by: Jason-JH.Lin <[email protected]>
> > ---
> > .../devicetree/bindings/display/mediatek/mediatek,gamma.yaml | 4
> ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git
> a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.y
> aml
> b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.y
> aml
> > index 3e6cb8f48bcc..90c454eea06f 100644
> > ---
> a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.y
> aml
> > +++
> b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.y
> aml
> > @@ -29,6 +29,10 @@ properties:
> > - enum:
> > - mediatek,mt6795-disp-gamma
> > - const: mediatek,mt8173-disp-gamma
> > + - items:
> > + - enum:
> > + - mediatek,mt8188-disp-gamma
> > + - const: mediatek,mt8195-disp-gamma
> > - items:
> > - enum:
> > - mediatek,mt8186-disp-gamma
>
> Please keep this ordered by fallback compatible, so your list with
> 8195
> fallback should go below the list here.
>
OK, I'll move it here.

Regards,
Jason-JH.Lin

> Best regards,
> Krzysztof
>

2024-02-29 14:38:44

by Jason-JH.Lin

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: display: mediatek: gamma: Change MT8195 to single enum group

Hi Angelo,

Thanks for the reviews.

On Thu, 2024-02-29 at 09:47 +0100, AngeloGioacchino Del Regno wrote:
> Il 29/02/24 03:35, Jason-JH.Lin ha scritto:
> > Since MT8195 gamma has multiple bank for 12 bits LUT and it is
> > different from any other SoC LUT setting.
> >
> > So we move MT8195 compatible from the one of items to the
> > single enum group.
> >
> > Signed-off-by: Jason-JH.Lin <[email protected]>
> > ---
> > .../devicetree/bindings/display/mediatek/mediatek,gamma.yaml |
> > 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma
> > .yaml
> > b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma
> > .yaml
> > index c6641acd75d6..3e6cb8f48bcc 100644
> > ---
> > a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma
> > .yaml
> > +++
> > b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma
> > .yaml
> > @@ -24,6 +24,7 @@ properties:
> > - enum:
> > - mediatek,mt8173-disp-gamma
> > - mediatek,mt8183-disp-gamma
> > + - mediatek,mt8195-disp-gamma
> > - items:
> > - enum:
> > - mediatek,mt6795-disp-gamma
> > @@ -33,7 +34,6 @@ properties:
> > - mediatek,mt8186-disp-gamma
> > - mediatek,mt8188-disp-gamma
> > - mediatek,mt8192-disp-gamma
> > - - mediatek,mt8195-disp-gamma
>
> While I agree on allowing mt8195-disp-gamma to have its own separated
> compatible
> as the IP is actually different from the one in MT8183, you can't do
> it like that,
> or dtbs_check will fail validation for the mt8195 devicetree.
>
OK, I'll keep mt8195 here to fix the validation.

> That one declares...
>
> gamma0: gamma@1c006000 {
> compatible = "mediatek,mt8195-disp-gamma", "mediatek,mt8183-
> disp-gamma";
>
> ...Please always run dtbs_check when performing bindings
> modifications.
>
I'm sorry about that.
I found that I have never run dtbs_check successfully because
the dtbs_check did not appear in my environment after I ran
dt_binding_check...

Finally, I found that using "make dt_binding_check dtbs_check" in the
same cmd line works!
So I'll always do this before sending bindings modification.

Regards,
Jason-JH.Lin

> Cheers,
> Angelo
>
> > - const: mediatek,mt8183-disp-gamma
> >
> > reg:
>
>

Subject: Re: [PATCH 1/3] dt-bindings: display: mediatek: gamma: Change MT8195 to single enum group

Il 29/02/24 03:35, Jason-JH.Lin ha scritto:
> Since MT8195 gamma has multiple bank for 12 bits LUT and it is
> different from any other SoC LUT setting.
>
> So we move MT8195 compatible from the one of items to the
> single enum group.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>
> ---
> .../devicetree/bindings/display/mediatek/mediatek,gamma.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> index c6641acd75d6..3e6cb8f48bcc 100644
> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml
> @@ -24,6 +24,7 @@ properties:
> - enum:
> - mediatek,mt8173-disp-gamma
> - mediatek,mt8183-disp-gamma
> + - mediatek,mt8195-disp-gamma
> - items:
> - enum:
> - mediatek,mt6795-disp-gamma
> @@ -33,7 +34,6 @@ properties:
> - mediatek,mt8186-disp-gamma
> - mediatek,mt8188-disp-gamma
> - mediatek,mt8192-disp-gamma
> - - mediatek,mt8195-disp-gamma

While I agree on allowing mt8195-disp-gamma to have its own separated compatible
as the IP is actually different from the one in MT8183, you can't do it like that,
or dtbs_check will fail validation for the mt8195 devicetree.

That one declares...

gamma0: gamma@1c006000 {
compatible = "mediatek,mt8195-disp-gamma", "mediatek,mt8183-disp-gamma";

..Please always run dtbs_check when performing bindings modifications.

Cheers,
Angelo

> - const: mediatek,mt8183-disp-gamma
>
> reg: