[v2,04/11] drm/mediatek: Add OVL compatible name for MT8195

Message ID 20230918084207.23604-5-shawn.sung@mediatek.com
State New
Headers
Series Support IGT in display driver |

Commit Message

Shawn Sung (宋孝謙) Sept. 18, 2023, 8:42 a.m. UTC
  Add OVL compatible name for MT8195.

Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

CK Hu (胡俊光) Sept. 18, 2023, 9:09 a.m. UTC | #1
On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
> Add OVL compatible name for MT8195.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

but it's weird to put this patch into IGT series. Without this patch,
mt8195 drm driver does not work not only IGT.

Regards,
CK

> 
> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 93552d76b6e7..7759a06e5c0e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -715,6 +715,8 @@ static const struct of_device_id
> mtk_ddp_comp_dt_ids[] = {
>  	  .data = (void *)MTK_DISP_OVL },
>  	{ .compatible = "mediatek,mt8192-disp-ovl",
>  	  .data = (void *)MTK_DISP_OVL },
> +	{ .compatible = "mediatek,mt8195-disp-ovl",
> +	  .data = (void *)MTK_DISP_OVL },
>  	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
>  	  .data = (void *)MTK_DISP_OVL_2L },
>  	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
  
AngeloGioacchino Del Regno Sept. 18, 2023, 9:21 a.m. UTC | #2
Il 18/09/23 11:09, CK Hu (胡俊光) ha scritto:
> On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
>> Add OVL compatible name for MT8195.
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 
> but it's weird to put this patch into IGT series. Without this patch,
> mt8195 drm driver does not work not only IGT.
> 

The driver does work because the devicetree node declares two compatibles,
"mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl" where the second
compatible is matched in mtk_drm_drv, and the first is matched in mtk_disp_ovl
as both are platform_driver.

This commit is not necessary, even... :-)

Regards,
Angelo

> Regards,
> CK
> 
>>
>> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
>> ---
>>   drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>> index 93552d76b6e7..7759a06e5c0e 100644
>> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>> @@ -715,6 +715,8 @@ static const struct of_device_id
>> mtk_ddp_comp_dt_ids[] = {
>>   	  .data = (void *)MTK_DISP_OVL },
>>   	{ .compatible = "mediatek,mt8192-disp-ovl",
>>   	  .data = (void *)MTK_DISP_OVL },
>> +	{ .compatible = "mediatek,mt8195-disp-ovl",
>> +	  .data = (void *)MTK_DISP_OVL },
>>   	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
>>   	  .data = (void *)MTK_DISP_OVL_2L },
>>   	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
  
CK Hu (胡俊光) Sept. 18, 2023, 9:27 a.m. UTC | #3
On Mon, 2023-09-18 at 11:21 +0200, AngeloGioacchino Del Regno wrote:
> Il 18/09/23 11:09, CK Hu (胡俊光) ha scritto:
> > On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
> > > Add OVL compatible name for MT8195.
> > 
> > Reviewed-by: CK Hu <ck.hu@mediatek.com>
> > 
> > but it's weird to put this patch into IGT series. Without this
> > patch,
> > mt8195 drm driver does not work not only IGT.
> > 
> 
> The driver does work because the devicetree node declares two
> compatibles,
> "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl" where the
> second
> compatible is matched in mtk_drm_drv, and the first is matched in
> mtk_disp_ovl
> as both are platform_driver.
> 
> This commit is not necessary, even... :-)


Agree. This patch is not necessary.

Regards,
CK

> 
> Regards,
> Angelo
> 
> > Regards,
> > CK
> > 
> > > 
> > > Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > > ---
> > >   drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > index 93552d76b6e7..7759a06e5c0e 100644
> > > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > @@ -715,6 +715,8 @@ static const struct of_device_id
> > > mtk_ddp_comp_dt_ids[] = {
> > >   	  .data = (void *)MTK_DISP_OVL },
> > >   	{ .compatible = "mediatek,mt8192-disp-ovl",
> > >   	  .data = (void *)MTK_DISP_OVL },
> > > +	{ .compatible = "mediatek,mt8195-disp-ovl",
> > > +	  .data = (void *)MTK_DISP_OVL },
> > >   	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
> > >   	  .data = (void *)MTK_DISP_OVL_2L },
> > >   	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
> 
> 
>
  
