acpi: video: enhance the quirk detect logic of _BQC

Currently we decide if the _BQC is using index by first setting the
level to maximum, and then check if _BQC returned maximum; if not, we
say it is using index.

This is not true for some buggy systems, where the _BQC method will
always return a constant value(e.g. 0 or 100 for the two broken system)
and thus break the current logic. So this patch tries to enhance the
quirk detect logic for _BQC: we do this by picking a test_level, it can
be the maximum level or the mininum one based on some condition. And we
don't make the assumption that if _BQC returned a value that is not what
we just set, it must be using an index. Instead, we will compare the
value returned from _BQC and if it doesn't match, see if the returned
value is an index. And if still no, clear the capability of _BQC.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=42861
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=56011
Reported-and-tested-by: Artem Savkov <artem.savkov@gmail.com>
Reported-by: Luis Medinas <lmedinas@gmail.com>
Reported-by: Cheppes <cheppes@mailinator.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
acpi: video: correct acpi_video_bus_add error processing

acpi_video_bus_get_devices may fail due to some video output device
doesn't have the _ADR method, and in this case, the error processing is
to simply free the video structure in acpi_video_bus_add, while leaving
those already registered video output devices in the wild, which means
for some video output device, we have already registered a backlight
interface and installed a notification handler for it. So it can happen
when user is using this system, on hotkey pressing, the notification
handler will send a keycode through a non-existing input device, causing
kernel freeze.

To solve this problem, we free all those already registered video output
devices once something goes wrong in acpi_video_bus_get_devices so that
no wild backlight interfaces and notification handlers exist.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=51731
Reported-bisected-and-tested-by: <i-tek@web.de>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
acpi: video: Let OS handle brightness level

Starting from win8, MS backlight control driver will set bit 2 of the
parameter of control method _DOS, to let firmware know OS will handle
backlight level and firmware should not change backlight level.

So this patch set bit 2 when calling _DOS, to make acpi video driver
work for firmwares adhere to win8 requirements.

The MS document on win8 backlight control is here:
http://msdn.microsoft.com/en-US/library/windows/hardware/jj159305

Buglink:https://bugzilla.kernel.org/show_bug.cgi?id=52951
Reported-by: Micael Dias <kam1kaz3@gmail.com>
acpi: video: Add some debug statement for bug fixing

Add some debug statements so that when user reports a bug, we can easily
collect information without letting user apply some debug patch and
re-compile the kernel.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>