eglfs: Fix DRM+KMS backends
The native display was simply invalid. Task-number: QTBUG-53225 Change-Id: I682fb1d91dbea3dab971a079060d181fc313da46 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>bb10
parent
ace5e5fc7b
commit
834087c324
|
|
@ -116,9 +116,9 @@ void QEglFSKmsGbmDevice::close()
|
|||
m_globalCursor = Q_NULLPTR;
|
||||
}
|
||||
|
||||
EGLNativeDisplayType QEglFSKmsGbmDevice::device() const
|
||||
EGLNativeDisplayType QEglFSKmsGbmDevice::nativeDisplay() const
|
||||
{
|
||||
return 0;
|
||||
return reinterpret_cast<EGLNativeDisplayType>(m_gbm_device);
|
||||
}
|
||||
|
||||
gbm_device * QEglFSKmsGbmDevice::gbmDevice() const
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
bool open() Q_DECL_OVERRIDE;
|
||||
void close() Q_DECL_OVERRIDE;
|
||||
|
||||
EGLNativeDisplayType device() const Q_DECL_OVERRIDE;
|
||||
EGLNativeDisplayType nativeDisplay() const Q_DECL_OVERRIDE;
|
||||
gbm_device *gbmDevice() const;
|
||||
|
||||
QPlatformCursor *globalCursor() const;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "qeglfskmsegldevice.h"
|
||||
#include "qeglfskmsegldevicescreen.h"
|
||||
#include "qeglfskmsegldeviceintegration.h"
|
||||
|
||||
#include <QtCore/private/qcore_unix_p.h>
|
||||
|
||||
|
|
@ -68,9 +69,9 @@ void QEglFSKmsEglDevice::close()
|
|||
setFd(-1);
|
||||
}
|
||||
|
||||
EGLNativeDisplayType QEglFSKmsEglDevice::device() const
|
||||
EGLNativeDisplayType QEglFSKmsEglDevice::nativeDisplay() const
|
||||
{
|
||||
return 0;
|
||||
return static_cast<QEglFSKmsEglDeviceIntegration *>(m_integration)->eglDevice();
|
||||
}
|
||||
|
||||
QEglFSKmsScreen *QEglFSKmsEglDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output, QPoint position)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public:
|
|||
virtual bool open() Q_DECL_OVERRIDE;
|
||||
virtual void close() Q_DECL_OVERRIDE;
|
||||
|
||||
virtual EGLNativeDisplayType device() const Q_DECL_OVERRIDE;
|
||||
virtual EGLNativeDisplayType nativeDisplay() const Q_DECL_OVERRIDE;
|
||||
|
||||
virtual QEglFSKmsScreen *createScreen(QEglFSKmsIntegration *integration,
|
||||
QEglFSKmsDevice *device,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ public:
|
|||
QEglFSWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE;
|
||||
|
||||
virtual bool separateScreens() const Q_DECL_OVERRIDE;
|
||||
|
||||
EGLDeviceEXT eglDevice() const { return m_egl_device; }
|
||||
|
||||
protected:
|
||||
QEglFSKmsDevice *createDevice(const QString &devicePath) Q_DECL_OVERRIDE;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
virtual void createScreens();
|
||||
|
||||
virtual EGLNativeDisplayType device() const = 0;
|
||||
virtual EGLNativeDisplayType nativeDisplay() const = 0;
|
||||
int fd() const;
|
||||
QString devicePath() const;
|
||||
|
||||
|
|
@ -72,9 +72,6 @@ protected:
|
|||
QPoint position);
|
||||
void setFd(int fd);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QEglFSKmsDevice)
|
||||
|
||||
QEglFSKmsIntegration *m_integration;
|
||||
QString m_path;
|
||||
int m_dri_fd;
|
||||
|
|
@ -91,6 +88,9 @@ private:
|
|||
unsigned int tv_sec,
|
||||
unsigned int tv_usec,
|
||||
void *user_data);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QEglFSKmsDevice)
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void QEglFSKmsIntegration::platformDestroy()
|
|||
EGLNativeDisplayType QEglFSKmsIntegration::platformDisplay() const
|
||||
{
|
||||
Q_ASSERT(m_device);
|
||||
return reinterpret_cast<EGLNativeDisplayType>(m_device->device());
|
||||
return m_device->nativeDisplay();
|
||||
}
|
||||
|
||||
bool QEglFSKmsIntegration::usesDefaultScreen()
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ public:
|
|||
protected:
|
||||
virtual QEglFSKmsDevice *createDevice(const QString &devicePath) = 0;
|
||||
|
||||
private:
|
||||
void loadConfig();
|
||||
|
||||
QEglFSKmsDevice *m_device;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ QEglFSKmsScreen::QEglFSKmsScreen(QEglFSKmsIntegration *integration,
|
|||
QEglFSKmsDevice *device,
|
||||
QEglFSKmsOutput output,
|
||||
QPoint position)
|
||||
: QEglFSScreen(eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(device->device())))
|
||||
: QEglFSScreen(eglGetDisplay(device->nativeDisplay()))
|
||||
, m_integration(integration)
|
||||
, m_device(device)
|
||||
, m_output(output)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public:
|
|||
QPlatformScreen::PowerState powerState() const Q_DECL_OVERRIDE;
|
||||
void setPowerState(QPlatformScreen::PowerState state) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
protected:
|
||||
QEglFSKmsIntegration *m_integration;
|
||||
QEglFSKmsDevice *m_device;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue