From 17029cd54f2eee4da9ddbc5154ea93dd836c513c Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 1 Apr 2024 15:02:43 -0400 Subject: [PATCH] backends/drm: Fix redraw issues on vmwgfx Disable the readability checks when running on vmwgfx. The DMABuf syncs seem broken on vmwgfx and until they're fixed disable the readablity checks to actually let KDE propertly redraw when running on vmwgfx. --- src/backends/drm/drm_buffer.cpp | 3 ++- src/backends/drm/drm_gpu.cpp | 6 ++++++ src/backends/drm/drm_gpu.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/drm_buffer.cpp b/src/backends/drm/drm_buffer.cpp index 6c207d7a77..2b8eec64c0 100644 --- a/src/backends/drm/drm_buffer.cpp +++ b/src/backends/drm/drm_buffer.cpp @@ -39,8 +39,9 @@ DrmFramebuffer::DrmFramebuffer(DrmGpu *gpu, uint32_t fbId, GraphicsBuffer *buffe , m_gpu(gpu) , m_bufferRef(buffer) { - if (s_disableBufferWait || (m_gpu->isI915() && !s_envIsSet)) { + if (s_disableBufferWait || ((m_gpu->isI915() || m_gpu->isVmwgfx()) && !s_envIsSet)) { // buffer readability checks cause frames to be wrongly delayed on some Intel laptops + // and on Virtual Machines running vmwgfx // See https://gitlab.freedesktop.org/drm/intel/-/issues/9415 m_readable = true; } diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index 9d5b4af3f3..c5f1f3d6e7 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -80,6 +80,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, int fd, std::unique_ptr &&device) m_isI915 = strstr(version->name, "i915"); m_isNVidia = strstr(version->name, "nvidia-drm"); m_isAmdgpu = strstr(version->name, "amdgpu"); + m_isVmwgfx = strstr(version->name, "vmwgfx"); m_isVirtualMachine = strstr(version->name, "virtio") || strstr(version->name, "qxl") || strstr(version->name, "vmwgfx") || strstr(version->name, "vboxvideo"); @@ -678,6 +679,11 @@ bool DrmGpu::isAmdgpu() const return m_isAmdgpu; } +bool DrmGpu::isVmwgfx() const +{ + return m_isVmwgfx; +} + bool DrmGpu::isRemoved() const { return m_isRemoved; diff --git a/src/backends/drm/drm_gpu.h b/src/backends/drm/drm_gpu.h index 9a12f5f255..2b54b50ac6 100644 --- a/src/backends/drm/drm_gpu.h +++ b/src/backends/drm/drm_gpu.h @@ -80,6 +80,7 @@ public: bool isI915() const; bool isNVidia() const; bool isAmdgpu() const; + bool isVmwgfx() const; EglDisplay *eglDisplay() const; DrmBackend *platform() const; /** @@ -137,6 +138,7 @@ private: bool m_isNVidia; bool m_isI915; bool m_isAmdgpu; + bool m_isVmwgfx; bool m_isVirtualMachine; bool m_supportsCursorPlaneHotspot = false; bool m_asyncPageflipSupported = false;