public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/fourcc: document format naming scheme
Date: Tue, 28 Apr 2026 15:16:43 +1000	[thread overview]
Message-ID: <review-patch1-20260426151641.93763-1-contact@emersion.fr> (raw)
In-Reply-To: <20260426151641.93763-1-contact@emersion.fr>

Patch Review

**Typo (line 137 of the diff context):**

```
+ * - The first letter indicates the number of planes, channel alignment and
+ *   ordering. It is should not be a letter already used to denote a channel.
```

"It is should not be" → "It should not be"

---

**Cb/Cr digit reversal rule is backwards:**

```
+ * - The two other digits indicate bits for the Y channel. If the Cb channel
+ *   comes before Cr, the digits are reversed.
```

This is wrong when checked against Q410/Q401:
- `DRM_FORMAT_Q410` (`'Q','4','1','0'`) = YCbCr (Cb before Cr) — digits are "10" (normal/unreversed)
- `DRM_FORMAT_Q401` (`'Q','4','0','1'`) = YCrCb (Cr before Cb) — digits are "01" (reversed)

So Q410 with Cb-before-Cr has the **normal** digits, not reversed. The rule is inverted — it should read: "If the **Cr** channel comes before Cb, the digits are reversed."

---

**Sub-sampling digit scheme doesn't cover NV formats:**

```
+ * - The first digit indicates chroma sub-sampling: 0 for 2x2, 2 for 2x1, 4 for
+ *   none.
```

This accurately describes P-series (P010→0=2x2, P210→2=2x1) and Q-series (Q410→4=none) formats. However, the NV family — the most common multi-planar YUV formats — uses a completely different scheme where the two trailing digits encode **bits-per-pixel** (NV12=12bpp, NV16=16bpp, NV24=24bpp), not "subsampling digit + Y-channel bits". While the "for the most part" qualifier hedges this, it might be worth explicitly noting that older multi-planar families (NV, YUV/YVU) predate and don't follow this convention, to avoid confusion.

---

**P030 exception to "Y channel bits" claim:**

```
+ * - The two other digits indicate bits for the Y channel.
```

P030 has digits "30" but its Y channel is 10-bit (it's a packed 3×10-bit format). P010/P012/P016 all fit the rule correctly. P030 is arguably just a naming oddity but is a notable exception within the very format family (P-series) that the scheme is supposed to describe.

---

**Underscore plane delimiter claim lacks examples:**

```
+ * An underscore "_" can be used to delimit planes.
```

I couldn't find any existing format in `drm_fourcc.h` that uses an underscore to delimit planes. `YUV420_8BIT` and `YUV420_10BIT` have underscores, but those separate the format type from the bit depth, not planes. If this is forward-looking guidance, it might be clearer stated as such.

---

**Minor observation — channel list completeness:**

The channel definitions are good. "D" for darkness (inverse brightness) is a nice touch documenting the D1/D2/D4/D8 formats. The single-channel "R" formats (R1, R2, R4, R8, R10, R12, R16) are covered by listing "R" as red.

---

**Overall**: The RGB naming scheme documentation is accurate and useful. The YUV section needs the Cb/Cr reversal rule fixed (it's currently stating the opposite of what the code shows) and the typo corrected. Consider acknowledging that NV-family formats use a different, older convention.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-04-28  5:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-26 15:16 [PATCH] drm/fourcc: document format naming scheme Simon Ser
2026-04-26 16:47 ` Laurent Pinchart
2026-04-26 16:59   ` Simon Ser
2026-04-28  5:16 ` Claude review: " Claude Code Review Bot
2026-04-28  5:16 ` 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-20260426151641.93763-1-contact@emersion.fr \
    --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