From 7142e8bd23449fe33d685687f0a84c0a853d6787 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 17 Jul 2012 10:44:18 +0300 Subject: [PATCH] Tear down properly in kms plugin when exiting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Idad060af4a8b4e68c2312cc2b69de39d2a58a1c4 Reviewed-by: Jørgen Lind --- src/plugins/platforms/kms/qkmsscreen.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/platforms/kms/qkmsscreen.cpp b/src/plugins/platforms/kms/qkmsscreen.cpp index f9b12d7..2f968a6 100644 --- a/src/plugins/platforms/kms/qkmsscreen.cpp +++ b/src/plugins/platforms/kms/qkmsscreen.cpp @@ -71,6 +71,7 @@ QKmsScreen::QKmsScreen(QKmsDevice *device, int connectorId) m_depth(32), m_format(QImage::Format_Invalid), m_refreshTime(16000), + m_eglWindowSurface(EGL_NO_SURFACE), m_modeSet(false) { m_cursor = new QKmsCursor(this); @@ -80,6 +81,13 @@ QKmsScreen::QKmsScreen(QKmsDevice *device, int connectorId) QKmsScreen::~QKmsScreen() { delete m_cursor; + drmModeSetCrtc(m_device->fd(), m_oldCrtc->crtc_id, m_oldCrtc->buffer_id, + m_oldCrtc->x, m_oldCrtc->y, + &m_connectorId, 1, &m_oldCrtc->mode); + drmModeFreeCrtc(m_oldCrtc); + if (m_eglWindowSurface != EGL_NO_SURFACE) + eglDestroySurface(m_device->eglDisplay(), m_eglWindowSurface); + gbm_surface_destroy(m_gbmSurface); } QRect QKmsScreen::geometry() const -- 2.7.4