public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Rex-BC Chen <rex-bc.chen@mediatek.com>,
	chunkuang.hu@kernel.org, matthias.bgg@gmail.com
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com,
	Jitao Shi <jitao.shi@mediatek.com>
Subject: Re: [v2,PATCH 1/3] drm/mediatek: dpi dual edge sample mode support
Date: Mon, 19 Apr 2021 09:36:42 +0200	[thread overview]
Message-ID: <a1ffcce8-621e-7493-22d4-e28ff09c31a4@baylibre.com> (raw)
In-Reply-To: <1618407316-10042-2-git-send-email-rex-bc.chen@mediatek.com>

Hi,

On 14/04/2021 15:35, Rex-BC Chen wrote:
> DPI can sample on falling, rising or both edge.
> When DPI sample the data both rising and falling edge.
> It can reduce half data io pins.
> 
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
> Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dpi.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index b05f900d9322..21a3a7b78835 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -83,6 +83,7 @@ struct mtk_dpi {
>  	struct pinctrl *pinctrl;
>  	struct pinctrl_state *pins_gpio;
>  	struct pinctrl_state *pins_dpi;
> +	bool ddr_edge_sel;
>  	int refcount;
>  };
>  
> @@ -121,6 +122,7 @@ struct mtk_dpi_conf {
>  	unsigned int (*cal_factor)(int clock);
>  	u32 reg_h_fre_con;
>  	bool edge_sel_en;
> +	bool dual_edge;
>  };
>  
>  static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask)
> @@ -380,6 +382,15 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
>  	}
>  }
>  
> +static void mtk_dpi_dual_edge(struct mtk_dpi *dpi)
> +{
> +	if (dpi->conf->dual_edge) {
> +		mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | DDR_4PHASE,
> +			     DDR_EN | DDR_4PHASE);
> +		mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, dpi->ddr_edge_sel ? EDGE_SEL : 0, EDGE_SEL);
> +	}
> +}
> +

By using the downstream code as reference:

-       clk_set_rate(dpi->pixel_clk, vm.pixelclock);
+       clk_set_rate(dpi->pixel_clk, vm.pixelclock * (dpi->conf->dual_edge ? 2 : 1));

is missing in mtk_dpi_set_display_mode()

>  static void mtk_dpi_power_off(struct mtk_dpi *dpi)
>  {
>  	if (WARN_ON(dpi->refcount == 0))
> @@ -518,6 +529,7 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi,
>  	mtk_dpi_config_yc_map(dpi, dpi->yc_map);
>  	mtk_dpi_config_color_format(dpi, dpi->color_format);
>  	mtk_dpi_config_2n_h_fre(dpi);
> +	mtk_dpi_dual_edge(dpi);
>  	mtk_dpi_config_disable_edge(dpi);
>  	mtk_dpi_sw_reset(dpi, false);
>  
> 

Neil

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  reply	other threads:[~2021-04-19  7:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 13:35 [v2,PATCH 0/3] mt8183 dpi supports dual edge Rex-BC Chen
2021-04-14 13:35 ` [v2,PATCH 1/3] drm/mediatek: dpi dual edge sample mode support Rex-BC Chen
2021-04-19  7:36   ` Neil Armstrong [this message]
2021-04-29  2:23     ` Rex-BC Chen
2021-04-14 13:35 ` [v2, PATCH 2/3] drm/mediatek: config mt8183 driver data to support dual edge sample Rex-BC Chen
2021-04-14 13:35 ` [v2,PATCH 3/3] drm/mediatek: dpi: add bus format negotiation Rex-BC Chen
2021-04-15  1:09   ` [SPAM][v2,PATCH " CK Hu
2021-04-15  6:14     ` Rex-BC Chen
2021-04-20  8:31       ` [SPAM]Re: " CK Hu
2021-04-29  2:27         ` Rex-BC Chen
2021-04-19  7:38   ` [v2,PATCH " Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1ffcce8-621e-7493-22d4-e28ff09c31a4@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jitao.shi@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rex-bc.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox