[PATCH 3/3] drm/i915/opregion: put internal panels to the front of CADL

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

 



The attempts to update CADL based on the actual active connectors have
not been successful. That is the right thing to do ultimately, but there
must be something we're still missing.

In the mean time, change the dumb CADL initialization we currently have
to put internal panels in front of the CADL to ensure they're included
in the list. (There's a max of eight.) Hopefully this ensures the BIOS
does not block backlight hotkey events, thinking the internal panel is
off.

Cc: Peter Wu <peter@xxxxxxxxxxxxx>
Cc: Rainer Koenig <Rainer.Koenig@xxxxxxxxxxxxxx>
Cc: Jan-Marek Glogowski <glogow@xxxxxxxxxx>
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
Cc: Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx>
Cc: Paolo Stivanin <paolostivanin@xxxxxxxxxxx>
Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_opregion.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 024ae9b393e7..cb58194973ae 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -753,8 +753,24 @@ static void intel_setup_cadls(struct drm_i915_private *dev_priv)
 	 * not always correct as display outputs may exist, but not active. This
 	 * initialization is necessary for some Clevo laptops that check this
 	 * field before processing the brightness and display switching hotkeys.
+	 * Put internal panels in front of the list to ensure they're not left
+	 * out.
 	 */
 	for_each_intel_connector(&dev_priv->drm, connector) {
+		if ((connector->acpi_device_id & ACPI_DISPLAY_TYPE_MASK) !=
+		    ACPI_DISPLAY_TYPE_INTERNAL_DIGITAL)
+			continue;
+
+		if (i >= ARRAY_SIZE(opregion->acpi->cadl))
+			break;
+		opregion->acpi->cadl[i++] = connector->acpi_device_id;
+	}
+
+	for_each_intel_connector(&dev_priv->drm, connector) {
+		if ((connector->acpi_device_id & ACPI_DISPLAY_TYPE_MASK) ==
+		    ACPI_DISPLAY_TYPE_INTERNAL_DIGITAL)
+			continue;
+
 		if (i >= ARRAY_SIZE(opregion->acpi->cadl))
 			break;
 		opregion->acpi->cadl[i++] = connector->acpi_device_id;
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux