No backlight since linux-4.2.4 - drivers/gpu/drm/radeon/atombios_encoders.c

2015-10-28 Thread Michael Burian
On 10/28/15 20:03, Alex Deucher wrote:
>>
>> My only doubt about this patch is: Should we also fall back to the old
>> beahviour in the !(rdev->mode_info.firmware_flags &
>> ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU) case?
> 
> Theoretically, it's not necessary, but I guess better safe than sorry.
> Updated patches attached.
> 

applied both patches on top of mainline[1], backlight works fine

[1]
8a28d67457b613258aa0578ccece206d166f2b9f "Merge tag 'powerpc-4.3-6' of 
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux"





No backlight since linux-4.2.4 - drivers/gpu/drm/radeon/atombios_encoders.c

2015-10-27 Thread Michael Burian
On 10/27/15 17:43, Alex Deucher wrote:
> 
> I see the problem.  We don't enable native backlight control on older
> asics like yours by default.  Does the attached patch help?
> 

Yes, backlight is on again. (tested against mainline: 
858e904bd71dd0057a548d6785d94ce5ec4aeabd)

thanks




No backlight since linux-4.2.4 - drivers/gpu/drm/radeon/atombios_encoders.c

2015-10-27 Thread Michael Burian
On 10/27/15 16:10, Alex Deucher wrote:

> 
> 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.
> 

no, still no backlight when applied against current current mainline

858e904bd71dd0057a548d6785d94ce5ec4aeabd (Merge tag 'iommu-fixes-v4.3-rc7' of 
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu)







No backlight since linux-4.2.4 - drivers/gpu/drm/radeon/atombios_encoders.c

2015-10-27 Thread Michael Burian
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_power0
brightness  10
actual_brightness   10
max_brightness  10




No backlight since linux-4.2.4 - drivers/gpu/drm/radeon/atombios_encoders.c

2015-10-27 Thread Michael Burian
On 10/27/15 03:36, Michel Dänzer wrote:
>>
>> [0] contains dmesg output with your patch applied (which fixes the backlight 
>> issue)
> 
> This is very surprising: The patch just adds some debugging output, it's
> not supposed to have any functional effect. Also, I don't see any of the
> debugging output added by the patch in
> dmesg-4.3.0-rc7-3-g85051e2-dirty-2015-10-26-11-00-41-radeon-bl-debug.
>

> Are you sure that my patch was actually applied to the radeon driver
> when generating that file? Did you update the initrd with the patched
> radeon.ko?
> 

the build was done using "make -j4 deb-pkg" on a better equipped machine,
.deb packages were copied over and installed - maybe something interesting
happened

AFAICT the patch should have been applied, at least it was shown with
git diff and the -dirty suffix was added by the build system, not me.
All graphics related drivers are compiled in (=y) rather than as
modules (=m) in .config.

Another thing I tried yesterday was to add the old way right below the new one
(this fixes the backlight issue) enclosed by some debug statements that indicate
start / stop of the old / new method. (see atomdebug.diff - should be applied 
against
mainline)

-- next part --
radeon_start_backlight_new_way
>> execute D2AA (len 348, WS 4, PS 4)
   SET_ATI_PORT @ 0xD2B0
  port: 0 (MM)
   COMPARE_PS @ 0xD2B3
  src1: 
PS[0x00,0x8802]
.[7:0] -> 0x02
  src2: 
IMM 0x04
  result: NE LE
   JUMP_EQUAL @ 0xD2B7
  taken: no
  target: 0x0128
   COMPARE_PS @ 0xD2BA
  src1: 
PS[0x00,0x8802]
.[7:0] -> 0x02
  src2: 
IMM 0x05
  result: NE LE
   JUMP_EQUAL @ 0xD2BE
  taken: no
  target: 0x0113
   COMPARE_PS @ 0xD2C1
  src1: 
PS[0x00,0x8802]
.[7:0] -> 0x02
  src2: 
IMM 0x00
  result: NE GT
   JUMP_EQUAL @ 0xD2C5
  taken: no
  target: 0x00D8
   COMPARE_PS @ 0xD2C8
  src1: 
PS[0x00,0x8802]
.[7:0] -> 0x02
  src2: 
IMM 0x01
  result: NE GT
   JUMP_NOT_EQUAL @ 0xD2CC
  taken: yes
  target: 0x013D
   COMPARE_PS @ 0xD3E7
  src1: 
PS[0x00,0x8802]
.[7:0] -> 0x02
  src2: 
IMM 0x03
  result: NE LE
   JUMP_NOT_EQUAL @ 0xD3EB
  taken: yes
  target: 0x0151
   OR_REG @ 0xD3FB
  dst: 
REG[0x1EBC]
.[31:24] -> 0x00
  src: 
IMM 0x02
  dst: 
REG[0x1EBC]
.[31:24] <- 0x02
   AND_REG @ 0xD400
  dst: 
REG[0x1EBC]
.[31:24] -> 0x02
  src: 
IMM 0xFE
  dst: 
REG[0x1EBC]
.[31:24] <- 0x02
   EOT @ 0xD405
<<
radeon_stop_backlight_new_wayradeon_start_backlight_old_way
-- next part --
radeon_stop_backlight_new_wayradeon_start_backlight_old_way
>> execute D2AA (len 348, WS 4, PS 4)
   SET_ATI_PORT @ 0xD2B0
  port: 0 (MM)
   COMPARE_PS @ 0xD2B3
  src1: 
PS[0x00,0x0003]
.[7:0] -> 0x03
  src2: 
IMM 0x04
  result: NE LE
   JUMP_EQUAL @ 0xD2B7
  taken: no
  target: 0x0128
   COMPARE_PS @ 0xD2BA
  src1: 
PS[0x00,0x0003]
.[7:0] -> 0x03
  src2: 
IMM 0x05
  result: NE LE
   JUMP_EQUAL @ 0xD2BE
  taken: no
  target: 0x0113
   COMPARE_PS @ 0xD2C1
  src1: 
PS[0x00,0x0003]
.[7:0] -> 0x03
  src2: 
IMM 0x00
  result: NE GT
   JUMP_EQUAL @ 0xD2C5
  taken: no
  target: 0x00D8
   COMPARE_PS @ 0xD2C8
  src1: 
PS[0x00,0x0003]
.[7:0] -> 0x03
  src2: 
IMM 0x01
  result: NE GT
   JUMP_NOT_EQUAL @ 0xD2CC
  taken: yes
  target: 0x013D
   COMPARE_PS @ 0xD3E7
  src1: 
PS[0x00,0x0003]
.[7:0] -> 0x03
  src2: 
IMM 0x03
  result: EQ LE
   JUMP_NOT_EQUAL @ 0xD3EB
  taken: no
  target: 0x0151
   OR_REG @ 0xD3EE
  dst: 
REG[0x1EBC]
.[31:24] -> 0x02
  src: 
IMM 0x02
  dst: 
REG[0x1EBC]
.[31:24] <- 0x02
   OR_REG @ 0xD3F3
  dst: 
REG[0x1EBC]
.[31:24] -> 0x02
  src: 
IMM 0x01
  dst: 
REG[0x1EBC]
.[31:24] <- 0x03
   JUMP @ 0xD3F8
  target: 0x015B
   EOT @ 0xD405
<<
radeon_stop_backlight_old_way
-- next part --
A non-text attachment was scrubbed...
Name: atomdebug.diff
Type: text/x-patch
Size: 1430 bytes
Desc: not available
URL: