From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/sitronix/st7586: fix bad pixel data due to byte swap
Date: Tue, 03 Mar 2026 14:04:23 +1000 [thread overview]
Message-ID: <review-patch1-20260228-drm-mipi-dbi-fix-st7586-byte-swap-v1-1-e78f6c24cd28@baylibre.com> (raw)
In-Reply-To: <20260228-drm-mipi-dbi-fix-st7586-byte-swap-v1-1-e78f6c24cd28@baylibre.com>
Patch Review
**Correctness: Good**
The fix correctly sets `dbi->write_memory_bpw = 8` immediately after `mipi_dbi_spi_init()`, which defaults `write_memory_bpw` to 16. This is the right value for the ST7586 since it uses 8-bit data (3 grayscale pixels packed per byte). The placement is correct:
1. `mipi_dbi_spi_init()` sets `write_memory_bpw = 16` (default)
2. **Patch adds** `dbi->write_memory_bpw = 8` — overrides before anything else uses the value
3. `mipi_dbi_dev_init_with_formats()` only overrides `write_memory_bpw` for `DRM_FORMAT_RGB888`, but st7586 uses `DRM_FORMAT_XRGB8888`, so no conflict
```c
+ /*
+ * Override value set by mipi_dbi_spi_init(). This driver is a bit
+ * non-standard, so best to set it explicitly here.
+ */
+ dbi->write_memory_bpw = 8;
```
**Removal of old workaround: Correct**
The old `swap_bytes = true` block is properly removed. The old comment explained that `swap_bytes` was being used not for actual byte swapping, but to trick `mipi_dbi_typec3_command()` into using 8-bit SPI transfers. That mechanism is now replaced by the direct `write_memory_bpw` control:
```c
- /*
- * we are using 8-bit data, so we are not actually swapping anything,
- * but setting mipi->swap_bytes makes mipi_dbi_typec3_command() do the
- * right thing and not use 16-bit transfers (which results in swapped
- * bytes on little-endian systems and causes out of order data to be
- * sent to the display).
- */
- dbi->swap_bytes = true;
```
**Minor style observation (not blocking):** The new comment is slightly generic — "a bit non-standard" doesn't explain *why* 8 bpw is needed. The old comment was more informative about the root cause (3 pixels per byte, 8-bit data). A one-liner like "ST7586 uses 8-bit data (3 pixels per byte)" would be more helpful to future readers. But this is a nit.
**Commit message: Good.** Clear explanation of the problem (every 3 columns swapped), root cause (default 16-bit transfers after refactoring), and fix. Proper `Fixes:` tag referencing the breaking commit.
**No other concerns.** The patch is minimal, focused, and correct.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-03 4:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 4:30 [PATCH] drm/sitronix/st7586: fix bad pixel data due to byte swap David Lechner
2026-03-02 7:46 ` Thomas Zimmermann
2026-03-03 4:04 ` Claude review: " Claude Code Review Bot
2026-03-03 4:04 ` Claude Code Review Bot [this message]
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=review-patch1-20260228-drm-mipi-dbi-fix-st7586-byte-swap-v1-1-e78f6c24cd28@baylibre.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox