Skip to contentSkip to conversation

Subject: Move detection time of video devices after ACPI PCI device setup

PATCH In review Thomas Renninger 1 participant 1 message Apr 16, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 Subject: Move detection time of video devices after ACPI PCI device setup

Subject: Move detection time of video devices after ACPI PCI device setup

video_bus_match detects the capabilities of a video device. This must only be done for devices that are physically plugged in and are not ACPI dummy devices. Therefore you need acpi_get_physical_device to check whether behind the ACPI device a real struct *device is present. The relationship/glueing between struct *device and struct *acpi_device must have been done for that -> move video device testing after it.

---
 drivers/acpi/scan.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/acpi/scan.c +7 -2
Index: linux-acpi-2.6_video_native_vs_vendor/drivers/acpi/scan.c
===================================================================
@@ -1035,8 +1035,6 @@ static void acpi_device_set_id(struct ac
 		   will get autoloaded and the device might still match
 		   against another driver.
 		*/
-		if (ACPI_SUCCESS(acpi_video_bus_match(device)))
-			cid_add(device, ACPI_VIDEO_HID, NULL);
 		else if (ACPI_SUCCESS(acpi_bay_match(device)))
 			cid_add(device, ACPI_BAY_HID, NULL);
 		else if (ACPI_SUCCESS(acpi_dock_match(device)))
@@ -1275,6 +1273,13 @@ acpi_add_single_object(struct acpi_devic
 			device->parent->ops.bind(device);
 	}
 
+	/* Checking for a video device and add its CID must be done
+	 * after pci bind because we also want to detect its capabilities.
+	 * And we only want to detect the capabilities of plugged in devices
+	 */
+	if (ACPI_SUCCESS(acpi_video_bus_match(device)))
+		cid_add(device, ACPI_VIDEO_HID, NULL);
+
       end:
 	if (!result)
 		*child = device;