Fixes neferwl#22.
Problem
On nvidia-drm, KMS refuses the hardware cursor plane with EINVAL (cursor plane refused; hardware cursor off). NeferWL then uses the software cursor, so every pointer motion forces a full frame. The cursor images were linear images that Vulkan allocated and exported, the same allocate-in-Vulkan, scan-out-in-KMS path that corrupted the primary plane on NVIDIA.
Fix
- Allocation: cursor images are KMS dumb buffers (
CREATE_DUMB,MAP_DUMBand mmap, AddFB2 by GEM handle), written by the CPU when the cursor image changes. Moves are unchanged: they only update the plane position. - Fallback: dumb buffers, then Vulkan cursor images, then the software cursor. Vulkan images are tried both when dumb allocation fails and when the plane refuses the dumb images in the TEST_ONLY probe; the current image is rewritten into them.
- Log:
hardware cursorlogsalloc(dumborvulkan, a warning forvulkan) and the size. - HDR cursor conversion: moved to
internal/adapters/hdrcursor, so the drm adapter and the renderer write the same pixels. A recorded vector checks byte-identical output.
Verified
make check,make race,make mocks-checkandstaticcheck ./...pass.- Real-device dumb-buffer test (allocate, map, write, AddFB, read back; no modeset or commit) passes on amdgpu and on nvidia-drm 615.78.08.
- Unit tests with generated mocks cover the allocator order, the TEST_ONLY refusal and swap (in-flight state, queued and hidden images), writes, crop and pitch, and cleanup.
Not verified
- NVIDIA cursor plane acceptance with a display attached. This needs a test on an NVIDIA machine: the log should show
"message":"hardware cursor"with"alloc":"dumb"and nocursor plane refused, and the cursor should show at startup.