On Tue, Oct 27, 2015 at 6:06 AM, Michael Burian <michael.burian@xxxxxx> wrote: > On 10/27/15 10:17, Michel Dänzer wrote: >> >> I'm not familiar with the ATOM bytecode, but since the number of >> bytecode instructions executed seems the same in both cases, I suspect >> that dig->backlight_level == 0 => ATOM_LCD_BLOFF is executed. (The >> debugging output in my patch would have provided all of this information >> and more, but there wasn't any of it in the dmesg you provided) >> >> I guess the question then becomes how dig->backlight_level is (supposed >> to be) initialized. >> >> What values do the following files contain in the broken and working cases? >> >> /sys/class/backlight/radeon_bl0/bl_power >> /sys/class/backlight/radeon_bl0/brightness >> /sys/class/backlight/radeon_bl0/actual_brightness >> /sys/class/backlight/radeon_bl0/max_brightness >> >> > > These files do not exist on my system, > I can offer /sys/class/backlight/acpi_video0/ > > content is identical in both cases > > bl_power 0 > brightness 10 > actual_brightness 10 > max_brightness 10 > > It would appear that your system does not use the gpu backlight controller. Either it's lying or messing with the GPU backlight controller causes some bad interaction with whatever does control it. Does the attached radeon patch help? I'm also attaching an amdgpu patch for reference in case the same problem appears on amdgpu. Alex
From 0b04a9688f83505a6dedea9266b7e9d173ff8306 Mon Sep 17 00:00:00 2001 From: Alex Deucher <alexander.deucher@xxxxxxx> Date: Tue, 27 Oct 2015 11:04:39 -0400 Subject: [PATCH 2/2] drm/amdgpu: fix backlight handling when not controlled by GPU Some systems claim the backlight is not controlled by the GPU but it seems to either actually be controlled by the GPU, or messing with the GPU backlight controls causes some other problem. If the system indicates the GPU does not control the backlight, revert back to the old behavior. Fixes a possible regression in: 74b3112e95073b351e3b0b9799795bc76f8415fa Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx --- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 1e0bba2..a7cfe75 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -1234,6 +1234,8 @@ amdgpu_atombios_encoder_setup_external_encoder(struct drm_encoder *encoder, static void amdgpu_atombios_encoder_setup_dig(struct drm_encoder *encoder, int action) { + struct drm_device *dev = encoder->dev; + struct amdgpu_device *adev = dev->dev_private; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_encoder *ext_encoder = amdgpu_get_external_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1278,8 +1280,14 @@ amdgpu_atombios_encoder_setup_dig(struct drm_encoder *encoder, int action) amdgpu_atombios_dp_link_train(encoder, connector); amdgpu_atombios_encoder_setup_dig_encoder(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0); } - if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) - amdgpu_atombios_encoder_set_backlight_level(amdgpu_encoder, dig->backlight_level); + if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + if (adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU) + amdgpu_atombios_encoder_set_backlight_level(amdgpu_encoder, + dig->backlight_level); + else + amdgpu_atombios_encoder_setup_dig_transmitter(encoder, + ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0); + } if (ext_encoder) amdgpu_atombios_encoder_setup_external_encoder(encoder, ext_encoder, ATOM_ENABLE); } else { -- 1.8.3.1
From e464cc8304fae331537b86f53f49c26854cdff59 Mon Sep 17 00:00:00 2001 From: Alex Deucher <alexander.deucher@xxxxxxx> Date: Tue, 27 Oct 2015 10:56:44 -0400 Subject: [PATCH 1/2] drm/radeon: fix backlight handling when not controlled by GPU Some systems claim the backlight is not controlled by the GPU but it seems to either actually be controlled by the GPU, or messing with the GPU backlight controls causes some other problem. If the system indicates the GPU does not control the backlight, revert back to the old behavior. Fixes a regression in commit: 4281f46ef839050d2ef60348f661eb463c21cc2e Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx --- drivers/gpu/drm/radeon/atombios_encoders.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 65adb9c..8ce32f9 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -1624,9 +1624,14 @@ 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)) { - struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; + if (rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU) { + struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; - atombios_set_backlight_level(radeon_encoder, dig->backlight_level); + atombios_set_backlight_level(radeon_encoder, dig->backlight_level); + } else { + args.ucAction = ATOM_LCD_BLON; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + } } break; case DRM_MODE_DPMS_STANDBY: @@ -1706,8 +1711,13 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0); } - if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) - atombios_set_backlight_level(radeon_encoder, dig->backlight_level); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + if (rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU) + atombios_set_backlight_level(radeon_encoder, dig->backlight_level); + else + atombios_dig_transmitter_setup(encoder, + ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0); + } if (ext_encoder) atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE); break; -- 1.8.3.1
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel