public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/14] ACPI / Video: blacklist some samsung laptops
       [not found] <1332233594-13099-1-git-send-email-corentin.chary@gmail.com>
@ 2012-03-20  8:53 ` Corentin Chary
  2012-03-20 16:05   ` Matthew Garrett
  0 siblings, 1 reply; 7+ messages in thread
From: Corentin Chary @ 2012-03-20  8:53 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: platform-driver-x86, Corentin Chary, Len Brown, linux-acpi,
	linux-kernel

From: Corentin Chary <corentincj@iksaif.net>

On these laptops, the ACPI video is not functional, and very unlikely
to be fixed by the vendor. Note that intel_backlight works for some
of these laptops, and the backlight from samsung-laptop always work.

The good news is that newer laptops have functional ACPI video device
and won't end up growing this list.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 drivers/acpi/video_detect.c |   49 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 45d8097..66be45e 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -132,6 +132,53 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
 	return AE_OK;
 }
 
+/* Force to use vendor driver when the ACPI device is known to be
+ * buggy */
+static int video_detect_force_vendor(const struct dmi_system_id *d)
+{
+	acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
+	return 0;
+}
+
+static struct dmi_system_id video_detect_dmi_table[] = {
+	{
+	 .callback = video_detect_force_vendor,
+	 .ident = "N150P",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "N150P"),
+		DMI_MATCH(DMI_BOARD_NAME, "N150P"),
+		},
+	},
+	{
+	 .callback = video_detect_force_vendor,
+	 .ident = "N145P/N250P/N260P",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"),
+		DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"),
+		},
+	},
+	{
+	 .callback = video_detect_force_vendor,
+	 .ident = "N150/N210/N220",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220"),
+		DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220"),
+		},
+	},
+	{
+	 .callback = video_detect_force_vendor,
+	 .ident = "NF110/NF210/NF310",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+		DMI_MATCH(DMI_PRODUCT_NAME, "NF110/NF210/NF310"),
+		DMI_MATCH(DMI_BOARD_NAME, "NF110/NF210/NF310"),
+		},
+	},
+};
+
 /*
  * Returns the video capabilities of a specific ACPI graphics device
  *
@@ -164,6 +211,8 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
 		 *		ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
 		 *}
 		 */
+
+		dmi_check_system(video_detect_dmi_table);
 	} else {
 		status = acpi_bus_get_device(graphics_handle, &tmp_dev);
 		if (ACPI_FAILURE(status)) {
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 01/14] ACPI / Video: blacklist some samsung laptops
  2012-03-20  8:53 ` [PATCH 01/14] ACPI / Video: blacklist some samsung laptops Corentin Chary
@ 2012-03-20 16:05   ` Matthew Garrett
  2012-03-20 16:28     ` Corentin Chary
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Garrett @ 2012-03-20 16:05 UTC (permalink / raw)
  To: Corentin Chary
  Cc: platform-driver-x86, Corentin Chary, Len Brown, linux-acpi,
	linux-kernel

On Tue, Mar 20, 2012 at 09:53:01AM +0100, Corentin Chary wrote:
> From: Corentin Chary <corentincj@iksaif.net>
> 
> On these laptops, the ACPI video is not functional, and very unlikely
> to be fixed by the vendor. Note that intel_backlight works for some
> of these laptops, and the backlight from samsung-laptop always work.
> 
> The good news is that newer laptops have functional ACPI video device
> and won't end up growing this list.

Are the hotkeys delivered via ACPI or via the Samsung device? If the 
latter, you can just do unregister_acpi_video() instead in the samsung 
driver and avoid having more machine-specific quirks in the ACPi code.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 01/14] ACPI / Video: blacklist some samsung laptops
  2012-03-20 16:05   ` Matthew Garrett
@ 2012-03-20 16:28     ` Corentin Chary
  2012-03-20 16:30       ` Matthew Garrett
  0 siblings, 1 reply; 7+ messages in thread
From: Corentin Chary @ 2012-03-20 16:28 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: platform-driver-x86, Len Brown, linux-acpi, linux-kernel

On Tue, Mar 20, 2012 at 5:05 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, Mar 20, 2012 at 09:53:01AM +0100, Corentin Chary wrote:
>> From: Corentin Chary <corentincj@iksaif.net>
>>
>> On these laptops, the ACPI video is not functional, and very unlikely
>> to be fixed by the vendor. Note that intel_backlight works for some
>> of these laptops, and the backlight from samsung-laptop always work.
>>
>> The good news is that newer laptops have functional ACPI video device
>> and won't end up growing this list.
>
> Are the hotkeys delivered via ACPI or via the Samsung device? If the
> latter, you can just do unregister_acpi_video() instead in the samsung
> driver and avoid having more machine-specific quirks in the ACPi code.

I wasn't aware of acpi_video_unregister(). The issue with that
solution is that it makes it harder to respect acpi_video= parameter.

On these machines, the ACPI Video device is broken (I don't know how,
I don't have the hardware, I just know it doesn't work at all), and I
want the default to be acpi_backlight=vendor, but it is still a good
idea to let users force acpi_backlight=video.

But if the policy is to use acpi_video_unregister() when the video
module is known to be broken, let's do that.

-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 01/14] ACPI / Video: blacklist some samsung laptops
  2012-03-20 16:28     ` Corentin Chary
@ 2012-03-20 16:30       ` Matthew Garrett
       [not found]         ` <1332421699-5315-1-git-send-email-corentincj@iksaif.net>
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Garrett @ 2012-03-20 16:30 UTC (permalink / raw)
  To: Corentin Chary; +Cc: platform-driver-x86, Len Brown, linux-acpi, linux-kernel

On Tue, Mar 20, 2012 at 05:28:06PM +0100, Corentin Chary wrote:
> On Tue, Mar 20, 2012 at 5:05 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > Are the hotkeys delivered via ACPI or via the Samsung device? If the
> > latter, you can just do unregister_acpi_video() instead in the samsung
> > driver and avoid having more machine-specific quirks in the ACPi code.
> 
> I wasn't aware of acpi_video_unregister(). The issue with that
> solution is that it makes it harder to respect acpi_video= parameter.
> 
> On these machines, the ACPI Video device is broken (I don't know how,
> I don't have the hardware, I just know it doesn't work at all), and I
> want the default to be acpi_backlight=vendor, but it is still a good
> idea to let users force acpi_backlight=video.

If it's broken then I don't think there's a great argument for providing 
an argument just to let people re-break their kernel :)

> But if the policy is to use acpi_video_unregister() when the video
> module is known to be broken, let's do that.

As long as ACPI isn't being used to deliver brightness keys, then this 
is fine.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] samsung-laptop: unregister ACPI video module for some well known laptops
       [not found]             ` <20120327112105.GA2845@srcf.ucam.org>
