devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jitao Shi <jitao.shi@mediatek.com>
To: Nicolas Boichat <drinkcat@chromium.org>
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 <yingjoe.chen@mediatek.com>,
	Ajay Kumar <ajaykumar.rs@samsung.com>,
	Vincent Palatin <vpalatin@chromium.org>,
	cawa cheng <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>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	Andy Yan <andy.yan@rock-chips.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Eddie Huang <eddie.huang@mediatek.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Rahul Sharma <rahul.sharma@samsung.com>,
	srv_heups
Subject: Re: [PATCH 3/3] drm/mediatek: add mt8183 dsi driver support
Date: Sun, 17 Feb 2019 22:48:12 +0800	[thread overview]
Message-ID: <1550414892.5194.17.camel@mszsdaap41> (raw)
In-Reply-To: <CANMq1KBR-CpjAtj6qTEjK8PA2DUW3w_-OP_EyE7uoaojGLoGLg@mail.gmail.com>

On Thu, 2019-02-14 at 13:54 +0800, Nicolas Boichat wrote:
> On Thu, Feb 14, 2019 at 12:43 PM Jitao Shi <jitao.shi@mediatek.com> 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.
> 
> Can you describe a little bit more what this is about? That's shadow
> registers, right?
> 

Yes, it is shadow registers.

Jitao

> > 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
> 
> As I said earlier, move this to 2/3.
> 

Thank for you review.
I'll move it to 2/3 next version.

Best Regards
Jitao

> > +#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 */
> 
> "DSI does not need double buffering, disable it when writing register"
> 

I'll fix it next version.


> > +       writel(FORCE_COMMIT | BYPASS_SHADOW, dsi->regs + DSI_SHADOW_DEBUG);
> 
> So you do this on all MT* variants, is that ok?
> 
> >         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 },
> >         { },
> >  };
> >
> > --
> > 2.20.1
> >


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

  reply	other threads:[~2019-02-17 14:48 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 [this message]
2019-02-17 23:43       ` Nicolas Boichat
2019-02-14  9:54   ` Matthias Brugger via dri-devel
2019-02-17 14:45     ` Jitao Shi
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=1550414892.5194.17.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=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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=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).