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.

If you happen to have a version for 6.12, I can test that as well.

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