<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>454161</bug_id>
          
          <creation_ts>2022-05-21 14:49:37 +0000</creation_ts>
          <short_desc>Brightness stuck at 30%</short_desc>
          <delta_ts>2022-06-30 18:07:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>Powerdevil</product>
          <component>general</component>
          <version>5.24.90</version>
          <rep_platform>Neon</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>VHI</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sparkwave">Plazmoid3</reporter>
          <assigned_to name="ratijas">me</assigned_to>
          <cc>alej.c.s</cc>
    
    <cc>alejandrosena</cc>
    
    <cc>andrea.ippo</cc>
    
    <cc>asturm</cc>
    
    <cc>brunopitrus</cc>
    
    <cc>cbdude</cc>
    
    <cc>contact</cc>
    
    <cc>cornelis</cc>
    
    <cc>coucouf</cc>
    
    <cc>davmor2</cc>
    
    <cc>eduardp</cc>
    
    <cc>fedux</cc>
    
    <cc>jramirez.uy</cc>
    
    <cc>kde</cc>
    
    <cc>laimislsecond</cc>
    
    <cc>luisbocanegra17b</cc>
    
    <cc>Mathias.Homann</cc>
    
    <cc>me</cc>
    
    <cc>me</cc>
    
    <cc>meven29</cc>
    
    <cc>nate</cc>
    
    <cc>patrick</cc>
    
    <cc>poomklao</cc>
    
    <cc>RaitaroHikami</cc>
    
    <cc>rikmills</cc>
    
    <cc>rohan</cc>
    
    <cc>sam</cc>
    
    <cc>tromzy</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/powerdevil/commit/dd74cdbdd3849fbd86e6613ef7ecab6c7857cb89</cf_commitlink>
          <cf_versionfixedin>5.25.1</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2125302</commentid>
    <comment_count>0</comment_count>
    <who name="Sparkwave">Plazmoid3</who>
    <bug_when>2022-05-21 14:49:37 +0000</bug_when>
    <thetext>SUMMARY
If the laptop is set to set its brightness to 30% upon reaching low battery, it will keep its brightness below 30% even after  the battery is fully charged and plugged in, and won&apos;t allow the user to set its brightness above 30% even after reboot, both with the hardware brightness keys and with the system brightness slider.

STEPS TO REPRODUCE
1. Set Plasma to lower the screen brightness to 30% at low battery
2. Wait until the device reaches low battery
3. Try to increase the brightness back up

OBSERVED RESULT
The brightness will snap back to 0% upon reaching 30%

EXPECTED RESULT
The brightness should continue being able to increase beyond 30%

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (Arch Linux Packages)
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2125636</commentid>
    <comment_count>1</comment_count>
    <who name="Luis Bocanegra">luisbocanegra17b</who>
    <bug_when>2022-05-23 06:15:55 +0000</bug_when>
    <thetext>I&apos;m having this bug too, in my case it happens even when with the brightness setting disabled in Energy Saving options.

Trying to set it manually is also affected:
```sh
qdbus local.org_kde_powerdevil /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 40000
```

While:
```sh
echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness
```
works

SOFTWARE/OS VERSIONS (Same as reporter)
Linux/KDE Plasma: Arch Linux (Arch Linux Packages)
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.17.9-arch1-1 (64-bit)
Graphics Platform: X11

HARDWARE
Processors: Intel i7-9750H
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: HP
Product Name: OMEN by HP Laptop 15-dc1xxx</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2126607</commentid>
    <comment_count>2</comment_count>
    <who name="Bruno Pitrus">brunopitrus</who>
    <bug_when>2022-05-25 14:10:18 +0000</bug_when>
    <thetext>Seems to be same as this SUSE bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=1199907</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2128007</commentid>
    <comment_count>3</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-05-31 13:57:30 +0000</bug_when>
    <thetext>Same issue on Debian unstable working on packaging 5.25 beta.

Others (at least from Kubuntu) don’t have the issue so not sure if the hardware or kernel is involved.
My kernel is 5.17.6, and the laptop an XPS 13 7390.

The issue is linked to the following commit :
    Write brightness to all raw devices
    https://invent.kde.org/plasma/powerdevil/-/commit/761fc8a4bf4bd70bcd9aca63fc67382c94ecf884

Reverting it and its followup :
    Fix Commit 761fc8a4
    https://invent.kde.org/plasma/powerdevil/-/commit/94f8186804d8a67459a11673b602c55e34db25ad

fixes the issue for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2128009</commentid>
    <comment_count>4</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-05-31 14:14:13 +0000</bug_when>
    <thetext>Quick note to say that for me it’s a serious bug.

