From cc812f516cb02eabea5d73a5479786b613972545 Mon Sep 17 00:00:00 2001 From: Timo Aarnipuro Date: Thu, 8 Feb 2018 13:11:56 +0200 Subject: Configure window manager to support RCar D3 Initialize the device earlier and enable the screen as well. These changes are also compatible with the RCar H3. Change-Id: I4a83dedc0eed9df181c32e60ebf3666824d2a6c6 Reviewed-by: Kimmo Ollila Reviewed-by: Laszlo Agocs --- .../eglfs_rcar/qeglfsrcarintegration.cpp | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_rcar/qeglfsrcarintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_rcar/qeglfsrcarintegration.cpp index 98cf1d3bfb..212ebde05a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_rcar/qeglfsrcarintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_rcar/qeglfsrcarintegration.cpp @@ -52,12 +52,28 @@ QT_BEGIN_NAMESPACE void QEglFSRcarIntegration::platformInit() { + bool ok; + QEglFSDeviceIntegration::platformInit(); PVRGrfxServerInit(); mScreenSize = q_screenSizeFromFb(0); mNativeDisplay = (NativeDisplayType)EGL_DEFAULT_DISPLAY; + + mNativeDisplayID = qEnvironmentVariableIntValue("QT_QPA_WM_DISP_ID", &ok); + if (!ok) + mNativeDisplayID = RCAR_DEFAULT_DISPLAY; + + r_wm_Error_t wm_err = R_WM_DevInit(mNativeDisplayID); + if (wm_err != R_WM_ERR_OK) + qFatal("Failed to init WM Dev: %d, error: %d", mNativeDisplayID, wm_err); + wm_err = R_WM_ScreenBgColorSet(mNativeDisplayID, 0x20, 0x20, 0x20); // Grey + if (wm_err != R_WM_ERR_OK) + qFatal("Failed to set screen background: %d", wm_err); + wm_err = R_WM_ScreenEnable(mNativeDisplayID); + if (wm_err != R_WM_ERR_OK) + qFatal("Failed to enable screen: %d", wm_err); } QSize QEglFSRcarIntegration::screenSize() const @@ -104,14 +120,6 @@ EGLNativeWindowType QEglFSRcarIntegration::createNativeWindow(QPlatformWindow *w { bool ok; - mNativeDisplayID = qEnvironmentVariableIntValue("QT_QPA_WM_DISP_ID", &ok); - if (!ok) - mNativeDisplayID = RCAR_DEFAULT_DISPLAY; - - r_wm_Error_t wm_err = R_WM_DevInit(mNativeDisplayID); - if (wm_err != R_WM_ERR_OK) - qFatal("Failed to init WM Dev: %d, error: %d", mNativeDisplayID, wm_err); - mNativeWindow = (EGLNativeWindowTypeREL*)malloc(sizeof(EGLNativeWindowTypeREL)); memset(mNativeWindow, 0, sizeof(EGLNativeWindowTypeREL)); @@ -134,7 +142,7 @@ EGLNativeWindowType QEglFSRcarIntegration::createNativeWindow(QPlatformWindow *w mNativeWindow->Surface.Type = R_WM_SURFACE_FB; mNativeWindow->Surface.BufMode = R_WM_WINBUF_ALLOC_INTERNAL; - wm_err = R_WM_WindowCreate(mNativeDisplayID, mNativeWindow); + r_wm_Error_t wm_err = R_WM_WindowCreate(mNativeDisplayID, mNativeWindow); if (wm_err != R_WM_ERR_OK) qFatal("Failed to create window layer: %d", wm_err); wm_err = R_WM_DevEventRegister(mNativeDisplayID, R_WM_EVENT_VBLANK, 0); -- cgit v1.2.3