@ 2012-04-06  9:42               ` Corentin Chary
  2012-04-06 14:34                 ` Seth Forshee
  0 siblings, 1 reply; 7+ messages in thread
From: Corentin Chary @ 2012-04-06  9:42 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: platform-driver-x86, linux-kernel, linux acpi, Len Brown

[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]

On Tue, Mar 27, 2012 at 1:21 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, Mar 27, 2012 at 11:11:18AM +0200, Corentin Chary wrote:
>> Matthew, is this one ok ? I really hope this patch can go in 3.4 so we
>> don't introduce a regression for old laptops.
>
> Yes, I've got this now.
>
> Thanks,


A user just found a DSDT which is broken by this way of doing things
(this is not really a regression since it was also broken before).

_BCL contains a wierd "Or (VDRV, 0x02, VDRV)".
So if you call _BLC once (video.ko will), it set a flag that affect
the behavior of all backlight related stuff, and it breaks
samsung-laptop's backlight even if samsung-laptop unload the acpi
backlight.
Using acpi_backlight=vendor solves that since it prevents the module
from being loaded. My previous patch also fix that since it use
acpi_backlight= mechanism.

Do you think using acpi_backlight=vendor is a good enought solution
here ? Should we use my first patch instead ?


-- 
Corentin Chary
http://xf.iksaif.net

