backend-drm: fix issues in libbacklight
The value of brightness node in backlight sys file may
end with '\n', which is not accepted by safe_strtoint
.
Another issue is that buffer
pointer is damaged by the
read
call, so it will be dangerous to free it if the
following asprintf
fails.
Merge request reports
Activity
added DRM/KMS backend label
@xndcn Is there a particular platform I can test this on to validate it?
Just stumbled onto this issue today, came up with the same fix
😄 . Would appreciate it, if this could be merged. @cphealy on any hardware that supports brightness control this should be visible. After the fix is applied the logs will show something like:Initialized backlight for head 'eDP-1', device /sys/class/backlight/acpi_video0
and the display should be dimmable (with the correct access rights). It seems like this bug was introduced in 2016 with the commit 913d7c15.@soerenmeier for this to be merged we need a s-o (https://gitlab.freedesktop.org/wayland/weston/-/blob/main/CONTRIBUTING.md#L99), to comply with https://gitlab.freedesktop.org/wayland/weston/-/blob/main/DCO-1.1.txt
Either @xndcn does that when re-basing, or you could open a new gitlab MR, and close this one.
mentioned in commit soerenmeier/weston@cf337923
mentioned in commit soerenmeier/weston@e506ec35
mentioned in commit soerenmeier/weston@009a2a3a
mentioned in merge request !818 (merged)
@soerenmeier I have forgotten the context about this commit since it was submited one year ago, so you are welcome to open a new MR.
mentioned in commit soerenmeier/weston@edef8746
mentioned in commit soerenmeier/weston@c983fc09