Skip to content

Draft: Enable HW cursors on Nvidia GPUs

Doğukan Korkmaztürk requested to merge dkorkmazturk/kwin:nvhwcursor into master

These changes enable the use of HW cursors on Nvidia GPUs. The problem with the current approach is that the cursor plane requires a linear buffer to be attached on the Nvidia hardware. However, Nvidia GPUs cannot render to a linear texture, this is why DRM_FORMAT_MOD_LINEAR is marked as "external only" when the supported modifiers are queried by eglQueryDmaBufModifiersEXT(). Since the EGL render backend in KWin cannot find a common DRM format modifier between what the cursor plane needs and what the GPU can render to, it falls back to the SW cursor implementation.

With these changes, the Wayland compositor renders the cursor scene using the CPU if the primary GPU is Nvidia while using the DRM output backend. In this case, the cursor is rendered using the existing QPainter render backend. Since it renders to a linear DRM dumb buffer, the cursor plane on the Nvidia hardware is able to use it. The main scene still uses the EGL render backend.

Merge request reports