Mesa (master): vulkan/wsi: disable the hardware cursor

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 17 17:37:25 UTC 2020


Module: Mesa
Branch: master
Commit: 51de5d5ac65ebeaaebe716291be19fd36692f5cb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=51de5d5ac65ebeaaebe716291be19fd36692f5cb

Author: Andres Rodriguez <andresx7 at gmail.com>
Date:   Tue Sep 10 14:30:35 2019 -0400

vulkan/wsi: disable the hardware cursor

Ensure the hardware cursor is disabled when we set the mode for a
VkDisplayKHR object. The extension doesn't expose any mechanisms to
program the hardware cursor, so we need to ensure it is hidden.

Currently, it seems like X is responsible for disabling the cursor
before handing over the lease. But that seems a little frail, and we
should be disabling the cursor ourselves so it works correctly
independently of how the lease was prepared for us.

Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1922>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1922>

---

 src/vulkan/wsi/wsi_common_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c
index 04c77162df4..0f9a1ffe8d3 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -1687,6 +1687,15 @@ _wsi_display_queue_next(struct wsi_swapchain *drv_chain)
                               &connector->id, 1,
                               &connector->current_drm_mode);
          if (ret == 0) {
+            /* Disable the HW cursor as the app doesn't have a mechanism
+             * to control it.
+             * Refer to question 12 of the VK_KHR_display spec.
+             */
+            ret = drmModeSetCursor(wsi->fd, connector->crtc_id, 0, 0, 0 );
+            if (ret != 0) {
+               wsi_display_debug("failed to hide cursor err %d %s\n", ret, strerror(-ret));
+            }
+
             /* Assume that the mode set is synchronous and that any
              * previous image is now idle.
              */



More information about the mesa-commit mailing list