From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260514065606.1151834-3-chen-yu.chen@amd.com> References: <20260514065606.1151834-1-chen-yu.chen@amd.com> <20260514065606.1151834-3-chen-yu.chen@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Placement of the DID2 fallback =E2=80=94 correct.** The new check is inserted after VSDB + DPCD and before the Samsung heuristi= c, which matches the priority the TODO comment described: ```c /* If VSDB and DPCD didn't determine panel type, check DID */ if (link->panel_type =3D=3D PANEL_TYPE_NONE) { if (display_info->did_panel_type =3D=3D DRM_MODE_PANEL_TYPE_LCD) link->panel_type =3D PANEL_TYPE_LCD; else if (display_info->did_panel_type =3D=3D DRM_MODE_PANEL_TYPE_OLED) link->panel_type =3D PANEL_TYPE_OLED; } ``` This correctly gates on `PANEL_TYPE_NONE`, so higher-priority detection (VS= DB, 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 pa= tch) is: ```c if (link->panel_type =3D=3D 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 f= rom `dc_types.h`). This falls into the `else` branch, and the userspace-vis= ible property is set to `DRM_MODE_PANEL_TYPE_UNKNOWN`. The LCD detection wo= rks internally within the driver but is invisible to userspace. This should be updated to also handle `PANEL_TYPE_LCD`: ```c if (link->panel_type =3D=3D PANEL_TYPE_OLED) ...DRM_MODE_PANEL_TYPE_OLED; else if (link->panel_type =3D=3D 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 =3D=3D DRM_MODE_PANEL_TYPE_LCD) link->panel_type =3D PANEL_TYPE_LCD; ``` This compares a `DRM_MODE_PANEL_TYPE_*` (UAPI) value against the same names= pace 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 cons= tants. 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, th= is breaks silently. **Overall:** The fallback logic is correct and well-placed. The missing pro= perty-setting update for LCD is the main issue that should be fixed before = merging. --- Generated by Claude Code Patch Reviewer