Backlight adjustments shows OSD but does not change anything on Samsung OLED panel

Bug #1854413 reported by Kyle Altendorf
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux
Unknown
Medium
linux (Ubuntu)
Confirmed
Medium
AaronMa

Bug Description

When running Ubuntu with linux-image-5.3.0-23-generic, mainline 5.3.13, or latest 5.4+ my Lenovo ThinkPad P1 Gen 2 with a Samsung OLED panel is unable to change the backlight brightness. The buttons trigger the on-screen display and move the bar but the actual display brightness does not change. With the kernel option i915.enable_dpcd_backlight=1 it does make the backlight change but erratically. For example moving through the range you get stuff like off, medium bright, dim, bright, medium, off. This does work in Ubuntu linux-image-4.15.0-1059-oem. It seems the following commits in particular make the difference.

UBUNTU: SAUCE: i915: intel_dp_aux_backlight: Fix max backlight calculations
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/eoan/commit/?h=oem&id=ff39163c455f31005e2709a2006a7605b3d8a05f

UBUNTU: SAUCE: drm/i915: customize DPCD brightness control for specific panel
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/eoan/commit/?h=oem&id=cf7286b44a6e27967f5ed134c4492dd17bde118a

It has been explained to me that these OEM changes are unlikely to be directly ported into -generic images but it seems relevant to document the issue. I ported the above commits to the latest linux mainline kernel and am running that (other than while reporting this issue). This was in part because >= 5.3.12 fixes another issue with this hardware where the screen remains black after a resume (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1854177). I have filed https://bugzilla.kernel.org/show_bug.cgi?id=205699.

https://github.com/altendky/linux/commit/395eb4b85f6a0f85061c0598247727de0d9316f6
https://github.com/altendky/linux/commit/c2dc38e6aadf3d979bea83e382a1b119574df7af

Built with:

git clean -fdx && cp /boot/config-5.3.0-23-generic .config && yes '' | make oldconfig && make clean && make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-altendky-backlight

Note that the use of DEVICE_ID_ANY is likely bad and the correct ID for this panel should be identified. I wanted to first confirm it worked before bothering to figure out which ID was needed there and how to get it.

