Commit 201bb624 authored by Alex Deucher's avatar Alex Deucher

drm/radeon: set default bl level to something reasonable

If the value in the scratch register is 0, set it to the
max level.  This fixes an issue where the console fb blanking
code calls back into the backlight driver on unblank and then
sets the backlight level to 0 after the driver has already
set the mode and enabled the backlight.

bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=81382
https://bugs.freedesktop.org/show_bug.cgi?id=70207Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Tested-by: default avatarDavid Heidelberger <david.heidelberger@ixit.cz>
Cc: stable@vger.kernel.org
parent 0ac66eff
...@@ -183,7 +183,6 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, ...@@ -183,7 +183,6 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
struct backlight_properties props; struct backlight_properties props;
struct radeon_backlight_privdata *pdata; struct radeon_backlight_privdata *pdata;
struct radeon_encoder_atom_dig *dig; struct radeon_encoder_atom_dig *dig;
u8 backlight_level;
char bl_name[16]; char bl_name[16];
/* Mac laptops with multiple GPUs use the gmux driver for backlight /* Mac laptops with multiple GPUs use the gmux driver for backlight
...@@ -222,12 +221,17 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, ...@@ -222,12 +221,17 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
pdata->encoder = radeon_encoder; pdata->encoder = radeon_encoder;
backlight_level = radeon_atom_get_backlight_level_from_reg(rdev);
dig = radeon_encoder->enc_priv; dig = radeon_encoder->enc_priv;
dig->bl_dev = bd; dig->bl_dev = bd;
bd->props.brightness = radeon_atom_backlight_get_brightness(bd); bd->props.brightness = radeon_atom_backlight_get_brightness(bd);
/* Set a reasonable default here if the level is 0 otherwise
* fbdev will attempt to turn the backlight on after console
* unblanking and it will try and restore 0 which turns the backlight
* off again.
*/
if (bd->props.brightness == 0)
bd->props.brightness = RADEON_MAX_BL_LEVEL;
bd->props.power = FB_BLANK_UNBLANK; bd->props.power = FB_BLANK_UNBLANK;
backlight_update_status(bd); backlight_update_status(bd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment