backends/drm: disable buffer readability checks on Intel
They cause stutters and reduced frame rates on some Intel laptops because the buffers don't become readable in time, so disable the checks until that's fixed on the driver side. For debugging purposes, the environment variable KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS can be used to override the default behavior. BUG: 476860
This commit is contained in:
parent
93443a8228
commit
869e86ff00
3 changed files with 16 additions and 0 deletions
|
@ -26,11 +26,19 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static bool s_envIsSet = false;
|
||||||
|
static bool s_disableBufferWait = qEnvironmentVariableIntValue("KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS", &s_envIsSet) && s_envIsSet;
|
||||||
|
|
||||||
DrmFramebuffer::DrmFramebuffer(DrmGpu *gpu, uint32_t fbId, GraphicsBuffer *buffer)
|
DrmFramebuffer::DrmFramebuffer(DrmGpu *gpu, uint32_t fbId, GraphicsBuffer *buffer)
|
||||||
: m_framebufferId(fbId)
|
: m_framebufferId(fbId)
|
||||||
, m_gpu(gpu)
|
, m_gpu(gpu)
|
||||||
, m_bufferRef(buffer)
|
, m_bufferRef(buffer)
|
||||||
{
|
{
|
||||||
|
if (s_disableBufferWait || (m_gpu->isI915() && !s_envIsSet)) {
|
||||||
|
// buffer readability checks cause frames to be wrongly delayed on some Intel laptops
|
||||||
|
// See https://gitlab.freedesktop.org/drm/intel/-/issues/9415
|
||||||
|
m_readable = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DrmFramebuffer::~DrmFramebuffer()
|
DrmFramebuffer::~DrmFramebuffer()
|
||||||
|
|
|
@ -75,6 +75,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, const QString &devNode, int fd, dev_t device
|
||||||
// find out what driver this kms device is using
|
// find out what driver this kms device is using
|
||||||
DrmUniquePtr<drmVersion> version(drmGetVersion(fd));
|
DrmUniquePtr<drmVersion> version(drmGetVersion(fd));
|
||||||
m_isNVidia = strstr(version->name, "nvidia-drm");
|
m_isNVidia = strstr(version->name, "nvidia-drm");
|
||||||
|
m_isI915 = strstr(version->name, "i915");
|
||||||
m_isVirtualMachine = strstr(version->name, "virtio") || strstr(version->name, "qxl")
|
m_isVirtualMachine = strstr(version->name, "virtio") || strstr(version->name, "qxl")
|
||||||
|| strstr(version->name, "vmwgfx") || strstr(version->name, "vboxvideo");
|
|| strstr(version->name, "vmwgfx") || strstr(version->name, "vboxvideo");
|
||||||
|
|
||||||
|
@ -690,6 +691,11 @@ bool DrmGpu::isNVidia() const
|
||||||
return m_isNVidia;
|
return m_isNVidia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DrmGpu::isI915() const
|
||||||
|
{
|
||||||
|
return m_isI915;
|
||||||
|
}
|
||||||
|
|
||||||
bool DrmGpu::isRemoved() const
|
bool DrmGpu::isRemoved() const
|
||||||
{
|
{
|
||||||
return m_isRemoved;
|
return m_isRemoved;
|
||||||
|
|
|
@ -79,6 +79,7 @@ public:
|
||||||
bool addFB2ModifiersSupported() const;
|
bool addFB2ModifiersSupported() const;
|
||||||
bool asyncPageflipSupported() const;
|
bool asyncPageflipSupported() const;
|
||||||
bool isNVidia() const;
|
bool isNVidia() const;
|
||||||
|
bool isI915() const;
|
||||||
gbm_device *gbmDevice() const;
|
gbm_device *gbmDevice() const;
|
||||||
EglDisplay *eglDisplay() const;
|
EglDisplay *eglDisplay() const;
|
||||||
DrmBackend *platform() const;
|
DrmBackend *platform() const;
|
||||||
|
@ -137,6 +138,7 @@ private:
|
||||||
bool m_atomicModeSetting;
|
bool m_atomicModeSetting;
|
||||||
bool m_addFB2ModifiersSupported = false;
|
bool m_addFB2ModifiersSupported = false;
|
||||||
bool m_isNVidia;
|
bool m_isNVidia;
|
||||||
|
bool m_isI915;
|
||||||
bool m_isVirtualMachine;
|
bool m_isVirtualMachine;
|
||||||
bool m_asyncPageflipSupported = false;
|
bool m_asyncPageflipSupported = false;
|
||||||
bool m_isRemoved = false;
|
bool m_isRemoved = false;
|
||||||
|
|
Loading…
Reference in a new issue