summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/atombios_encoders.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2012-09-14 09:59:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-09-27 10:22:41 -0400
commit6d92f81dcf2d40b8ebb947bba5435642b830f649 (patch)
tree9a9f606f27c6e0007d473727326b5b761186c331 /drivers/gpu/drm/radeon/atombios_encoders.c
parent2e3b3b105ab3bb5b6a37198da4f193cd13781d13 (diff)
drm/radeon: add get_backlight_level callback
Read back the backlight level from the hw. Needed for proper backlight restoration on resume. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_encoders.c')
-rw-r--r--drivers/gpu/drm/radeon/atombios_encoders.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index 266036b10fec..5ce13b8fbe6c 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -72,6 +72,18 @@ radeon_atom_set_backlight_level_to_reg(struct radeon_device *rdev,
WREG32(RADEON_BIOS_2_SCRATCH, bios_2_scratch);
}
+u8
+atombios_get_backlight_level(struct radeon_encoder *radeon_encoder)
+{
+ struct drm_device *dev = radeon_encoder->base.dev;
+ struct radeon_device *rdev = dev->dev_private;
+
+ if (!(rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))
+ return 0;
+
+ return radeon_atom_get_backlight_level_from_reg(rdev);
+}
+
void
atombios_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level)
{