I have naively ported these patches. While I have done embedded C for years and some hardware design... I am not familiar with Linux kernel development nor any details of controlling this hardware.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: linux-image-5.3.0-23-generic 5.3.0-23.25
ProcVersionSignature: Ubuntu 5.3.0-23.25-generic 5.3.7
Uname: Linux 5.3.0-23-generic x86_64
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: altendky 1381 F.... pulseaudio
CurrentDesktop: KDE
Date: Thu Nov 28 21:24:12 2019
InstallationDate: Installed on 2019-11-26 (2 days ago)
InstallationMedia: Kubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
MachineType: LENOVO 20QTCTO1WW
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.3.0-23-generic root=/dev/mapper/lvm_group-root ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-5.3.0-23-generic N/A
 linux-backports-modules-5.3.0-23-generic N/A
 linux-firmware 1.183.2
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/17/2019
dmi.bios.vendor: LENOVO
dmi.bios.version: N2OET40W (1.27 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20QTCTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0T08861 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN2OET40W(1.27):bd10/17/2019:svnLENOVO:pn20QTCTO1WW:pvrThinkPadP1Gen2:rvnLENOVO:rn20QTCTO1WW:rvrSDK0T08861WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad P1 Gen 2
dmi.product.name: 20QTCTO1WW
dmi.product.sku: LENOVO_MT_20QT_BU_Think_FM_ThinkPad P1 Gen 2
dmi.product.version: ThinkPad P1 Gen 2
dmi.sys.vendor: LENOVO

Revision history for this message
In , sda (sda-linux-kernel-bugs) wrote :

Created attachment 286111
fix_max_backlight_calculations

When running Ubuntu with linux-image-5.3.0-23-generic, mainline 5.3.13, or latest 5.4+ my Lenovo ThinkPad P1 Gen 2 is unable to change the backlight brightness. The buttons trigger the on-screen display and move the bar but the actual display brightness does not change. With the kernel option i915.enable_dpcd_backlight=1 it does make the backlight change but erratically. For example moving through the range you get stuff like off, medium bright, dim, bright, medium, off. This does work in Ubuntu linux-image-4.15.0-1059-oem. It seems the following commits in particular make the difference.

UBUNTU: SAUCE: i915: intel_dp_aux_backlight: Fix max backlight calculations
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/eoan/commit/?h=oem&id=ff39163c455f31005e2709a2006a7605b3d8a05f

UBUNTU: SAUCE: drm/i915: customize DPCD brightness control for specific panel
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/eoan/commit/?h=oem&id=cf7286b44a6e27967f5ed134c4492dd17bde118a

I ported the above commits to the latest linux mainline kernel and am running that. This was in part because >= 5.3.12 fixes another issue with this hardware where the screen remains black after a resume (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1854177).

https://github.com/altendky/linux/commit/395eb4b85f6a0f85061c0598247727de0d9316f6
https://github.com/altendky/linux/commit/c2dc38e6aadf3d979bea83e382a1b119574df7af

Built with:

git clean -fdx && cp /boot/config-5.3.0-23-generic .config && yes '' | make oldconfig && make clean && make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-altendky-backlight

Note that the use of DEVICE_ID_ANY is likely bad and the correct ID for this panel should be identified. I wanted to first confirm it worked before bothering to figure out which ID was needed there and how to get it.

Revision history for this message
In , sda (sda-linux-kernel-bugs) wrote :

Created attachment 286113
customize_dpcd_brightness_control_for_specific_panel

Revision history for this message
In , sda (sda-linux-kernel-bugs) wrote :

Created attachment 286115
fix_max_backlight_calculations

Revision history for this message
In , sda (sda-linux-kernel-bugs) wrote :

I should note that I have naively ported these patches. While I have done embedded C for years and some hardware design... I am not familiar with Linux kernel development nor any details of controlling this hardware.

Revision history for this message
In , sda (sda-linux-kernel-bugs) wrote :

:[ Also, this laptop has the Samsung OLED panel.

Revision history for this message
Kyle Altendorf (sda) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu):
assignee: nobody → AaronMa (mapengyu)
importance: Undecided → Medium
Revision history for this message
In , jani.nikula (jani.nikula-linux-kernel-bugs) wrote :
Changed in linux:
importance: Unknown → Medium
Revision history for this message
Kyle Altendorf (sda) wrote :

I haven't had a chance to try these out and I'm not sure how to track these changes through the various repositories and branches but for the record there are some other commits in drm/i915 that are claimed to fix the issue. I'll report back when I get a chance to patch these into 5.3.0-40-generic (which, as a side note, fixes the black screen after resuming from suspend issue on the P1 Gen 2).

fde7266fb2f6 drm/i915: Fix eDP DPCD aux max backlight calculations
79946723092b drm/i915: Assume 100% brightness when not in DPCD control mode
662884a9ad99 drm/i915: Fix DPCD register order in intel_dp_aux_enable_backlight()
9ac7d53d70a2 drm/i915: Auto detect DPCD backlight support by default

d2a4bb6f8bc8 drm/i915: Don't use VBT for detecting DPCD backlight controls

---

https://gitlab.freedesktop.org/drm/intel/issues/510#note_387666

https://github.com/torvalds/linux/commit/fde7266fb2f6fff2a7fe861474bf198ef0f2449f
https://github.com/torvalds/linux/commit/79946723092bde318ff11b3e57a02ba13a30b17e
https://github.com/torvalds/linux/commit/662884a9ad992240b8169624aae1b0cc273edc30
https://github.com/torvalds/linux/commit/9ac7d53d70a2b4f43360e3aa0f14a2514339328f
https://github.com/torvalds/linux/commit/d2a4bb6f8bc8cf2d788adf7e59b5b52fe3a3333c

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.