Bug 16418

Summary: [Backlight] asus laptops patch for intel video
Product: xorg Reporter: Evgeniy Manachkin <sfstudio>
Component: Driver/intelAssignee: Gordon Jin <gordon.jin>
Status: RESOLVED INVALID QA Contact: Evgeniy Manachkin <sfstudio>
Severity: normal    
Priority: high CC: jbarnes, sfstudio, zhenyu.z.wang
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: http://sadnet.ru/index.php?option=com_remository&Itemid=29&func=fileinfo&id=18
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch for videodriver Intel (xf86-video-intel-2.3.2)
none
Sorry is diff for driver none

Description Evgeniy Manachkin 2008-06-18 13:57:21 UTC
Created attachment 17218 [details] [review]
patch for videodriver Intel (xf86-video-intel-2.3.2) 

Greetings.

I send you a small patch for videodriver Intel (xf86-video-intel-2.3.2) solving a problem of correct restoration of brightness on Asus laptops. 

Patch in attachments.

With the best regards.
Comment 1 Evgeniy Manachkin 2008-06-18 14:06:16 UTC
Created attachment 17219 [details] [review]
Sorry is diff for driver
Comment 2 Gordon Jin 2008-06-18 18:42:12 UTC
Jesse/Zhenyu, any of you would review the patch?
Comment 3 Evgeniy Manachkin 2008-06-18 18:51:43 UTC
It`s only one string to support /sys/class/backlight/asus-laptop mode.

Kernel: [root@sfbook asus-laptop]# uname -a
Linux sfbook.sadnet.lo 2.6.25.7 #1 SMP Tue Jun 17 23:31:25 OMSST 2008 i686 Intel(R) Celeron(R) CPU          540  @ 1.86GHz GNU/Linux

Please include this patch to the driver code.

Zhao Yakui <yakui.zhao@intel.com> sad:
"It seems that the driver of asus-acpi is still used. Now it is
depreciated. Please use the asus-laptop driver and see whether the
problem still exists.( Set CONFIG_ASUS_LAPTOP in kernel configuration)."

Patch it`s work on asus X51L. 

Sorry my English. 
Comment 4 Evgeniy Manachkin 2008-06-18 18:55:46 UTC
The problem is shown at switching in the console or at start fullscreen OpenGL appendices. Brightness decreases up to a minimum and is restored only in manual back.

Too most occurs at change of sanctions or at transition in a sleeping mode.
Comment 5 Evgeniy Manachkin 2008-06-18 19:23:02 UTC
Please name me Evgeniy or John;)
John R.Manachkin - sounds;)
Comment 6 Wang Zhenyu 2008-06-18 20:04:15 UTC
Yeah, last time when I looked into asus_acpi, it hasn't provided any sysfs backlight control support, though I did a patch against xf86-video-intel to use /proc/acpi/asus instead. And now it looks current kernel has sysfs support ready, cool.

