diff mbox

[Update] ACPI / video / i915: Remove ACPI backlight if firmware expects Windows 8

Message ID 1373994495.9314.1.camel@x230 (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Garrett July 16, 2013, 5:08 p.m. UTC
On Tue, 2013-07-16 at 17:32 +0400, Igor Gnatenko wrote:
> Hmm. I found regression in user-space. In GNOME (maybe and other DEs) we no longer see switch status of backlight.

Yeah, I can duplicate that. Rafael, we have to call
acpi_video_init_brightness() even if we're not going to initialise the
backlight - Thinkpads seem to use this as the trigger for enabling ACPI
notifications rather than handling it in firmware. This seems to do the
job:

 		struct pci_dev *pdev;
@@ -909,9 +912,6 @@ static void acpi_video_device_find_cap(struct
acpi_video_device *device)
 		static int count = 0;
 		char *name;
 
-		result = acpi_video_init_brightness(device);
-		if (result)
-			return;
 		name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
 		if (!name)
 			return;

Comments

Rafael Wysocki July 16, 2013, 10:01 p.m. UTC | #1
On Tuesday, July 16, 2013 05:08:16 PM Matthew Garrett wrote:
> On Tue, 2013-07-16 at 17:32 +0400, Igor Gnatenko wrote:
> > Hmm. I found regression in user-space. In GNOME (maybe and other DEs) we no longer see switch status of backlight.
> 
> Yeah, I can duplicate that. Rafael, we have to call
> acpi_video_init_brightness() even if we're not going to initialise the
> backlight - Thinkpads seem to use this as the trigger for enabling ACPI
> notifications rather than handling it in firmware. This seems to do the
> job:

Igor, does this additional patch from Matthew help?

Rafael


> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index 01b1a25..71865f7 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -900,6 +900,9 @@ static void acpi_video_device_find_cap(struct
> acpi_video_device *device)
>  		device->cap._DDC = 1;
>  	}
>  
> +	if (acpi_video_init_brightness(device))
> +		return;
> +
>  	if (acpi_video_verify_backlight_support()) {
>  		struct backlight_properties props;
>  		struct pci_dev *pdev;
> @@ -909,9 +912,6 @@ static void acpi_video_device_find_cap(struct
> acpi_video_device *device)
>  		static int count = 0;
>  		char *name;
>  
> -		result = acpi_video_init_brightness(device);
> -		if (result)
> -			return;
>  		name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
>  		if (!name)
>  			return;
> 
> 
> -- 
> Matthew Garrett | mjg59@srcf.ucam.org
>
Igor Gnatenko July 17, 2013, 5:16 a.m. UTC | #2
On Wed, 2013-07-17 at 00:01 +0200, Rafael J. Wysocki wrote:
> On Tuesday, July 16, 2013 05:08:16 PM Matthew Garrett wrote:
> > On Tue, 2013-07-16 at 17:32 +0400, Igor Gnatenko wrote:
> > > Hmm. I found regression in user-space. In GNOME (maybe and other DEs) we no longer see switch status of backlight.
> > 
> > Yeah, I can duplicate that. Rafael, we have to call
> > acpi_video_init_brightness() even if we're not going to initialise the
> > backlight - Thinkpads seem to use this as the trigger for enabling ACPI
> > notifications rather than handling it in firmware. This seems to do the
> > job:
> 
> Igor, does this additional patch from Matthew help?
Yes. With this patch I have backlight switch indicator on my ThinkPad X230.
> 
> Rafael
> 
> 
Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
> > diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> > index 01b1a25..71865f7 100644
> > --- a/drivers/acpi/video.c
> > +++ b/drivers/acpi/video.c
> > @@ -900,6 +900,9 @@ static void acpi_video_device_find_cap(struct
> > acpi_video_device *device)
> >  		device->cap._DDC = 1;
> >  	}
> >  
> > +	if (acpi_video_init_brightness(device))
> > +		return;
> > +
> >  	if (acpi_video_verify_backlight_support()) {
> >  		struct backlight_properties props;
> >  		struct pci_dev *pdev;
> > @@ -909,9 +912,6 @@ static void acpi_video_device_find_cap(struct
> > acpi_video_device *device)
> >  		static int count = 0;
> >  		char *name;
> >  
> > -		result = acpi_video_init_brightness(device);
> > -		if (result)
> > -			return;
> >  		name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
> >  		if (!name)
> >  			return;
> > 
> > 
> > -- 
> > Matthew Garrett | mjg59@srcf.ucam.org
> >
diff mbox

Patch

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 01b1a25..71865f7 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -900,6 +900,9 @@  static void acpi_video_device_find_cap(struct
acpi_video_device *device)
 		device->cap._DDC = 1;
 	}
 
+	if (acpi_video_init_brightness(device))
+		return;
+
 	if (acpi_video_verify_backlight_support()) {
 		struct backlight_properties props;