Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351325 - ACPI backlight control is broken for Samsung R519
Summary: ACPI backlight control is broken for Samsung R519
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-10 18:59 UTC by PM
Modified: 2011-03-21 22:43 UTC (History)
1 user (show)

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


Attachments
my kernel config (config,60.57 KB, text/plain)
2011-01-10 18:59 UTC, PM
Details
X log (Xorg.0.log,31.57 KB, text/plain)
2011-01-10 19:03 UTC, PM
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PM 2011-01-10 18:59:05 UTC
Since I've installed Gentoo on my Samsung R519 laptop I have no control over the panel backlight. This alone wasn't that much of a problem, but after today's kernel and driver upgrade (more on that later) I decided to report this.

So, the funny thing is, that the system seems to think that there is some backlight control. I can 'set' it using xbacklight and it stores those settings:
----------------------------------------
piotrek@laptop2 ~ $ xbacklight
100.000000
piotrek@laptop2 ~ $ xbacklight -set 50
piotrek@laptop2 ~ $ xbacklight
42.857143
piotrek@laptop2 ~ $
-------------------------------------
also:
# cd /sys/class/backlight/acpi_video0
laptop2 acpi_video0 # cat brightness 
7
laptop2 acpi_video0 # echo 5 > brightness 
laptop2 acpi_video0 # cat brightness 
5
laptop2 acpi_video0 #
-----------------------------------
None of these actions have any effect on the screen brightness.

Now about it getting worse. Today I upgraded the kernel to 2.6.37 and x11-drivers/xf86-video-intel to 2.14.0. 
Since that upgrade something weird started happening. Whenever I close the lid, leave it closed for some time and then I open it, the backlight comes up being much darker than before closing it. After 3 or 4 times the screen becomes so dark it's almost impossible to work and I have to reboot the system.

Now, the ability to close the laptop's lid is pretty much important to me... Could someone please look into it it? Thanks a lot in advance.

I'm attaching my kernel config, xorg log and the usual stuff.

Reproducible: Always




Portage 2.2.0_alpha14 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.2, glibc-2.12.2-r0, 2.6.37-pf2 x86_64)
=================================================================
System uname: Linux-2.6.37-pf2-x86_64-Pentium-R-_Dual-Core_CPU_T4300_@_2.10GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 10 Jan 2011 08:30:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 2.7.1, 3.1.3
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.8
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo kde-sunset dupa
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -pipe -g"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=core2 -pipe -g"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.supp.name/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/kde-sunset /usr/local/portage/moje"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib acl acpi alsa amd64 amr amrnb amrwb async audiofile automount bash-completion berkdb bfq bineditor bluetooth branding bzip2 cairo cdaudio cddb cdio cdparanoia cdr cli consolekit cracklib crypt css cups curl cxx dbus devhelp dirac disk-partition divx djvu dri dts dvd dvdr editor emboss emovix enca encode exchange exif faac faad fam fat ffmpeg fftw firefox firefox3 flac fontconfig fortran gd gdbm gdu geoip gif glitz gmedia gphoto2 gpm gtk hddtemp htmlhandbook iconv id3 id3tag imagemagick inotify ipod jack jpeg kde kde4 kdehiddenvisibility kipi kpathsea kqemu ladspa lame laptop lcms libcaca libnotify libsamplerate llvm lm_sensors mad mikmod mjpeg mmap mmx mmxext mng modules mp3 mp3tunes mp4 mpeg mplayer mtp mudflap multilib musicbrainz ncurses nls nptl nptlonly nsplugin ntfs ogg openal opencore-amr opencore-amrnb opencore-amrwb opengl openmp pam pango pch pcre pdf perl plasma png policykit ppds pppd private-headers python qt-copy qt3 qt3support qt4 rar readline realmedia roe sasl scanner schroedinger sdl secure-delete sensord session sndfile solver soundtouch sourceview spell sse sse2 ssl ssse3 startup-notification svg swat symlink sysfs syslog tcpd theora threads tiff truetype udev unicode upnp usb vamp vcd vorbis webkit wicd wmf wmp wxwidgets wxwindows x264 xcb xcomposite xine xml xorg xscreensaver xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="battery sensors rrdtool" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 PM 2011-01-10 18:59:44 UTC
Created attachment 259487 [details]
my kernel config
Comment 2 PM 2011-01-10 19:03:19 UTC
Created attachment 259490 [details]
X log
Comment 3 Wormo (RETIRED) gentoo-dev 2011-01-18 07:08:00 UTC
You're not the only one with backlight problems on Samsung laptops; apparently they didn't implement the normal ACPI controls thus requiring a custom driver -- which unfortunately doesn't seem to be in mainline kernels.

