Use correct DRM event context version

Explicitly declare which DRM event context version we want to use,
rather than just the latest one libdrm supports. New versions may change
semantics, or extend the structure, in ways we're unaware of.

Stick with version 2, which is the version that introduced
page_flip_handler.

Change-Id: I1d2066d5ab485ea571f016a8660829f435821c82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Jonathan Liu 2017-07-26 21:20:50 +10:00
parent af7e756155
commit 50275fbcaf
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ void QEglFSKmsGbmDevice::handleDrmEvent()
{
drmEventContext drmEvent;
memset(&drmEvent, 0, sizeof(drmEvent));
drmEvent.version = DRM_EVENT_CONTEXT_VERSION;
drmEvent.version = 2;
drmEvent.vblank_handler = nullptr;
drmEvent.page_flip_handler = pageFlipHandler;

View File

@ -314,7 +314,7 @@ void QLinuxFbDevice::swapBuffers(Output *output)
while (output->backFb == fbIdx) {
drmEventContext drmEvent;
memset(&drmEvent, 0, sizeof(drmEvent));
drmEvent.version = DRM_EVENT_CONTEXT_VERSION;
drmEvent.version = 2;
drmEvent.vblank_handler = nullptr;
drmEvent.page_flip_handler = pageFlipHandler;
// Blocks until there is something to read on the drm fd