From: Bilal Wasim <bilalwasim676@gmail.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Jitao Shi <jitao.shi@mediatek.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@linux.ie>,
linux-kernel <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
Daniel Vetter <daniel@ffwll.ch>, CK Hu <ck.hu@mediatek.com>
Subject: Re: [PATCH] drm/mediatek: dsi: Calculate horizontal_backporch_byte by itself
Date: Mon, 16 Nov 2020 00:25:22 +0500 [thread overview]
Message-ID: <20201116002522.1a5c3736@a-VirtualBox> (raw)
In-Reply-To: <CAAOTY_-16s=NXg2kOJijhO+82nNsT9HkKj4PVh1qN8dKchBOBA@mail.gmail.com>
Hi CK,
On Sun, 15 Nov 2020 08:53:24 +0800
Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
> Hi, Bilal:
>
> Please help to test this patch on your Chromebook elm, thanks.
>
> Regards,
> Chun-Kuang Hu
Just tried this patch on the Chromebook Elm, and it doesn't work. The
HDMI screen remains black, though the rest of the system keeps on
operating normally.
>
> Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2020年11月15日 週日
> 上午8:14寫道:
> >
> > From: CK Hu <ck.hu@mediatek.com>
> >
> > Using vm->hfront_porch + vm->hback_porch to calculate
> > horizontal_backporch_byte would make it negtive, so
> > use horizontal_backporch_byte itself to make it positive.
> >
> > Fixes: 35bf948f1edb ("drm/mediatek: dsi: Fix scrolling of panel
> > with small hfp or hbp")
> >
> > Signed-off-by: CK Hu <ck.hu@mediatek.com>
> > Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 53
> > ++++++++++-------------------- 1 file changed, 18 insertions(+), 35
> > deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c index
> > 4a188a942c38..2a64fdaed9a7 100644 ---
> > a/drivers/gpu/drm/mediatek/mtk_dsi.c +++
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -444,7 +444,10 @@ static
> > void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) u32
> > horizontal_sync_active_byte; u32 horizontal_backporch_byte;
> > u32 horizontal_frontporch_byte;
> > + u32 horizontal_front_back_byte;
> > + u32 data_phy_cycles_byte;
> > u32 dsi_tmp_buf_bpp, data_phy_cycles;
> > + u32 delta;
> > struct mtk_phy_timing *timing = &dsi->phy_timing;
> >
> > struct videomode *vm = &dsi->vm;
> > @@ -474,42 +477,22 @@ static void mtk_dsi_config_vdo_timing(struct
> > mtk_dsi *dsi) data_phy_cycles = timing->lpx + timing->da_hs_prepare
> > + timing->da_hs_zero + timing->da_hs_exit;
> >
> > - if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 18) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch); -
> > - horizontal_backporch_byte =
> > - horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 :
> > 12; +
> > + horizontal_frontporch_byte = vm->hfront_porch *
> > dsi_tmp_buf_bpp;
> > + horizontal_front_back_byte = horizontal_frontporch_byte +
> > horizontal_backporch_byte;
> > + data_phy_cycles_byte = data_phy_cycles * dsi->lanes + delta;
> > +
> > + if (horizontal_front_back_byte > data_phy_cycles_byte) {
> > + horizontal_frontporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_frontporch_byte /
> > +
> > horizontal_front_back_byte; +
> > + horizontal_backporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_backporch_byte /
> > +
> > horizontal_front_back_byte; } else {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 12) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - horizontal_backporch_byte =
> > horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + DRM_WARN("HFP + HBP less than d-phy, FPS will under
> > 60Hz\n"); }
> >
> > writel(horizontal_sync_active_byte, dsi->regs + DSI_HSA_WC);
> > --
> > 2.17.1
> >
Thanks,
Bilal
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Bilal Wasim <bilalwasim676@gmail.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Jitao Shi <jitao.shi@mediatek.com>,
David Airlie <airlied@linux.ie>,
linux-kernel <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] drm/mediatek: dsi: Calculate horizontal_backporch_byte by itself
Date: Mon, 16 Nov 2020 00:25:22 +0500 [thread overview]
Message-ID: <20201116002522.1a5c3736@a-VirtualBox> (raw)
In-Reply-To: <CAAOTY_-16s=NXg2kOJijhO+82nNsT9HkKj4PVh1qN8dKchBOBA@mail.gmail.com>
Hi CK,
On Sun, 15 Nov 2020 08:53:24 +0800
Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
> Hi, Bilal:
>
> Please help to test this patch on your Chromebook elm, thanks.
>
> Regards,
> Chun-Kuang Hu
Just tried this patch on the Chromebook Elm, and it doesn't work. The
HDMI screen remains black, though the rest of the system keeps on
operating normally.
>
> Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2020年11月15日 週日
> 上午8:14寫道:
> >
> > From: CK Hu <ck.hu@mediatek.com>
> >
> > Using vm->hfront_porch + vm->hback_porch to calculate
> > horizontal_backporch_byte would make it negtive, so
> > use horizontal_backporch_byte itself to make it positive.
> >
> > Fixes: 35bf948f1edb ("drm/mediatek: dsi: Fix scrolling of panel
> > with small hfp or hbp")
> >
> > Signed-off-by: CK Hu <ck.hu@mediatek.com>
> > Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 53
> > ++++++++++-------------------- 1 file changed, 18 insertions(+), 35
> > deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c index
> > 4a188a942c38..2a64fdaed9a7 100644 ---
> > a/drivers/gpu/drm/mediatek/mtk_dsi.c +++
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -444,7 +444,10 @@ static
> > void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) u32
> > horizontal_sync_active_byte; u32 horizontal_backporch_byte;
> > u32 horizontal_frontporch_byte;
> > + u32 horizontal_front_back_byte;
> > + u32 data_phy_cycles_byte;
> > u32 dsi_tmp_buf_bpp, data_phy_cycles;
> > + u32 delta;
> > struct mtk_phy_timing *timing = &dsi->phy_timing;
> >
> > struct videomode *vm = &dsi->vm;
> > @@ -474,42 +477,22 @@ static void mtk_dsi_config_vdo_timing(struct
> > mtk_dsi *dsi) data_phy_cycles = timing->lpx + timing->da_hs_prepare
> > + timing->da_hs_zero + timing->da_hs_exit;
> >
> > - if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 18) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch); -
> > - horizontal_backporch_byte =
> > - horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 :
> > 12; +
> > + horizontal_frontporch_byte = vm->hfront_porch *
> > dsi_tmp_buf_bpp;
> > + horizontal_front_back_byte = horizontal_frontporch_byte +
> > horizontal_backporch_byte;
> > + data_phy_cycles_byte = data_phy_cycles * dsi->lanes + delta;
> > +
> > + if (horizontal_front_back_byte > data_phy_cycles_byte) {
> > + horizontal_frontporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_frontporch_byte /
> > +
> > horizontal_front_back_byte; +
> > + horizontal_backporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_backporch_byte /
> > +
> > horizontal_front_back_byte; } else {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 12) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - horizontal_backporch_byte =
> > horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + DRM_WARN("HFP + HBP less than d-phy, FPS will under
> > 60Hz\n"); }
> >
> > writel(horizontal_sync_active_byte, dsi->regs + DSI_HSA_WC);
> > --
> > 2.17.1
> >
Thanks,
Bilal
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Bilal Wasim <bilalwasim676@gmail.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Jitao Shi <jitao.shi@mediatek.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
linux-kernel <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>, CK Hu <ck.hu@mediatek.com>
Subject: Re: [PATCH] drm/mediatek: dsi: Calculate horizontal_backporch_byte by itself
Date: Mon, 16 Nov 2020 00:25:22 +0500 [thread overview]
Message-ID: <20201116002522.1a5c3736@a-VirtualBox> (raw)
In-Reply-To: <CAAOTY_-16s=NXg2kOJijhO+82nNsT9HkKj4PVh1qN8dKchBOBA@mail.gmail.com>
Hi CK,
On Sun, 15 Nov 2020 08:53:24 +0800
Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
> Hi, Bilal:
>
> Please help to test this patch on your Chromebook elm, thanks.
>
> Regards,
> Chun-Kuang Hu
Just tried this patch on the Chromebook Elm, and it doesn't work. The
HDMI screen remains black, though the rest of the system keeps on
operating normally.
>
> Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2020年11月15日 週日
> 上午8:14寫道:
> >
> > From: CK Hu <ck.hu@mediatek.com>
> >
> > Using vm->hfront_porch + vm->hback_porch to calculate
> > horizontal_backporch_byte would make it negtive, so
> > use horizontal_backporch_byte itself to make it positive.
> >
> > Fixes: 35bf948f1edb ("drm/mediatek: dsi: Fix scrolling of panel
> > with small hfp or hbp")
> >
> > Signed-off-by: CK Hu <ck.hu@mediatek.com>
> > Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 53
> > ++++++++++-------------------- 1 file changed, 18 insertions(+), 35
> > deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c index
> > 4a188a942c38..2a64fdaed9a7 100644 ---
> > a/drivers/gpu/drm/mediatek/mtk_dsi.c +++
> > b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -444,7 +444,10 @@ static
> > void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) u32
> > horizontal_sync_active_byte; u32 horizontal_backporch_byte;
> > u32 horizontal_frontporch_byte;
> > + u32 horizontal_front_back_byte;
> > + u32 data_phy_cycles_byte;
> > u32 dsi_tmp_buf_bpp, data_phy_cycles;
> > + u32 delta;
> > struct mtk_phy_timing *timing = &dsi->phy_timing;
> >
> > struct videomode *vm = &dsi->vm;
> > @@ -474,42 +477,22 @@ static void mtk_dsi_config_vdo_timing(struct
> > mtk_dsi *dsi) data_phy_cycles = timing->lpx + timing->da_hs_prepare
> > + timing->da_hs_zero + timing->da_hs_exit;
> >
> > - if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 18) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch); -
> > - horizontal_backporch_byte =
> > - horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 18)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 :
> > 12; +
> > + horizontal_frontporch_byte = vm->hfront_porch *
> > dsi_tmp_buf_bpp;
> > + horizontal_front_back_byte = horizontal_frontporch_byte +
> > horizontal_backporch_byte;
> > + data_phy_cycles_byte = data_phy_cycles * dsi->lanes + delta;
> > +
> > + if (horizontal_front_back_byte > data_phy_cycles_byte) {
> > + horizontal_frontporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_frontporch_byte /
> > +
> > horizontal_front_back_byte; +
> > + horizontal_backporch_byte -= data_phy_cycles_byte *
> > +
> > horizontal_backporch_byte /
> > +
> > horizontal_front_back_byte; } else {
> > - if ((vm->hfront_porch + vm->hback_porch) *
> > dsi_tmp_buf_bpp >
> > - data_phy_cycles * dsi->lanes + 12) {
> > - horizontal_frontporch_byte =
> > - vm->hfront_porch * dsi_tmp_buf_bpp -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hfront_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - horizontal_backporch_byte =
> > horizontal_backporch_byte -
> > - (data_phy_cycles * dsi->lanes + 12)
> > *
> > - vm->hback_porch /
> > - (vm->hfront_porch +
> > vm->hback_porch);
> > - } else {
> > - DRM_WARN("HFP less than d-phy, FPS will
> > under 60Hz\n");
> > - horizontal_frontporch_byte =
> > vm->hfront_porch *
> > -
> > dsi_tmp_buf_bpp;
> > - }
> > + DRM_WARN("HFP + HBP less than d-phy, FPS will under
> > 60Hz\n"); }
> >
> > writel(horizontal_sync_active_byte, dsi->regs + DSI_HSA_WC);
> > --
> > 2.17.1
> >
Thanks,
Bilal
next prev parent reply other threads:[~2020-11-15 19:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-15 0:14 [PATCH] drm/mediatek: dsi: Calculate horizontal_backporch_byte by itself Chun-Kuang Hu
2020-11-15 0:14 ` Chun-Kuang Hu
2020-11-15 0:14 ` Chun-Kuang Hu
2020-11-15 0:53 ` Chun-Kuang Hu
2020-11-15 0:53 ` Chun-Kuang Hu
2020-11-15 0:53 ` Chun-Kuang Hu
2020-11-15 19:25 ` Bilal Wasim [this message]
2020-11-15 19:25 ` Bilal Wasim
2020-11-15 19:25 ` Bilal Wasim
2020-11-15 23:12 ` Chun-Kuang Hu
2020-11-15 23:12 ` Chun-Kuang Hu
2020-11-15 23:12 ` Chun-Kuang Hu
2020-11-16 11:53 ` Bilal Wasim
2020-11-16 11:53 ` Bilal Wasim
2020-11-16 11:53 ` Bilal Wasim
2020-11-16 16:43 ` Chun-Kuang Hu
2020-11-16 16:43 ` Chun-Kuang Hu
2020-11-16 16:43 ` Chun-Kuang Hu
2020-11-17 11:58 ` Bilal Wasim
2020-11-17 11:58 ` Bilal Wasim
2020-11-17 11:58 ` Bilal Wasim
2020-11-17 12:01 ` Bilal Wasim
2020-11-17 12:01 ` Bilal Wasim
2020-11-17 12:01 ` Bilal Wasim
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=20201116002522.1a5c3736@a-VirtualBox \
--to=bilalwasim676@gmail.com \
--cc=airlied@linux.ie \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jitao.shi@mediatek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.