Re: [PATCH v7 15/20] drm/mediatek: add display merge mute/unmute support for MT8195

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Nancy:

Nancy.Lin <nancy.lin@xxxxxxxxxxxx> 於 2021年10月29日 週五 下午3:52寫道:
>
> Add merge mute/unmute setting for MT8195.
> MT8195 Vdosys1 merge1~merge4 support HW mute function.

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@xxxxxxxxxx>

>
> Signed-off-by: Nancy.Lin <nancy.lin@xxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/mediatek/mtk_disp_merge.c | 23 ++++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> index 92c81ce24a49..dff2797a2f68 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> @@ -58,12 +58,15 @@
>  #define FLD_PREULTRA_TH_LOW                    GENMASK(15, 0)
>  #define FLD_PREULTRA_TH_HIGH                   GENMASK(31, 16)
>
> +#define DISP_REG_MERGE_MUTE_0          0xf00
> +
>  struct mtk_disp_merge {
> -       void __iomem *regs;
> -       struct clk *clk;
> -       struct clk *async_clk;
> -       struct cmdq_client_reg          cmdq_reg;
> -       bool                            fifo_en;
> +       void __iomem            *regs;
> +       struct clk              *clk;
> +       struct clk              *async_clk;
> +       struct cmdq_client_reg  cmdq_reg;
> +       bool                    fifo_en;
> +       bool                    mute_support;
>  };
>
>  void mtk_merge_start(struct device *dev)
> @@ -82,6 +85,10 @@ void mtk_merge_start_cmdq(struct device *dev, struct cmdq_pkt *cmdq_pkt)
>  {
>         struct mtk_disp_merge *priv = dev_get_drvdata(dev);
>
> +       if (priv->mute_support)
> +               mtk_ddp_write(cmdq_pkt, 0x0, &priv->cmdq_reg, priv->regs,
> +                             DISP_REG_MERGE_MUTE_0);
> +
>         mtk_ddp_write(cmdq_pkt, 1, &priv->cmdq_reg, priv->regs,
>                       DISP_REG_MERGE_CTRL);
>  }
> @@ -90,6 +97,10 @@ void mtk_merge_stop_cmdq(struct device *dev, struct cmdq_pkt *cmdq_pkt)
>  {
>         struct mtk_disp_merge *priv = dev_get_drvdata(dev);
>
> +       if (priv->mute_support)
> +               mtk_ddp_write(cmdq_pkt, 0x1, &priv->cmdq_reg, priv->regs,
> +                             DISP_REG_MERGE_MUTE_0);
> +
>         mtk_ddp_write(cmdq_pkt, 0, &priv->cmdq_reg, priv->regs,
>                       DISP_REG_MERGE_CTRL);
>  }
> @@ -264,6 +275,8 @@ static int mtk_disp_merge_probe(struct platform_device *pdev)
>         priv->fifo_en = of_property_read_bool(dev->of_node,
>                                               "mediatek,merge-fifo-en");
>
> +       priv->mute_support = of_property_read_bool(dev->of_node,
> +                                                  "mediatek,merge-mute");
>         platform_set_drvdata(pdev, priv);
>
>         ret = component_add(dev, &mtk_disp_merge_component_ops);
> --
> 2.18.0
>




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux