Skip to content

drm: panel-backlight-quirks: Do partial refactor and apply OLED fix

Antheas Kapenekakis amd-gfx dri-devel lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 4 repliesIn review
  2. v25 patches 3 repliesSuperseded
  3. v15 patches 14 repliesSuperseded

Changes in v3 from the cover letter

- Apply SD quirks at the middle so that backlight quirks stay together
- Add log when quirks are applied. Has to be separate because we need to grab a reference to the drm_device first and add it to min brightness first.
- Capitalize OR in patch 4

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm: panel-backlight-quirks: Make EDID match optionaldrivers/gpu/drm/drm_panel_backlight_quirks.c+1 -10 replies
2/6drm: panel-backlight-quirks: Convert brightness quirk to generic structuredrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c drivers/gpu/drm/drm_panel_backlight_quirks.c include/drm/drm_utils.h+35 -250 replies
3/6drm: panel-backlight-quirks: Add secondary DMI matchdrivers/gpu/drm/drm_panel_backlight_quirks.c+14 -50 replies
4/6drm: panel-backlight-quirks: Add brightness mask quirkdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h drivers/gpu/drm/drm_panel_backlight_quirks.c +1 more+49 -00 replies
5/6drm: panel-backlight-quirks: Add Steam Deck brightness quirkdrivers/gpu/drm/drm_panel_backlight_quirks.c+15 -00 replies
6/6drm: panel-backlight-quirks: Log applied panel brightness quirksdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+13 -34 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchPhilip MüllerMario LimoncielloRobert BeckettAlex Deucher
1/6T-b R-b
2/6T-b R-b
3/6T-b R-b
4/6T-b R-b
5/6R-b R-b
6/6R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/6] drm: panel-backlight-quirks: Do partial refactor and apply OLED fix

This is an alternative to [1], since Phil found out there are still invalid values. We need to reconsider the other patch in that series anyway because the latest AMD firmware update might have fixed the Z13.

This series refactors the panel-backlight-quirks code to make it easier to add new quirks. Specifically, it adds the ability to bind to a secondary DMI match so that the make of a device can be specified. Then, it makes EDID optional, for devices we know the value should be applied universally.

This is then used to add a quirk for OLED panels that have an issue when their backlight is set with a value that contains a 0/1 value in their minor byte. This issue affects four handhelds from three different vendors, three of which are in the field. This quirk applies a |3 mask to the backlight value, which avoids this issue. In addition, the value change is minor enough so that it is essentially a NOOP. There is no need for ensuring it runs only on panels with faulty firmwares.

Finally, since allowed by this refactor, a quirk for Steam Decks is added that lowers their minimum brightness to 0, matching SteamOS. This is a nicety commit, which allows for mildly lower minimum brightness, so there is no time sensitivity for having it merged. Mario noted that if that quirk was refactored to use an EDID match via the current interface, it could go through the fixes tree and land sooner, but perhaps it is not worth the effort.

[1] https://lore.kernel.org/all/[email protected]/

---
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/

Changes since V2:
- Apply SD quirks at the middle so that backlight quirks stay together
- Add log when quirks are applied. Has to be separate because we need to grab a reference to the drm_device first and add it to min brightness first.
- Capitalize OR in patch 4

Changes since v1:
- Remove leftover quirk from patch 3 (refactor)
- Add dangling comma in patch 4 (oled quirk)
- Add the next generation Zotac Zone in patch 4 (currently unreleased)
- Reword patch 1 and 5 subjects

Antheas Kapenekakis (6):
drm: panel-backlight-quirks: Make EDID match optional
drm: panel-backlight-quirks: Convert brightness quirk to generic
structure
drm: panel-backlight-quirks: Add secondary DMI match
drm: panel-backlight-quirks: Add brightness mask quirk
drm: panel-backlight-quirks: Add Steam Deck brightness quirk
drm: panel-backlight-quirks: Log applied panel brightness quirks

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  31 ++++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |   5 +
 drivers/gpu/drm/drm_panel_backlight_quirks.c  | 113 ++++++++++++++----
 include/drm/drm_utils.h                       |   8 +-
 4 files changed, 125 insertions(+), 32 deletions(-)

base-commit: 1b237f190eb3d36f52dffe07a40b5eb210280e00

Signature · 1 line
2.51.0