Actually I also did some work on eeepc-acpi in debian to work with video driver too, it also looks already available in current kernel git. So we can add both
to our video driver.
Comment 7 Evgeniy Manachkin 2008-06-18 20:09:26 UTC
(In reply to comment #6)
> So we can add both to our video driver.

It`s good !

Comment 8 Wang Zhenyu 2008-06-18 20:13:01 UTC
I've pushed your patch with eeepc support too. Thanks!
Comment 9 Evgeniy Manachkin 2008-07-01 09:54:02 UTC
ooops... code is wrong.

Please edit i830_lvds.c.

Lines "acpi_video1","acpi_video0", should be "thinkpad_screen", "fujitsu-laptop", "asus-laptop","eeepc", below lines. 

It is very important for correct work!

True code down:

static char *backlight_interfaces[] = {
    "thinkpad_screen",
    "fujitsu-laptop",
    "asus-laptop",
    "eeepc",
    "acpi_video1",
    "acpi_video0",
    NULL,
};
Comment 10 Wang Zhenyu 2008-07-01 19:38:55 UTC
oh, so you've seen both acpi_videoX and asus-laptop backlight method under /sys/class/backlight?
Comment 11 Evgeniy Manachkin 2008-07-01 19:50:08 UTC
[sfstudio@sfbook backlight]$ ls
acpi_video0/  asus-laptop/

[sfstudio@sfbook backlight]$ uname -a
Linux sfbook.sadnet.lo 2.6.25.9 #5 SMP Fri Jun 27 00:40:11 OMSST 2008 i686 Intel(R) Celeron(R) CPU          540  @ 1.86GHz GNU/Linux

Comment 12 Wang Zhenyu 2008-07-01 19:52:06 UTC
ok, so acpi_video method doesn't work but asus does right?

I might push a patch to pre-order asus and eeepc interface than acpi ones.
Comment 13 Evgeniy Manachkin 2008-07-01 19:53:02 UTC
P.S.  acpi_video0 does not work.
Comment 14 Wang Zhenyu 2008-07-01 20:19:01 UTC
Thanks a lot, I've pushed the fix.
Comment 15 Evgeniy Manachkin 2008-07-14 09:04:22 UTC
In 2.6.26 kernel "/sys/class/backlight/asus-laptop" moved to "/sys/class/backlight/asus".

To support backligth it 2.6.26 please add "asus" method.

True code:

/*
 * List of available kernel interfaces in priority order
 */
static char *backlight_interfaces[] = {
    "asus-laptop",
    "asus",
    "thinkpad_screen",
    "acpi_video1",
    "acpi_video0",
    "fujitsu-laptop",
    NULL,
};
Comment 16 Wang Zhenyu 2008-07-14 18:12:04 UTC
Are you sure? I haven't seen changes from kernel log.
Comment 17 Evgeniy Manachkin 2008-07-15 01:34:16 UTC
Sure.

[root@sfbook sfstudio]# uname -a
Linux sfbook.sadnet.lo 2.6.26 #1 SMP Tue Jul 15 05:23:28 OMSST 2008 i686 Intel(R) Celeron(R) CPU          540  @ 1.86GHz GNU/Linux


[root@sfbook sfstudio]# ls /sys/class/backlight/asus
actual_brightness  bl_power  brightness  max_brightness  power/  subsystem@  uevent

[root@sfbook sfstudio]# ls /sys/class/backlight/asus-laptop
ls: cannot access /sys/class/backlight/asus-laptop: No such file or directory

I suggest to add a method asus. To not clean asus-laptop to keep compatibility with older kernels.
Comment 18 Evgeniy Manachkin 2008-07-15 07:35:23 UTC
Sure.

[root@sfbook sfstudio]# uname -a
Linux sfbook.sadnet.lo 2.6.26 #1 SMP Tue Jul 15 05:23:28 OMSST 2008 i686 Intel(R) Celeron(R) CPU          540  @ 1.86GHz GNU/Linux


[root@sfbook sfstudio]# ls /sys/class/backlight/asus
actual_brightness  bl_power  brightness  max_brightness  power/  subsystem@  uevent

[root@sfbook sfstudio]# ls /sys/class/backlight/asus-laptop
ls: cannot access /sys/class/backlight/asus-laptop: No such file or directory

I suggest to add a method asus. To not clean asus-laptop to keep compatibility with older kernels.
Comment 19 Evgeniy Manachkin 2008-07-15 10:27:18 UTC
Opps Sorry.

If CONFIG_ACPI_ASUS=y - use /sys/class/backlight/asus for backligth.

If CONFIG_ASUS_LAPTOP=m - use /sys/class/backlight/asus-laptop for backligth.

I consider that it is necessary to support both versions since ASUS_LAPTOP while it is marked EXPEREMENTAL.
Comment 20 Evgeniy Manachkin 2008-07-15 10:29:30 UTC
Moreover, at CONFIG_ASUS_LAPTOP=m does not work wireless led. Therefore support asus and asus-laptop is necessary.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.