Discussion:
[BUG] drm_rockchip: rk3066_hdmi: No driver support for vblank timestamp query.
Tomasz Figa
2018-11-27 09:11:23 UTC
Permalink
Hi Johan,

Adding the dri-devel mailing lists and some maintainers.
For a TV stick called MK808 with rk3066 processor I would like to enable
the VOP and HDMI.
With boot logo and console enabled I can see 2 pinguins and a cursor for
a second and then the display is black.
From a internet search I learned that the rk3066 doesn't support a
vblank counter.
Yet they have replaced the Rockchip custom wait_for_vblanks with a drm
helper.
All of the Rockchip SoCs supported by the upstream driver lack a
vblank counter and the code that you refer to is designed for this
limitation in particular. I suspect the problem you're seeing is
unrelated.
-Did anyone test this convert on a rk3066?
Not sure. I have tested internally on RK3399.
-Can someone with more knowledge explane what happens in this crash
rapport below.
To me, it looks like the vblank interrupt
-Can this be fixed?
Very likely. :)
Please contact if more info is needed.
I don't see display support enabled in the rk3066-mk808.dts in latest upstream:
https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/rk3066a-mk808.dts

Do you have any local changes in your kernel sources?

Best regards,
Tomasz
Kind regards,
Johan Jonker
///////////////////////////////////////////
-drm/rockchip: Replace custom wait_for_vblanks with helper
https://patchwork.kernel.org/patch/9331351/
-drm/rockchip: don't wait for vblank if fb hasn't changed
https://patchwork.kernel.org/patch/8024741/
-explain why we can't wait_for_vblanks
https://lore.kernel.org/patchwork/patch/635586/
-drm/rockchip: Convert to support atomic API
https://patchwork.kernel.org/patch/7732341/
-drm/rockchip: Convert to support atomic API
https://patchwork.kernel.org/patch/7868601/
https://lkml.org/lkml/2017/9/4/251
//////////////////////////////////////////
[ 0.897682] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.904616] [drm] No driver support for vblank timestamp query.
htotal 1650, vtotal 750, vdisplay 720
[ 1.440212] [drm:drm_calc_timestamping_constants] crtc 30: clock
74250 kHz framedur 16666666 linedur 22222
[ 1.440307] [drm:drm_crtc_vblank_on] crtc 0, vblank enabled 0,
inmodeset 0
[ 1.451189] [drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[ 1.451202] [drm:drm_update_vblank_count] updating vblank count on
crtc 0: current=1, diff=0, hw=0 hw_last=0
.
.
.
.
[ 4.303883] [drm:drm_update_vblank_count] updating vblank count on
crtc 0: current=113, diff=1, hw=0 hw_last=0
[ 4.304140] Warning: unable to open an initial console.
[ 6.777825] ------------[ cut here ]------------
[ 6.786554] WARNING: CPU: 0 PID: 19 at
drivers/gpu/drm/drm_atomic_helper.c:1406
drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0
[ 6.800803] [CRTC:30:crtc-0] vblank wait timed out
[ 6.810317] CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted
4.20.0-rc1-g0d694f0b3-dirty #19
[ 6.819938] Hardware name: Rockchip (Device Tree)
[ 6.825498] Workqueue: events output_poll_execute
[ 6.831062] [<c01104a0>] (unwind_backtrace) from [<c010c868>]
(show_stack+0x10/0x14)
[ 6.840191] [<c010c868>] (show_stack) from [<c069e538>]
(dump_stack+0x88/0x9c)
[ 6.848729] [<c069e538>] (dump_stack) from [<c0122784>]
(__warn+0xf8/0x110)
[ 6.856936] [<c0122784>] (__warn) from [<c01227e4>]
(warn_slowpath_fmt+0x48/0x6c)
[ 6.873544] [<c01227e4>] (warn_slowpath_fmt) from [<c0445b04>]
(drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0)
[ 6.886148] [<c0445b04>] (drm_atomic_helper_wait_for_vblanks.part.1)
from [<c0477fec>] (rockchip_atomic_helper_commit_tail_rpm+0x17c/0x194)
[ 6.900896] [<c0477fec>] (rockchip_atomic_helper_commit_tail_rpm)
from [<c0447418>] (commit_tail+0x40/0x6c)
[ 6.912370] [<c0447418>] (commit_tail) from [<c0447508>]
(drm_atomic_helper_commit+0xbc/0x128)
[ 6.922515] [<c0447508>] (drm_atomic_helper_commit) from [<c0449b38>]
(restore_fbdev_mode_atomic+0x1cc/0x1dc)
[ 6.934196] [<c0449b38>] (restore_fbdev_mode_atomic) from
[<c044d34c>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0)
[ 6.947410] [<c044d34c>] (drm_fb_helper_restore_fbdev_mode_unlocked)
from [<c044d3c8>] (drm_fb_helper_set_par+0x30/0x54)
[ 6.960213] [<c044d3c8>] (drm_fb_helper_set_par) from [<c044d2b4>]
(drm_fb_helper_hotplug_event.part.9+0x90/0xa8)
[ 6.972305] [<c044d2b4>] (drm_fb_helper_hotplug_event.part.9) from
[<c043cd70>] (drm_kms_helper_hotplug_event+0x24/0x30)
[ 6.985108] [<c043cd70>] (drm_kms_helper_hotplug_event) from
[<c043cf30>] (output_poll_execute+0x188/0x1a0)
[ 6.996583] [<c043cf30>] (output_poll_execute) from [<c013bc68>]
(process_one_work+0x218/0x508)
[ 7.006829] [<c013bc68>] (process_one_work) from [<c013ca9c>]
(worker_thread+0x30/0x59c)
[ 7.016360] [<c013ca9c>] (worker_thread) from [<c01415b0>]
(kthread+0x124/0x154)
[ 7.025073] [<c01415b0>] (kthread) from [<c01010e8>]
(ret_from_fork+0x14/0x2c)
[ 7.033567] Exception stack(0xeea3dfb0 to 0xeea3dff8)
[ 7.039514] dfa0: 00000000
00000000 00000000 00000000
[ 7.049145] dfc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 7.058774] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 7.066677] ---[ end trace aaf7d2040cebe21e ]---
Tomasz Figa
2018-11-27 09:12:13 UTC
Permalink
Post by Tomasz Figa
Hi Johan,
Adding the dri-devel mailing lists and some maintainers.
For a TV stick called MK808 with rk3066 processor I would like to enable
the VOP and HDMI.
With boot logo and console enabled I can see 2 pinguins and a cursor for
a second and then the display is black.
From a internet search I learned that the rk3066 doesn't support a
vblank counter.
Yet they have replaced the Rockchip custom wait_for_vblanks with a drm
helper.
All of the Rockchip SoCs supported by the upstream driver lack a
vblank counter and the code that you refer to is designed for this
limitation in particular. I suspect the problem you're seeing is
unrelated.
-Did anyone test this convert on a rk3066?
Not sure. I have tested internally on RK3399.
-Can someone with more knowledge explane what happens in this crash
rapport below.
To me, it looks like the vblank interrupt
Oops. I meant:

