From 2817e7581f7bbc8c914cd82de33f41a1746d06b2 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 9 Dec 2021 16:20:21 +0100 Subject: [PATCH] backends/drm: fix legacy cursor --- src/backends/drm/drm_pipeline.cpp | 2 +- src/backends/drm/drm_pipeline_legacy.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index d75935e9fe..f40130dcee 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -344,11 +344,11 @@ bool DrmPipeline::moveCursor(QPoint pos) if (pending.cursorPos == pos) { return true; } + pending.cursorPos = pos; bool result; const bool visibleBefore = isCursorVisible(); // explicitly check for the cursor plane and not for AMS, as we might not always have one if (pending.crtc->cursorPlane()) { - pending.cursorPos = pos; result = commitPipelines({this}, CommitMode::Test); } else { result = moveCursorLegacy(); diff --git a/src/backends/drm/drm_pipeline_legacy.cpp b/src/backends/drm/drm_pipeline_legacy.cpp index 4a44d6dd49..49eaee2d17 100644 --- a/src/backends/drm/drm_pipeline_legacy.cpp +++ b/src/backends/drm/drm_pipeline_legacy.cpp @@ -128,12 +128,12 @@ bool DrmPipeline::setCursorLegacy() pending.cursorBo ? pending.cursorBo->handle() : 0, s.width(), s.height()); } - return true; + return ret == 0; } bool DrmPipeline::moveCursorLegacy() { - return drmModeMoveCursor(gpu()->fd(), pending.crtc->id(), pending.cursorPos.x(), pending.cursorPos.y()) != 0; + return drmModeMoveCursor(gpu()->fd(), pending.crtc->id(), pending.cursorPos.x(), pending.cursorPos.y()) == 0; } }