diff mbox series

[v1,13/17] drm/mediatek: Add AAL support for MT8195

Message ID 20210707041249.29816-14-jason-jh.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Add MediaTek SoC DRM (vdosys0) support for mt8195 | expand

Commit Message

Jason-JH Lin (林睿祥) July 7, 2021, 4:12 a.m. UTC
1. Add AAL support for MT8195.
2. Add AAL_OUTPUT_SIZE configuration.

Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 8 +++++++-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c      | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

CK Hu (胡俊光) July 7, 2021, 6:14 a.m. UTC | #1
Hi, Jason:

On Wed, 2021-07-07 at 12:12 +0800, jason-jh.lin wrote:
> 1. Add AAL support for MT8195.
> 2. Add AAL_OUTPUT_SIZE configuration.
> 
> Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 8 +++++++-
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c      | 2 ++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> index 75bc00e17fc4..f154f7c0cd11 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> @@ -34,6 +34,7 @@
>  
>  #define DISP_AAL_EN				0x0000
>  #define DISP_AAL_SIZE				0x0030
> +#define DISP_AAL_OUTPUT_SIZE			0x04d8
>  
>  #define DISP_DITHER_EN				0x0000
>  #define DITHER_EN				BIT(0)
> @@ -196,7 +197,12 @@ static void mtk_aal_config(struct device *dev, unsigned int w,
>  {
>  	struct mtk_ddp_comp_dev *priv = dev_get_drvdata(dev);
>  
> -	mtk_ddp_write(cmdq_pkt, w << 16 | h, &priv->cmdq_reg, priv->regs, DISP_AAL_SIZE);
> +	mtk_ddp_write(cmdq_pkt, w << 16 | h,
> +				&priv->cmdq_reg, priv->regs,
> +				DISP_AAL_SIZE);

Why do you change this?

> +	mtk_ddp_write(cmdq_pkt, w << 16 | h,
> +				&priv->cmdq_reg, priv->regs,
> +				DISP_AAL_OUTPUT_SIZE);

This seems not related to mt8195, so move this modification to another
patch.

>  }
>  
>  static void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state)
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 058b50d0e64b..459bb1e53f2e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -450,6 +450,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
>  	  .data = (void *)MTK_DISP_COLOR },
>  	{ .compatible = "mediatek,mt8173-disp-aal",
>  	  .data = (void *)MTK_DISP_AAL},
> +	{ .compatible = "mediatek,mt8195-disp-aal",
> +	  .data = (void *)MTK_DISP_AAL},

The same question for OVL, COLOR, CCORR.

Regards,
CK

