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

            Bug ID: 529041
           Summary: PowerDevil leaves KWin output dimming stuck at 30%
                    after wake from sleep (and re-applies 30% on
                    Brightness key press)
    Classification: Plasma
           Product: plasmashell
      Version First 6.8.3
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Power management & brightness
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

Environment

    OS: CachyOS (linux-cachyos 7.3.4-1, x86_64_v3)
    KDE Plasma / KWin / PowerDevil: 6.8.3-1.1 (Wayland)
    Display Setup: Hybrid laptop (eDP-1 internal panel + DP-3 external
DisplayPort monitor)

Description of the Bug

When "Dim automatically" (DimDisplayWhenIdle=true) is enabled (the default):

    Before entering sleep/DPMS off, PowerDevil::BundledActions::DimDisplay sets
the dimming ratio to 0.30 (30%) via
ScreenBrightnessController::setDimmingRatio.
    On wake from sleep (PrepareForSleep(false=resume)), org_kde_powerdevil
attempts to restore the dimming ratio to 1.0 (100%) before the DRM outputs have
finished reconnecting, logging:

    org_kde_powerdevil: Received dbus signal PrepareForSleep(false=resume)
    org_kde_powerdevil: There are no outputs - creating placeholder screen

    When eDP-1 and DP-3 reconnect a moment later, kscreen-doctor -o shows both
outputs remain stuck at dimming to 30%:

    Output: 1 eDP-1
        Brightness control: supported, set to 55% and dimming to 30%
    Output: 2 DP-3
        Brightness control: supported, set to 100% and dimming to 30%

    Furthermore, even if the user manually resets KWin's dimming to 100% via
kscreen-doctor output.eDP-1.dimming.100 output.DP-3.dimming.100,
KWinDisplayDetector inside libpowerdevilcore.so (0x98229–0x98249) still holds
the stale m_desiredDimming = 0.30 (0x48(%rbx)) in memory:

    9823a: call KScreen::Output::setBrightness(double)
    98240: vmovsd 0x48(%rbx),%xmm0
    98249: call KScreen::Output::setDimming(double)

    As soon as the user presses the hardware brightness keys (Fn+F5 / Fn+F6),
PowerDevil pushes both setBrightness() and the stale setDimming(0.30),
immediately re-dimming all screens back to 30%.

Workaround

Disabling DimDisplayWhenIdle=false in ~/.config/powerdevilrc under
[AC][Display], [Battery][Display], and [LowBattery][Display] and restarting
plasma-powerdevil.service prevents 0.30 from being applied before sleep.

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

Reply via email to