Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 291191 Details for
Bug 427518
ACPI video driver should validate brightness level before setting it via _BCM
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
the patch in question, in case someone wants to test
patch-video-set-brightness-level-correctly (text/plain), 2.85 KB, created by
Chuck Ebbert
on 2008-01-09 19:36:33 UTC
(
hide
)
Description:
the patch in question, in case someone wants to test
Filename:
MIME Type:
Creator:
Chuck Ebbert
Created:
2008-01-09 19:36:33 UTC
Size:
2.85 KB
patch
obsolete
>From: Zhang Rui <rui.zhang@intel.com> > >Make sure the brightness level is set correctly. >http://bugzilla.kernel.org/show_bug.cgi?id=9277 > > >Signed-off-by: Zhang Rui <rui.zhang@intel.com> >--- > drivers/acpi/video.c | 48 ++++++++++++++++++++++++++++++------------------ > 1 file changed, 30 insertions(+), 18 deletions(-) > >BZ 427518 (and others?) > >Index: linux-2.6/drivers/acpi/video.c >=================================================================== >--- linux-2.6.orig/drivers/acpi/video.c >+++ linux-2.6/drivers/acpi/video.c >@@ -300,11 +300,20 @@ static int acpi_video_get_brightness(str > > static int acpi_video_set_brightness(struct backlight_device *bd) > { >- int request_level = bd->props.brightness; > struct acpi_video_device *vd = > (struct acpi_video_device *)bl_get_data(bd); >- acpi_video_device_lcd_set_level(vd, request_level); >- return 0; >+ int i; >+ >+ /* >+ * adjust to the proper brightness levels. >+ * levels[2] ~ levels[max]: the supported brightness levels >+ */ >+ for (i = 2; i < vd->brightness->count; i++) >+ if (vd->brightness->levels[i] >= bd->props.brightness) >+ return acpi_video_device_lcd_set_level(vd, >+ vd->brightness->levels[i]); >+ >+ return -EINVAL; > } > > static struct backlight_ops acpi_backlight_ops = { >@@ -410,18 +419,27 @@ acpi_video_device_lcd_query_levels(struc > static int > acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) > { >- int status = AE_OK; >+ acpi_status status; > union acpi_object arg0 = { ACPI_TYPE_INTEGER }; > struct acpi_object_list args = { 1, &arg0 }; >+ int i; > >+ if (!device->cap._BCM) >+ return -ENODEV; > > arg0.integer.value = level; > >- if (device->cap._BCM) >- status = acpi_evaluate_object(device->dev->handle, "_BCM", >- &args, NULL); >- device->brightness->curr = level; >- return status; >+ for (i = 0; i < device->brightness->count; i++) >+ if (level == device->brightness->levels[i]) { >+ status = acpi_evaluate_object(device->dev->handle, >+ "_BCM", &args, NULL); >+ if (ACPI_FAILURE(status)) >+ return -EIO; >+ device->brightness->curr = level; >+ return 0; >+ } >+ >+ return -EINVAL; > } > > static int >@@ -899,7 +917,7 @@ acpi_video_device_write_brightness(struc > struct acpi_video_device *dev = m->private; > char str[5] = { 0 }; > unsigned int level = 0; >- int i; >+ int result = -EINVAL; > > > if (!dev || !dev->brightness || count + 1 > sizeof str) >@@ -915,15 +933,9 @@ acpi_video_device_write_brightness(struc > return -EFAULT; > > /* validate through the list of available levels */ >- for (i = 0; i < dev->brightness->count; i++) >- if (level == dev->brightness->levels[i]) { >- if (ACPI_SUCCESS >- (acpi_video_device_lcd_set_level(dev, level))) >- dev->brightness->curr = level; >- break; >- } >+ result = acpi_video_device_lcd_set_level(dev, level); > >- return count; >+ return result ? result : count; > } > > static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 427518
: 291191