Take a look at this:
https://patchwork.kernel.org/patch/43284/

Not sure if the patch will still apply to your quite-recent kernel, but maybe without too much hacking...
Comment 4 PM 2011-01-18 09:35:14 UTC
Thanks for the reply. However this patch is over a year old. If it worked, wouldn't it be in the kernel as of now? I tried applying it, but it failed and I'm not very good (or rather at all good) at kernel hacking... 
I also found a driver in the file drivers/staging/samsung-laptop/samsung-laptop.c which looks very similar to the one from your patch. I tried it before and it didn't work.

On the other hand I found the way to set the brightness using setpci on some blog. So I'm kind of saved for now...

Comment 5 Wormo (RETIRED) gentoo-dev 2011-01-19 19:37:21 UTC
This samsung R519 brightness problem is at the kernel level, not X, which relies on a working kernel driver for brightness control. The workaround pokes PCI registers manually, which is the sort of thing that kernel drivers normally handle.

You're right that the samsung brightness driver did make it's way into staging, and the reason it's still in staging is that the author lacked the relevant hardware and didn't get enough feedback that it worked. In fact it _doesn't_ work yet for R519 model, so somebody who has one should give him that feedback and offer to test proposed patches -- are you game? You'll be asked to use one of the standard kernels (gentoo-sources or vanilla-sources) for testing any such patches. If not, this bug will have to be closed until a willing tester shows up.
Comment 6 PM 2011-01-19 20:17:35 UTC
Sure, I can do that. How should I contact the author? Directly? Or post to some mailing list? 
Comment 7 Wormo (RETIRED) gentoo-dev 2011-01-19 21:31:35 UTC
Actually, the author happens to be a gentoo developer - Greg Kroah-Hartman. So I'll go ahead and assign this bug to him.
Comment 8 Greg Kroah-Hartman (RETIRED) gentoo-dev 2011-01-21 05:01:46 UTC
Sorry, but I only had a N128 laptop, and got that to work, and wrote the 
driver that is in the kernel tree for it.  Samsung only supports that single laptop for Linux, for any other, sorry, I really can't help as I don't have
one, and the interface is different.
Comment 9 Wormo (RETIRED) gentoo-dev 2011-01-21 07:11:42 UTC
Hm guess we have to give up then on getting a real driver until a kernel developer ends up with one of these laptops... sorry we couldn't be more help, but at least you've got a workaround for now
Comment 10 PM 2011-02-10 12:16:23 UTC
I just saw Greg's post on Planet Gentoo: http://www.kroah.com/log/linux/samsung_laptop.html, so it seems the situation changed rather drastically from "Samsung only supports that single laptop for Linux" to "Linux can now properly support all known Samsung laptop devices" ;)

However my R519 still doesn't work with that driver (module won't load with "no such device" error). So, if things really started moving, maybe I can help with adding support for this model? I'm reopening the bug, feel free to close it if the situation hasn't really changed.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-10 21:09:48 UTC
Why on Earth would anyone even contemplate reassigning a bug to bug-wranglers?
Comment 12 Mike Pagano gentoo-dev 2011-03-21 22:43:42 UTC
It sounds like you have a request to support an unsupported laptop.  You will need to take this upstream to bugzilla.kernel.org