Commit Graph

33 Commits

Author SHA1 Message Date
Jung-uk Kim
8444599e1e Silence PVS-Studio warning (V595). 2016-02-23 22:55:44 +00:00
Jung-uk Kim
7054df7f5b Remove brightness notify handler before reinstalling new one. 2016-02-23 22:50:45 +00:00
Jung-uk Kim
3e4f6cc6c7 Fix white spaces. 2016-02-23 22:30:45 +00:00
Jung-uk Kim
8d4a1dbf7b Fix style(9) bugs. 2016-02-23 22:22:15 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
John Baldwin
a18367634e When checking to see if a video output's _ADR matches an entry in the
parent adapter's _DOD list, only check the low 16 bits of both _ADR and
_DOD.  The language in the ACPI spec seems to indicate that the _ADR values
should exactly match the entries in _DOD.  However, I assume that the
masking added to _DOD values was added to work around some known busted
machines (the commit history doesn't indicate either way), and the ACPI
spec does require that the low 16 bits are unique for all video outputs,
so only check the low 16 bits should be fine.

This fixes recognition of video outputs that use the new standardized
device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops.

Tested by:	Juergen Lock  nox  jelal kn-bremen de
MFC after:	3 days
2012-10-19 19:17:43 +00:00
Mitsuru IWASAKI
5e33d57ff1 Resotre LCD brightness level on resuming.
MFC after:	3 days
2012-06-17 16:19:09 +00:00
Ed Schouten
d745c852be Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
2011-11-07 06:44:47 +00:00
Matthew D Fleming
f4f04709ac Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
Jung-uk Kim
2e1bf57ca8 Simplify a function for getting brightness levels. 2010-06-11 19:58:41 +00:00
Jung-uk Kim
30363a9a9e Remove unused assignment.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 4537, 4538, 4539)
2010-06-11 19:53:42 +00:00
Jung-uk Kim
9c98a9acdd Fix white spaces. 2010-03-10 18:30:55 +00:00
Jung-uk Kim
463537a097 Rename some macros to clarify their intentions and fix style nits. 2010-02-15 20:46:01 +00:00
Jung-uk Kim
aba311e1d4 Add support for cycle' and zero' events for LCD brightness control.
Submitted by:	Daniel Walter (d dot walter at 0x90 dot at) (intial version)
2010-02-15 19:30:28 +00:00
Jung-uk Kim
f29d6f75fa Make sanity check slightly more useful and tweak an error message. 2010-02-13 05:38:21 +00:00
Jung-uk Kim
35dd1ef75c Implement LCD brightness control notify handler.
Submitted by:	Daniel Walter(d dot walter at 0x90 dot at) (intial version)
2010-02-13 02:24:23 +00:00
Jung-uk Kim
2272d05019 Merge ACPICA 20091112. 2009-11-16 21:47:12 +00:00
John Baldwin
0032eb1acb Split the 'video' ACPI lock up into two locks to resolve a LOR with the
sysctl lock.  The 'video' lock now protects the 'bus' of video output
devices attached to a graphics adapter.  It is used when iterating over
the list of outputs, etc.  The 'video_output' lock is used to lock the
output-specific data similar to a driver lock for the individual video
outputs.

MFC after:	2 weeks
2009-09-30 17:05:26 +00:00
John Baldwin
36a888a17f Uninline an instance of STAILQ_FOREACH_SAFE(). 2009-09-23 15:39:54 +00:00
Jung-uk Kim
129d3046ef Import ACPICA 20090521. 2009-06-05 18:44:36 +00:00
Bruno Ducrot
48411a171a Improve the way we'll detect video devices as per ACPI 3.0.
PR:		100271
Requested by:	john AT utzweb DOT net
Submitted by:	hrs
Reviewed by:	njl
Approved by:	njl
MFC after:	3 days
2006-08-10 13:18:02 +00:00
John Baldwin
a1ee13ef19 Attach to the vgapci device rather than pci. 2005-12-20 22:42:16 +00:00
David E. O'Brien
2a191126de Canonize the include of acpi.h. 2005-09-11 18:39:03 +00:00
David E. O'Brien
dad97fee58 Fix SCM ID's. 2005-03-02 09:22:34 +00:00
Nate Lawson
cbd886065b Tell the BIOS we want to handle brightness switching as well as output
switching.  Don't initialize variables in their declaration.  Reduce stack
usage for device names.  Minor style cleanups.

MFC after:	1 week
2004-11-09 04:41:30 +00:00
Nate Lawson
5bfe5826f0 MPSAFE locking
* Serialize operations in acpi_video_bind_outputs(), acpi_video_detach(),
  acpi_video_notify_handler(), acpi_video_power_profile(), and the sysctls.
  The main goal is to protect the shared device list and prevent conflicting
  settings.
* Add assertions that the sx lock is held in the leaf functions.
2004-08-13 06:22:20 +00:00
Nate Lawson
6b3322721c Fix a bug where an item was being removed from a list without using
FOREACH_SAFE.  Remove bad cast of retp and instead use an additional
arg to pass back the number of valid outputs.  Use the package convenience
functions for parsing packages.
2004-07-24 17:51:22 +00:00
Nate Lawson
c8f3591b78 Remove unused (and bogus) locking, style cleanup, remove unnecessary casts. 2004-07-22 05:18:05 +00:00
Nate Lawson
7051c84dd3 Fix acpi_video loading. When we started cleaning up the duplicate handles
left around after the PCI probe, acpi_video stopped attaching because while
it was an acpi child device, it really is a PCI device.  Fix this by making
it a PCI child.

* Remove non-handle ivars accesses since child busses only implement
acpi_get_handle().
* Access the acpi softc directly through the devclass instead of through
the implied parent.
* Clean up a potential panic on unload by freeing the sysctl context before
storing NULL in the OID.

Found by:	marks
2004-07-16 16:59:32 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Nate Lawson
a4ecd54325 Unify on version 1 to be similar to the rest of the tree. After 5-stable
branches, increment version on any API change visible to other modules.
2004-04-08 16:45:12 +00:00
Nate Lawson
c310653ea1 Change to acpi_{Get,Set}Integer to provide both methods. Convert all
callers to the new API.

Submitted by:	Mark Santcroos <marks@ripe.net>
2004-03-03 18:34:42 +00:00
Nate Lawson
c58375c3a5 Add the ACPI standard video extensions driver. I've done some style cleanup
but a bit more reamins to be done.  For now, it is usable.

Submitted by:	Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
2004-03-01 08:12:56 +00:00