Commit dfc2066d authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915/opregion: start using extended didl

Adding support for did2, or the extended support display devices ID
list, increases the total to 15.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent d5cbb22f
...@@ -669,7 +669,7 @@ static void intel_didl_outputs(struct drm_device *dev) ...@@ -669,7 +669,7 @@ static void intel_didl_outputs(struct drm_device *dev)
struct acpi_device *acpi_dev, *acpi_cdev, *acpi_video_bus = NULL; struct acpi_device *acpi_dev, *acpi_cdev, *acpi_video_bus = NULL;
unsigned long long device_id; unsigned long long device_id;
acpi_status status; acpi_status status;
u32 temp; u32 temp, max_outputs;
int i = 0; int i = 0;
handle = ACPI_HANDLE(&dev->pdev->dev); handle = ACPI_HANDLE(&dev->pdev->dev);
...@@ -692,9 +692,20 @@ static void intel_didl_outputs(struct drm_device *dev) ...@@ -692,9 +692,20 @@ static void intel_didl_outputs(struct drm_device *dev)
return; return;
} }
/*
* In theory, did2, the extended didl, gets added at opregion version
* 3.0. In practice, however, we're supposed to set it for earlier
* versions as well, since a BIOS that doesn't understand did2 should
* not look at it anyway. Use a variable so we can tweak this if a need
* arises later.
*/
max_outputs = ARRAY_SIZE(opregion->acpi->didl) +
ARRAY_SIZE(opregion->acpi->did2);
list_for_each_entry(acpi_cdev, &acpi_video_bus->children, node) { list_for_each_entry(acpi_cdev, &acpi_video_bus->children, node) {
if (i >= 8) { if (i >= max_outputs) {
DRM_DEBUG_KMS("More than 8 outputs detected via ACPI\n"); DRM_DEBUG_KMS("More than %u outputs detected via ACPI\n",
max_outputs);
return; return;
} }
status = acpi_evaluate_integer(acpi_cdev->handle, "_ADR", status = acpi_evaluate_integer(acpi_cdev->handle, "_ADR",
...@@ -707,8 +718,10 @@ static void intel_didl_outputs(struct drm_device *dev) ...@@ -707,8 +718,10 @@ static void intel_didl_outputs(struct drm_device *dev)
} }
end: end:
/* If fewer than 8 outputs, the list must be null terminated */ DRM_DEBUG_KMS("%d outputs detected\n", i);
if (i < 8)
/* If fewer than max outputs, the list must be null terminated */
if (i < max_outputs)
set_did(opregion, i, 0); set_did(opregion, i, 0);
return; return;
...@@ -716,8 +729,9 @@ static void intel_didl_outputs(struct drm_device *dev) ...@@ -716,8 +729,9 @@ static void intel_didl_outputs(struct drm_device *dev)
i = 0; i = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
int output_type = ACPI_OTHER_OUTPUT; int output_type = ACPI_OTHER_OUTPUT;
if (i >= 8) { if (i >= max_outputs) {
DRM_DEBUG_KMS("More than 8 outputs in connector list\n"); DRM_DEBUG_KMS("More than %u outputs in connector list\n",
max_outputs);
return; return;
} }
switch (connector->connector_type) { switch (connector->connector_type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment