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: 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
either always return a constant value(e.g. 0 or 100 for the two broken
systems) or only return correct values for max/min levels but not
others and thus break the current logic. So this patch enhances the
quirk detect logic for _BQC: we do this by picking the second maximum
level and set it through _BCM, then compare with the value returned
from _BQC. If it doesn't match, see if the returned value is an index.
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
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=52951
Reported-by: Artem Savkov <artem.savkov@gmail.com>
Reported-by: Luis Medinas <lmedinas@gmail.com>
Reported-by: Cheppes <cheppes@mailinator.com>
Reported-by: Micael Dias <kam1kaz3@gmail.com>
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>