It looks like the vblank interrupt doesn't fire for some reason.
Post by Tomasz Figa
-Can this be fixed?
Very likely. :)
Please contact if more info is needed.
https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/rk3066a-mk808.dts
Do you have any local changes in your kernel sources?
Best regards,
Tomasz
Kind regards,
Johan Jonker
///////////////////////////////////////////
-drm/rockchip: Replace custom wait_for_vblanks with helper
https://patchwork.kernel.org/patch/9331351/
-drm/rockchip: don't wait for vblank if fb hasn't changed
https://patchwork.kernel.org/patch/8024741/
-explain why we can't wait_for_vblanks
https://lore.kernel.org/patchwork/patch/635586/
-drm/rockchip: Convert to support atomic API
https://patchwork.kernel.org/patch/7732341/
-drm/rockchip: Convert to support atomic API
https://patchwork.kernel.org/patch/7868601/
https://lkml.org/lkml/2017/9/4/251
//////////////////////////////////////////
[ 0.897682] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.904616] [drm] No driver support for vblank timestamp query.
htotal 1650, vtotal 750, vdisplay 720
[ 1.440212] [drm:drm_calc_timestamping_constants] crtc 30: clock
74250 kHz framedur 16666666 linedur 22222
[ 1.440307] [drm:drm_crtc_vblank_on] crtc 0, vblank enabled 0,
inmodeset 0
[ 1.451189] [drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[ 1.451202] [drm:drm_update_vblank_count] updating vblank count on
crtc 0: current=1, diff=0, hw=0 hw_last=0
.
.
.
.
[ 4.303883] [drm:drm_update_vblank_count] updating vblank count on
crtc 0: current=113, diff=1, hw=0 hw_last=0
[ 4.304140] Warning: unable to open an initial console.
[ 6.777825] ------------[ cut here ]------------
[ 6.786554] WARNING: CPU: 0 PID: 19 at
drivers/gpu/drm/drm_atomic_helper.c:1406
drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0
[ 6.800803] [CRTC:30:crtc-0] vblank wait timed out
[ 6.810317] CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted
4.20.0-rc1-g0d694f0b3-dirty #19
[ 6.819938] Hardware name: Rockchip (Device Tree)
[ 6.825498] Workqueue: events output_poll_execute
[ 6.831062] [<c01104a0>] (unwind_backtrace) from [<c010c868>]
(show_stack+0x10/0x14)
[ 6.840191] [<c010c868>] (show_stack) from [<c069e538>]
(dump_stack+0x88/0x9c)
[ 6.848729] [<c069e538>] (dump_stack) from [<c0122784>]
(__warn+0xf8/0x110)
[ 6.856936] [<c0122784>] (__warn) from [<c01227e4>]
(warn_slowpath_fmt+0x48/0x6c)
[ 6.873544] [<c01227e4>] (warn_slowpath_fmt) from [<c0445b04>]
(drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0)
[ 6.886148] [<c0445b04>] (drm_atomic_helper_wait_for_vblanks.part.1)
from [<c0477fec>] (rockchip_atomic_helper_commit_tail_rpm+0x17c/0x194)
[ 6.900896] [<c0477fec>] (rockchip_atomic_helper_commit_tail_rpm)
from [<c0447418>] (commit_tail+0x40/0x6c)
[ 6.912370] [<c0447418>] (commit_tail) from [<c0447508>]
(drm_atomic_helper_commit+0xbc/0x128)
[ 6.922515] [<c0447508>] (drm_atomic_helper_commit) from [<c0449b38>]
(restore_fbdev_mode_atomic+0x1cc/0x1dc)
[ 6.934196] [<c0449b38>] (restore_fbdev_mode_atomic) from
[<c044d34c>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa0)
[ 6.947410] [<c044d34c>] (drm_fb_helper_restore_fbdev_mode_unlocked)
from [<c044d3c8>] (drm_fb_helper_set_par+0x30/0x54)
[ 6.960213] [<c044d3c8>] (drm_fb_helper_set_par) from [<c044d2b4>]
(drm_fb_helper_hotplug_event.part.9+0x90/0xa8)
[ 6.972305] [<c044d2b4>] (drm_fb_helper_hotplug_event.part.9) from
[<c043cd70>] (drm_kms_helper_hotplug_event+0x24/0x30)
[ 6.985108] [<c043cd70>] (drm_kms_helper_hotplug_event) from
[<c043cf30>] (output_poll_execute+0x188/0x1a0)
[ 6.996583] [<c043cf30>] (output_poll_execute) from [<c013bc68>]
(process_one_work+0x218/0x508)
[ 7.006829] [<c013bc68>] (process_one_work) from [<c013ca9c>]
(worker_thread+0x30/0x59c)
[ 7.016360] [<c013ca9c>] (worker_thread) from [<c01415b0>]
(kthread+0x124/0x154)
[ 7.025073] [<c01415b0>] (kthread) from [<c01010e8>]
(ret_from_fork+0x14/0x2c)
[ 7.033567] Exception stack(0xeea3dfb0 to 0xeea3dff8)
[ 7.039514] dfa0: 00000000
00000000 00000000 00000000
[ 7.049145] dfc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[ 7.058774] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 7.066677] ---[ end trace aaf7d2040cebe21e ]---
Johan Jonker
2018-11-27 15:37:53 UTC
Permalink
Post by Tomasz Figa
https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/rk3066a-mk808.dts
Do you have any local changes in your kernel sources?
Thanks for your response.
My local changes for VOP. (PART 1)
Johan Jonker
2018-11-27 20:51:14 UTC
Permalink
My local changes for VOP and HDMI. (PART 2)
Johan Jonker
2018-11-28 18:53:50 UTC
Permalink
My local changes for HDMI. (PART 3)
Johan Jonker
2018-11-28 20:17:00 UTC
Permalink
My local bugs. (PART 5)

