aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLekensteyn <lekensteyn@gmail.com>2012-06-25 18:36:24 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-20 08:23:05 -0400
commitd627b62ff8d4d36761adbcd90ff143d79c94ab22 (patch)
tree876ee022b82bbd17f310bcabbd6e6afec6c14b97
parent3739850b46f560a2be29287c3e5c29999d1a7e0e (diff)
i915: initialize CADL in opregion
This is rather a hack to fix brightness hotkeys on a Clevo laptop. CADL is not used anywhere in the driver code at the moment, but it could be used in BIOS as is the case with the Clevo laptop. The Clevo B7130 requires the CADL field to contain at least the ID of the LCD device. If this field is empty, the ACPI methods that are called on pressing brightness / display switching hotkeys will not trigger a notification. As a result, it appears as no hotkey has been pressed. Reference: https://bugs.freedesktop.org/show_bug.cgi?id=45452 Tested-by: Peter Wu <lekensteyn@gmail.com> Signed-off-by: Peter Wu <lekensteyn@gmail.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_opregion.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 18bd0af855dc..e27c17012628 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -427,6 +427,25 @@ blind_set:
427 goto end; 427 goto end;
428} 428}
429 429
430static void intel_setup_cadls(struct drm_device *dev)
431{
432 struct drm_i915_private *dev_priv = dev->dev_private;
433 struct intel_opregion *opregion = &dev_priv->opregion;
434 int i = 0;
435 u32 disp_id;
436
437 /* Initialize the CADL field by duplicating the DIDL values.
438 * Technically, this is not always correct as display outputs may exist,
439 * but not active. This initialization is necessary for some Clevo
440 * laptops that check this field before processing the brightness and
441 * display switching hotkeys. Just like DIDL, CADL is NULL-terminated if
442 * there are less than eight devices. */
443 do {
444 disp_id = ioread32(&opregion->acpi->didl[i]);
445 iowrite32(disp_id, &opregion->acpi->cadl[i]);
446 } while (++i < 8 && disp_id != 0);
447}
448
430void intel_opregion_init(struct drm_device *dev) 449void intel_opregion_init(struct drm_device *dev)
431{ 450{
432 struct drm_i915_private *dev_priv = dev->dev_private; 451 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -436,8 +455,10 @@ void intel_opregion_init(struct drm_device *dev)
436 return; 455 return;
437 456
438 if (opregion->acpi) { 457 if (opregion->acpi) {
439 if (drm_core_check_feature(dev, DRIVER_MODESET)) 458 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
440 intel_didl_outputs(dev); 459 intel_didl_outputs(dev);
460 intel_setup_cadls(dev);
461 }
441 462
442 /* Notify BIOS we are ready to handle ACPI video ext notifs. 463 /* Notify BIOS we are ready to handle ACPI video ext notifs.
443 * Right now, all the events are handled by the ACPI video module. 464 * Right now, all the events are handled by the ACPI video module.