Shawn Sung (宋孝謙) Oct. 11, 2023, 9:38 a.m. UTC | #4
Hi, Angelo and CK,

On Mon, 2023-09-18 at 11:21 +0200, AngeloGioacchino Del Regno wrote:
> Il 18/09/23 11:09, CK Hu (胡俊光) ha scritto:
> > On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
> > > Add OVL compatible name for MT8195.
> > 
> > Reviewed-by: CK Hu <ck.hu@mediatek.com>
> > 
> > but it's weird to put this patch into IGT series. Without this
> > patch,
> > mt8195 drm driver does not work not only IGT.
> > 
> 
> The driver does work because the devicetree node declares two
> compatibles,
> "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl" where the
> second
> compatible is matched in mtk_drm_drv, and the first is matched in
> mtk_disp_ovl
> as both are platform_driver.
> 
> This commit is not necessary, even... :-)
> 
> Regards,
> Angelo
> 
> > Regards,
> > CK
> > 
> > > 
> > > Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > > ---
> > >   drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > index 93552d76b6e7..7759a06e5c0e 100644
> > > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > @@ -715,6 +715,8 @@ static const struct of_device_id
> > > mtk_ddp_comp_dt_ids[] = {
> > >   	  .data = (void *)MTK_DISP_OVL },
> > >   	{ .compatible = "mediatek,mt8192-disp-ovl",
> > >   	  .data = (void *)MTK_DISP_OVL },
> > > +	{ .compatible = "mediatek,mt8195-disp-ovl",
> > > +	  .data = (void *)MTK_DISP_OVL },
> > >   	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
> > >   	  .data = (void *)MTK_DISP_OVL_2L },
> > >   	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
> 
> 

Please refer to c6aa5f1fb505. This is the main reason why we have to
use MT8195 instead of MT8183/MT8192. Most of the formats required by
IGT is not supported.

Without this commit, DRM won't work after changing the compatible name 
of ovl0 to "mediatek,mt8195-disp-ovl" in the dts.

Thanks,
Shawn
  
AngeloGioacchino Del Regno Oct. 11, 2023, 11:51 a.m. UTC | #5
Il 11/10/23 11:38, Shawn Sung (宋孝謙) ha scritto:
> Hi, Angelo and CK,
> 
> On Mon, 2023-09-18 at 11:21 +0200, AngeloGioacchino Del Regno wrote:
>> Il 18/09/23 11:09, CK Hu (胡俊光) ha scritto:
>>> On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
>>>> Add OVL compatible name for MT8195.
>>>
>>> Reviewed-by: CK Hu <ck.hu@mediatek.com>
>>>
>>> but it's weird to put this patch into IGT series. Without this
>>> patch,
>>> mt8195 drm driver does not work not only IGT.
>>>
>>
>> The driver does work because the devicetree node declares two
>> compatibles,
>> "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl" where the
>> second
>> compatible is matched in mtk_drm_drv, and the first is matched in
>> mtk_disp_ovl
>> as both are platform_driver.
>>
>> This commit is not necessary, even... :-)
>>
>> Regards,
>> Angelo
>>
>>> Regards,
>>> CK
>>>
>>>>
>>>> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
>>>> ---
>>>>    drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>>>> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>>>> index 93552d76b6e7..7759a06e5c0e 100644
>>>> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>>>> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
>>>> @@ -715,6 +715,8 @@ static const struct of_device_id
>>>> mtk_ddp_comp_dt_ids[] = {
>>>>    	  .data = (void *)MTK_DISP_OVL },
>>>>    	{ .compatible = "mediatek,mt8192-disp-ovl",
>>>>    	  .data = (void *)MTK_DISP_OVL },
>>>> +	{ .compatible = "mediatek,mt8195-disp-ovl",
>>>> +	  .data = (void *)MTK_DISP_OVL },
>>>>    	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
>>>>    	  .data = (void *)MTK_DISP_OVL_2L },
>>>>    	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
>>
>>
> 
> Please refer to c6aa5f1fb505. This is the main reason why we have to
> use MT8195 instead of MT8183/MT8192. Most of the formats required by
> IGT is not supported.
> 
> Without this commit, DRM won't work after changing the compatible name
> of ovl0 to "mediatek,mt8195-disp-ovl" in the dts.
> 
> Thanks,
> Shawn

