diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-08-03 19:39:43 +0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-20 21:10:37 +0400 |
commit | 37e9b6a62fb775276f8edb5bd2b9f13a3102b9dd (patch) | |
tree | 558e7267ff977b1851613102f8de01aa9c6b994e /drivers/gpu/drm/radeon/radeon_acpi.c | |
parent | e3a1592085988c60a2207eb492b89493573a0303 (diff) | |
download | linux-37e9b6a62fb775276f8edb5bd2b9f13a3102b9dd.tar.xz |
drm/radeon: rework the backlight control to be an asic callback
This cleans up the interface a bit as well.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_acpi.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_acpi.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c index cae895ba8e2f..c3976eb341bf 100644 --- a/drivers/gpu/drm/radeon/radeon_acpi.c +++ b/drivers/gpu/drm/radeon/radeon_acpi.c @@ -364,19 +364,23 @@ int radeon_atif_handler(struct radeon_device *rdev, DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count); if (req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) { - struct radeon_encoder *enc = atif->backlight_ctl; + struct radeon_encoder *enc = atif->encoder_for_bl; if (enc) { - struct radeon_encoder_atom_dig *dig = enc->enc_priv; - dig->backlight_level = req.backlight_level; - DRM_DEBUG_DRIVER("Changing brightness to %d\n", req.backlight_level); - atombios_set_panel_brightness(enc); + radeon_set_backlight_level(rdev, enc, req.backlight_level); - backlight_force_update(dig->bl_dev, - BACKLIGHT_UPDATE_HOTKEY); + if (rdev->is_atom_bios) { + struct radeon_encoder_atom_dig *dig = enc->enc_priv; + backlight_force_update(dig->bl_dev, + BACKLIGHT_UPDATE_HOTKEY); + } else { + struct radeon_encoder_lvds *dig = enc->enc_priv; + backlight_force_update(dig->bl_dev, + BACKLIGHT_UPDATE_HOTKEY); + } } } /* TODO: check other events */ @@ -577,16 +581,26 @@ int radeon_acpi_init(struct radeon_device *rdev) list_for_each_entry(tmp, &rdev->ddev->mode_config.encoder_list, head) { struct radeon_encoder *enc = to_radeon_encoder(tmp); - struct radeon_encoder_atom_dig *dig = enc->enc_priv; if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) && - dig->bl_dev != NULL) { - target = enc; - break; + enc->enc_priv) { + if (rdev->is_atom_bios) { + struct radeon_encoder_atom_dig *dig = enc->enc_priv; + if (dig->bl_dev) { + target = enc; + break; + } + } else { + struct radeon_encoder_lvds *dig = enc->enc_priv; + if (dig->bl_dev) { + target = enc; + break; + } + } } } - atif->backlight_ctl = target; + atif->encoder_for_bl = target; if (!target) { /* Brightness change notification is enabled, but we * didn't find a backlight controller, this should |