backends/drm: work around atomic commits failing with NVidia

For some reason, when IN_FENCE_FD is set, the NVidia driver rejects the
commit. Until that's fixed in the driver, don't set the property

BUG: 478246
This commit is contained in:
Xaver Hugl 2023-12-08 16:24:22 +01:00
parent eb13085de2
commit 50899f3f34
3 changed files with 9 additions and 1 deletions

View file

@ -57,7 +57,8 @@ void DrmAtomicCommit::addBuffer(DrmPlane *plane, const std::shared_ptr<DrmFrameb
{
addProperty(plane->fbId, buffer ? buffer->framebufferId() : 0);
m_buffers[plane] = buffer;
if (plane->inFenceFd.isValid()) {
// atomic commits with IN_FENCE_FD fail with NVidia
if (plane->inFenceFd.isValid() && !plane->gpu()->isNVidia()) {
addProperty(plane->inFenceFd, buffer ? buffer->syncFd().get() : -1);
}
m_planes.emplace(plane);

View file

@ -79,6 +79,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, const QString &devNode, int fd, dev_t device
// find out what driver this kms device is using
DrmUniquePtr<drmVersion> version(drmGetVersion(fd));
m_isI915 = strstr(version->name, "i915");
m_isNVidia = strstr(version->name, "nvidia-drm");
m_isVirtualMachine = strstr(version->name, "virtio") || strstr(version->name, "qxl")
|| strstr(version->name, "vmwgfx") || strstr(version->name, "vboxvideo");
@ -695,6 +696,11 @@ bool DrmGpu::isI915() const
return m_isI915;
}
bool DrmGpu::isNVidia() const
{
return m_isNVidia;
}
bool DrmGpu::isRemoved() const
{
return m_isRemoved;

View file

@ -78,6 +78,7 @@ public:
bool addFB2ModifiersSupported() const;
bool asyncPageflipSupported() const;
bool isI915() const;
bool isNVidia() const;
gbm_device *gbmDevice() const;
EglDisplay *eglDisplay() const;
DrmBackend *platform() const;