>  	{ .compatible = "mediatek,mt8173-disp-gamma",
>  	  .data = (void *)MTK_DISP_GAMMA, },
>  	{ .compatible = "mediatek,mt8183-disp-gamma",
Jason-JH Lin (林睿祥) July 10, 2021, 7:35 a.m. UTC | #2
On Wed, 2021-07-07 at 14:14 +0800, CK Hu wrote:
> Hi, Jason:
> 
> On Wed, 2021-07-07 at 12:12 +0800, jason-jh.lin wrote:
> > 1. Add AAL support for MT8195.
> > 2. Add AAL_OUTPUT_SIZE configuration.
> > 
> > Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 8 +++++++-
> >  drivers/gpu/drm/mediatek/mtk_drm_drv.c      | 2 ++
> >  2 files changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> > b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> > index 75bc00e17fc4..f154f7c0cd11 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> > @@ -34,6 +34,7 @@
> >  
> >  #define DISP_AAL_EN				0x0000
> >  #define DISP_AAL_SIZE				0x0030
> > +#define DISP_AAL_OUTPUT_SIZE			0x04d8
> >  
> >  #define DISP_DITHER_EN				0x0000
> >  #define DITHER_EN				BIT(0)
> > @@ -196,7 +197,12 @@ static void mtk_aal_config(struct device *dev,
> > unsigned int w,
> >  {
> >  	struct mtk_ddp_comp_dev *priv = dev_get_drvdata(dev);
> >  
> > -	mtk_ddp_write(cmdq_pkt, w << 16 | h, &priv->cmdq_reg, priv-
> > >regs, DISP_AAL_SIZE);
> > +	mtk_ddp_write(cmdq_pkt, w << 16 | h,
> > +				&priv->cmdq_reg, priv->regs,
> > +				DISP_AAL_SIZE);
> 
> Why do you change this?
> 
> > +	mtk_ddp_write(cmdq_pkt, w << 16 | h,
> > +				&priv->cmdq_reg, priv->regs,
> > +				DISP_AAL_OUTPUT_SIZE);
> 
> This seems not related to mt8195, so move this modification to
> another
> patch.
> 
> >  }
> >  
> >  static void mtk_aal_gamma_set(struct device *dev, struct
> > drm_crtc_state *state)
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > index 058b50d0e64b..459bb1e53f2e 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > @@ -450,6 +450,8 @@ static const struct of_device_id
> > mtk_ddp_comp_dt_ids[] = {
> >  	  .data = (void *)MTK_DISP_COLOR },
> >  	{ .compatible = "mediatek,mt8173-disp-aal",
> >  	  .data = (void *)MTK_DISP_AAL},
> > +	{ .compatible = "mediatek,mt8195-disp-aal",
> > +	  .data = (void *)MTK_DISP_AAL},
> 
> The same question for OVL, COLOR, CCORR.
> 
> Regards,
> CK
> 
> 
Hi CK,

To avoid the output height is incorrect, AAL_OUTPUT_SIZE
configuration is necessary setting for every chips.

> 
Other chips may set AAL_OUPUT_SIZE in boot loader or somewhere before
kernel, so they didn't need this confiuration here.

So I'll remove this patch at the next version.

Regard,
Jason-JH.Lin

> >  	{ .compatible = "mediatek,mt8173-disp-gamma",
> >  	  .data = (void *)MTK_DISP_GAMMA, },
> >  	{ .compatible = "mediatek,mt8183-disp-gamma",
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
index 75bc00e17fc4..f154f7c0cd11 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
@@ -34,6 +34,7 @@ 
 
 #define DISP_AAL_EN				0x0000
 #define DISP_AAL_SIZE				0x0030
+#define DISP_AAL_OUTPUT_SIZE			0x04d8
 
 #define DISP_DITHER_EN				0x0000
 #define DITHER_EN				BIT(0)
@@ -196,7 +197,12 @@  static void mtk_aal_config(struct device *dev, unsigned int w,
 {
 	struct mtk_ddp_comp_dev *priv = dev_get_drvdata(dev);
 
-	mtk_ddp_write(cmdq_pkt, w << 16 | h, &priv->cmdq_reg, priv->regs, DISP_AAL_SIZE);
+	mtk_ddp_write(cmdq_pkt, w << 16 | h,
+				&priv->cmdq_reg, priv->regs,
+				DISP_AAL_SIZE);
+	mtk_ddp_write(cmdq_pkt, w << 16 | h,
+				&priv->cmdq_reg, priv->regs,
+				DISP_AAL_OUTPUT_SIZE);
 }
 
 static void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 058b50d0e64b..459bb1e53f2e 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -450,6 +450,8 @@  static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
 	  .data = (void *)MTK_DISP_COLOR },
 	{ .compatible = "mediatek,mt8173-disp-aal",
 	  .data = (void *)MTK_DISP_AAL},
+	{ .compatible = "mediatek,mt8195-disp-aal",
+	  .data = (void *)MTK_DISP_AAL},
 	{ .compatible = "mediatek,mt8173-disp-gamma",
 	  .data = (void *)MTK_DISP_GAMMA, },
 	{ .compatible = "mediatek,mt8183-disp-gamma",