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/amd/display: use DisplayID panel type in dm_set_panel_type
Date: Sat, 16 May 2026 11:17:30 +1000	[thread overview]
Message-ID: <review-patch2-20260514065606.1151834-3-chen-yu.chen@amd.com> (raw)
In-Reply-To: <20260514065606.1151834-3-chen-yu.chen@amd.com>

Patch Review

**Placement of the DID2 fallback — correct.**

The new check is inserted after VSDB + DPCD and before the Samsung heuristic, which matches the priority the TODO comment described:

```c
/* If VSDB and DPCD didn't determine panel type, check DID */
if (link->panel_type == PANEL_TYPE_NONE) {
    if (display_info->did_panel_type == DRM_MODE_PANEL_TYPE_LCD)
        link->panel_type = PANEL_TYPE_LCD;
    else if (display_info->did_panel_type == DRM_MODE_PANEL_TYPE_OLED)
        link->panel_type = PANEL_TYPE_OLED;
}
```

This correctly gates on `PANEL_TYPE_NONE`, so higher-priority detection (VSDB, DPCD) is not overridden.

**Bug: property-setting code not updated for LCD.**

The existing code at the end of `dm_set_panel_type()` (untouched by this patch) is:

```c
if (link->panel_type == PANEL_TYPE_OLED)
    drm_object_property_set_value(&connector->base,
        adev_to_drm(adev)->mode_config.panel_type_property,
        DRM_MODE_PANEL_TYPE_OLED);
else
    drm_object_property_set_value(&connector->base,
        adev_to_drm(adev)->mode_config.panel_type_property,
        DRM_MODE_PANEL_TYPE_UNKNOWN);
```

If DID2 detects LCD, `link->panel_type` becomes `PANEL_TYPE_LCD` (value 1 from `dc_types.h`). This falls into the `else` branch, and the userspace-visible property is set to `DRM_MODE_PANEL_TYPE_UNKNOWN`. The LCD detection works internally within the driver but is invisible to userspace.

This should be updated to also handle `PANEL_TYPE_LCD`:

```c
if (link->panel_type == PANEL_TYPE_OLED)
    ...DRM_MODE_PANEL_TYPE_OLED;
else if (link->panel_type == PANEL_TYPE_LCD)
    ...DRM_MODE_PANEL_TYPE_LCD;
else
    ...DRM_MODE_PANEL_TYPE_UNKNOWN;
```

**Style nit: mixing UAPI and internal constants in the comparison.**

```c
if (display_info->did_panel_type == DRM_MODE_PANEL_TYPE_LCD)
    link->panel_type = PANEL_TYPE_LCD;
```

This compares a `DRM_MODE_PANEL_TYPE_*` (UAPI) value against the same namespace and assigns a `PANEL_TYPE_*` (DC internal) value. It works because the values happen to map correctly, but it couples the driver to the UAPI constants. The `did_panel_type` field in `drm_display_info` uses UAPI constants by design (it's DRM core), so this cross-namespace mapping is unavoidable here. Just be aware that if either namespace is reordered independently, this breaks silently.

**Overall:** The fallback logic is correct and well-placed. The missing property-setting update for LCD is the main issue that should be fixed before merging.

---
Generated by Claude Code Patch Reviewer

  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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch2-20260514065606.1151834-3-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