MK808 is connected to DVI-D monitor.
Serial console at /dev/ttyUSB0.
Boots with 2 pinguins and bootlog scroll. Then display turns off black.

Example 1 when vblank wait timed out happens after boot in a program
called DRM-dumb-buffer. It also happens during boot. I can't get a
pattern in it. When I add a revert patch vblank doesn't seem to crash,
but a alert is observed.

For example:
[ 5.104171] rockchip-vop 1010c000.vop: [drm:vop_crtc_atomic_flush]
*ERROR* VOP vblank IRQ stuck for 10 ms

/////////////////////////////////////////
There are 3 types of errors in the DRM-dumb-buffer log:

-1 vblank wait timed out.

-2 rk3066_hdmi_get_power_mode returns 0.
In the old source this would lead to a loop hangup/stall, because 0
multiplied is still 0. It never gets into a higher power level.

-3 flip_done timed out

[ 451.674799] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CRTC:30:crtc-0] flip_done timed out
[ 461.913900] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CONNECTOR:33:HDMI-A-1] flip_done timed out
[ 472.154303] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[PLANE:28:plane-0] flip_done timed out

/////////////////////////////////////////

It would be nice if after boot I could use my display and keyboard
instead of my serial console.
Please advise if more info is needed!

Kind regards,

Johan Jonker
Johan Jonker
2018-11-28 19:03:42 UTC
Permalink
My local .config (PART 4)
Johan Jonker
2018-11-30 18:53:03 UTC
Permalink
Hi,

