Hi,
could anyone help me to understand a problem that appears when I run a small Qt Quick 2 example on a custom AM3517 board running with a patched 3.7.0 kernel and Graphics SDK 4.08.00.01.
My very simple Qt Quick example just displays a rotating green rectangle in the screen center:
import QtQuick 2.0
Rectangle {
width: 800; height: 480
Rectangle {
color: "green"
width: 400; height: 400
anchors.centerIn: parent
NumberAnimation on rotation {
from: 0.0; to: 360.0
duration: 5000
loops: Animation.Infinite
}
}
MouseArea {
anchors.fill: parent
onClicked: Qt.quit()
}
}
When I disable the Qt render thread (QML_BAD_GUI_RENDER_LOOP=1) this example runs smoothly with ~59 fps. But every ~2 secs there is a short ~100 ms hickup which I can track down to the glDrawElements function used in Qt to render the rectangle. With the render thread enabled it even happens every third frame.
The output of my example looks as follows:
root@bluemode:~ /opt/RotationPerformanceTest/bin/RotationPerformanceTest
evdevtouch: Using device /dev/input/event0
min X: 0 max X: 1791
min Y: 0 max Y: 1023
min pressure: 0 max pressure: 0
device name: EP0700M06
Protocol type B
PVR: Hint: Setting WindowSystem to libpvrPVR2D_FRONTWSEGL.so
PVR:(Error): PVRSRVMetricsTimeNow: using (potentially) low resolution timer [95, /pvr_metrics.c]
PVR:
PVR: Memory Stats
PVR: ------------
PVR:
PVR: High Water Mark = 4144 bytes
PVR:
PVR: 4144 bytes still allocated in 1 allocations
PVR:
PVR: 1 - 4144 bytes at 0x3c6c0 - eurasiacon/imgegl/tls.c:32
PVR:
PVR:(Warning): PVR2DEnumerateDevices: display device name too long, truncating [142, /pvr2dinit.c]
PVR:
PVR: Memory Stats
PVR: ------------
PVR:
PVR: High Water Mark = 4144 bytes
PVR:
PVR: 4144 bytes still allocated in 1 allocations
PVR:
PVR: 1 - 4144 bytes at 0x3c6c0 - eurasiacon/imgegl/tls.c:32
PVR:
PVR:(Warning): Running StartUpMemSpeedTest. High memory watermark will be ruined. Disable using apphint EnableMemorySpeedTest [45, /metrics.c]
PVR: Bytes : 512 1024 2048 4096 8192 16384 32768 65536 131072
PVR: ---------------|-------|-------|-------|-------|-------|-------|-------|-------|
PVR: H -> VB: 202.23 647.95 684.62 607.64 619.12 646.50 677.43 682.10 709.05
PVR: H -> H: 434.92 494.15 502.96 369.72 433.07 126.23 391.97 418.94 463.10
glDrawElements took 25.9399 ms
glDrawElements took 95.52 ms
glDrawElements took 101.959 ms
glDrawElements took 102.203 ms
glDrawElements took 94.9707 ms
glDrawElements took 96.0083 ms
glDrawElements took 94.6045 ms
glDrawElements took 101.685 ms
glDrawElements took 94.5435 ms
glDrawElements took 97.0154 ms
glDrawElements took 101.013 ms
glDrawElements took 101.959 ms
glDrawElements took 96.0083 ms
glDrawElements took 96.2219 ms
glDrawElements took 101.746 ms
glDrawElements took 94.635 ms
glDrawElements took 95.2149 ms
glDrawElements took 95.9168 ms
glDrawElements took 94.4824 ms
...
The glDrawElements output comes from a Qt5 patch that outputs the duration of the glDrawElements call in qsgrenderer.cpp if it takes longer than 10 ms. This happens approx. every 2 secs with the render thread disabled.
The gfx_check output is:
WSEGL settings
[default]
WindowSystem=libpvrPVR2D_FRONTWSEGL.so
# for direct writes to FrameBuffer - FRONT mode of operation - directly writes to FrameBuffer without waiting for vsync - fastest mode of operation
#WindowSystem=libpvrPVR2D_FLIPWSEGL.so
# for VSync synchronised writes to Framebuffer - slower, but avoids tearing
#WindowSystem=libpvrPVR2D_BLITWSEGL.so
# for direct writes to back-buffer, which later gets written to FrameBuffer with sync
------
ARM CPU information
Processor : ARMv7 Processor rev 7 (v7l)
BogoMIPS : 397.57
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part : 0xc08
CPU revision : 7
Hardware : Technexion TAM3517 Evaluation Board
Revision : 0020
Serial : 0000000000000000
------
SGX driver information
Version SGX_DDK_Linux_CustomerTI sgxddk 19 1.9.RC2@2139099 (debug) /home/dev/svn/trunk/ptxdist_workspace/platform-disira/build-target/Graphics_SDK_setuplinux_4_08_00_01/GFX_Linux_KM
System Version String: SGX revision = 1.2.1
------
Framebuffer settings
Frame buffer device information:
Name : omapfb
Address : 0x8e200000
Size : 10485760
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 1600
Accelerator : No
mode "UNNAMED" {
{ 800 480 30093 88 40 33 10 128 2 }
{ 16 11:5:0 5:6:0 0:5:0 0:0:0 0 0 }
virtual 800 480
}
------
Rotation settings
0
------
Kernel Module information
Module Size Used by
omaplfb 11744 0
pvrsrvkm 468251 1 omaplfb
edt_ft5x06 8132 0
pca953x_pnp 4685 0
lm73 2341 0
rtc_mcp7941x 2403 0
tam3517_buzzer 4852 0
------
Boot settings
mem=256M mpurate=600 console=ttyO0,115200n8 vram=30M omapfb.vram=0:10M,1:10M,2:10M mtdparts=omap2-nand.0:512k(xloader),1024k(uboot),512k(params),6m(kernel),-(rootfs) rootfstype=ubifs ubi.mtd=4 root=ubi0:rootfs
------
Linux Kernel version
Linux bluemode 3.7.0-rc8-71840-g046e293-dirty #53 Wed Feb 6 16:55:51 CET 2013 armv7l GNU/Linux
The init kernel powervr modules output is:
[ 12.280090] PVR: PVRCore_Init
[ 12.288421] PVR: PVRSRVDriverProbe(pDevice=bf07de98)
[ 12.294647] PVR: EnableSystemClocks: Enabling System Clocks
[ 12.300750] PVR: Setting GPTIMER11 parent to System Clock
[ 12.306518] PVR: GPTIMER11 clock is 13MHz
[ 12.310913] PVR: Setting GPTIMER11 mode to posted (currently is non-posted)
[ 12.320037] PVR: PVRCore_Init: major device 249
[ 12.430786]
[ 12.432373] =============================================
[ 12.438079] [ INFO: possible recursive locking detected ]
[ 12.443786] 3.7.0-rc8-71840-g046e293-dirty #53 Tainted: G O
[ 12.450561] ---------------------------------------------
[ 12.456268] pvrsrvctl/1506 is trying to acquire lock:
[ 12.461608] (psPVRSRVMutex){+.+.+.}, at: [<bf046274>] LinuxLockMutex+0x18/0x20 [pvrsrvkm]
[ 12.470794]
[ 12.470794] but task is already holding lock:
[ 12.476959] (psPVRSRVMutex){+.+.+.}, at: [<bf046274>] LinuxLockMutex+0x18/0x20 [pvrsrvkm]
[ 12.485870]
[ 12.485870] other info that might help us debug this:
[ 12.492767] Possible unsafe locking scenario:
[ 12.492767]
[ 12.499023] CPU0
[ 12.501586] ----
[ 12.504150] lock(psPVRSRVMutex);
[ 12.507751] lock(psPVRSRVMutex);
[ 12.511352]
[ 12.511352] *** DEADLOCK ***
[ 12.511352]
[ 12.517608] May be due to missing lock nesting notation
[ 12.517608]
[ 12.524749] 1 lock held by pvrsrvctl/1506:
[ 12.529083] #0: (psPVRSRVMutex){+.+.+.}, at: [<bf046274>] LinuxLockMutex+0x18/0x20 [pvrsrvkm]
[ 12.538452]
[ 12.538452] stack backtrace:
[ 12.543090] [<c00194d8>] (unwind_backtrace+0x0/0xf0) from [<c007bda4>] (__lock_acquire+0x1338/0x1a14)
[ 12.552856] [<c007bda4>] (__lock_acquire+0x1338/0x1a14) from [<c007c9a8>] (lock_acquire+0x98/0x120)
[ 12.562408] [<c007c9a8>] (lock_acquire+0x98/0x120) from [<c052fc2c>] (mutex_lock_nested+0x3c/0x294)
[ 12.572113] [<c052fc2c>] (mutex_lock_nested+0x3c/0x294) from [<bf046274>] (LinuxLockMutex+0x18/0x20 [pvrsrvkm])
[ 12.583068] [<bf046274>] (LinuxLockMutex+0x18/0x20 [pvrsrvkm]) from [<bf042d5c>] (DebugMemAllocRecordAdd+0x20/0x23c [pvrsrvkm])
[ 12.595458] [<bf042d5c>] (DebugMemAllocRecordAdd+0x20/0x23c [pvrsrvkm]) from [<bf042cf4>] (_KMallocWrapper+0x7c/0x8c [pvrsrvkm])
[ 12.607971] [<bf042cf4>] (_KMallocWrapper+0x7c/0x8c [pvrsrvkm]) from [<bf04ac20>] (OSAllocMem_Impl+0x70/0xa4 [pvrsrvkm])
[ 12.619689] [<bf04ac20>] (OSAllocMem_Impl+0x70/0xa4 [pvrsrvkm]) from [<bf026e94>] (PVRSRVPerProcessDataConnect+0x7c/0x324 [pvrsrvkm])
[ 12.632568] [<bf026e94>] (PVRSRVPerProcessDataConnect+0x7c/0x324 [pvrsrvkm]) from [<bf035a4c>] (PVRSRVProcessConnect+0x1c/0x2c [pvrsrvkm])
[ 12.645965] [<bf035a4c>] (PVRSRVProcessConnect+0x1c/0x2c [pvrsrvkm]) from [<bf048a24>] (PVRSRVOpen+0x34/0xe0 [pvrsrvkm])
[ 12.657592] [<bf048a24>] (PVRSRVOpen+0x34/0xe0 [pvrsrvkm]) from [<c00e7c0c>] (chrdev_open+0x90/0x15c)
[ 12.667327] [<c00e7c0c>] (chrdev_open+0x90/0x15c) from [<c00e2884>] (do_dentry_open+0x1dc/0x264)
[ 12.676635] [<c00e2884>] (do_dentry_open+0x1dc/0x264) from [<c00e2940>] (finish_open+0x34/0x4c)
[ 12.685821] [<c00e2940>] (finish_open+0x34/0x4c) from [<c00f06f8>] (do_last.isra.27+0x5a4/0xbb0)
[ 12.695098] [<c00f06f8>] (do_last.isra.27+0x5a4/0xbb0) from [<c00f0dac>] (path_openat+0xa8/0x44c)
[ 12.704467] [<c00f0dac>] (path_openat+0xa8/0x44c) from [<c00f141c>] (do_filp_open+0x2c/0x80)
[ 12.713348] [<c00f141c>] (do_filp_open+0x2c/0x80) from [<c00e3880>] (do_sys_open+0xe4/0x174)
[ 12.722290] [<c00e3880>] (do_sys_open+0xe4/0x174) from [<c00131e0>] (ret_fast_syscall+0x0/0x3c)
[ 12.772766] PVR: Installing MISR with cookie bf0811a8
[ 12.779388] PVR: Installing device LISR SGX ISR on IRQ 21 with cookie ccc05280
[ 12.787261] PVR: SysFinalise: Version string: SGX revision = 1.2.1
Can anybody give me a hint where I have to look further into this issue? I was worried about the recursive locking message in dmesg, could that point to the reason?
Thanks in advance,
Florian.