Skip to content

Releases: Rayekkk/LeGo2BrightnessFix

Release list

1.0.1

Choose a tag to compare

@Rayekkk Rayekkk released this 28 Jul 21:18

Fixed

  • Brightness is put back when gamescope drops it. It forgets what the plugin wrote whenever it re-initialises, which it does across a suspend and a session restart, and the level stayed wrong until the slider was touched next.
  • The brightness half no longer drives an external display. The backlight it reads belongs to the built-in panel while the setting applies to whatever gamescope is showing, so docking set a monitor's brightness from a slider that had nothing to do with it.
  • Turning the plugin off puts the brightness back properly. A value the plugin had written itself could be mistaken for the one that was there beforehand, in which case "off" left the level exactly where "on" had put it.
  • Uninstalling restores the EDID handed to games even if the plugin was reloaded in between. The bytes to put back are now kept on disk rather than only in memory, so the file is no longer left trimmed with nothing maintaining it.
  • Restoring that EDID checks the file is the one that was patched, so docking cannot get this panel's data written over another display's.

Changed

  • The display gamescope is running on is found rather than assumed. Which X server it uses depends on how many it was told to start and what was already taken, so a fixed guess could silently do nothing on another setup.
  • A session that restarts or moves is looked for again, instead of reading as unreachable until the plugin is reloaded.
  • Both halves read everything they need in one query instead of two.

Internal

  • Backend tests up to 54 from 41, covering the new gate paths, the display search, and the EDID surviving a plugin reload.

Install

Download the zip, then in Decky: gear icon, Developer, Install Plugin from ZIP File.

1.0.0

Choose a tag to compare

@Rayekkk Rayekkk released this 26 Jul 20:20

Initial release.

Two display fixes for the Lenovo Legion Go 2 OLED under gamescope, both measured on the device rather than inferred from source.

The Steam brightness slider works again in HDR/PQ

The panel is driven over eDP AUX luminance control and ignores the backlight while in PQ, so Steam's writes to /sys/class/backlight/amdgpu_bl0 went nowhere — the slider moved and nothing happened.

The requested level is forwarded to gamescope's GAMESCOPE_SDR_ON_HDR_CONTENT_BRIGHTNESS instead. Both are expressed in nits, so the mapping is a plain divide by 1000 and Steam's own perceptual step spacing carries over untouched. There is no second slider to learn: the one you already use starts working.

It stands down whenever HDR content is on screen, where Steam already drives its own gain atoms, and whenever the panel is not in PQ, where the backlight works by itself.

Games read the panel's real HDR metadata

DXVK vendors libdisplay-info from March 2023, whose parse_ext() ignores errno and therefore discards an entire EDID when it meets a DisplayID 2.0 block it does not support. Games were handed DXVK's placeholders instead.

Measured with DXVK_HDR=1, so DXVK is in the same HDR10 colour space a game would be:

What a game is told Without the fix With the fix The panel's EDID
Peak luminance 1499.000 nits 1107.128 nits 1107.128
Full-frame luminance 799.000 nits 475.683 nits 475.683
Black level 0.0100 nits 0.0007 nits 0.0007
Red primary 0.6800, 0.3200 0.6836, 0.3154 0.6836, 0.3154
Green primary 0.2650, 0.6900 0.2402, 0.7139 0.2402, 0.7139
Blue primary 0.1500, 0.0600 0.1396, 0.0439 0.1396, 0.0439

Peak overstated by 35%, full-field by 68%, black level by 14x, and a gamut that is simply a different one. Cross-check: with the fix on, Marvel's Spider-Man Remastered reports 1107 nits in its own HDR calibration screen after a reset to defaults.

The proper fix belongs in DXVK. This is a stopgap for as long as that copy is stale.

Setup

The plugin installs the gamescope display script it needs and keeps any existing one alongside as .backup. Until that is done the panel shows only the setup button, and the background work stays off with it. Uninstalling puts the previous script back.

Cost

No polling. The backlight class raises sysfs_notify() on every level change, so the plugin blocks on that and the kernel wakes it exactly when the slider moves. One xprop call every two seconds is the only recurring work — about 0.1% of one core.

Install

Download the zip below, then in Decky: gear icon → Developer → Install Plugin from ZIP File.

Requires a Legion Go 2 with the Samsung AMS881KB01-0 panel for the brightness half; the EDID half works on any affected display.