Seems like you can use KWIN_DRM_NO_AMS=1 as a workaround in the
meantime until they add hyperv_drm support on their end.

That was it. With KWIN_DRM_NO_AMS=1 set for the session (checked in
kwin_wayland's environment), on the same kernel as before
(drm-misc-next at c88084027d0e, 7.4.0-rc2):

- one pointer, no extra copies
- smooth, no lag, also on long fast moves
- clicks land exactly under the tip, checked on small targets
- cursors too large for the plane still fall back to the software
  cursor, as before

So the driver side works here, and the three pointers came from KWin
6.3.6 not treating hyperv_drm as a driver that needs the hotspot on
its atomic path.

I will report this to KDE with a pointer to your patch, unless you
have already done so or would rather do it yourself.

Tested-by: Sascha Eder <[email protected]>

Thank you for the quick help. This makes a Linux guest on Hyper-V
feel right for the first time.

Sascha


Quoting Hamza Mahfooz <[email protected]>:

On Fri, Nov 13, 2026 at 02:18:54AM +0100, [email protected] wrote:
Hi,

> Development for the driver is done on drm-misc-next[1], so I would
> suggest testing it on there.

Done. Short version: the pointer is smooth now, the lag is gone,
but the host-drawn pointer shows up three times side by side.


What I built
- drm-misc-next at c88084027d0e ("drm: Discard
  pm_runtime_put_autosuspend() return values"), 7.4.0-rc2

- The tree already contains the cursor plane code: git am of your
  patch failed and patch(1) reported it as previously applied, so I
  built the tree as it is. Please tell me if that is not the version
  you want tested.

- Config: Debian 13's 6.12 config through localmodconfig, with
  HYPERV=y, HYPERV_VMBUS=m, DRM_HYPERV=m


Setup
- Host: Windows 11 Pro 26H2 (build 26300.9711), Hyper-V, Generation 2
  VM, basic session (vmconnect), 3840x2160
- Guest: Debian 13 userland, KDE Plasma 6.3.6 on Wayland (KWin 6.3.6),
  3840x2160 at 200 % scale, 4 vCPUs


What works
- The pointer follows the hand without delay, also on long fast moves.
  KWin picked up the cursor plane without any configuration.

- Cursors too large for the plane fall back to the software cursor
  correctly: one pointer, drawn right, with the old lag.


What does not
- Whenever the host draws the pointer, I see it three times: the real
  pointer, and two extra copies of it to its right. All three have the
  same shape, are evenly spaced in a row and move together. Clicks land
  under the leftmost one; the other two are only images. In phone
  photos of the screen the three look striped, as if only some of
their lines were drawn or those "ghosts" were meant to render as one pointer

- This is the same for every size that uses the plane and for every theme I
tried:

    Breeze, 200 % scale   size 12, 18, 24, 30, 36   plane, three pointers
                          size 42 and larger        software, one pointer

    Breeze Light          same as Breeze

    DMZ White, DMZ Black  three pointers

- The count is always the same: one real pointer plus two copies,
  whatever the cursor size.


I wasn't able to repro that issue but it seems like KWin maintains a
hardcoded list of driver names [1] which it uses to determine if it
should enable hotspot support on it's atomic path. Seems like you can
use KWIN_DRM_NO_AMS=1 as a workaround in the meantime until they add
hyperv_drm support on their end.

[1] https://invent.kde.org/plasma/kwin/-/blob/75175b104504748aacd3d6a955a79d19751f8310/src/core/drmdevice.cpp#L48

- Host is on build 26300.9711 (the 2026-10 security update);
  the November update is not offered for this edition yet, so I could not
  check whether a newer host build behaves differently.
  I will retest when it arrives.

I have photos of the screen and could send them off-list or put them
somewhere, since the list likely does not take jpg attachments.

Tested on the setup above; I would hold a Tested-by until the copies are gone.

regards
Sascha



Quoting Hamza Mahfooz <[email protected]>:

> On Wed, Nov 11, 2026 at 10:05:06PM +0100, [email protected] wrote:
> > Hi,
> >
> > thank you for the speedy reply :)
> >
> > > Cursor plane support is a WIP, you can test out [1] on your end.
> >
> > That is exactly the fix I was hoping for.
> >
> > Which tree and commit does the patch apply to?
> >
> > My guest runs Debian 13 with kernel 6.12, where the driver still has the
> > hyperv_ prefix and the simple display pipe,
> > so I would build the tree you name with the patch on top and report back.
> >
>
> Development for the driver is done on drm-misc-next[1], so I would
> suggest testing it on there.
>
> [1] https://gitlab.freedesktop.org/drm/misc/kernel/-/tree/drm-misc-next
>
> > If you happen to have a version for 6.12, I can test that as well.
> >
>
> Quite a lot has changed in the DRM subsystem since then so I doubt my patch
> applies cleanly there or works as expected.
>
> Hamza
>
> > regards
> >
> > Sascha
> >
> >
> >
> > Quoting Hamza Mahfooz <[email protected]>:
> >
> > > Hi,
> > >
> > > On Wed, Nov 11, 2026 at 12:13:16PM +0100, [email protected] wrote:
> > > > Hi,
> > > >
> > > > I am a Windows developer porting some of my own desktop tools to
> > Linux, and
> > > > I use a Debian guest on Hyper-V to judge how they look and feel there.
> > > >
> > > > The static picture is good, the mouse pointer is not, and I
> > think the cause
> > > > is small and fixable in hyperv_drm. I am writing because this is
> > the first
> > > > thing a Windows developer notices when trying Linux on their own
> > machine: as
> > > > long as a Linux VM feels sluggish next to a Windows VM on the
> > same host, few
> > > > of us will move a repo over and be happy about it.
> > > >
> > > > Setup
> > > > - Host: [Windows 11/26H2], Hyper-V, Generation 2 VM, basic session
> > > > (vmconnect), 3840x2160 display
> > > > - Guest: Debian 13, kernel 6.12.113+deb13-amd64, hyperv_drm
> > (Synthvid 3.5),
> > > > KDE Plasma 6.3.6 on Wayland (KWin 6.3.6, libwayland 1.23.1)
> > > > - 4 vCPUs, about 7 GB RAM
> > > >
> > > > What I saw so far:
> > > >
> > > > - The pointer trails the hand by a small constant delay. Fast, long
> > > > movements (taskbar to top of the screen) are visibly laggy, not just
> > > > slightly off.
> > > >
> > > > - A Windows guest on the same host, same viewer, same mouse is smooth -
> > > > directly, and even when the host itself is reached through RDP.
> > The Debian
> > > > guest lags in both cases.
> > > >
> > > > - While moving the pointer: kwin_wayland uses 35-50 % of one
> > core, a kworker
> > > > (events_unbound) 13-21 %, and the VM is about 80 % idle. Adding vCPUs
> > > > changes nothing, so it is not a lack of CPU.
> > > >
> > > > - A smaller cursor and disabling KDE's shake-to-enlarge effect helped a
> > > > little. A plain color desktop did not.
> > > >
> > > > What I think the cause is (from reading the driver, I have not
> > patched it)
> > > >
> > > > 1. hyperv_drm exposes only the primary plane. There is no cursor
> > plane, so
> > > > the compositor has to paint the pointer into the framebuffer, and every
> > > > movement goes through compositing, the "blit to VRAM" and the
> > dirt message.
> > > >
> > > > 2. hyperv_pipe_update() uses drm_atomic_helper_damage_merged(),
> > so the old
> > > > and the new pointer position become one bounding rectangle. For
> > a long or
> > > > diagonal move at 4K that is a large part of the screen per pointer step,
> > > > which matches the more noticable lag (much worse) on big movements.
> > > >
> > > > 3. The protocol already has what is needed. hyperv_hide_hw_ptr() exists > > > > because, as its commit message says, "Hyper-V supports a hardware cursor > > > > feature. It is not used by Linux VM, but the Hyper-V host still draws" a
> > > > pointer; the driver hides it by sending a 1x1 transparent ARGB
> > shape with
> > > > SYNTHVID_POINTER_SHAPE. So the host does accept a shape from a
> > Linux guest
> > > > and does draw the pointer itself.
> > > >
> > > > Proposal:
> > > >
> > > > Add a cursor plane to hyperv_drm (up to SYNTHVID_CURSOR_MAX_X/Y, 96x96,
> > > > ARGB) that sends the compositor's cursor image and hot spot through
> > > > SYNTHVID_POINTER_SHAPE instead of the transparent pixel, and
> > re-sends it on
> > > > SYNTHVID_FEATURE_CHANGE where the hide call is made today.
> > > >
> > >
> > > Cursor plane support is a WIP, you can test out [1] on your end.
> > >
> > > [1] https://patchwork.freedesktop.org/patch/761562/
> > >
> > > Hamza
> > >
> > > > With cursor hot-spot support for virtualized drivers,
> > compositors would then
> > > > leave the pointer to the host, as Windows guests do, and pointer
> > movement
> > > > would cause no framebuffer damage at all.
> > > >
> > > > Independently of that, handling damage clips individually
> > instead of merged
> > > > would reduce the cost of the software-cursor fallback (cursors
> > larger than
> > > > 96x96).
> > > >
> > > > A second, smaller item found on the way:
> > > >
> > > > With Set-VMVideo set to 3840x2160 (Maximum), the guest offers
> > modes only up
> > > > to 2560x1600. The connector's modes come from
> > drm_add_modes_noedid(), and
> > > > 3840x2160 is not in that table, so it only appears with
> > > > video=Virtual-1:3840x2160 on the kernel command line. Adding the host's
> > > > maximum (or preferred) resolution as an explicit mode would make
> > 4K hosts
> > > > work without that step.
> > > >
> > > > I can test patches on this setup and report back. I am not in a
> > position to
> > > > write the kernel change myself (drivers are not my field of work
> > at all).
> > > >
> > > > Thanks for maintaining the driver.
> > > >
> > > > Sascha Eder
> > > >
> > > >
> >
> >






Reply via email to