devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jitao Shi <jitao.shi@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, David Airlie <airlied@linux.ie>,
	stonea168@163.com, dri-devel@lists.freedesktop.org,
	yingjoe.chen@mediatek.com, Ajay Kumar <ajaykumar.rs@samsung.com>,
	drinkcat@chromium.org, Vincent Palatin <vpalatin@chromium.org>,
	cawa.cheng@mediatek.com,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Thierry Reding <treding@nvidia.com>,
	linux-pwm@vger.kernel.org, Sascha Hauer <kernel@pengutronix.de>,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Andy Yan <andy.yan@rock-chips.com>,
	eddie.huang@mediatek.com, linux-arm-kernel@lists.infradead.org,
	Rahul Sharma <rahul.sharma@samsung.com>,
	srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org,
	Kumar Gala <galak@codeaurora.org>,
	Sean Paul <seanpaul@chromium.org>
Subject: Re: [PATCH 3/3] drm/mediatek: add mt8183 dsi driver support
Date: Sun, 17 Feb 2019 22:45:16 +0800	[thread overview]
Message-ID: <1550414716.5194.14.camel@mszsdaap41> (raw)
In-Reply-To: <9e37106d-5e29-fc4a-56e1-5b551f47d723@gmail.com>

On Thu, 2019-02-14 at 10:54 +0100, Matthias Brugger wrote:
> 
> On 14/02/2019 05:42, Jitao Shi wrote:
> > MT8183 dsi has two changes with mt8173.
> > 1. Add the register double buffer control, but we no need it, So make
> >    it default off.
> > 2. Add picture size control.
> > 
> > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_dsi.c | 20 +++++++++++++++++++-
> >  1 file changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > index 80db02a25cb0..20cb53f05d42 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > @@ -78,6 +78,7 @@
> >  #define DSI_VBP_NL		0x24
> >  #define DSI_VFP_NL		0x28
> >  #define DSI_VACT_NL		0x2C
> > +#define DSI_SIZE_CON		0x38
> >  #define DSI_HSA_WC		0x50
> >  #define DSI_HBP_WC		0x54
> >  #define DSI_HFP_WC		0x58
> > @@ -131,7 +132,10 @@
> >  #define VM_CMD_EN			BIT(0)
> >  #define TS_VFP_EN			BIT(5)
> >  
> > -#define DSI_CMDQ0		0x180
> > +#define DSI_SHADOW_DEBUG	0x190U
> > +#define FORCE_COMMIT		BIT(0)
> > +#define BYPASS_SHADOW		BIT(1)
> > +
> >  #define CONFIG				(0xff << 0)
> >  #define SHORT_PACKET			0
> >  #define LONG_PACKET			2
> > @@ -158,6 +162,7 @@ struct phy;
> >  
> >  struct mtk_dsi_driver_data {
> >  	const u32 reg_cmdq_off;
> > +	bool has_size_ctl;
> >  };
> >  
> >  struct mtk_dsi {
> > @@ -426,6 +431,9 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi)
> >  	writel(vm->vfront_porch, dsi->regs + DSI_VFP_NL);
> >  	writel(vm->vactive, dsi->regs + DSI_VACT_NL);
> >  
> > +	if (dsi->driver_data->has_size_ctl)
> > +		writel(vm->vactive << 16 | vm->hactive, dsi->regs + DSI_SIZE_CON);
> > +
> >  	horizontal_sync_active_byte = (vm->hsync_len * dsi_tmp_buf_bpp - 10);
> >  
> >  	if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
> > @@ -595,6 +603,9 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
> >  	}
> >  
> >  	mtk_dsi_enable(dsi);
> > +
> > +	/* DSI no need this double buffer, disable it when writing register */
> > +	writel(FORCE_COMMIT | BYPASS_SHADOW, dsi->regs + DSI_SHADOW_DEBUG);
> 
> Is this a mt8183 thing? Did you assure that this does not introduce regressions
> on other SoCs, or does it fix any?
> 
> I think this should be a independent patch. If it fixes an actual issue, then
> please provide a fixes tag in that patch.
> 
> Thanks,
> Matthias
> 

Yes, this is for mt8183. But this reg is reverse on other mtk soc.
It is unsuitable. And i'll put it in mt8183 driver data next version.

Best Regards
Jitao

> >  	mtk_dsi_reset_engine(dsi);
> >  	mtk_dsi_phy_timconfig(dsi);
> >  
> > @@ -1090,11 +1101,18 @@ static const struct mtk_dsi_driver_data mt2701_dsi_driver_data = {
> >  	.reg_cmdq_off = 0x180,
> >  };
> >  
> > +static const struct mtk_dsi_driver_data mt8183_dsi_driver_data = {
> > +	.reg_cmdq_off = 0x200,
> > +	.has_size_ctl = true,
> > +};
> > +
> >  static const struct of_device_id mtk_dsi_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-dsi",
> >  	  .data = &mt2701_dsi_driver_data },
> >  	{ .compatible = "mediatek,mt8173-dsi",
> >  	  .data = &mt8173_dsi_driver_data },
> > +	{ .compatible = "mediatek,mt8183-dsi",
> > +	  .data = &mt8183_dsi_driver_data },
> >  	{ },
> >  };
> >  
> > 


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-02-17 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14  4:42 [PATCH 1/3] drm/mediatek: move mipi_dsi_host_register to probe Jitao Shi
2019-02-14  4:42 ` [PATCH 2/3] drm/mediatek: CMDQ reg address of mt8173 is different with mt2701 Jitao Shi
2019-02-14  5:48   ` Nicolas Boichat
2019-02-17 15:17     ` Jitao Shi
2019-02-14  4:42 ` [PATCH 3/3] drm/mediatek: add mt8183 dsi driver support Jitao Shi
2019-02-14  5:54   ` Nicolas Boichat via dri-devel
2019-02-17 14:48     ` Jitao Shi
2019-02-17 23:43       ` Nicolas Boichat
2019-02-14  9:54   ` Matthias Brugger via dri-devel
2019-02-17 14:45     ` Jitao Shi [this message]
2019-02-14  6:02 ` [PATCH 1/3] drm/mediatek: move mipi_dsi_host_register to probe Nicolas Boichat
2019-02-17 15:13   ` Jitao Shi
2019-02-14 20:48 ` Sean Paul
2019-02-17 14:33   ` Jitao Shi

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=1550414716.5194.14.camel@mszsdaap41 \
    --to=jitao.shi@mediatek.com \
    --cc=airlied@linux.ie \
    --cc=ajaykumar.rs@samsung.com \
    --cc=andy.yan@rock-chips.com \
    --cc=cawa.cheng@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drinkcat@chromium.org \
    --cc=eddie.huang@mediatek.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=rahul.sharma@samsung.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=stonea168@163.com \
    --cc=treding@nvidia.com \
    --cc=vpalatin@chromium.org \
    --cc=yingjoe.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;
as well as URLs for NNTP newsgroup(s).