[PATCH] Untested proposal patch: Store video capabilities of BIOS globally at ACPI parse time and export it.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Store video capabilities of BIOS globally at ACPI parse time and export it.

This is for vendor specific vs video driver so that they can distinguish who
should take care of video/brightness control.
The bits are chosen in a way that video can handle the ability gracefully
if all the checked functions are there...

Vendor specific modules must check on that bits and take their hands off
brightness/video control when set, as they are then served by the video
driver.

This hasn't been tested yet. It's more a proposal whether this is the way
to go...
Would be great if someone could give it a test if accepted, I will test
this also as soon as some positive feedback is popping up.

Signed-off-by: Thomas Renninger <trenn@xxxxxxx>

---
 drivers/acpi/scan.c  |   42 ++++++++++++++++++++++++++++++++++++------
 include/linux/acpi.h |    7 +++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

Index: lenb/drivers/acpi/scan.c
===================================================================
--- lenb.orig/drivers/acpi/scan.c
+++ lenb/drivers/acpi/scan.c
@@ -870,6 +870,25 @@ static void acpi_device_get_busid(struct
 	}
 }
 
+u8 acpi_video_support;
+EXPORT_SYMBOL(acpi_video_support);
+
+static acpi_status
+acpi_brighntess_cap_match(acpi_handle handle, u32 level, void *context,
+			  void **return_value)
+{
+	acpi_handle h_dummy1;
+	acpi_handle h_dummy2;
+	acpi_handle h_dummy3;
+
+	if (ACPI_SUCCESS(acpi_get_handle(handle, "_BCM", &h_dummy1)) &&
+	    ACPI_SUCCESS(acpi_get_handle(handle, "_BCL", &h_dummy2)) &&
+	    ACPI_SUCCESS(acpi_get_handle(handle, "_BQC", &h_dummy3)))
+		acpi_video_support |= ACPI_VIDEO_BRIGHTNESS;
+
+	return 0;
+}
+
 static int
 acpi_video_bus_match(struct acpi_device *device)
 {
@@ -887,20 +906,31 @@ acpi_video_bus_match(struct acpi_device 
 
 	/* Does this device able to support video switching ? */
 	if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) &&
-	    ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2)))
-		return 0;
+	    ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) {
+		acpi_video_support |= ACPI_VIDEO_OUTPUT_SWITCHING;
+		goto success;
+	}
 
 	/* Does this device able to retrieve a video ROM ? */
-	if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1)))
-		return 0;
+	if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) {
+		acpi_video_support |= ACPI_VIDEO_ROM_AVAILABLE;
+		goto success;
+	}
 
 	/* Does this device able to configure which video head to be POSTed ? */
 	if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) &&
 	    ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) &&
-	    ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3)))
-		return 0;
+	    ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) {
+		acpi_video_support |= ACPI_VIDEO_DEVICE_POSTING;
+		goto success;
+	}
 
 	return -ENODEV;
+
+ success:
+	acpi_walk_namespace(ACPI_TYPE_METHOD, device->handle, ACPI_UINT32_MAX,
+			    acpi_brighntess_cap_match, NULL, NULL);
+	return 0;
 }
 
 /*
Index: lenb/include/linux/acpi.h
===================================================================
--- lenb.orig/include/linux/acpi.h
+++ lenb/include/linux/acpi.h
@@ -184,6 +184,13 @@ struct acpi_pci_driver {
 int acpi_pci_register_driver(struct acpi_pci_driver *driver);
 void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
 
+/* video/brightness support */
+#define ACPI_VIDEO_OUTPUT_SWITCHING	1
+#define ACPI_VIDEO_DEVICE_POSTING	2
+#define ACPI_VIDEO_ROM_AVAILABLE	4
+#define ACPI_VIDEO_BRIGHTNESS		8
+extern u8 acpi_video_support;
+
 #endif /* CONFIG_ACPI */
 
 #ifdef CONFIG_ACPI_EC


-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux