diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2016-07-12 19:29:39 +0200 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2016-07-18 08:52:48 +0000 |
commit | b08a4c2f421494b515dc7ef6f50d33e37e18eb91 (patch) | |
tree | eb33692155fa7296f2d9f64feef09760fbf6a5a1 /tests/benchmarks | |
parent | 20b96e21090fd008cc4a0d39300402fa3865d705 (diff) |
Remove vsync sleep before rendering first frame
The QSGRenderThread slept for up to one vsync interval before
the first frame was rendered. This happened when the QSGRenderContext
was not yet initialized and thus a sync could not result in changes.
With LTTNG and custom trace points this latency was easily visible
before the first frame swap. With perf it can also be checked, when
one does:
QSG_RENDER_LOOP=threaded perf trace record -m 10M \
-e syscalls:sys_enter_nanosleep,syscalls:sys_enter_ioctl \
--call-graph dwarf qml main.qml
...
[ perf record: Captured and wrote 116.731 MB perf.data (14309 samples) ]
Then afterwards have a look at the output of
perf script --comms QSGRenderThread
And you will notice the sleep directly at the start, followed by the
bulk of ioctl required to setup the OpenGL contexts:
QSGRenderThread 10875 [001] 13940.801449: syscalls:sys_enter_nanosleep: rqtp: 0x7f1ab954cd60, rmtp: 0x7f1ab954cd60
7f1ada3997fd __nanosleep+0x2d (/usr/lib/libpthread-2.23.so)
7f1ada9683ed qt_nanosleep+0x2d (/home/milian/projects/compiled/qt5-5.7-opt/lib/libQt5Core.so.5.7.0)
7f1ada8c73b8 QThread::msleep+0x38 (/home/milian/projects/compiled/qt5-5.7-opt/lib/libQt5Core.so.5.7.0)
7f1abb594320 QSGRenderThread::syncAndRender+0x320 (/home/milian/projects/compiled/qt5-5.7-opt/lib/libQt5Quick.so.5.7.0)
7f1abb598b0c QSGRenderThread::run+0x19c (/home/milian/projects/compiled/qt5-5.7-opt/lib/libQt5Quick.so.5.7.0)
7f1ada8c7f89 QThreadPrivate::start+0x149 (/home/milian/projects/compiled/qt5-5.7-opt/lib/libQt5Core.so.5.7.0)
7f1ada390484 start_thread+0xc4 (/usr/lib/libpthread-2.23.so)
7f1ad982e6dd __clone+0x6d (/usr/lib/libc-2.23.so)
... ioctl follow
This change here checks the validity of the render context before
sleeping, thereby removing the vsync latency before rendering the
first frame. Note that simply skipping the calls to `syncAndRender`
from `run` is not an option, as those also trigger the expose event
that is required for the initialization to happen eventually.
[ChangeLog][QtQuick] The threaded scene graph renderer does not
sleep up to one vsync interval before the first frame anymore.
Change-Id: If7474d5420e0d4a1d05ccb664c7c6932fa989127
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/benchmarks')
0 files changed, 0 insertions, 0 deletions