Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485704 - app-laptop/nvidiabl-0.81 gives wrong values in kernel /sys interface
Summary: app-laptop/nvidiabl-0.81 gives wrong values in kernel /sys interface
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christoph Mende (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-09-23 04:38 UTC by Arthur D.
Modified: 2013-09-25 18:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix integer division rounding in the module (nvidiabl-0.81-fix-division.patch,1.68 KB, text/plain)
2013-09-23 04:38 UTC, Arthur D.
Details
Patch for ebuild (nvidiabl-ebuild.patch,345 bytes, patch)
2013-09-23 04:40 UTC, Arthur D.
Details | Diff
Fix integer division rounding in the module (nvidiabl-0.81-fix-division.patch,1.09 KB, patch)
2013-09-23 06:03 UTC, Arthur D.
Details | Diff
Add description to the patch (nvidiabl-0.81-fix-division.patch,1.70 KB, patch)
2013-09-23 06:06 UTC, Arthur D.
Details | Diff
Fix integer division rounding in the module (nvidiabl-0.81-fix-division.patch,1.70 KB, patch)
2013-09-23 06:08 UTC, Arthur D.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur D. 2013-09-23 04:38:24 UTC
Created attachment 359268 [details]
Fix integer division rounding in the module

Here's an example of how to reproduce:
# modprobe nvidiabl
# echo 1 > /sys/class/backlight/nvidia_backlight/brightness
# cat /sys/class/backlight/nvidia_backlight/actual_brightness
0
# echo 3 > /sys/class/backlight/nvidia_backlight/brightness
# cat /sys/class/backlight/nvidia_backlight/actual_brightness
2

The issue comes from rounding of integer division results in
CPU (it just drops fractional part).

Affected package is app-laptop/pommed-1.39 which tries to get
accurate values from kernel /sys interface. The result of the
issue is the user able to lower monitor brightness using pommed,
but not able to make it more intensive using appropriate keyboard
shortcuts. The user is forced either to reboot laptop or find out
the reason why the brightness is not controlled right by pommed.

I reported the patch upstream but didn't get any response yet.

The fix is pretty simple, so I don't think it's a problem to
add it to portage.
Comment 1 Arthur D. 2013-09-23 04:40:58 UTC
Created attachment 359270 [details, diff]
Patch for ebuild
Comment 2 Arthur D. 2013-09-23 06:03:43 UTC
Created attachment 359272 [details, diff]
Fix integer division rounding in the module

The previous patch has wrong constants.
This one is correct.
Comment 3 Arthur D. 2013-09-23 06:06:27 UTC
Created attachment 359274 [details, diff]
Add description to the patch
Comment 4 Arthur D. 2013-09-23 06:08:31 UTC
Created attachment 359276 [details, diff]
Fix integer division rounding in the module

Change patch description
Comment 5 Christoph Mende (RETIRED) gentoo-dev 2013-09-25 17:56:05 UTC
The patch was actually just accepted upstream. I'll wait for the next release which should be soon.
Comment 6 Christoph Mende (RETIRED) gentoo-dev 2013-09-25 18:27:10 UTC
Looks like it was already released, bumped to 0.83.