Setting display gamma in Wayland doesn't affect the cursor on some hardware
Steps to reproduce:
- login into Gnome Wayland session,
- enable Night Light,
- the cursor remains unaffected by the changed gamma (and is a jarring cold-white on otherwise warm-colored display).
Expected result:
- the cursor should have the same gamma as the display.
This happens only in Wayland; X11 session works fine.
Software used:
- amdgpu kernel driver as shipped with 4.15rc9 kernel (from fedora's vanilla kernel mainline repository),
- for X11 session, amdgpu xorg driver 1.4.0
Mutter controls the display gamma using the Monitor Manager and implements backends for KMS and X11.
The KMS backend calls drmModeCrtsSetGamma() inside meta_monitor_manager_kms_set_crtc_gamma() and that's it.
The X11 backend calls XRRSetCrtcGamma() in meta_monitor_manager_xrandr_set_crtc_gamma(), which bubbles into the xorg server and into the amdgpu driver, which, after also calling drmModeCrtsSetGamma() (in drmmode_crtc_gamma_do_set()) also calls xf86CursorResetCursor() (in drmmode_crtc_gamma_set()). This call has the consequence of forcing the cursor to have the same gamma as the surface behind.
Suggested resolution:
- Mutter should ensure, that the cursor has the same gamma as the surface behind it, just like the amdgpu xorg driver does.