Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329483
b: refs/heads/master
c: d627b62
h: refs/heads/master
i:
  329481: d22c9c4
  329479: f3a7d5a
v: v3
  • Loading branch information
Lekensteyn authored and Daniel Vetter committed Sep 20, 2012
1 parent 282cb9c commit 3d67059
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3739850b46f560a2be29287c3e5c29999d1a7e0e
refs/heads/master: d627b62ff8d4d36761adbcd90ff143d79c94ab22
23 changes: 22 additions & 1 deletion trunk/drivers/gpu/drm/i915/intel_opregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,25 @@ static void intel_didl_outputs(struct drm_device *dev)
goto end;
}

static void intel_setup_cadls(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_opregion *opregion = &dev_priv->opregion;
int i = 0;
u32 disp_id;

/* Initialize the CADL field by duplicating the DIDL values.
* Technically, this is 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. Just like DIDL, CADL is NULL-terminated if
* there are less than eight devices. */
do {
disp_id = ioread32(&opregion->acpi->didl[i]);
iowrite32(disp_id, &opregion->acpi->cadl[i]);
} while (++i < 8 && disp_id != 0);
}

void intel_opregion_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
Expand All @@ -436,8 +455,10 @@ void intel_opregion_init(struct drm_device *dev)
return;

if (opregion->acpi) {
if (drm_core_check_feature(dev, DRIVER_MODESET))
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
intel_didl_outputs(dev);
intel_setup_cadls(dev);
}

/* Notify BIOS we are ready to handle ACPI video ext notifs.
* Right now, all the events are handled by the ACPI video module.
Expand Down

0 comments on commit 3d67059

Please sign in to comment.