From cc0ec147123f9fd53d95169732ce0ace3c3d2d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 1 Jul 2024 15:40:37 +0200 Subject: [PATCH] monitor-manager: Add new backlight D-Bus API It is intended to replace using GetResources() and ChangeBacklight(). It moves from a normalized 1-100 numbers, to directly exposing the hardware. This more closely maps to how gsd-backlight.c in gnome-settings-daemon normally works, and simplifies the API a bit to not have to deal with rounding issues. There is still no KMS uAPI for this, so it still only hooks up to XRANDR. Being private API, it doesn't try very hard to predict how the KMS uAPI will look. When that day comes, it will likely need some adaptations. Part of the motivation here is to get something for gsd-backlight.c to use where it can work more similarly to how the current common case (sysefs) works, while attempting to migrate away from libgnome-rr. Part-of: --- .../org.gnome.Mutter.DisplayConfig.xml | 30 +++ src/backends/meta-monitor-manager.c | 139 +++++++++++++- src/tests/meson.build | 17 ++ src/tests/monitor-backlight-client.c | 179 ++++++++++++++++++ src/tests/monitor-backlight-tests.c | 59 ++++++ 5 files changed, 423 insertions(+), 1 deletion(-) create mode 100644 src/tests/monitor-backlight-client.c diff --git a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml index d8f1ea9b1..8c1b951a7 100644 --- a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml +++ b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml @@ -210,12 +210,42 @@ Returns the new value after rounding. --> + + + + + + + + + + +