https://bugs.kde.org/show_bug.cgi?id=482713

--- Comment #27 from Jakob Petsovits <jpe...@petsovits.com> ---
Git commit 48453745b1cfb0fce66e16ec9ef8caf961e79677 by Jakob Petsovits.
Committed on 14/10/2024 at 23:04.
Pushed by jpetso into branch 'Plasma/6.2'.

daemon: Retry failed DDC/CI reads and writes repeatedly

DDC/CI communication with monitors can be unreliable,
especially when the monitor is still in the process of
fully waking up. The moment that we receive a connection
or DPMS awake event may not be the moment that brightness
commands start working.

Prior to this commit, `DDCutilDisplay` protected itself against
this case with a drastic measure: if a read or write command
failed, the object would claim brightness controls as
unsupported. This error condition meant that we won't end up
with inconsistent state, but it also makes the monitor's
brightness slider go away (or fall back to software
brightness controls if KWin wants those instead).

This commit still uses the same failure mode, but will try
harder before we give up on the monitor altogether.
Both initialization (reading the initial brightness value)
and `setBrightness()` will now retry a few times if the
first attempt didn't work out. Subsequent retries will be
spaced out further, until we finally give up on that monitor.

To avoid exposing uninitialized `DDCutilDisplay` objects,
a list of pending displays now holds these objects while
they're waiting for another initialization attempt.

`setBrightness()` will only be performed once initialization
has succeeded, so the two operations are mutually exclusive.
We can reuse DDCutilDisplay's existing brightness delay timer
for both kinds of retry operations.
Related: bug 493329


(cherry picked from commit 44e6922ae9f06a3e2fa3e7640be7eb32591cd579)

Co-authored-by: Jakob Petsovits <jpe...@petsovits.com>

M  +23   -11   daemon/controllers/ddcutildetector.cpp
M  +69   -15   daemon/controllers/ddcutildisplay.cpp
M  +8    -2    daemon/controllers/ddcutildisplay.h

https://invent.kde.org/plasma/powerdevil/-/commit/48453745b1cfb0fce66e16ec9ef8caf961e79677

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to