From 0e85b554ad147dc542790fb85629c7dae2ecb8ca Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Tue, 6 Feb 2018 11:15:42 +0200 Subject: [PATCH] Add WFD_DEVICE_CLIENT_TYPE attribute for INTEGRITY S820Am ADP This is needed to be compatible with latest Qualcomm BSP releases. This patch also makes it possible to select HW layer via QT_OPENWFD_CLIENT_ID and QT_OPENWFD_PIPELINE_ID environment variables. Change-Id: Ie795b21afc61a1de7c1d0b52cdb30a754e3f8266 Reviewed-by: Janne Koskinen Reviewed-by: Timo Aarnipuro Reviewed-by: Laszlo Agocs (cherry picked from commit 00f693d3e5046999270c92731e34a3e7fcd01c6b) Reviewed-by: Simon Hausmann --- .../integrity-armv8-msm8996au/qmake.conf | 2 +- .../qeglfsopenwfdintegration.cpp | 24 +++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf index 90299bf3e9..e78bde54b9 100644 --- a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf +++ b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf @@ -38,7 +38,7 @@ QMAKE_LIBDIR += $$(QCLIBS_DIR)/multimedia/display QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR) -QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd +QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary QMAKE_LIBS_OPENGL_ES2 += $${QMAKE_LIBS_EGL} QMAKE_CFLAGS += -DINTEGRITY diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp index bb176a69d2..738c30c65a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE #define MAX_NUM_OF_WFD_BUFFERS 3 #define MAX_NUM_OF_WFD_DEVICES 4 -#define MAX_NUM_OF_WFD_PIPELINES 4 +#define MAX_NUM_OF_WFD_PIPELINES 16 #define MAX_NUM_OF_WFD_PORT_MODES 64 #define MAX_NUM_OF_WFD_PORTS 4 @@ -77,7 +77,17 @@ void QEglFSOpenWFDIntegration::platformInit() wfdEnumerateDevices(devIds, numDevs, nullptr); // Create device - mDevice = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, nullptr); + WFDint dev_attribs[3] = {WFD_DEVICE_CLIENT_TYPE, + WFD_CLIENT_ID_CLUSTER, + WFD_NONE}; + + bool ok; + WFDint clientType = qgetenv("QT_OPENWFD_CLIENT_ID").toInt(&ok, 16); + + if (ok) + dev_attribs[1] = clientType; + + mDevice = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, dev_attribs); if (WFD_INVALID_HANDLE == mDevice) qFatal( "Failed to create wfd device"); @@ -138,9 +148,13 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow WFDint pipelineIds[MAX_NUM_OF_WFD_PIPELINES]; wfdEnumeratePipelines(mDevice, pipelineIds, numPipelines, nullptr); - WFDint testId = 0; - testId = pipelineIds[0]; - WFDPipeline pipeline = wfdCreatePipeline(mDevice, testId, nullptr); + bool ok; + WFDint pipelineId = qgetenv("QT_OPENWFD_PIPELINE_ID").toInt(&ok); + + if (!ok) + pipelineId = pipelineIds[0]; + + WFDPipeline pipeline = wfdCreatePipeline(mDevice, pipelineId, nullptr); if (WFD_INVALID_HANDLE == pipeline) qFatal("Failed to create wfd pipeline");