From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/edid: parse panel type from DisplayID 2.x Display Parameters block
Date: Sat, 16 May 2026 11:17:30 +1000 [thread overview]
Message-ID: <review-patch1-20260514065606.1151834-2-chen-yu.chen@amd.com> (raw)
In-Reply-To: <20260514065606.1151834-2-chen-yu.chen@amd.com>
Patch Review
**Struct layout and minimum length check — looks correct.**
The `displayid_display_params_block` struct places `device_tech_byte` at payload offset 27 (absolute block offset 0x1E), matching the spec reference. The `DISPLAYID_DISPLAY_PARAMS_MIN_LEN` correctly computes 29 (the struct payload excluding the `displayid_block` header), ensuring `device_tech_byte` is accessible before it's read:
```c
if (block->num_bytes < DISPLAYID_DISPLAY_PARAMS_MIN_LEN) {
...
continue;
}
```
**Private field access in `displayid_iter`.**
The patch accesses `iter.section` directly:
```c
const u8 *section = NULL;
...
if (section != iter.section) {
...
section = iter.section;
}
```
The `displayid_iter` struct is annotated with `Do not access directly, this is private.` While `drm_edid.c` is core DRM code and uses the internal header, this still violates the stated API contract. Consider adding an accessor like `displayid_section()` alongside the existing `displayid_version()` and `displayid_primary_use()`. Alternatively, a boolean `displayid_is_v2_headmount()` helper that encapsulates the VR/AR check might be cleaner, so the section-tracking remains internal to the iterator implementation.
**Behavior change from removing the `break` — intentional but worth noting in the commit message.**
The old code:
```c
displayid_iter_for_each(block, &iter) {
// log + VR/AR check
break; // only first block of first section
}
```
The new code iterates **all blocks across all sections**. This is required to find the Display Parameters block, and the VR/AR detection is correctly refactored to fire once per section via the `section` pointer guard. However, the commit message doesn't mention this change in iteration scope. It would be helpful to note that the function now processes all DisplayID sections/blocks, not just the first.
**Minor: magic numbers in the switch.**
```c
case 1: /* LCD */
info->did_panel_type = DRM_MODE_PANEL_TYPE_LCD;
break;
case 2: /* OLED */
info->did_panel_type = DRM_MODE_PANEL_TYPE_OLED;
break;
```
These match the spec (Display Device Technology: 001b = LCD, 010b = OLED). The comments are sufficient, but named constants in the header (e.g. `DISPLAYID_DEVICE_TECH_LCD = 1`, `DISPLAYID_DEVICE_TECH_OLED = 2`) would be slightly more self-documenting and consistent with the kernel style for spec-derived values.
**Missing update to `drm_panel_type_enum_list`.**
The new `DRM_MODE_PANEL_TYPE_LCD` value is added to `drm_mode.h` but the enum registration in `drm_connector.c` is not updated:
```c
static const struct drm_prop_enum_list drm_panel_type_enum_list[] = {
{ DRM_MODE_PANEL_TYPE_UNKNOWN, "unknown" },
{ DRM_MODE_PANEL_TYPE_OLED, "OLED" },
// missing: { DRM_MODE_PANEL_TYPE_LCD, "LCD" },
};
```
Without this, `DRM_MODE_PANEL_TYPE_LCD` cannot actually be used as a property value. This should be part of this patch (since this is where the UAPI constant is introduced).
**Overall:** Structurally solid parsing code, but needs the enum list update and preferably an accessor for `iter.section`.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 1:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 6:54 [PATCH 0/2] drm: detect panel type from DisplayID 2.x Chenyu Chen
2026-05-14 6:54 ` [PATCH 1/2] drm/edid: parse panel type from DisplayID 2.x Display Parameters block Chenyu Chen
2026-05-15 8:23 ` Jani Nikula
2026-05-15 23:47 ` Leo Li
2026-05-16 1:17 ` Claude Code Review Bot [this message]
2026-05-14 6:54 ` [PATCH 2/2] drm/amd/display: use DisplayID panel type in dm_set_panel_type Chenyu Chen
2026-05-16 1:17 ` Claude review: " Claude Code Review Bot
2026-05-16 1:17 ` Claude review: drm: detect panel type from DisplayID 2.x Claude Code Review 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=review-patch1-20260514065606.1151834-2-chen-yu.chen@amd.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