This is about a TV stick called MK808.
Enabled VOP an HDMI for rk3066.
Able to see pinguins at boot.

Found similar bug reports for rk3399.

http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020426.html
http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020427.html
http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020428.html


This patch doesn't seem to work for me.

+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1601,6 +1601,8 @@ static void vop_unbind(struct device *dev, struct
device *master, void *data)
{
struct vop *vop = dev_get_drvdata(dev);

+ // Pair with the initial disable_irq()
+ enable_irq(vop->irq);

Compared to rk3399 the rk3066 doesn't seem to have iommu.

[ 0.383273] rockchip-drm display-subsystem:
[drm:rockchip_drm_platform_probe] no iommu attached for /***@1010c000,
using non-iommu buffers

Bugs as usual:


[ 4.730057] rockchip-vop 1010c000.vop: [drm:vop_crtc_atomic_flush]
*ERROR* VOP vblank IRQ stuck for 10 ms

[ 596.422383] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CRTC:30:crtc-0] flip_done timed out

[ 606.661508] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CONNECTOR:33:HDMI-A-1] flip_done timed out

[ 616.901899] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[PLANE:28:plane-0] flip_done timed out
Tomasz Figa
2018-12-10 02:53:16 UTC
Permalink
Hi Johan,

It looks like VOP on RK3066 is not officially supported by upstream, so
what you're seeing is not a bug, it's just expected behavior, because
nobody had the time (or need) to enable support for your hardware yet.

I added all the people that may be potentially thinking to add support for
this SoC, but they have no obligation to do so. If you are in an urgent
need, I think you may have more luck asking your hardware or SoC vendor
directly.

Best regards,
Tomasz
Post by Johan Jonker
Hi,
This is about a TV stick called MK808.
Enabled VOP an HDMI for rk3066.
Able to see pinguins at boot.
Found similar bug reports for rk3399.
http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020426.html
http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020427.html
http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020428.html
This patch doesn't seem to work for me.
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1601,6 +1601,8 @@ static void vop_unbind(struct device *dev, struct
device *master, void *data)
{
struct vop *vop = dev_get_drvdata(dev);
+ // Pair with the initial disable_irq()
+ enable_irq(vop->irq);
Compared to rk3399 the rk3066 doesn't seem to have iommu.
using non-iommu buffers
[ 4.730057] rockchip-vop 1010c000.vop: [drm:vop_crtc_atomic_flush]
*ERROR* VOP vblank IRQ stuck for 10 ms
[ 596.422383] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CRTC:30:crtc-0] flip_done timed out
[ 606.661508] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CONNECTOR:33:HDMI-A-1] flip_done timed out
[ 616.901899] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[PLANE:28:plane-0] flip_done timed out
Loading...