tunahansahiner / easy-slow-down-manager

Automatically exported from code.google.com/p/easy-slow-down-manager
0 stars 0 forks source link

N250 support #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On Samsung N250, the module compiles and loads cleanly, producing following 
messages in dmesg:

[10317.864181] Easy slow down manager: checking for SABI support.
[10317.864511] Easy slow down manager: SABI is supported (f50e0)

Backlight can be turned on and off, but the level cannot be changed. Given that 
there are no sysfs files for backlight, a way to gradually change the level 
would be nice. There is a setpci hack working already (setpci -s 00:02.0 
F4.B=hh, where hh is brightness level from 0 to 255, 0 being disabled).

WiFi kill switch works perfectly, but the changing the slow-down itself 
produces no noticeable results (as does changing 
/sys/class/thermal/cooling_device* settings). No matter what, the fan is 
rotating quietly, but constantly, and the netbook itself is a bit more hot than 
is comfortable; ACPI reports 52 deg. C, in almost idle state.

Here is the relevant information:

# dmidecode -s system-product-name
N145P/N250P/N260P          
# dmidecode -s baseboard-product-name
N145P/N250P/N260P          
# lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated 
Graphics Controller
# lspci -n | grep 00:02.0
00:02.0 0300: 8086:a011

Original issue reported on code.google.com by whitequ...@gmail.com on 19 Nov 2010 at 11:30

GoogleCodeExporter commented 9 years ago
Sorry, I just noticed that "slowing down" works fine. But it would be still 
very good to have a brightness adjust control.

Original comment by whitequ...@gmail.com on 20 Nov 2010 at 7:03

GoogleCodeExporter commented 9 years ago
did you use kernel option 'acpi_backlight=vendor'? did you have something in 
/sys/class/backlight/ and /sys/devices/virtual/backlight/?

Original comment by SergeyK...@gmail.com on 27 Nov 2010 at 1:35

GoogleCodeExporter commented 9 years ago
There is a /sys/class/backlight/samsung/ directory/symlink, and currently (with 
acpi_backlight=vendor option) it works incorrectly: bl_power does not work at 
all, and modifying brightness from 0 to 7 actually makes the screen a little 
bit brighter or darker, somewhere in the middle of its possible range. (Not to 
mention that max_brightness is 7. _Seven_, while I currently use about 20 
levels with a handwritten script).

Also, I think that script can be interesting to you: there's a linear mapping 
between button presses and brightness changes which turned out to be very 
convenient and smooth. Here it is (set_brightness does the setpci hack and 
get_brightness returns the value previously saved by get_brightness):

adjust_brightness() {
  local value=$(get_brightness)
  local dir=$1
  local step=$(( value / 10 + 3))
  if [ "$dir" == "up" ]; then
    value=$(( value + step ))
  elif [ "$dir" == "down" ]; then
    value=$(( value - step ))
  else
    echo "Invalid direction $dir" >&2
    exit 1
  fi
  set_brightness $value
}

Original comment by whitequ...@gmail.com on 27 Nov 2010 at 7:54

GoogleCodeExporter commented 9 years ago
could you try to load the module samsung_backlight with 'use_sabi=0 force=1' 
options? this way the driver should go by the same setpci trick.
How many brightness levels do you have in Windows? 

Original comment by SergeyK...@gmail.com on 28 Nov 2010 at 8:18

GoogleCodeExporter commented 9 years ago
With 'use_sabi=0 force=1' parameters it works just fine, with 255 of brightness 
levels. 'bl_power' still do not work, but 'echo 0 >backlight' works.

Don't know. I didn't even booted that operating system. (Actually I tried, but 
waiting half a hour for the _preinstalled_ OS to do something is frustrating.)

Original comment by whitequ...@gmail.com on 1 Dec 2010 at 5:16

GoogleCodeExporter commented 9 years ago
ok, seems that samsung has changed number of brightness levels, supported by 
BIOS, for your laptop model. I'll add your model to the list  in the next 
revision and add some parameters to the module, so you could tune up number of 
brightness levels

Original comment by SergeyK...@gmail.com on 1 Dec 2010 at 10:05

GoogleCodeExporter commented 9 years ago
The latest version should work with parameter usa_sabi=0; 
otherwise, you could play with the options maxbright and levels (for example, 
try maxbright=16 levels=16);
(bl_power not supported yet)

Original comment by SergeyK...@gmail.com on 24 Jan 2011 at 6:23

GoogleCodeExporter commented 9 years ago
Thanks, I'll check it in a few days. What about X integration? (IIRC, X just 
uses kernel backlight interface, so this is about porting it to a specific 
sysfs API)

Original comment by whitequ...@gmail.com on 24 Jan 2011 at 6:35

GoogleCodeExporter commented 9 years ago
X brightness control works properly, if the driver is installed correctly (see 
boot args in readme)

Original comment by SergeyK...@gmail.com on 29 Jan 2011 at 8:17

GoogleCodeExporter commented 9 years ago
I've tested that. With use_sabi=1 (the default) it works in a very strange way; 
while I'm not sure this is what really happens, I'd try to describe it as such: 
it queues backlight level change requests somewhere, and instead of updating 
with my changes fetches one element from that queue and executes it. For 
example, I may write several different values to `brightness`, and each time 
the actual level would change by 1, and then I would write several 1's or 0's 
to bl_power, and it will suddenly change the level several times in a manner 
looking unrelated to what I write.

It works with use_sabi=0, through also force=1 option is required. Sadly, the X 
backlight control does not work:

$ grep -i backlight /var/log/Xorg.0.log
Kernel command line: BOOT_IMAGE=/vmlinuz-2.6.32-5-686 
root=/dev/mapper/mannaz-root ro quiet splash acpi_backlight=vendor
(II) intel(0): found backlight control interface /sys/class/backlight/samsung

But nothing happens when I press backlight change keys.

Original comment by whitequ...@gmail.com on 5 Feb 2011 at 12:31