platforms/drm: fix drmModeSetCursor2 fallback

the return value is -errno, not errno.
This commit is contained in:
Xaver Hugl 2021-09-06 23:57:18 +02:00
parent d63b06d7a5
commit 237ef3d47f

View file

@ -314,7 +314,7 @@ bool DrmPipeline::setCursor(const QSharedPointer<DrmDumbBuffer> &buffer, const Q
}
const QSize &s = buffer ? buffer->size() : QSize(64, 64);
int ret = drmModeSetCursor2(m_gpu->fd(), m_crtc->id(), buffer ? buffer->handle() : 0, s.width(), s.height(), hotspot.x(), hotspot.y());
if (ret == ENOTSUP) {
if (ret == -ENOTSUP) {
// for NVIDIA case that does not support drmModeSetCursor2
ret = drmModeSetCursor(m_gpu->fd(), m_crtc->id(), buffer ? buffer->handle() : 0, s.width(), s.height());
}