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/bridge: dw-hdmi: Replace calls to deprecated HDMI/audio detection functions
Date: Fri, 27 Feb 2026 13:44:34 +1000	[thread overview]
Message-ID: <review-patch1-20260225093051.12031-1-karanja99erick@gmail.com> (raw)
In-Reply-To: <20260225093051.12031-1-karanja99erick@gmail.com>

Patch Review

**Concept: Correct.** The existing code has a FIXME comment (lines 2485-2489 in the current tree) that explicitly asks for this exact change. Removing the deprecated `drm_detect_hdmi_monitor()` and `drm_detect_monitor_audio()` in favor of `connector->display_info.is_hdmi` / `.has_audio` is the right direction.

**Problem 1: Duplicate `drm_edid_connector_update()` in the connector path.**

The patch adds `drm_edid_connector_update(connector, drm_edid)` inside `dw_hdmi_edid_read()`. But `dw_hdmi_edid_read()` has **two callers**:

1. `dw_hdmi_connector_get_modes()` (line 2520) — which **already calls** `drm_edid_connector_update()` at line 2522:
   ```c
   drm_edid = dw_hdmi_edid_read(hdmi, connector);
   drm_edid_connector_update(connector, drm_edid);  /* existing call */
   ```

2. `dw_hdmi_bridge_edid_read()` (line 3009) — which returns the EDID to the **bridge connector framework**, which then calls `drm_edid_connector_update()` itself in `drm_bridge_connector_get_modes_edid()` at `drm_bridge_connector.c:311`.

So with this patch, `drm_edid_connector_update()` will be called **twice** in both code paths — once inside `dw_hdmi_edid_read()` and once by the caller/framework. While calling it twice is not a crash-inducing bug, it's wasteful and indicates the wrong approach.

**The proper fix** should keep the `drm_edid_connector_update()` call where it already is (in the callers/framework) and just change the `dw_hdmi_edid_read()` function to read from `connector->display_info` **after** `dw_hdmi_edid_read()` returns and `drm_edid_connector_update()` has been called. This likely means moving the `sink_is_hdmi`/`sink_has_audio` assignment out of `dw_hdmi_edid_read()` and into each caller, after their respective `drm_edid_connector_update()` calls.

**Problem 2: Lost debug logging.**

The patch removes:
```c
dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",
        edid->width_cm, edid->height_cm);
```

This debug message is useful for driver developers and should be preserved. It can be rewritten to use `connector->display_info` fields (e.g., `connector->display_info.width_mm`) rather than raw EDID fields, or simply kept as-is using `drm_edid_raw()`.

**Problem 3: Ordering concern.**

Even ignoring the duplicate call, the patch places `drm_edid_connector_update()` *before* returning the `drm_edid` to the caller. In `dw_hdmi_connector_get_modes()`, the caller then calls it again. But more importantly, the bridge path (`dw_hdmi_bridge_edid_read`) just returns `drm_edid` and the framework calls `drm_edid_connector_update()` again. The intent of the FIXME was to read `display_info` **after** the normal update path has run, not to add an early extra call.

**Suggested approach:** Instead of adding `drm_edid_connector_update()` inside `dw_hdmi_edid_read()`, refactor so that `sink_is_hdmi` and `sink_has_audio` are set in each caller *after* `drm_edid_connector_update()` has been called:

```c
/* In dw_hdmi_connector_get_modes(): */
drm_edid = dw_hdmi_edid_read(hdmi, connector);
drm_edid_connector_update(connector, drm_edid);   /* already exists */
hdmi->sink_is_hdmi = connector->display_info.is_hdmi;
hdmi->sink_has_audio = connector->display_info.has_audio;
```

And similarly handle the bridge path (which is trickier since the framework makes the call, so you may need to set these fields in the bridge `atomic_enable` or `mode_set` callback where `display_info` is already populated).

**Minor:** The commit message and subject are clear and well-written. The `RFT` (Request For Testing) tag is appropriate given this is untested.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-02-27  3:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  9:30 [PATCH RFT] drm/bridge: dw-hdmi: Replace calls to deprecated HDMI/audio detection functions Erick Karanja
2026-02-25 10:11 ` Maxime Ripard
2026-02-25 18:40   ` Erick Karanja
2026-02-27  3:44 ` Claude Code Review Bot [this message]
2026-02-27  3:44 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-02-26 12:06 [PATCH v2] " Erick Karanja
2026-02-27  2:14 ` Claude review: " Claude Code Review Bot
2026-02-27  2:14 ` 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-20260225093051.12031-1-karanja99erick@gmail.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