You don't have to change anything at all in the dts.

The current mt8195.dtsi declares:
compatible = "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl";

..this is enough to get the mediatek,mt8195-disp-ovl match in mtk_disp_ovl.

Regards,
Angelo
  
Shawn Sung (宋孝謙) Oct. 12, 2023, 2:18 a.m. UTC | #6
Hi Angelo,

On Wed, 2023-10-11 at 13:51 +0200, AngeloGioacchino Del Regno wrote:
> Il 11/10/23 11:38, Shawn Sung (宋孝謙) ha scritto:
> > Hi, Angelo and CK,
> > 
> > On Mon, 2023-09-18 at 11:21 +0200, AngeloGioacchino Del Regno
> > wrote:
> > > Il 18/09/23 11:09, CK Hu (胡俊光) ha scritto:
> > > > On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
> > > > > Add OVL compatible name for MT8195.
> > > > 
> > > > Reviewed-by: CK Hu <ck.hu@mediatek.com>
> > > > 
> > > > but it's weird to put this patch into IGT series. Without this
> > > > patch,
> > > > mt8195 drm driver does not work not only IGT.
> > > > 
> > > 
> > > The driver does work because the devicetree node declares two
> > > compatibles,
> > > "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl" where the
> > > second
> > > compatible is matched in mtk_drm_drv, and the first is matched in
> > > mtk_disp_ovl
> > > as both are platform_driver.
> > > 
> > > This commit is not necessary, even... :-)
> > > 
> > > Regards,
> > > Angelo
> > > 
> > > > Regards,
> > > > CK
> > > > 
> > > > > 
> > > > > Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > > > > ---
> > > > >    drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++
> > > > >    1 file changed, 2 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > > > b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > > > index 93552d76b6e7..7759a06e5c0e 100644
> > > > > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > > > > @@ -715,6 +715,8 @@ static const struct of_device_id
> > > > > mtk_ddp_comp_dt_ids[] = {
> > > > >    	  .data = (void *)MTK_DISP_OVL },
> > > > >    	{ .compatible = "mediatek,mt8192-disp-ovl",
> > > > >    	  .data = (void *)MTK_DISP_OVL },
> > > > > +	{ .compatible = "mediatek,mt8195-disp-ovl",
> > > > > +	  .data = (void *)MTK_DISP_OVL },
> > > > >    	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
> > > > >    	  .data = (void *)MTK_DISP_OVL_2L },
> > > > >    	{ .compatible = "mediatek,mt8192-disp-ovl-2l",
> > > 
> > > 
> > 
> > Please refer to c6aa5f1fb505. This is the main reason why we have
> > to
> > use MT8195 instead of MT8183/MT8192. Most of the formats required
> > by
> > IGT is not supported.
> > 
> > Without this commit, DRM won't work after changing the compatible
> > name
> > of ovl0 to "mediatek,mt8195-disp-ovl" in the dts.
> > 
> > Thanks,
> > Shawn
> 
> You don't have to change anything at all in the dts.
> 
> The current mt8195.dtsi declares:
> compatible = "mediatek,mt8195-disp-ovl", "mediatek,mt8183-disp-ovl";
> 
> ..this is enough to get the mediatek,mt8195-disp-ovl match in
> mtk_disp_ovl.
> 
> Regards,
> Angelo

We are running IGT on MT8188 and current patch is based on Kernel 6.1.

Regards,
Shawn
  

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 93552d76b6e7..7759a06e5c0e 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -715,6 +715,8 @@  static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
 	  .data = (void *)MTK_DISP_OVL },
 	{ .compatible = "mediatek,mt8192-disp-ovl",
 	  .data = (void *)MTK_DISP_OVL },
+	{ .compatible = "mediatek,mt8195-disp-ovl",
+	  .data = (void *)MTK_DISP_OVL },
 	{ .compatible = "mediatek,mt8183-disp-ovl-2l",
 	  .data = (void *)MTK_DISP_OVL_2L },
 	{ .compatible = "mediatek,mt8192-disp-ovl-2l",