The brightness I get with the bug is more around 20% and makes it barely usable during daytime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2129743</commentid>
    <comment_count>5</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-07 18:02:34 +0000</bug_when>
    <thetext>It does seem hardware-dependent. I cannot reproduce with my laptop that has an Intel HD 620 iGPU and no dedicated GPU. I&apos;m CCing some people who might be able to help, and will ping the original author.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131156</commentid>
    <comment_count>6</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-14 18:17:07 +0000</bug_when>
    <thetext>Are you using the slider in the Battery &amp; Brightness applet? Does it work if you click on a position in the track rather than dragging the handle?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131158</commentid>
    <comment_count>7</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-14 18:17:11 +0000</bug_when>
    <thetext>*** Bug 455256 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131206</commentid>
    <comment_count>8</comment_count>
    <who name="Sam James">sam</who>
    <bug_when>2022-06-14 20:20:38 +0000</bug_when>
    <thetext>(In reply to Aurélien COUDERC from comment #3)
&gt; Same issue on Debian unstable working on packaging 5.25 beta.
&gt; 
&gt; https://invent.kde.org/plasma/powerdevil/-/commit/
&gt; 761fc8a4bf4bd70bcd9aca63fc67382c94ecf884
&gt; https://invent.kde.org/plasma/powerdevil/-/commit/
&gt; 94f8186804d8a67459a11673b602c55e34db25ad
&gt; 

Thanks. Reverting these sorts out the issue for me too.

Gentoo, KDE Plasma 5.25, Frameworks 5.95.0.
Dell XPS 15 9510, but using Intel graphics.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131264</commentid>
    <comment_count>9</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-06-14 22:45:48 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #6)
&gt; Are you using the slider in the Battery &amp; Brightness applet? Does it work if
&gt; you click on a position in the track rather than dragging the handle?

I’ve reverted the commits for some time now, but as far as I remember both the slider and the keys had the same effect.

It was not only blocking at ~20 % but the brightness was also flickering between steps until it reached that level. So it would do something like 6%, 8%, 2%, 12%, 1%, 16%, 3%, 18% (not precisely these numbers but you get the idea).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131338</commentid>
    <comment_count>10</comment_count>
    <who name="">poomklao</who>
    <bug_when>2022-06-15 08:30:46 +0000</bug_when>
    <thetext>&quot;Me-too&quot;-ing this bug.
* For me, this happens without the laptop ever going below 30% post-update.
* Both the slider and the keys have the same effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131347</commentid>
    <comment_count>11</comment_count>
    <who name="">tromzy</who>
    <bug_when>2022-06-15 09:19:08 +0000</bug_when>
    <thetext>I&apos;m having the same issue : https://bugs.kde.org/show_bug.cgi?id=455307</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131349</commentid>
    <comment_count>12</comment_count>
    <who name="Patrick van Elk">patrick</who>
    <bug_when>2022-06-15 09:24:56 +0000</bug_when>
    <thetext>Temporary workaround for KDE Neon:

sudo apt install powerdevil=4:5.24.5-0xneon+20.04+focal+release+build47 powerdevil-data=4:5.24.5-0xneon+20.04+focal+release+build47</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131456</commentid>
    <comment_count>13</comment_count>
    <who name="Sam James">sam</who>
    <bug_when>2022-06-15 15:37:37 +0000</bug_when>
    <thetext>*** Bug 455307 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131458</commentid>
    <comment_count>14</comment_count>
    <who name="Sam James">sam</who>
    <bug_when>2022-06-15 15:38:24 +0000</bug_when>
    <thetext>*** Bug 455308 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131526</commentid>
    <comment_count>15</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2022-06-15 17:46:06 +0000</bug_when>
    <thetext>*** Bug 455347 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131530</commentid>
    <comment_count>16</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2022-06-15 17:47:42 +0000</bug_when>
    <thetext>*** Bug 455348 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131604</commentid>
    <comment_count>17</comment_count>
    <who name="eduard">eduardp</who>
    <bug_when>2022-06-15 20:19:24 +0000</bug_when>
    <thetext>Same workaround for KUbuntu :

sudo apt install powerdevil=4:5.24.4-0ubuntu1 powerdevil-data=4:5.24.4-0ubuntu1 libpowerdevilcore2=4:5.24.4-0ubuntu1 libpowerdevilui5=4:5.24.4-0ubuntu1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131628</commentid>
    <comment_count>18</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-06-15 21:48:12 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/94</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131631</commentid>
    <comment_count>19</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-15 22:15:42 +0000</bug_when>
    <thetext>Can affected folks test that patch? ^^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131640</commentid>
    <comment_count>20</comment_count>
    <who name="ichramm">jramirez.uy</who>
    <bug_when>2022-06-15 22:36:35 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #19)
&gt; Can affected folks test that patch? ^^

It works! (KDE Neon User Edition on Dell XPS 7590).

Steps:

* Created a new branch over the tag v5.25.0
* Cherry-picked Ivan&apos;s commit
* cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; sudo make install</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131666</commentid>
    <comment_count>21</comment_count>
    <who name="">alejandrosena</who>
    <bug_when>2022-06-16 01:25:30 +0000</bug_when>
    <thetext>Same happening here

Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.13.0-48-generic (64-bit)
Graphics Platform: X11
Graphics Processor: Mesa Intel® UHD Graphics 620</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131667</commentid>
    <comment_count>22</comment_count>
    <who name="Sam James">sam</who>
    <bug_when>2022-06-16 01:56:54 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #19)
&gt; Can affected folks test that patch? ^^

Works for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131700</commentid>
    <comment_count>23</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-06-16 05:32:26 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #19)
&gt; Can affected folks test that patch? ^^

Works for me on top of the Debian package on an XPS 7390.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131722</commentid>
    <comment_count>24</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2022-06-16 07:13:15 +0000</bug_when>
    <thetext>*** Bug 455381 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131728</commentid>
    <comment_count>25</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2022-06-16 07:36:22 +0000</bug_when>
    <thetext>*** Bug 455382 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131743</commentid>
    <comment_count>26</comment_count>
    <who name="K900">me</who>
    <bug_when>2022-06-16 08:21:40 +0000</bug_when>
    <thetext>Also works for me on Dell Latitude 5420.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131745</commentid>
    <comment_count>27</comment_count>
    <who name="Mathias Homann">Mathias.Homann</who>
    <bug_when>2022-06-16 08:26:25 +0000</bug_when>
    <thetext>Works for me on a MSI Prestige 14 running openSUSE Tumbleweed. RPMs for Tumbleweed containing that fix can be found on OBS at
https://build.opensuse.org/package/show/home:lemmy04:branches:KDE:Frameworks5/powerdevil5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131925</commentid>
    <comment_count>28</comment_count>
    <who name="">cbdude</who>
    <bug_when>2022-06-16 16:54:34 +0000</bug_when>
    <thetext>Same issue here in KDE Neon, thanks to Patrick van Elk for the workaround 

sudo apt install powerdevil=4:5.24.5-0xneon+20.04+focal+release+build47 powerdevil-data=4:5.24.5-0xneon+20.04+focal+release+build47</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131951</commentid>
    <comment_count>29</comment_count>
    <who name="ratijas">me</who>
    <bug_when>2022-06-16 18:14:13 +0000</bug_when>
    <thetext>Git commit 2ebe655d220c9167b66893a823b2fff2e2b8a531 by ivan tkachenko.
Committed on 15/06/2022 at 22:24.
Pushed by ratijas into branch &apos;master&apos;.

upower: Prevent integer overflow during new brightness computation

Provably, if two integers can fit in 31 bits each, the result of their
multiplication is expressible in 62 bits (let alone 63 available). So,
this should be safe. And the division can&apos;t do much harm: the divisor
is always at least 1, and worst case scenario — it would be so big that
the overall results becomes zero.

This code still assumes that the allowed brightness values can fit in 32
bits int, which is not totally unreasonable so far.

M  +7    -4    daemon/backends/upower/backlighthelper.cpp

https://invent.kde.org/plasma/powerdevil/commit/2ebe655d220c9167b66893a823b2fff2e2b8a531</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131953</commentid>
    <comment_count>30</comment_count>
    <who name="ratijas">me</who>
    <bug_when>2022-06-16 18:18:03 +0000</bug_when>
    <thetext>Git commit dd74cdbdd3849fbd86e6613ef7ecab6c7857cb89 by ivan tkachenko.
Committed on 16/06/2022 at 18:17.
Pushed by ratijas into branch &apos;Plasma/5.25&apos;.

upower: Prevent integer overflow during new brightness computation

Provably, if two integers can fit in 31 bits each, the result of their
multiplication is expressible in 62 bits (let alone 63 available). So,
this should be safe. And the division can&apos;t do much harm: the divisor
is always at least 1, and worst case scenario — it would be so big that
the overall results becomes zero.

This code still assumes that the allowed brightness values can fit in 32
bits int, which is not totally unreasonable so far.


(cherry picked from commit 2ebe655d220c9167b66893a823b2fff2e2b8a531)

M  +7    -4    daemon/backends/upower/backlighthelper.cpp

https://invent.kde.org/plasma/powerdevil/commit/dd74cdbdd3849fbd86e6613ef7ecab6c7857cb89</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2132085</commentid>
    <comment_count>31</comment_count>
    <who name="">poomklao</who>
    <bug_when>2022-06-17 03:49:34 +0000</bug_when>
    <thetext>Note to self: Affected version of powerdevil is 4:5.25.0-0xneon+20.04+focal+release+build49</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2133991</commentid>
    <comment_count>32</comment_count>
    <who name="MiXiM">contact</who>
    <bug_when>2022-06-23 05:50:06 +0000</bug_when>
    <thetext>Hi, same issue here in KDE Neon,
Dell XPS15 9570, latest stable updates,
 thanks to Patrick van Elk for the workaround,
works 4 me 2

sudo apt install powerdevil=4:5.24.5-0xneon+20.04+focal+release+build47 powerdevil-data=4:5.24.5-0xneon+20.04+focal+release+build47</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2135265</commentid>
    <comment_count>33</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-27 21:11:57 +0000</bug_when>
    <thetext>*** Bug 455256 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136149</commentid>
    <comment_count>34</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-06-30 18:07:16 +0000</bug_when>
    <thetext>*** Bug 455960 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>