Linux-mediatek Archive on lore.kernel.org
 help / color / Atom feed
* [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp
@ 2020-10-10  7:09 Jitao Shi
  2020-10-10  7:09 ` [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp" Jitao Shi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jitao Shi @ 2020-10-10  7:09 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Daniel Vetter,
	David Airlie, dri-devel, linux-kernel
  Cc: devicetree, Jitao Shi, srv_heupstream, huijuan.xie, stonea168,
	cawa.cheng, linux-mediatek, bibby.hsieh, ck.hu, yingjoe.chen,
	eddie.huang, linux-arm-kernel

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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp"
  2020-10-10  7:09 [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp Jitao Shi
@ 2020-10-10  7:09 ` Jitao Shi
  2020-10-12 12:07   ` Bilal Wasim
  2020-10-10  7:09 ` [PATCH v4 2/2] drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp Jitao Shi
  2020-10-12 15:22 ` [v4 PATCH 0/2] " Chun-Kuang Hu
  2 siblings, 1 reply; 6+ messages in thread
From: Jitao Shi @ 2020-10-10  7:09 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Daniel Vetter,
	David Airlie, dri-devel, linux-kernel
  Cc: devicetree, Jitao Shi, srv_heupstream, huijuan.xie, stonea168,
	cawa.cheng, linux-mediatek, bibby.hsieh, ck.hu, yingjoe.chen,
	eddie.huang, linux-arm-kernel

This reverts commit 35bf948f1edbf507f6e57e0879fa6ea36d2d2930.

Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
 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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 2/2] drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp
  2020-10-10  7:09 [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp Jitao Shi
  2020-10-10  7:09 ` [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp" Jitao Shi
@ 2020-10-10  7:09 ` Jitao Shi
  2020-10-12 15:22 ` [v4 PATCH 0/2] " Chun-Kuang Hu
  2 siblings, 0 replies; 6+ messages in thread
From: Jitao Shi @ 2020-10-10  7:09 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Daniel Vetter,
	David Airlie, dri-devel, linux-kernel
  Cc: devicetree, Jitao Shi, srv_heupstream, huijuan.xie, stonea168,
	cawa.cheng, linux-mediatek, bibby.hsieh, ck.hu, yingjoe.chen,
	eddie.huang, linux-arm-kernel

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 <jitao.shi@mediatek.com>
---
 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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp"
  2020-10-10  7:09 ` [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp" Jitao Shi
@ 2020-10-12 12:07   ` Bilal Wasim
  0 siblings, 0 replies; 6+ messages in thread
From: Bilal Wasim @ 2020-10-12 12:07 UTC (permalink / raw)
  To: Jitao Shi
  Cc: Mark Rutland, devicetree, bibby.hsieh, srv_heupstream,
	David Airlie, huijuan.xie, stonea168, linux-kernel, dri-devel,
	cawa.cheng, ck.hu, Rob Herring, linux-mediatek, Daniel Vetter,
	Matthias Brugger, yingjoe.chen, eddie.huang, linux-arm-kernel

Hi Jitao,

On Sat, 10 Oct 2020 15:09:09 +0800
Jitao Shi <jitao.shi@mediatek.com> wrote:

> This reverts commit 35bf948f1edbf507f6e57e0879fa6ea36d2d2930.
> 
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
> ---
>  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 <bilal.wasim@imgtec.com>
Tested-by: Bilal Wasim <bilal.wasim@imgtec.com>

Thanks,
Bilal

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp
  2020-10-10  7:09 [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp Jitao Shi
  2020-10-10  7:09 ` [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp" Jitao Shi
  2020-10-10  7:09 ` [PATCH v4 2/2] drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp Jitao Shi
@ 2020-10-12 15:22 ` Chun-Kuang Hu
  2020-10-13  9:55   ` Jitao Shi
  2 siblings, 1 reply; 6+ messages in thread
From: Chun-Kuang Hu @ 2020-10-12 15:22 UTC (permalink / raw)
  To: Jitao Shi
  Cc: Mark Rutland, DTML, srv_heupstream, David Airlie, huijuan.xie,
	stonea168, linux-kernel, DRI Development, cawa.cheng,
	Rob Herring, moderated list:ARM/Mediatek SoC support,
	Daniel Vetter, Matthias Brugger, yingjoe.chen, eddie.huang,
	Linux ARM

Hi, Jitao:

Jitao Shi <jitao.shi@mediatek.com> 於 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
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp
  2020-10-12 15:22 ` [v4 PATCH 0/2] " Chun-Kuang Hu
@ 2020-10-13  9:55   ` Jitao Shi
  0 siblings, 0 replies; 6+ messages in thread
From: Jitao Shi @ 2020-10-13  9:55 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Mark Rutland, DTML, srv_heupstream, David Airlie, huijuan.xie,
	stonea168, linux-kernel, DRI Development, cawa.cheng,
	Rob Herring, moderated list:ARM/Mediatek SoC support,
	Daniel Vetter, Matthias Brugger, yingjoe.chen, eddie.huang,
	Linux ARM

On Mon, 2020-10-12 at 23:22 +0800, Chun-Kuang Hu wrote:
> Hi, Jitao:
> 
> Jitao Shi <jitao.shi@mediatek.com> 於 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
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10  7:09 [v4 PATCH 0/2] fix scrolling of panel with small hfp or hbp Jitao Shi
2020-10-10  7:09 ` [PATCH v4 1/2] Revert "drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp" Jitao Shi
2020-10-12 12:07   ` Bilal Wasim
2020-10-10  7:09 ` [PATCH v4 2/2] drm/mediatek: dsi: fix scrolling of panel with small hfp or hbp Jitao Shi
2020-10-12 15:22 ` [v4 PATCH 0/2] " Chun-Kuang Hu
2020-10-13  9:55   ` Jitao Shi

Linux-mediatek Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mediatek/0 linux-mediatek/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mediatek linux-mediatek/ https://lore.kernel.org/linux-mediatek \
		linux-mediatek@lists.infradead.org
	public-inbox-index linux-mediatek

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mediatek


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git