Skip to content
Commit f996906d authored by Jakob Petsovits's avatar Jakob Petsovits
Browse files

daemon: Avoid constantly locking ddcutil display handles

Since libddcutil implemented functionality for per-monitor
device lock files, other programs that are also using libddcutil
(such as the ddcutil CLI itself) were blocked from performing
monitor commands because PowerDevil kept all its handles open.

The better way of interacting with libddcutil as a long-running
program is to store a DDCA_Display_Ref for each monitor in question,
use it to get a temporary display handle, and close it again.

Now we can peacefully coexist with other libddcutil programs,
and users can e.g. query their monitor properties again.

As a slight downside, this means it's possible for another program
to set display brightness independently without PowerDevil noticing.
That seems like a smaller evil though, and can't be fixed by simply
using libddcutil itself as it cannot signal any VCP changes.
Common infrastructure such as digitaltrails/ddcutil-service or a
future kernel DRM interface for DDC/CI could help to mitigate this.

BUG: 481793
FIXED-IN: 6.0.4

(cherry picked from commit db4a6c79)

(generateDisplayId() changes extracted from commit a6b9cf5f)
parent e77348dd
Pipeline #661861 failed with stage
in 1 minute and 19 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment