drm/sun4i: dsi: Fixes/updates (A33 reworked!)
Subsystems (6)
v11 cover drm/sun4i: dsi: Fixes/updates (A33 reworked!)
This is v11 version changes for previous series[1].
This series dropped the tcon->dclk_min_div and tcon->dclk_max_div patches, since the discussion on the respective threads[2][3] not finalized or not agree on both the ends.
This series mostly the commit messages changes suggested by Chen-Yu.
Most of these issues are reproduced while supporting Allwinner A64 MIPI-DSI [4] but to confirm it with other SoC this series is reworked on A33 since the controller tested it A33 as of now.
Since we don't have proper evidence and documentation for dsi controller in Allwinner, these changes are more likely to rely on new working BSP codes (even the initial driver written as per this rule).
All these fixes/updates are tested in "bananapi,s070wv20-ct16" panel on Allwinner A33, the same panel timings are available in panel-simple in mainline tree.
Changes for v11:
- Drop DCLK dividers patches
- Updated the commit message changes suggested by Chen-Yu
- rebased on linux-next
Changes for v10:
- reworked previous "Fixes/updates" patches on A33
- reworked previous A64 DSI fixes on A33
- added proper detailed commit messages with logs
- tested on BPI-M2M board.
Changes for v9:
- rebase on drm-misc
- update commit messages
- add hsync_porch overflow patch
Changes for v8:
- rebase on master
- rework on commit messages
- rework video start delay
- include drq changes from previous version
Changes for v7:
- rebase on master
- collect Merlijn Wajer Tested-by credits.
Changes for v6:
- fixed all burst mode patches as per previous version comments
- rebase on master
- update proper commit message
- dropped unneeded comments
- order the patches that make review easy
Changes for v5, v4, v3, v2:
- use existing driver code construct for hblk computation
- create separate function for vblk computation
- cleanup commit messages
- update proper commit messages
- fixed checkpatch warnings/errors
- use proper return value for tcon0 probe
- add logic to get tcon0 divider values
- simplify timings code to support burst mode
- fix drq computation return values
- rebase on master
Any inputs?
Jagan.
[1] https://patchwork.freedesktop.org/series/60847/
[2] https://patchwork.freedesktop.org/patch/305923/?series=60847&rev=1
[3] https://patchwork.kernel.org/patch/10779937/
[4] https://patchwork.freedesktop.org/series/57834/
Jagan Teki (7):
drm/sun4i: dsi: Fix TCON DRQ set bits
drm/sun4i: dsi: Update start value in video start delay
drm/sun4i: dsi: Fix video start delay computation
dt-bindings: sun6i-dsi: Add VCC-DSI supply property
drm/sun4i: sun6i_mipi_dsi: Add VCC-DSI regulator support
[DO NOT MERGE] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge [DO NOT MERGE] ARM: dts: sun8i: bananapi-m2m: Enable Bananapi S070WV20-CT16 DSI panel
.../display/allwinner,sun6i-a31-mipi-dsi.yaml | 3 + arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 40 +++ drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-bananapi-s070wv20-icn6211.c | 293 ++++++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 32 +- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 + 7 files changed, 376 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v11 1/7 drm/sun4i: dsi: Fix TCON DRQ set bits
The LCD timing definitions between Linux DRM vs Allwinner are different, below diagram shows this clear differences.
Active Front Sync Back
Region Porch Porch
<-----------------------><----------------><--------------><-------------->
//////////////////////|
////////////////////// |
////////////////////// |.................. ................
________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------>
<----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp --------->
<-------------------------------- lcd_[hv]t ------------------------------>
The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to flip_done timed out as:
WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00026-g01f0c75b902d-dirty #13 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac) [<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0) [<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140) [<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c) [<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8) [<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160) [<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8) [<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c) [<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c) [<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90) [<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace b57eb1e5c64c6b8b ]---
random: fast init done
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0] flip_done timed out
With the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +2 -2
@@ -437,9 +437,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, SUN6I_DSI_BURST_LINE_SYNC_POINT(SUN6I_DSI_SYNC_POINT)); val =SUN6I_DSI_TCON_DRQ_ENABLE_MODE ; - }else if ((mode->hsync_end - mode->hdisplay) >20 ) { + }else if ((mode->hsync_start - mode->hdisplay) >20 ) {/* Maaaaaagic */ -u16 drq = (mode->hsync_end - mode->hdisplay) -20 ; +u16 drq = (mode->hsync_start - mode->hdisplay) -20 ; drq *=mipi_dsi_pixel_format_to_bpp (device->format); drq /=32 ;
Signature · 1 line
2.18.0.321.gffc6fa0e3
Re: [PATCH v11 1/7] drm/sun4i: dsi: Fix TCON DRQ set bits
于 2019年10月3日 GMT+08:00 下午2:45:21, Jagan Teki <[email protected]> 写到:
Quoted 23 lines
The LCD timing definitions between Linux DRM vs Allwinner are different,
below diagram shows this clear differences.Active Front Sync Back Region Porch Porch<-----------------------><----------------><--------------><-------------->
//////////////////////|
////////////////////// |
////////////////////// |..................
................________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------><----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp ---------><-------------------------------- lcd_[hv]t
------------------------------>
Quoted 7 lines
The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to
flip_donetimed out as:
I don't think attaching this error infomation is useful at all.
It's just timing mismatch.
Quoted 121 lines
WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00026-g01f0c75b902d-dirty #13 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func[<
c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14)
[<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c)
[<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128)
[<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc)
[<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac)
[<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390)
[<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4)
[<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc)
[<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84)
[<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60)
[<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20)
[<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8)
[<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118)
[<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160)
[<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0)
[<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140)
[<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234)
[<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c)
[<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8)
[<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160)
[<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8)
[<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c)
[<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c)
[<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90)
[<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420)
[<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0)
[<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)Exception stack(0xde539fb0 to 0xde539ff8)9fa0: 00000000 00000000 00000000
00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000---[ end trace b57eb1e5c64c6b8b ]---random: fast init done [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0]
flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0]flip_donetimed outWith the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +2
-2@@ -437,9 +437,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, SUN6I_DSI_BURST_LINE_SYNC_POINT(SUN6I_DSI_SYNC_POINT)); val =SUN6I_DSI_TCON_DRQ_ENABLE_MODE ; - }else if ((mode->hsync_end - mode->hdisplay) >20 ) { + }else if ((mode->hsync_start - mode->hdisplay) >20 ) {/* Maaaaaagic */ -u16 drq = (mode->hsync_end - mode->hdisplay) -20 ; +u16 drq = (mode->hsync_start - mode->hdisplay) -20 ; drq *=mipi_dsi_pixel_format_to_bpp (device->format);drq /= 32;
Signature · 1 line
使用 K-9 Mail 发送自我的Android设备。
Re: [linux-sunxi] Re: [PATCH v11 1/7] drm/sun4i: dsi: Fix TCON DRQ set bits
Quoted 33 lines · Icenowy Zheng
于 2019年10月3日 GMT+08:00 下午2:45:21, Jagan Teki <[email protected]> 写到:
Quoted 29 lines
The LCD timing definitions between Linux DRM vs Allwinner are different,
below diagram shows this clear differences.Active Front Sync Back Region Porch Porch<-----------------------><----------------><--------------><-------------->
//////////////////////|
////////////////////// |
////////////////////// |..................
................________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------><----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp ---------><-------------------------------- lcd_[hv]t
------------------------------>The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Quoted 3 lines
Quoted 1 line
Including additional sync timings leads to
flip_donetimed out as:I don't think attaching this error infomation is useful at all.
Since the error would be common irrespective of panels and it would trigger from dsi controller, I thought this would be useful for reference. I have had this conversation in previous version changes, so I have added it. let me know if have any comments.
Re: [PATCH v11 1/7] drm/sun4i: dsi: Fix TCON DRQ set bits
In reply to Jagan TekiQuoted 81 lines · Jagan Teki
The LCD timing definitions between Linux DRM vs Allwinner are different, below diagram shows this clear differences.
Active Front Sync Back Region Porch Porch <-----------------------><----------------><--------------><--------------> //////////////////////| ////////////////////// | ////////////////////// |.................. ................ ________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------><----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp ---------><-------------------------------- lcd_[hv]t ------------------------------>
The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to
flip_donetimed out as:WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00026-g01f0c75b902d-dirty #13 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac) [<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0) [<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140) [<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c) [<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8) [<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160) [<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8) [<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c) [<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c) [<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90) [<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace b57eb1e5c64c6b8b ]---random: fast init done
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0]flip_donetimed out
Quoted 5 lines
With the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Applied, thanks
Maxime
Re: [PATCH v11 1/7] drm/sun4i: dsi: Fix TCON DRQ set bits
Quoted 83 lines · Maxime Ripard
Quoted 81 lines · Jagan Teki
The LCD timing definitions between Linux DRM vs Allwinner are different, below diagram shows this clear differences.
Active Front Sync Back Region Porch Porch <-----------------------><----------------><--------------><--------------> //////////////////////| ////////////////////// | ////////////////////// |.................. ................ ________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------><----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp ---------><-------------------------------- lcd_[hv]t ------------------------------>
The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to
flip_donetimed out as:WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00026-g01f0c75b902d-dirty #13 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac) [<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0) [<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140) [<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c) [<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8) [<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160) [<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8) [<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c) [<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c) [<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90) [<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace b57eb1e5c64c6b8b ]---random: fast init done
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0]flip_donetimed out
Quoted 7 lines
Quoted 5 lines
With the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>Applied, thanks
Thanks, would you apply the similar change in 3/7?
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maxime Ripard
maintainerRe: [PATCH v11 1/7] drm/sun4i: dsi: Fix TCON DRQ set bits
Quoted 87 lines · Jagan Teki
Quoted 86 lines · Maxime Ripard
Quoted 84 lines · Jagan Teki
The LCD timing definitions between Linux DRM vs Allwinner are different, below diagram shows this clear differences.
Active Front Sync Back Region Porch Porch <-----------------------><----------------><--------------><--------------> //////////////////////| ////////////////////// | ////////////////////// |.................. ................ ________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------><----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp ---------><-------------------------------- lcd_[hv]t ------------------------------>
The DSI driver misinterpreted the hbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the horizontal front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to
flip_donetimed out as:WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00026-g01f0c75b902d-dirty #13 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac) [<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0) [<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140) [<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c) [<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8) [<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160) [<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8) [<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c) [<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c) [<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90) [<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace b57eb1e5c64c6b8b ]---random: fast init done
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0]flip_donetimed outWith the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>Applied, thanks
Thanks, would you apply the similar change in 3/7?
It doesn't apply anymore, please resend it
Maxime
PATCH v11 2/7 drm/sun4i: dsi: Update start value in video start delay
In reply to Jagan Tekistart value in video start delay was changed in
commit da676c6aa641 ("drm/sun4i: dsi: Change the start delay calculation") to match the legacy BSP driver [1].
So, using this existing start delay computation gives the wrong start delay value for the "bananapi,s070wv20-ct16" panel. Due to this the panel trigger below flip_done timed out as during kernel bootup:
WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Tainted: G W 5.1.0-next-20190514-00025-gf928bc7cc146 #15 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c90>] (dump_stack+0x84/0x98) [<c0688c90>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c0411cb0>] (drm_fb_helper_pan_display+0xac/0x1d0) [<c0411cb0>] (drm_fb_helper_pan_display) from [<c03a4e84>] (fb_pan_display+0xcc/0x134) [<c03a4e84>] (fb_pan_display) from [<c03b1214>] (bit_update_start+0x14/0x30) [<c03b1214>] (bit_update_start) from [<c03afe94>] (fbcon_switch+0x3d8/0x4e0) [<c03afe94>] (fbcon_switch) from [<c03ec930>] (redraw_screen+0x174/0x238) [<c03ec930>] (redraw_screen) from [<c03aceb4>] (fbcon_prepare_logo+0x3c4/0x400) [<c03aceb4>] (fbcon_prepare_logo) from [<c03ad2b8>] (fbcon_init+0x3c8/0x5ac) [<c03ad2b8>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b5b0>] (try_to_bring_up_master+0x164/0x1a0) [<c044b5b0>] (try_to_bring_up_master) from [<c044b680>] (__component_add+0x94/0x140) [<c044b680>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452f0c>] (platform_drv_probe+0x48/0x9c) [<c0452f0c>] (platform_drv_probe) from [<c04512e4>] (really_probe+0x1dc/0x2c8) [<c04512e4>] (really_probe) from [<c0451530>] (driver_probe_device+0x60/0x160) [<c0451530>] (driver_probe_device) from [<c044f7bc>] (bus_for_each_drv+0x74/0xb8) [<c044f7bc>] (bus_for_each_drv) from [<c0451094>] (__device_attach+0xd0/0x13c) [<c0451094>] (__device_attach) from [<c045048c>] (bus_probe_device+0x84/0x8c) [<c045048c>] (bus_probe_device) from [<c0450918>] (deferred_probe_work_func+0x64/0x90) [<c0450918>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 755e10f62b83f396 ]--- Console: switching to colour frame buffer device 100x30 [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0] flip_done timed out
To fix this, adjust the start delay computation according to the new BSP code [2].
Unfortunately we don't have any evidence or documentation for this reassignment to 1 in new bsp, but it is working with below mainline supported panels in A33, A64.
- bananapi,s070wv20-ct16
- feiyang,fy07024di26a30d
- techstar,ts8550b
So, use the start as per new bsp code since it is working in all the supported panels.
[1] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/legacy/disp/de_bsp/de/ebios/de_dsi.c#L682
[2] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L807
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +11 -1
@@ -365,7 +365,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi,static u16 sun6i_dsi_get_video_start_delay (struct sun6i_dsi *dsi,struct drm_display_mode *mode) { -u16 start =clamp (mode->vtotal - mode->vdisplay -10 ,8 ,100 ); +/** +* Allwinner legacy (drivers/video/sunxi/legacy), +* new (drivers/video/sunxi/disp/de/lowlevel_sun8iw5) bsp drivers +* are evaluating start as: +* +* vtotal - vdisplay - 10 +* +* but the new drivers are reassigning start to 1, which seems to be +* working in DSI panels available in mainline. +*/ +u8 start =1 ;u16 delay = mode->vtotal - (mode->vsync_end - mode->vdisplay) + start;if (delay > mode->vtotal)
Signature · 1 line
2.18.0.321.gffc6fa0e3
Re: [PATCH v11 2/7] drm/sun4i: dsi: Update start value in video start delay
于 2019年10月3日 GMT+08:00 下午2:45:22, Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org> 写到:
Quoted 144 lines
start value in video start delay was changed in commit
da676c6aa641("drm/sun4i: dsi: Change the start delay calculation")
to match the legacy BSP driver [1].So, using this existing start delay computation gives the wrong start delay value for the "bananapi,s070wv20-ct16" panel. Due to this the panel trigger below
flip_donetimed out as during kernel bootup:WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Tainted: G W 5.1.0-next-20190514-00025-gf928bc7cc146 #15 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func[<
c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14)
[<c010b76c>] (show_stack) from [<c0688c90>] (dump_stack+0x84/0x98) [<c0688c90>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c)
[<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128)
[<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc)
[<c0411b64>] (restore_fbdev_mode_atomic) from [<c0411cb0>] (drm_fb_helper_pan_display+0xac/0x1d0)
[<c0411cb0>] (drm_fb_helper_pan_display) from [<c03a4e84>] (fb_pan_display+0xcc/0x134)
[<c03a4e84>] (fb_pan_display) from [<c03b1214>] (bit_update_start+0x14/0x30)
[<c03b1214>] (bit_update_start) from [<c03afe94>] (fbcon_switch+0x3d8/0x4e0)
[<c03afe94>] (fbcon_switch) from [<c03ec930>] (redraw_screen+0x174/0x238)
[<c03ec930>] (redraw_screen) from [<c03aceb4>] (fbcon_prepare_logo+0x3c4/0x400)
[<c03aceb4>] (fbcon_prepare_logo) from [<c03ad2b8>] (fbcon_init+0x3c8/0x5ac)
[<c03ad2b8>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390)
[<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4)
[<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc)
[<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84)
[<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60)
[<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20)
[<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8)
[<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118)
[<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160)
[<c043f060>] (sun4i_drv_bind) from [<c044b5b0>] (try_to_bring_up_master+0x164/0x1a0)
[<c044b5b0>] (try_to_bring_up_master) from [<c044b680>] (__component_add+0x94/0x140)
[<c044b680>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234)
[<c0445e1c>] (sun6i_dsi_probe) from [<c0452f0c>] (platform_drv_probe+0x48/0x9c)
[<c0452f0c>] (platform_drv_probe) from [<c04512e4>] (really_probe+0x1dc/0x2c8)
[<c04512e4>] (really_probe) from [<c0451530>] (driver_probe_device+0x60/0x160)
[<c0451530>] (driver_probe_device) from [<c044f7bc>] (bus_for_each_drv+0x74/0xb8)
[<c044f7bc>] (bus_for_each_drv) from [<c0451094>] (__device_attach+0xd0/0x13c)
[<c0451094>] (__device_attach) from [<c045048c>] (bus_probe_device+0x84/0x8c)
[<c045048c>] (bus_probe_device) from [<c0450918>] (deferred_probe_work_func+0x64/0x90)
[<c0450918>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420)
[<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0)
[<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)Exception stack(0xde539fb0 to 0xde539ff8)9fa0: 00000000 00000000 00000000
00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000---[ end trace 755e10f62b83f396 ]---Console: switching to colour frame buffer device 100x30 [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0]
flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1]flip_donetimed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0]flip_donetimed outTo fix this, adjust the start delay computation according to the new BSP code [2].
Unfortunately we don't have any evidence or documentation for this reassignment to 1 in new bsp, but it is working with below mainline supported panels in A33, A64.
- bananapi,s070wv20-ct16
- feiyang,fy07024di26a30d
- techstar,ts8550bSo, use the start as per new bsp code since it is working in all the supported panels.
[1]
https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/legacy/disp/de_bsp/de/ebios/de_dsi.c#L682
[2]
https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L807---
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c| 12 +++++++++++-1 file changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +0
-0@@ -365,7 +365,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,struct drm_display_mode *mode) {
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c static void sun6i_dsi_inst_init(struct sun6i_dsi · line 377
Quoted 10 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +9
-1-u16 start =clamp (mode->vtotal - mode->vdisplay -10 ,8 ,100 ); +/** +* Allwinner legacy (drivers/video/sunxi/legacy), +* new (drivers/video/sunxi/disp/de/lowlevel_sun8iw5) bsp drivers +* are evaluating start as: +* +* vtotal - vdisplay - 10 +* +* but the new drivers are reassigning start to 1, which seems to be +* working in DSI panels available in mainline.
Please see my patchset for the reason that set 1 here.
Quoted 5 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +2
-0+*/ +u8 start =1 ;u16 delay = mode->vtotal - (mode->vsync_end - mode->vdisplay) + start;if (delay > mode->vtotal)
Signature · 6 lines
使用 K-9 Mail 发送自我的Android设备。 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/75B6346D-714D-4235-B4B8-CAE4384919DB%40aosc.io.
PATCH v11 3/7 drm/sun4i: dsi: Fix video start delay computation
In reply to Jagan TekiThe LCD timing definitions between Linux DRM vs Allwinner are different, below diagram shows this clear differences.
Active Front Sync Back
Region Porch Porch
<-----------------------><----------------><--------------><-------------->
//////////////////////|
////////////////////// |
////////////////////// |.................. ................
________________<----- [hv]display ----->
<------------- [hv]sync_start ------------> <--------------------- [hv]sync_end ----------------------> <-------------------------------- [hv]total ------------------------------>
<----- lcd_[xy] --------> <- lcd_[hv]spw ->
<---------- lcd_[hv]bp --------->
<-------------------------------- lcd_[hv]t ------------------------------>
The DSI driver misinterpreted the vbp term from the BSP code to refer only to the backporch, when in fact it was backporch + sync. Thus the driver incorrectly used the vertical front porch plus sync in its calculation of the DRQ set bit value, when it should not have included the sync timing.
Including additional sync timings leads to flip_done timed out as:
WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.1.0-next-20190514-00029-g09e5b0ed0a58 #18 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [<c010ed54>] (unwind_backtrace) from [<c010b76c>] (show_stack+0x10/0x14) [<c010b76c>] (show_stack) from [<c0688c70>] (dump_stack+0x84/0x98) [<c0688c70>] (dump_stack) from [<c011d9e4>] (__warn+0xfc/0x114) [<c011d9e4>] (__warn) from [<c011da40>] (warn_slowpath_fmt+0x44/0x68) [<c011da40>] (warn_slowpath_fmt) from [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [<c040cd50>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c040e694>] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [<c040e694>] (drm_atomic_helper_commit_tail_rpm) from [<c040e4dc>] (commit_tail+0x40/0x6c) [<c040e4dc>] (commit_tail) from [<c040e5cc>] (drm_atomic_helper_commit+0xbc/0x128) [<c040e5cc>] (drm_atomic_helper_commit) from [<c0411b64>] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [<c0411b64>] (restore_fbdev_mode_atomic) from [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0) [<c04156f8>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c0415774>] (drm_fb_helper_set_par+0x30/0x54) [<c0415774>] (drm_fb_helper_set_par) from [<c03ad450>] (fbcon_init+0x560/0x5ac) [<c03ad450>] (fbcon_init) from [<c03eb8a0>] (visual_init+0xbc/0x104) [<c03eb8a0>] (visual_init) from [<c03ed1b8>] (do_bind_con_driver+0x1b0/0x390) [<c03ed1b8>] (do_bind_con_driver) from [<c03ed780>] (do_take_over_console+0x13c/0x1c4) [<c03ed780>] (do_take_over_console) from [<c03ad800>] (do_fbcon_takeover+0x74/0xcc) [<c03ad800>] (do_fbcon_takeover) from [<c013c9c8>] (notifier_call_chain+0x44/0x84) [<c013c9c8>] (notifier_call_chain) from [<c013cd20>] (__blocking_notifier_call_chain+0x48/0x60) [<c013cd20>] (__blocking_notifier_call_chain) from [<c013cd50>] (blocking_notifier_call_chain+0x18/0x20) [<c013cd50>] (blocking_notifier_call_chain) from [<c03a6e44>] (register_framebuffer+0x1e0/0x2f8) [<c03a6e44>] (register_framebuffer) from [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [<c04153c0>] (__drm_fb_helper_initial_config_and_unlock) from [<c04158c8>] (drm_fbdev_client_hotplug+0xe8/0x1b8) [<c04158c8>] (drm_fbdev_client_hotplug) from [<c0415a20>] (drm_fbdev_generic_setup+0x88/0x118) [<c0415a20>] (drm_fbdev_generic_setup) from [<c043f060>] (sun4i_drv_bind+0x128/0x160) [<c043f060>] (sun4i_drv_bind) from [<c044b598>] (try_to_bring_up_master+0x164/0x1a0) [<c044b598>] (try_to_bring_up_master) from [<c044b668>] (__component_add+0x94/0x140) [<c044b668>] (__component_add) from [<c0445e1c>] (sun6i_dsi_probe+0x144/0x234) [<c0445e1c>] (sun6i_dsi_probe) from [<c0452ef4>] (platform_drv_probe+0x48/0x9c) [<c0452ef4>] (platform_drv_probe) from [<c04512cc>] (really_probe+0x1dc/0x2c8) [<c04512cc>] (really_probe) from [<c0451518>] (driver_probe_device+0x60/0x160) [<c0451518>] (driver_probe_device) from [<c044f7a4>] (bus_for_each_drv+0x74/0xb8) [<c044f7a4>] (bus_for_each_drv) from [<c045107c>] (__device_attach+0xd0/0x13c) [<c045107c>] (__device_attach) from [<c0450474>] (bus_probe_device+0x84/0x8c) [<c0450474>] (bus_probe_device) from [<c0450900>] (deferred_probe_work_func+0x64/0x90) [<c0450900>] (deferred_probe_work_func) from [<c0135970>] (process_one_work+0x204/0x420) [<c0135970>] (process_one_work) from [<c013690c>] (worker_thread+0x274/0x5a0) [<c013690c>] (worker_thread) from [<c013b3d8>] (kthread+0x11c/0x14c) [<c013b3d8>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 495200a78b24980e ]---
random: fast init done
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0] flip_done timed out
With the terms(as described in above diagram) fixed, the panel displays correctly without any timeouts.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +1 -1
@@ -376,7 +376,7 @@ static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,* working in DSI panels available in mainline. */ u8 start =1 ; -u16 delay = mode->vtotal - (mode->vsync_end - mode->vdisplay) + start; +u16 delay = mode->vtotal - (mode->vsync_start - mode->vdisplay) + start;if (delay > mode->vtotal) delay = delay % mode->vtotal;
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v11 4/7 dt-bindings: sun6i-dsi: Add VCC-DSI supply property
In reply to Jagan TekiAllwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Some board still work without supplying this but give more faith on datasheet and hardware schematics and document this supply property in required property list.
--- .../bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +3 -0
@@ -36,6 +36,9 @@ properties: resets: maxItems: 1 + vcc-dsi-supply: + description: VCC-DSI power supply of the DSI encoder + phys: maxItems: 1
Signature · 1 line
2.18.0.321.gffc6fa0e3
Maxime Ripard
maintainerRe: [PATCH v11 4/7] dt-bindings: sun6i-dsi: Add VCC-DSI supply property
Quoted 19 lines · Jagan Teki
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Some board still work without supplying this but give more faith on datasheet and hardware schematics and document this supply property in required property list.
Reviewed-by Rob Herring <[email protected]>Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- .../bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +0
-0
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml properties: · line 41
Quoted 6 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +3
-0@@ -36,6 +36,9 @@ properties: resets: maxItems: 1 + vcc-dsi-supply: + description: VCC-DSI power supply of the DSI encoder +
The driver treats it as mandatory, so I've added it to the binding, as suggested by the commit log.
Maxime
Re: [PATCH v11 4/7] dt-bindings: sun6i-dsi: Add VCC-DSI supply property
于 2019年10月3日 GMT+08:00 下午7:47:33, Maxime Ripard <[email protected]> 写到:
Quoted 28 lines · Jagan Teki
Quoted 7 lines
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Some board still work without supplying this but give more faith on datasheet and hardware schematics and document this supply property in required property list.
Quoted 5 lines
Reviewed-by Rob Herring <[email protected]>Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- .../bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml | 3+++
Quoted 3 lines
1 file changed, 3 insertions(+)diff --git
a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlb/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 2 lines
index
47950fced28d..9d4c25b104f6100644
---
a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 1 line
+++
b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 4 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +0
-0@@ -36,6 +36,9 @@ properties: resets: maxItems: 1
Quoted 6 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml properties: · line 41
Quoted 3 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +3
-0+ vcc-dsi-supply: + description: VCC-DSI power supply of the DSI encoder +The driver treats it as mandatory, so I've added it to the binding, as suggested by the commit log.
No. The regulator_get function will return dummy regulator, rather than fail, if the regulator is not specified.
Quoted 2 lines
Maxime
Signature · 1 line
使用 K-9 Mail 发送自我的Android设备。
Maxime Ripard
maintainerRe: [PATCH v11 4/7] dt-bindings: sun6i-dsi: Add VCC-DSI supply property
Quoted 36 lines · Icenowy Zheng
于 2019年10月3日 GMT+08:00 下午7:47:33, Maxime Ripard <[email protected]> 写到:
Quoted 28 lines · Jagan Teki
Quoted 7 lines
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Some board still work without supplying this but give more faith on datasheet and hardware schematics and document this supply property in required property list.
Quoted 5 lines
Reviewed-by Rob Herring <[email protected]>Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- .../bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml | 3+++
Quoted 3 lines
1 file changed, 3 insertions(+)diff --git
a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlb/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 2 lines
index
47950fced28d..9d4c25b104f6100644
---
a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 1 line
+++
b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yamlQuoted 4 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +0
-0@@ -36,6 +36,9 @@ properties: resets: maxItems: 1Quoted 6 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml properties: · line 41
Quoted 3 lines
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +3
-0+ vcc-dsi-supply: + description: VCC-DSI power supply of the DSI encoder +The driver treats it as mandatory, so I've added it to the binding, as suggested by the commit log.
Quoted 2 lines
No. The
regulator_getfunction will return dummy regulator, rather than fail, if the regulator is not specified.
Yes. And this deals nicely with the backward compatibility case. The regulator is there on all the SoCs, so there's no reason to leave it out.
Maxime
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v11 5/7 drm/sun4i: sun6i_mipi_dsi: Add VCC-DSI regulator support
In reply to Jagan TekiAllwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Add support for this supply pin by adding voltage
regulator handling code to MIPI DSI driver.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 ++ 2 files changed, 16 insertions(+)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +14 -0
@@ -1110,6 +1110,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev)return PTR_ERR (base); } + dsi->regulator =devm_regulator_get (dev,"vcc-dsi" ); +if (IS_ERR (dsi->regulator)) { +dev_err (dev,"Couldn't get VCC-DSI supply\n" ); +return PTR_ERR (dsi->regulator); + } + dsi->regs =devm_regmap_init_mmio_clk (dev,"bus" , base, &sun6i_dsi_regmap_config);if (IS_ERR (dsi->regs)) {
@@ -1183,6 +1189,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev)static int __maybe_unused sun6i_dsi_runtime_resume (struct device *dev) {struct sun6i_dsi *dsi =dev_get_drvdata (dev); +int err; + + err =regulator_enable (dsi->regulator); +if (err) { +dev_err (dsi->dev,"failed to enable VCC-DSI supply: %d\n" , err); +return err; + }reset_control_deassert (dsi->reset);clk_prepare_enable (dsi->mod_clk);
@@ -1215,6 +1228,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev)clk_disable_unprepare (dsi->mod_clk);reset_control_assert (dsi->reset); +regulator_disable (dsi->regulator);return 0 ; }
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +2 -0
@@ -12,6 +12,7 @@#include <drm/drm_connector.h> #include <drm/drm_encoder.h> #include <drm/drm_mipi_dsi.h> +#include <linux/regulator/consumer.h> #define SUN6I_DSI_TCON_DIV 4
@@ -23,6 +24,7 @@ struct sun6i_dsi {struct clk *bus_clk;struct clk *mod_clk;struct regmap *regs; +struct regulator *regulator;struct reset_control *reset;struct phy *dphy;
Signature · 1 line
2.18.0.321.gffc6fa0e3
Re: [PATCH v11 5/7] drm/sun4i: sun6i_mipi_dsi: Add VCC-DSI regulator support
Quoted 58 lines · Jagan Teki
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Add support for this supply pin by adding voltage regulator handling code to MIPI DSI driver.
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 ++ 2 files changed, 16 insertions(+)drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +14
-0@@ -1110,6 +1110,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev)return PTR_ERR (base); } + dsi->regulator =devm_regulator_get (dev,"vcc-dsi" ); +if (IS_ERR (dsi->regulator)) { +dev_err (dev,"Couldn't get VCC-DSI supply\n" ); +return PTR_ERR (dsi->regulator); + } + dsi->regs =devm_regmap_init_mmio_clk (dev,"bus" , base, &sun6i_dsi_regmap_config);if (IS_ERR (dsi->regs)) {@@ -1183,6 +1189,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev)static int __maybe_unused sun6i_dsi_runtime_resume (struct device *dev) {struct sun6i_dsi *dsi =dev_get_drvdata (dev); +int err; + + err =regulator_enable (dsi->regulator); +if (err) { +dev_err (dsi->dev,"failed to enable VCC-DSI supply: %d\n" , err); +return err; + }reset_control_deassert (dsi->reset);clk_prepare_enable (dsi->mod_clk);@@ -1215,6 +1228,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev)clk_disable_unprepare (dsi->mod_clk);reset_control_assert (dsi->reset); +regulator_disable (dsi->regulator);return 0 ; }drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +0
-0
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h line 15
Quoted 4 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +1
-0@@ -12,6 +12,7 @@#include <drm/drm_connector.h> #include <drm/drm_encoder.h> #include <drm/drm_mipi_dsi.h> +#include <linux/regulator/consumer.h>
You don't need to include the header file since you are only including a pointer to the struct, and nothing else.
Otherwise,
Quoted 14 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +1
-1#define SUN6I_DSI_TCON_DIV 4@@ -23,6 +24,7 @@ struct sun6i_dsi {struct clk *bus_clk;struct clk *mod_clk;struct regmap *regs; +struct regulator *regulator;struct reset_control *reset;struct phy *dphy; --2.18.0.321.gffc6fa0e3
Re: [PATCH v11 5/7] drm/sun4i: sun6i_mipi_dsi: Add VCC-DSI regulator support
Quoted 53 lines · Chen-Yu Tsai
Quoted 51 lines · Jagan Teki
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Add support for this supply pin by adding voltage
regulator handling code to MIPI DSI driver.Tested-by Merlijn Wajer <[email protected]>--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 ++ 2 files changed, 16 insertions(+)drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +14
-0@@ -1110,6 +1110,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev)return PTR_ERR (base); } + dsi->regulator =devm_regulator_get (dev,"vcc-dsi" ); +if (IS_ERR (dsi->regulator)) { +dev_err (dev,"Couldn't get VCC-DSI supply\n" ); +return PTR_ERR (dsi->regulator); + } + dsi->regs =devm_regmap_init_mmio_clk (dev,"bus" , base, &sun6i_dsi_regmap_config);if (IS_ERR (dsi->regs)) {@@ -1183,6 +1189,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev)static int __maybe_unused sun6i_dsi_runtime_resume (struct device *dev) {struct sun6i_dsi *dsi =dev_get_drvdata (dev); +int err; + + err =regulator_enable (dsi->regulator); +if (err) { +dev_err (dsi->dev,"failed to enable VCC-DSI supply: %d\n" , err); +return err; + }reset_control_deassert (dsi->reset);clk_prepare_enable (dsi->mod_clk);@@ -1215,6 +1228,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev)clk_disable_unprepare (dsi->mod_clk);reset_control_assert (dsi->reset); +regulator_disable (dsi->regulator);
Quoted 14 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h line 15
Quoted 11 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +0
-0return 0 ; }drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +1
-0@@ -12,6 +12,7 @@#include <drm/drm_connector.h> #include <drm/drm_encoder.h> #include <drm/drm_mipi_dsi.h> +#include <linux/regulator/consumer.h> You don't need to include the header file since you are only including a pointer to the struct, and nothing else.
Yes, make sense. I will drop it.
Quoted 4 lines
Otherwise,
Reviewed-by Chen-Yu Tsai <[email protected]>
thanks.
Maxime Ripard
maintainerRe: [PATCH v11 5/7] drm/sun4i: sun6i_mipi_dsi: Add VCC-DSI regulator support
Quoted 69 lines · Jagan Teki
Quoted 53 lines · Chen-Yu Tsai
Quoted 51 lines · Jagan Teki
Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin.
Add support for this supply pin by adding voltage regulator handling code to MIPI DSI driver.
Tested-by Merlijn Wajer <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 ++ 2 files changed, 16 insertions(+)drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +14
-0@@ -1110,6 +1110,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev)return PTR_ERR (base); } + dsi->regulator =devm_regulator_get (dev,"vcc-dsi" ); +if (IS_ERR (dsi->regulator)) { +dev_err (dev,"Couldn't get VCC-DSI supply\n" ); +return PTR_ERR (dsi->regulator); + } + dsi->regs =devm_regmap_init_mmio_clk (dev,"bus" , base, &sun6i_dsi_regmap_config);if (IS_ERR (dsi->regs)) {@@ -1183,6 +1189,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev)static int __maybe_unused sun6i_dsi_runtime_resume (struct device *dev) {struct sun6i_dsi *dsi =dev_get_drvdata (dev); +int err; + + err =regulator_enable (dsi->regulator); +if (err) { +dev_err (dsi->dev,"failed to enable VCC-DSI supply: %d\n" , err); +return err; + }reset_control_deassert (dsi->reset);clk_prepare_enable (dsi->mod_clk);@@ -1215,6 +1228,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev)clk_disable_unprepare (dsi->mod_clk);reset_control_assert (dsi->reset); +regulator_disable (dsi->regulator);Quoted 14 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h line 15
Quoted 11 lines
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +0
-0return 0 ; }drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +1
-0@@ -12,6 +12,7 @@#include <drm/drm_connector.h> #include <drm/drm_encoder.h> #include <drm/drm_mipi_dsi.h> +#include <linux/regulator/consumer.h> You don't need to include the header file since you are only including a pointer to the struct, and nothing else.
Quoted 8 lines
Yes, make sense. I will drop it.
Quoted 4 lines
Otherwise,
Reviewed-by Chen-Yu Tsai <[email protected]>thanks.
I've moved the include to the driver that was lacking it while applying, thanks!
Maxime
PATCH v11 6/7 drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge
In reply to Jagan TekiBananapi S070WV20-CT16 ICN6211 is 800x480, 4-lane MIPI-DSI to RGB bridge panel which can be used to connect via DSI port on BPI-M64 board, so add a driver for it.
The same panel PCB comes with parallel RBG which is supported via panel-simple driver with "bananapi,s070wv20-ct16" compatible.
--- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-bananapi-s070wv20-icn6211.c | 293 ++++++++++++++++++ 3 files changed, 303 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c
drivers/gpu/drm/panel/Kconfig +9 -0
@@ -18,6 +18,15 @@ config DRM_PANEL_ARM_VERSATILE reference designs. The panel is detected using special registers in the Versatile family syscon registers. +config DRM_PANEL_BANANAPI_S070WV20_ICN6211 + tristate "Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y if you want to enable support for panels based on the + Bananapi S070WV20-CT16 MIPI-DSI controller. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o +obj-$(CONFIG_DRM_PANEL_BANANAPI_S070WV20_ICN6211) += panel-bananapi-s070wv20-icn6211.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o
drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c new file +293 -0
293 lines not on this page · raw message
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v11 6/7] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge
Quoted 5 lines · Jagan Teki
Bananapi S070WV20-CT16 ICN6211 is 800x480, 4-lane MIPI-DSI to RGB bridge panel which can be used to connect via DSI port on BPI-M64 board, so add a driver for it.
Quoted 8 lines
The same panel PCB comes with parallel RBG which is supported via panel-simple driver with "bananapi,s070wv20-ct16" compatible.
Signed-off-by Jagan Teki <[email protected]>--- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-bananapi-s070wv20-icn6211.c | 293 ++++++++++++++++++
This would be an overlay patch, which doesn't need to mege. please correct the same.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v11 7/7 ARM: dts: sun8i: bananapi-m2m: Enable Bananapi S070WV20-CT16 DSI panel
In reply to Jagan TekiThis patch add support for Bananapi S070WV20-CT16 DSI panel to BPI-M2M board.
DSI panel connected via board DSI port with,
- DCDC1 as VCC-DSI supply
- DLDO1 as VDD supply
- PL5 gpio for lcd reset gpio pin
- PB7 gpio for lcd enable gpio pin
- PL4 gpio for backlight enable pin
--- arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+)
arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts +40 -0
@@ -44,6 +44,7 @@ #include "sun8i-a33.dtsi" #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pwm/pwm.h> / { model = "BananaPi M2 Magic";
@@ -61,6 +62,14 @@ stdout-path = "serial0:115200n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 255>; + default-brightness-level = <8>; + enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PL4 */ + }; + leds { compatible = "gpio-leds";
@@ -122,6 +131,27 @@ status = "okay"; }; +&de { + status = "okay"; +}; + +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dcdc1>; /* VCC3V3-DSI */ + status = "okay"; + + panel@0 { + compatible = "bananapi,s070wv20-ct16-icn6211"; + reg = <0>; + enable-gpios = <&pio 1 7 GPIO_ACTIVE_HIGH>; /* LCD-PWR-EN: PB7 */ + reset-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* LCD-RST: PL5 */ + backlight = <&backlight>; + }; +}; + &ehci0 { status = "okay"; };
@@ -157,6 +187,12 @@ status = "okay"; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + &r_rsb { status = "okay";
@@ -269,6 +305,10 @@ status = "okay"; }; +&tcon0 { + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v11 7/7] ARM: dts: sun8i: bananapi-m2m: Enable Bananapi S070WV20-CT16 DSI panel
Quoted 11 lines · Jagan Teki
This patch add support for Bananapi S070WV20-CT16 DSI panel to BPI-M2M board.
DSI panel connected via board DSI port with,
- DCDC1 as VCC-DSI supply
- DLDO1 as VDD supply
- PL5 gpio for lcd reset gpio pin
- PB7 gpio for lcd enable gpio pin
- PL4 gpio for backlight enable pin
Quoted 2 lines
---
This would be an overlay patch, which doesn't need to mege. please correct the same.