diff options
| author | Amit Barzilai <amit.barzilai22@gmail.com> | 2026-07-29 08:30:53 +0300 |
|---|---|---|
| committer | Javier Martinez Canillas <javierm@redhat.com> | 2026-08-06 14:55:55 +0200 |
| commit | a16d5be8ea2ad36aa95373095fd635b3c5f84be4 (patch) | |
| tree | 851bc7adc22f838ee61d15c752f244487b463f13 /tools/perf/scripts/python | |
| parent | 2b209e52a5b40b93ce3803fe1cc9ddbe859ccb5d (diff) | |
drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init
ssd133x_init() wrote the SSD133X_CONTRAST_A/B/C commands with magic hex
values (0x91/0x50/0x7d). These are a per-channel white-balance
calibration: the A/B/C channels drive sub-pixels whose OLED materials
differ in luminous efficiency, so the values set the white point at full
brightness.
Extract them into ssd133x_set_contrast(), which scales each channel by a
requested brightness via ssd130x_scale_contrast(), instead of writing the
calibration unconditionally. This makes the sequence readable, avoids
repetition, and is a prerequisite for wiring up an ssd133x backlight
controller that dims while preserving the white point.
Note this changes the ssd133x power-on brightness. Previously the init
wrote the calibration unscaled and ignored ssd130x->contrast, so the
panel always booted at full brightness. It now scales by the shared
default contrast of 127, i.e. half of MAX_CONTRAST (255). This is
intentional and matches ssd130x, whose contrast register also defaults
to 127 (mid-scale), so all families now power on at ~50% and report
props.brightness = 127 / max_brightness = 255 to userspace.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Amit Barzilai <amit.barzilai22@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patch.msgid.link/20260729053054.29374-2-amit.barzilai22@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