[-- Attachment #2: acpidump.bin.gz --]
[-- Type: application/x-gzip, Size: 45898 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] samsung-laptop: unregister ACPI video module for some well known laptops
  2012-04-06  9:42               ` [PATCH] samsung-laptop: unregister ACPI video module for some well known laptops Corentin Chary
@ 2012-04-06 14:34                 ` Seth Forshee
  2012-04-17  8:31                   ` Corentin Chary
  0 siblings, 1 reply; 7+ messages in thread
From: Seth Forshee @ 2012-04-06 14:34 UTC (permalink / raw)
  To: Matthew Garrett, Corentin Chary
  Cc: platform-driver-x86, linux-kernel, linux acpi, Len Brown

On Fri, Apr 06, 2012 at 11:42:18AM +0200, Corentin Chary wrote:
> On Tue, Mar 27, 2012 at 1:21 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > On Tue, Mar 27, 2012 at 11:11:18AM +0200, Corentin Chary wrote:
> >> Matthew, is this one ok ? I really hope this patch can go in 3.4 so we
> >> don't introduce a regression for old laptops.
> >
> > Yes, I've got this now.
> >
> > Thanks,
> 
> 
> A user just found a DSDT which is broken by this way of doing things
> (this is not really a regression since it was also broken before).
> 
> _BCL contains a wierd "Or (VDRV, 0x02, VDRV)".
> So if you call _BLC once (video.ko will), it set a flag that affect
> the behavior of all backlight related stuff, and it breaks
> samsung-laptop's backlight even if samsung-laptop unload the acpi
> backlight.
> Using acpi_backlight=vendor solves that since it prevents the module
> from being loaded. My previous patch also fix that since it use
> acpi_backlight= mechanism.
> 
> Do you think using acpi_backlight=vendor is a good enought solution
> here ? Should we use my first patch instead ?

I've recently noticed another problem with using acpi_video_unregister()
to disable known broken backlights -- another module might call
acpi_video_register() and make it reappear. i915 does this, so when I
EFI boot the MacBook Pro 8,2 the acpi backlights reappear (under a BIOS
compatible boot the Intel GPU doesn't show up on the bus).

So Corentin's solution does seem like a better way to go, or else
something similar that forces the ACPI video driver to behave as with
acpi_video=vendor.

Seth

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] samsung-laptop: unregister ACPI video module for some well known laptops
  2012-04-06 14:34                 ` Seth Forshee
@ 2012-04-17  8:31                   ` Corentin Chary
  0 siblings, 0 replies; 7+ messages in thread
From: Corentin Chary @ 2012-04-17  8:31 UTC (permalink / raw)
  To: Matthew Garrett, Corentin Chary, platform-driver-x86,
	linux-kernel, linux acpi, Len Brown

On Fri, Apr 6, 2012 at 4:34 PM, Seth Forshee <seth.forshee@canonical.com> wrote:
> On Fri, Apr 06, 2012 at 11:42:18AM +0200, Corentin Chary wrote:
>> On Tue, Mar 27, 2012 at 1:21 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
>> > On Tue, Mar 27, 2012 at 11:11:18AM +0200, Corentin Chary wrote:
>> >> Matthew, is this one ok ? I really hope this patch can go in 3.4 so we
>> >> don't introduce a regression for old laptops.
>> >
>> > Yes, I've got this now.
>> >
>> > Thanks,
>>
>>
>> A user just found a DSDT which is broken by this way of doing things
>> (this is not really a regression since it was also broken before).
>>
>> _BCL contains a wierd "Or (VDRV, 0x02, VDRV)".
>> So if you call _BLC once (video.ko will), it set a flag that affect
>> the behavior of all backlight related stuff, and it breaks
>> samsung-laptop's backlight even if samsung-laptop unload the acpi
>> backlight.
>> Using acpi_backlight=vendor solves that since it prevents the module
>> from being loaded. My previous patch also fix that since it use
>> acpi_backlight= mechanism.
>>
>> Do you think using acpi_backlight=vendor is a good enought solution
>> here ? Should we use my first patch instead ?
>
> I've recently noticed another problem with using acpi_video_unregister()
> to disable known broken backlights -- another module might call
> acpi_video_register() and make it reappear. i915 does this, so when I
> EFI boot the MacBook Pro 8,2 the acpi backlights reappear (under a BIOS
> compatible boot the Intel GPU doesn't show up on the bus).
>
> So Corentin's solution does seem like a better way to go, or else
> something similar that forces the ACPI video driver to behave as with
> acpi_video=vendor.
>
> Seth
>

Matthew, Len, any input on that ? Should we keep the current code even
if broken with some (also broken) hardware or should we move the
blacklist in acpi/video.c ?


-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-17  8:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1332233594-13099-1-git-send-email-corentin.chary@gmail.com>
2012-03-20  8:53 ` [PATCH 01/14] ACPI / Video: blacklist some samsung laptops Corentin Chary
2012-03-20 16:05   ` Matthew Garrett
2012-03-20 16:28     ` Corentin Chary
2012-03-20 16:30       ` Matthew Garrett
     [not found]         ` <1332421699-5315-1-git-send-email-corentincj@iksaif.net>
     [not found]           ` <CAHR064hc4AdFUeoO8Szg0FG6CwLK+xauGn9VMJntWV1Gik=ACQ@mail.gmail.com>
     [not found]             ` <20120327112105.GA2845@srcf.ucam.org>
2012-04-06  9:42               ` [PATCH] samsung-laptop: unregister ACPI video module for some well known laptops Corentin Chary
2012-04-06 14:34                 ` Seth Forshee
2012-04-17  8:31                   ` Corentin Chary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox