@@ -48,6 +48,8 @@
#include <QtCore/QCoreApplication>
#include <private/qwindow_p.h>
+#include <private/qsystrace_p.h>
+
#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
// #define QPA_HWC_TIMING
@@ -71,6 +73,13 @@
static void hwc11_callback_vsync(const struct hwc_procs *procs, int, int64_t)
{
+ static int counter = 0;
+ ++counter;
+ if (counter % 2)
+ QSystrace::begin("graphics", "QPA::vsync", "");
+ else
+ QSystrace::end("graphics", "QPA::vsync", "");
+
QCoreApplication::postEvent(static_cast<const HwcProcs_v11 *>(procs)->backend, new QEvent(QEvent::User));
}
@@ -116,6 +125,8 @@
void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
{
+ QSystraceEvent trace("graphics", "QPA::present");
+
QPA_HWC_TIMING_SAMPLE(presentTime);
fblayer->handle = buffer->handle;
@@ -139,8 +150,10 @@
QPA_HWC_TIMING_SAMPLE(prepareTime);
+ QSystrace::begin("graphics", "QPA::set", "");
err = hwcdevice->set(hwcdevice, num_displays, mlist);
HWC_PLUGIN_EXPECT_ZERO(err);
+ QSystrace::end("graphics", "QPA::set", "");
QPA_HWC_TIMING_SAMPLE(setTime);
@@ -174,6 +187,8 @@
HwComposerBackend_v11::~HwComposerBackend_v11()
{
+ hwc_device->eventControl(hwc_device, 0, HWC_EVENT_VSYNC, 0);
+
// Close the hwcomposer handle
if (!qgetenv("QPA_HWC_WORKAROUNDS").split(',').contains("no-close-hwc"))
HWC_PLUGIN_EXPECT_ZERO(hwc_close_1(hwc_device));
@@ -405,6 +420,7 @@
void HwComposerBackend_v11::handleVSyncEvent()
{
+ QSystraceEvent trace("graphics", "QPA::handleVsync");
QSet<QWindow *> pendingWindows = m_pendingUpdate;
m_pendingUpdate.clear();
foreach (QWindow *w, pendingWindows) {
|