diff mbox

[3.16.y-ckt,072/104] drm/radeon: Restore LCD backlight level on resume (>= R5xx)

Message ID 1445867006-18048-73-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques Oct. 26, 2015, 1:42 p.m. UTC
3.16.7-ckt19 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>

commit 4281f46ef839050d2ef60348f661eb463c21cc2e upstream.

Instead of only enabling the backlight (which seems to set it to max
brightness), just re-set the current backlight level, which also takes
care of enabling the backlight if necessary.

Only the radeon_atom_encoder_dpms_dig part tested on a Kaveri laptop,
the radeon_atom_encoder_dpms_avivo part is only compile tested.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/atombios_encoders.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Michel Dänzer Oct. 27, 2015, 2:10 a.m. UTC | #1
On 26.10.2015 22:42, Luis Henriques wrote:
> 3.16.7-ckt19 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: =TF-8?q?Michel Dänzer?= <michel.daenzer@amd.com>
> 
> commit 4281f46ef839050d2ef60348f661eb463c21cc2e upstream.
> 
> Instead of only enabling the backlight (which seems to set it to max
> brightness), just re-set the current backlight level, which also takes
> care of enabling the backlight if necessary.
> 
> Only the radeon_atom_encoder_dpms_dig part tested on a Kaveri laptop,
> the radeon_atom_encoder_dpms_avivo part is only compile tested.
> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

We're currently investigating a regression which was bisected to this
change. Please hold off on backporting this change until we have a
solution for that.
Luis Henriques Oct. 28, 2015, 10:45 a.m. UTC | #2
On Tue, Oct 27, 2015 at 11:10:29AM +0900, Michel Dänzer wrote:
> On 26.10.2015 22:42, Luis Henriques wrote:
> > 3.16.7-ckt19 -stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: =TF-8?q?Michel Dänzer?= <michel.daenzer@amd.com>
> > 
> > commit 4281f46ef839050d2ef60348f661eb463c21cc2e upstream.
> > 
> > Instead of only enabling the backlight (which seems to set it to max
> > brightness), just re-set the current backlight level, which also takes
> > care of enabling the backlight if necessary.
> > 
> > Only the radeon_atom_encoder_dpms_dig part tested on a Kaveri laptop,
> > the radeon_atom_encoder_dpms_avivo part is only compile tested.
> > 
> > Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> 
> We're currently investigating a regression which was bisected to this
> change. Please hold off on backporting this change until we have a
> solution for that.

Thanks, I'll drop this patch for this 3.16 release, and will wait for a
fix to be available.

Cheers,
--
Luís
Michel Dänzer Nov. 2, 2015, 7:52 a.m. UTC | #3
On 28.10.2015 19:45, Luis Henriques wrote:
> On Tue, Oct 27, 2015 at 11:10:29AM +0900, Michel Dänzer wrote:
>> On 26.10.2015 22:42, Luis Henriques wrote:
>>> 3.16.7-ckt19 -stable review patch.  If anyone has any objections, please let me know.
>>>
>>> ------------------
>>>
>>> From: =TF-8?q?Michel Dänzer?= <michel.daenzer@amd.com>
>>>
>>> commit 4281f46ef839050d2ef60348f661eb463c21cc2e upstream.
>>>
>>> Instead of only enabling the backlight (which seems to set it to max
>>> brightness), just re-set the current backlight level, which also takes
>>> care of enabling the backlight if necessary.
>>>
>>> Only the radeon_atom_encoder_dpms_dig part tested on a Kaveri laptop,
>>> the radeon_atom_encoder_dpms_avivo part is only compile tested.
>>>
>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>>
>> We're currently investigating a regression which was bisected to this
>> change. Please hold off on backporting this change until we have a
>> solution for that.
> 
> Thanks, I'll drop this patch for this 3.16 release, and will wait for a
> fix to be available.

The regression is fixed in commits
4cee6a9057d5e13911f0cb6e143d11dc1a3245dd and
ae93580ee59c02395c1711d3e6b90546b8137b86 . Please only backport
4281f46ef839050d2ef60348f661eb463c21cc2e together with those two.
Luis Henriques Nov. 11, 2015, 3:43 p.m. UTC | #4
On Mon, Nov 02, 2015 at 04:52:06PM +0900, Michel Dänzer wrote:
> On 28.10.2015 19:45, Luis Henriques wrote:
> > On Tue, Oct 27, 2015 at 11:10:29AM +0900, Michel Dänzer wrote:
> >> On 26.10.2015 22:42, Luis Henriques wrote:
> >>> 3.16.7-ckt19 -stable review patch.  If anyone has any objections, please let me know.
> >>>
> >>> ------------------
> >>>
> >>> From: =TF-8?q?Michel Dänzer?= <michel.daenzer@amd.com>
> >>>
> >>> commit 4281f46ef839050d2ef60348f661eb463c21cc2e upstream.
> >>>
> >>> Instead of only enabling the backlight (which seems to set it to max
> >>> brightness), just re-set the current backlight level, which also takes
> >>> care of enabling the backlight if necessary.
> >>>
> >>> Only the radeon_atom_encoder_dpms_dig part tested on a Kaveri laptop,
> >>> the radeon_atom_encoder_dpms_avivo part is only compile tested.
> >>>
> >>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> >>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> >>> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >>
> >> We're currently investigating a regression which was bisected to this
> >> change. Please hold off on backporting this change until we have a
> >> solution for that.
> > 
> > Thanks, I'll drop this patch for this 3.16 release, and will wait for a
> > fix to be available.
> 
> The regression is fixed in commits
> 4cee6a9057d5e13911f0cb6e143d11dc1a3245dd and
> ae93580ee59c02395c1711d3e6b90546b8137b86 . Please only backport
> 4281f46ef839050d2ef60348f661eb463c21cc2e together with those two.
> 

Thanks (and sorry for the delay in my reply!).

I'll queue all these 3 commits for the 3.16 kernel.  Commit 4cee6a9057d5
("drm/radeon: move bl encoder assignment into bl init") required a bit of
backporting which I would appreciate if you could review it (you'll
received the email with the patch soon).

Cheers,
--
Luís
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index 7d68203a3737..f35008cf0bc3 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -1609,8 +1609,9 @@  radeon_atom_encoder_dpms_avivo(struct drm_encoder *encoder, int mode)
 		} else
 			atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 		if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
-			args.ucAction = ATOM_LCD_BLON;
-			atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
+			struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+
+			atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
 		}
 		break;
 	case DRM_MODE_DPMS_STANDBY:
@@ -1691,8 +1692,7 @@  radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
 				atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
 		}
 		if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
-			atombios_dig_transmitter_setup(encoder,
-						       ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
+			atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
 		if (ext_encoder)
 			atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE);
 		break;