Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Changing gamma doesn't change the display's gamma #2429

Closed
msrd0 opened this issue Oct 12, 2020 · 10 comments
Closed

Changing gamma doesn't change the display's gamma #2429

msrd0 opened this issue Oct 12, 2020 · 10 comments

Comments

@msrd0
Copy link

msrd0 commented Oct 12, 2020

I used to use redshift-wlr until it recently started segfaulting on me. Since the project seemed abandoned, I tried gammastep and wlsunset, which both claimed to be updating the colour temperature but nothing changed on my screen. Also, the gamma-control example from wlroots does not do anything, it just idles until I Ctrl+C it.

This is the debug output:

~/git/wlroots [master|✔]$ WAYLAND_DEBUG=1 ./build/examples/gamma-control -b 0.5
[  1362.623]  -> wl_display@1.get_registry(new id wl_registry@2)
[  1362.682]  -> wl_display@1.sync(new id wl_callback@3)
[  1362.995] wl_display@1.delete_id(3)
[  1363.051] wl_registry@2.global(1, "wl_shm", 1)
[  1363.087] wl_registry@2.global(2, "wl_drm", 2)
[  1363.130] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 3)
[  1363.168] wl_registry@2.global(4, "wl_compositor", 4)
[  1363.203] wl_registry@2.global(5, "wl_subcompositor", 1)
[  1363.250] wl_registry@2.global(6, "wl_data_device_manager", 3)
[  1363.294] wl_registry@2.global(7, "zwlr_gamma_control_manager_v1", 1)
[  1363.335]  -> wl_registry@2.bind(7, "zwlr_gamma_control_manager_v1", 1, new id [unknown]@4)
[  1363.413] wl_registry@2.global(8, "gtk_primary_selection_device_manager", 1)
[  1363.449] wl_registry@2.global(9, "zxdg_output_manager_v1", 3)
[  1363.492] wl_registry@2.global(10, "org_kde_kwin_idle", 1)
[  1363.536] wl_registry@2.global(11, "zwp_idle_inhibit_manager_v1", 1)
[  1363.573] wl_registry@2.global(12, "zwlr_layer_shell_v1", 2)
[  1363.605] wl_registry@2.global(13, "xdg_wm_base", 2)
[  1363.651] wl_registry@2.global(14, "zwp_tablet_manager_v2", 1)
[  1363.691] wl_registry@2.global(15, "org_kde_kwin_server_decoration_manager", 1)
[  1363.734] wl_registry@2.global(16, "zxdg_decoration_manager_v1", 1)
[  1363.780] wl_registry@2.global(17, "zwp_relative_pointer_manager_v1", 1)
[  1363.820] wl_registry@2.global(18, "zwp_pointer_constraints_v1", 1)
[  1363.863] wl_registry@2.global(19, "wp_presentation", 1)
[  1363.898] wl_registry@2.global(20, "zwlr_output_manager_v1", 2)
[  1363.934] wl_registry@2.global(21, "zwlr_output_power_manager_v1", 1)
[  1363.977] wl_registry@2.global(22, "zwp_input_method_manager_v2", 1)
[  1364.013] wl_registry@2.global(23, "zwp_text_input_manager_v3", 1)
[  1364.056] wl_registry@2.global(24, "zwlr_foreign_toplevel_manager_v1", 2)
[  1364.096] wl_registry@2.global(25, "zwlr_export_dmabuf_manager_v1", 1)
[  1364.135] wl_registry@2.global(26, "zwlr_screencopy_manager_v1", 3)
[  1364.182] wl_registry@2.global(27, "zwlr_data_control_manager_v1", 2)
[  1364.226] wl_registry@2.global(28, "zwp_primary_selection_device_manager_v1", 1)
[  1364.264] wl_registry@2.global(29, "wp_viewporter", 1)
[  1364.309] wl_registry@2.global(30, "zwp_virtual_keyboard_manager_v1", 1)
[  1364.357] wl_registry@2.global(31, "zwlr_virtual_pointer_manager_v1", 2)
[  1364.404] wl_registry@2.global(32, "zwlr_input_inhibit_manager_v1", 1)
[  1364.449] wl_registry@2.global(33, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[  1364.490] wl_registry@2.global(34, "wl_seat", 7)
[  1364.537] wl_registry@2.global(35, "zwp_pointer_gestures_v1", 1)
[  1364.575] wl_registry@2.global(36, "wl_output", 3)
[  1364.615]  -> wl_registry@2.bind(36, "wl_output", 1, new id [unknown]@5)
[  1364.680] wl_callback@3.done(2185)
[  1364.703]  -> zwlr_gamma_control_manager_v1@4.get_gamma_control(new id zwlr_gamma_control_v1@3, wl_output@5)
[  1364.743]  -> wl_display@1.sync(new id wl_callback@6)
[  1365.074] wl_display@1.delete_id(6)
[  1365.125] zwlr_gamma_control_v1@3.gamma_size(1024)
[  1365.239] wl_callback@6.done(2185)
[  1365.480]  -> zwlr_gamma_control_v1@3.set_gamma(fd 5)

I'm running ArchLinux 5.8.14-arch1-1 on an Acer Spin-3 with an i5-8250U (Intel UHD Graphics 620), integrated Full-HD touchscreen-display (I don't have an external display to test right now), and the issue is present on both wlroots 0.11 / sway 1.5 and on the respective master branches.

@emersion
Copy link
Member

Please provide a Sway debug log as well.

@msrd0
Copy link
Author

msrd0 commented Oct 12, 2020

Here's the sway debug log when just trying to run wlsunset: sway.log

@kennylevinsen
Copy link
Member

00:00:03.862 [ERROR] [backend/drm/legacy.c:157] Failed to set LUT on CRTC 51: Invalid argument

wat.

@emersion
Copy link
Member

emersion commented Oct 14, 2020

Can you provide a drm_info log?

This bug may be caused by WLR_DRM_NO_ATOMIC.

@emersion
Copy link
Member

At the very least, wlr-gamma-control should send a failed event in this case.

@msrd0
Copy link
Author

msrd0 commented Oct 14, 2020

Here's my drm_info log: drm_info.log

@emersion
Copy link
Member

Here's the issue: the GAMMA_LUT property size is

│   │       └───"GAMMA_LUT_SIZE" (immutable): range [0, UINT32_MAX] = 1024

whereas the legacy gamma size is

│   │   ├───Gamma size: 256

We should be consistent in the interfaces we use, and not mix GAMMA_LUT with drmModeCrtcSetGamma.

@msrd0
Copy link
Author

msrd0 commented Oct 14, 2020

Removing export WLR_DRM_NO_ATOMIC=1 from my .bashrc seems to fix this, not sure why it was there to begin with but I'm sure I had a reason to put it there.

@g00pix
Copy link

g00pix commented Nov 12, 2020

Hi,

I have a very similar issue with the same error in my sway logs ([ERROR] [backend/drm/legacy.c:157] Failed to set gamma LUT on CRTC 50: Invalid argument), same symptoms (gamma not changing with gammastep) and drm_info does print a GAMMA_LUT_SIZE of 1024 instead of the legacy 256. However, WLR_DRM_NO_ATOMIC is not set in my environment.
Do you want me to create another issue or maybe give more information?

@emersion
Copy link
Member

Do you want me to create another issue or maybe give more information?

No need, we have all information needed here. Someone just needs to type the patch to fix this.

kennylevinsen added a commit to kennylevinsen/wlroots that referenced this issue Nov 19, 2020
We would always return the GAMMA_LUT_SIZE property if available, and
only fall back to legacy gamma size otherwise. This leads to issues if
both are available in differs in size while we use the legacy backend.

Ensure that we only return the legacy size if we're using the legacy
backend.

Closes: swaywm#2429
emersion pushed a commit to emersion/wlroots that referenced this issue Nov 25, 2020
We would always return the GAMMA_LUT_SIZE property if available, and
only fall back to legacy gamma size otherwise. This leads to issues if
both are available in differs in size while we use the legacy backend.

Ensure that we only return the legacy size if we're using the legacy
backend.

Closes: swaywm#2429
udfn pushed a commit to udfn/wlroots that referenced this issue Dec 8, 2020
We would always return the GAMMA_LUT_SIZE property if available, and
only fall back to legacy gamma size otherwise. This leads to issues if
both are available in differs in size while we use the legacy backend.

Ensure that we only return the legacy size if we're using the legacy
backend.

Closes: swaywm#2429
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants