2020-10-10 09:04:35

by Jitao Shi

[permalink] [raw]
Subject: [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp

Changes since v3:
- Revert v2, for v2 will cause some bridge ic no output. the cause
the video linetime doesn't match display mode from get mode.
- Make sure the horizontal_frontporch_byte and horizontal_backporch_byte
are > 0.

Jitao Shi (2):
Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or
hbp"
drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp

drivers/gpu/drm/mediatek/mtk_dsi.c | 65 +++++++++++++++-----------------------
1 file changed, 25 insertions(+), 40 deletions(-)

--
2.12.5


2020-10-10 09:04:35

by Jitao Shi

[permalink] [raw]
Subject: [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp"

This reverts commit 35bf948f1edbf507f6e57e0879fa6ea36d2d2930.

Signed-off-by: Jitao Shi <[email protected]>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 80b7a082e874..16fd99dcdacf 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -466,13 +466,14 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi)
horizontal_sync_active_byte = (vm->hsync_len * dsi_tmp_buf_bpp - 10);

if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
- horizontal_backporch_byte = vm->hback_porch * dsi_tmp_buf_bpp;
+ horizontal_backporch_byte =
+ (vm->hback_porch * dsi_tmp_buf_bpp - 10);
else
- horizontal_backporch_byte = (vm->hback_porch + vm->hsync_len) *
- dsi_tmp_buf_bpp;
+ horizontal_backporch_byte = ((vm->hback_porch + vm->hsync_len) *
+ dsi_tmp_buf_bpp - 10);

data_phy_cycles = timing->lpx + timing->da_hs_prepare +
- timing->da_hs_zero + timing->da_hs_exit;
+ timing->da_hs_zero + timing->da_hs_exit + 3;

if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
if ((vm->hfront_porch + vm->hback_porch) * dsi_tmp_buf_bpp >
--
2.12.5

2020-10-11 08:34:56

by Jitao Shi

[permalink] [raw]
Subject: [PATCH v4 2/2] drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp

Replace horizontal_backporch_byte with vm->hback_porch * bpp to aovid
flowing judgement negative number.

if ((vm->hfront_porch * dsi_tmp_buf_bpp + horizontal_backporch_byte) >
data_phy_cycles * dsi->lanes + delta)

Signed-off-by: Jitao Shi <[email protected]>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 54 ++++++++++++++------------------------
1 file changed, 19 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 16fd99dcdacf..ddddf69ebeaf 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -445,6 +445,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi)
u32 horizontal_backporch_byte;
u32 horizontal_frontporch_byte;
u32 dsi_tmp_buf_bpp, data_phy_cycles;
+ u32 delta;
struct mtk_phy_timing *timing = &dsi->phy_timing;

struct videomode *vm = &dsi->vm;
@@ -475,42 +476,25 @@ 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 + 3;

- 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;
+
+ if ((vm->hfront_porch * dsi_tmp_buf_bpp + horizontal_backporch_byte) >
+ data_phy_cycles * dsi->lanes + delta) {
+ horizontal_frontporch_byte =
+ vm->hfront_porch * dsi_tmp_buf_bpp -
+ (data_phy_cycles * dsi->lanes + delta) *
+ vm->hfront_porch /
+ (vm->hfront_porch + vm->hback_porch);
+
+ horizontal_backporch_byte =
+ horizontal_backporch_byte -
+ (data_phy_cycles * dsi->lanes + delta) *
+ vm->hback_porch /
+ (vm->hfront_porch + vm->hback_porch);
} 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");
+ horizontal_frontporch_byte = vm->hfront_porch *
+ dsi_tmp_buf_bpp;
}

writel(horizontal_sync_active_byte, dsi->regs + DSI_HSA_WC);
--
2.12.5

2020-10-12 12:09:43

by Bilal Wasim

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp"

Hi Jitao,

On Sat, 10 Oct 2020 15:09:09 +0800
Jitao Shi <[email protected]> wrote:

> This reverts commit 35bf948f1edbf507f6e57e0879fa6ea36d2d2930.
>
> Signed-off-by: Jitao Shi <[email protected]>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> b/drivers/gpu/drm/mediatek/mtk_dsi.c index 80b7a082e874..16fd99dcdacf
> 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -466,13 +466,14 @@ static void mtk_dsi_config_vdo_timing(struct
> mtk_dsi *dsi) horizontal_sync_active_byte = (vm->hsync_len *
> dsi_tmp_buf_bpp - 10);
> if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
> - horizontal_backporch_byte = vm->hback_porch *
> dsi_tmp_buf_bpp;
> + horizontal_backporch_byte =
> + (vm->hback_porch * dsi_tmp_buf_bpp - 10);
> else
> - horizontal_backporch_byte = (vm->hback_porch +
> vm->hsync_len) *
> - dsi_tmp_buf_bpp;
> + horizontal_backporch_byte = ((vm->hback_porch +
> vm->hsync_len) *
> + dsi_tmp_buf_bpp - 10);
>
> data_phy_cycles = timing->lpx + timing->da_hs_prepare +
> - timing->da_hs_zero + timing->da_hs_exit;
> + timing->da_hs_zero + timing->da_hs_exit +
> 3;
> if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
> if ((vm->hfront_porch + vm->hback_porch) *
> dsi_tmp_buf_bpp >

Reviewed-by: Bilal Wasim <[email protected]>
Tested-by: Bilal Wasim <[email protected]>

Thanks,
Bilal

2020-10-13 05:56:21

by Chun-Kuang Hu

[permalink] [raw]
Subject: Re: [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp

Hi, Jitao:

Jitao Shi <[email protected]> 於 2020年10月10日 週六 下午3:09寫道:
>
> Changes since v3:
> - Revert v2, for v2 will cause some bridge ic no output. the cause
> the video linetime doesn't match display mode from get mode.
> - Make sure the horizontal_frontporch_byte and horizontal_backporch_byte
> are > 0.

Because v2 is merged into mainline, I think you should merge 1/2 and
2/2 to one patch which fix the problem caused by v2.

Regards,
Chun-Kuang.

>
> Jitao Shi (2):
> Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or
> hbp"
> drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp
>
> drivers/gpu/drm/mediatek/mtk_dsi.c | 65 +++++++++++++++-----------------------
> 1 file changed, 25 insertions(+), 40 deletions(-)
>
> --
> 2.12.5
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

2020-10-13 16:25:35

by Jitao Shi

[permalink] [raw]
Subject: Re: [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp

On Mon, 2020-10-12 at 23:22 +0800, Chun-Kuang Hu wrote:
> Hi, Jitao:
>
> Jitao Shi <[email protected]> 於 2020年10月10日 週六 下午3:09寫道:
> >
> > Changes since v3:
> > - Revert v2, for v2 will cause some bridge ic no output. the cause
> > the video linetime doesn't match display mode from get mode.
> > - Make sure the horizontal_frontporch_byte and horizontal_backporch_byte
> > are > 0.
>
> Because v2 is merged into mainline, I think you should merge 1/2 and
> 2/2 to one patch which fix the problem caused by v2.
>
> Regards,
> Chun-Kuang.
>

Thanks for your reviewing.
I'll update next version.

Best Regards
Jitao

> >
> > Jitao Shi (2):
> > Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or
> > hbp"
> > drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp
> >
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 65 +++++++++++++++-----------------------
> > 1 file changed, 25 insertions(+), 40 deletions(-)
> >
> > --
> > 2.12.5
> > _______________________________________________
> > dri-devel mailing list
> > [email protected]
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel