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: ite-it66121: Set TX mode in the .atomic_enable callback
Date: Sat, 16 May 2026 13:19:45 +1000	[thread overview]
Message-ID: <review-patch1-20260512132232.333654-2-javierm@redhat.com> (raw)
In-Reply-To: <20260512132232.333654-2-javierm@redhat.com>

Patch Review

**Issue: Duplicate register writes not removed from `.mode_set`**

The patch adds a new `it66121_set_tx_mode()` called from `it66121_bridge_enable()`, but the existing code in `it66121_bridge_mode_set()` still writes the same registers:

```c
/* Enable AVI infoframe */
if (regmap_write(ctx->regmap, IT66121_AVI_INFO_PKT_REG,
		 IT66121_AVI_INFO_PKT_ON | IT66121_AVI_INFO_PKT_RPT))
	goto unlock;

/* Set TX mode to HDMI */
if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HDMI))
	goto unlock;
```

These lines at the current tree's lines 796-803 are not removed. The diffstat shows `1 file changed, 18 insertions(+)` with zero deletions, confirming the old code remains. The commit message says "it is more correct to do this in .atomic_enable" but doesn't explain why the old writes are kept. These should be removed from `.mode_set` to avoid writing the same registers twice per mode change, and to avoid confusion about which callback is the authoritative one.

**Minor: Error handling style**

```c
if (regmap_write(ctx->regmap, IT66121_AVI_INFO_PKT_REG,
		 IT66121_AVI_INFO_PKT_ON | IT66121_AVI_INFO_PKT_RPT))
	goto unlock;

regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HDMI);
```

The first `regmap_write` checks for errors and jumps to `unlock`, but the second `regmap_write` result is silently discarded. This is inconsistent — either both should check for errors or neither should (the existing `.mode_set` code checks both). This is a minor nit since the function returns void and there's nothing to do on error except release the lock, but consistency is preferred.

**Ordering observation**: The call to `it66121_set_tx_mode()` is placed *after* `it66121_set_mute(ctx, false)` in `.atomic_enable`. This means the display is unmuted before the TX mode is configured. On a DVI monitor receiving HDMI-mode infoframes during this window, there could be a brief glitch. Consider placing `it66121_set_tx_mode()` before the unmute. This ordering also matters because in the existing `.mode_set`, the TX mode/infoframe setup is done *before* the AFE configuration and *before* unmute — moving it after unmute changes the sequencing.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-16  3:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 13:22 [PATCH v3 0/2] drm/bridge: it66121: Fix display output on DVI monitors Javier Martinez Canillas
2026-05-12 13:22 ` [PATCH v3 1/2] drm/bridge: ite-it66121: Set TX mode in the .atomic_enable callback Javier Martinez Canillas
2026-05-12 14:07   ` Maxime Ripard
2026-05-12 18:54     ` Javier Martinez Canillas
2026-05-13 11:55       ` Maxime Ripard
2026-05-13 12:38         ` Javier Martinez Canillas
2026-05-16  3:19   ` Claude Code Review Bot [this message]
2026-05-12 13:22 ` [PATCH v3 2/2] drm/bridge: ite-it66121: Select HDMI or DVI mode based on sink type Javier Martinez Canillas
2026-05-16  3:19   ` Claude review: " Claude Code Review Bot
2026-05-16  3:19 ` Claude review: drm/bridge: it66121: Fix display output on DVI monitors 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-20260512132232.333654-2-javierm@redhat.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