backends/drm: fix legacy cursor

This commit is contained in:
Xaver Hugl 2021-12-09 16:20:21 +01:00
parent 9537ea6d16
commit 2817e7581f
2 changed files with 3 additions and 3 deletions

View file

@ -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();

View file

@ -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;
}
}