From e84118d9f8fd838f658dccd016ae51d4d347bbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 13 Oct 2012 16:40:17 +0200 Subject: [PATCH] Add detection support for VMware driver (SVGA3D) to GLPlatform VMware uses a Gallium driver which means that OpenGL based compositing works out of the box without any adjustments to GLPlatform. Just adding recognizing code for the SVGA3D driver. REVIEW: 106826 --- libkwineffects/kwinglplatform.cpp | 16 ++++++++++++++++ libkwineffects/kwinglplatform.h | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index ce6c9edfe9..823bade955 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -432,6 +432,8 @@ QString GLPlatform::driverToString(Driver driver) return "LLVMpipe"; case Driver_VirtualBox: return "VirtualBox (Chromium)"; + case Driver_VMware: + return "VMware (SVGA3D)"; default: return "Unknown"; @@ -680,6 +682,11 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) else if (m_vendor == "VMware, Inc." && m_chipset == "llvmpipe") { m_driver = Driver_Llvmpipe; } + + // SVGA3D + else if (m_vendor == "VMware, Inc." && m_chipset.contains("SVGA3D")) { + m_driver = Driver_VMware; + } } @@ -789,6 +796,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) if (isVirtualBox()) { m_virtualMachine = true; } + + if (isVMware()) { + m_virtualMachine = true; + } } static void print(const QString &label, const QString &setting) @@ -934,6 +945,11 @@ bool GLPlatform::isVirtualBox() const return m_driver == Driver_VirtualBox; } +bool GLPlatform::isVMware() const +{ + return m_driver == Driver_VMware; +} + bool GLPlatform::isSoftwareEmulation() const { return m_driver == Driver_Softpipe || m_driver == Driver_Swrast || m_driver == Driver_Llvmpipe; diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index a961efe9d7..79bf46d19f 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -97,6 +97,7 @@ enum Driver { Driver_Softpipe, Driver_Llvmpipe, Driver_VirtualBox, + Driver_VMware, Driver_Unknown }; @@ -245,6 +246,12 @@ public: **/ bool isVirtualBox() const; + /** + * @returns @c true if the "GPU" is a VMWare GPU, and @c false otherwise. + * @since 4.10 + **/ + bool isVMware() const; + /** * @returns @c true if OpenGL is emulated in software. * @since 4.7