All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Amit Barzilai" <amit.barzilai22@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init
Date: Wed, 29 Jul 2026 05:41:45 +0000	[thread overview]
Message-ID: <20260729054146.23C271F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260729053054.29374-2-amit.barzilai22@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The generic backlight update function corrupts the white balance on ssd133x panels by only updating contrast channel A.
--

--- Patch [1]: [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init ---
commit 2b92cd2c08daa2f9c52218a1668057ae50f9c448
Author: Amit Barzilai <amit.barzilai22@gmail.com>

drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init
    
This patch extracts the SSD133X A/B/C channel contrast calibration into
ssd133x_set_contrast() which scales each channel by the requested 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.

[Severity: High]
This isn't a bug introduced by this patch, but does the generic backlight
update function corrupt the white balance on ssd133x panels by only updating
contrast channel A?

The commit message notes this is a prerequisite for a proper ssd133x backlight
controller, but currently ssd130x_probe() unconditionally registers the
generic backlight controller for all devices:

drivers/gpu/drm/solomon/ssd130x.c:ssd130x_probe() {
	...
	bl = devm_backlight_device_register(dev, dev_name(dev), dev, ssd130x,
					    &ssd130xfb_bl_ops, NULL);
	...
}

When the backlight is enabled or updated via sysfs, ssd130x_update_bl()
blindly writes the unscaled brightness to 0x81 (SSD13XX_CONTRAST). On ssd133x
panels, this maps to SSD133X_CONTRAST_A (Red):

drivers/gpu/drm/solomon/ssd130x.c:ssd130x_update_bl() {
	...
	ret = ssd130x_write_cmd(ssd130x, 1, SSD13XX_CONTRAST);
	if (ret < 0)
		return ret;

	ret = ssd130x_write_cmd(ssd130x, 1, ssd130x->contrast);
	...
}

This leaves channels B and C untouched at their initialization values,
destroying the white balance.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260729053054.29374-1-amit.barzilai22@gmail.com?part=1

  reply	other threads:[~2026-07-29  5:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  5:30 [PATCH 0/2] drm/ssd130x: Wire up ssd133x backlight/dimming Amit Barzilai
2026-07-29  5:30 ` [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init Amit Barzilai
2026-07-29  5:41   ` sashiko-bot [this message]
2026-07-29  5:30 ` [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic Amit Barzilai
2026-07-29  5:40   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729054146.23C271F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amit.barzilai22@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.