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/hisilicon/hibmc: use clock to look up the PLL value
Date: Fri, 13 Mar 2026 14:23:19 +1000	[thread overview]
Message-ID: <review-patch4-20260312074202.1491504-5-shiyongbang@huawei.com> (raw)
In-Reply-To: <20260312074202.1491504-5-shiyongbang@huawei.com>

Patch Review

**1. Unused `CLOCK_TOLERANCE` define:** The patch adds `#define CLOCK_TOLERANCE 100` but never uses it. The tolerance check in `hibmc_get_best_clock_idx()` uses `mode->clock / 100` (1% tolerance) instead. The `CLOCK_TOLERANCE` define should either be removed or actually used.

**2. Tolerance logic for low clocks:** The expression `diff < mode->clock / 100` uses integer division. For the 25000 kHz entry, the tolerance is 250 kHz which is fine. But if a mode somehow had a very low clock, the tolerance could round to 0 due to integer division, making the match impossible. Not a practical problem given the table entries, but `<= 0` should be guarded (e.g., `mode->clock / 100` should be at least 1). 

**3. `get_pll_config` now takes non-const mode pointer:**
```c
-static void get_pll_config(u64 x, u64 y, u32 *pll1, u32 *pll2)
+static void get_pll_config(struct drm_display_mode *mode, u32 *pll1, u32 *pll2)
```
The `mode` parameter should be `const struct drm_display_mode *mode` since it's not modified. The `hibmc_get_best_clock_idx` already takes a `const` pointer, so this is just a missed annotation on `get_pll_config`.

**4. Good refactoring:** Consolidating the table lookup into `hibmc_get_best_clock_idx()` and reusing it in both `hibmc_crtc_mode_valid()` and `get_pll_config()` is a nice cleanup that eliminates code duplication.

**5. `hibmc_dislay_pll_config` typo:** The struct name `hibmc_dislay_pll_config` has a typo — it should be `hibmc_display_pll_config`. This is pre-existing and not introduced by this patch, but could be cleaned up while touching this code.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-13  4:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12  7:41 [PATCH RESEND drm-dp 0/4] Fix some bugs in the hibmc driver Yongbang Shi
2026-03-12  7:41 ` [PATCH RESEND drm-dp 1/4] drm/hisilicon/hibmc: add updating link cap in DP detect() Yongbang Shi
2026-03-13  4:23   ` Claude review: " Claude Code Review Bot
2026-03-12  7:42 ` [PATCH RESEND drm-dp 2/4] drm/hisilicon/hibmc: fix no showing when no connectors connected Yongbang Shi
2026-03-13  4:23   ` Claude review: " Claude Code Review Bot
2026-03-12  7:42 ` [PATCH RESEND drm-dp 3/4] drm/hisilicon/hibmc: move display contrl config to hibmc_probe() Yongbang Shi
2026-03-13  4:23   ` Claude review: " Claude Code Review Bot
2026-03-12  7:42 ` [PATCH RESEND drm-dp 4/4] drm/hisilicon/hibmc: use clock to look up the PLL value Yongbang Shi
2026-03-13  4:23   ` Claude Code Review Bot [this message]
2026-03-13  4:23 ` Claude review: Fix some bugs in the hibmc driver 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-patch4-20260312074202.1491504-5-shiyongbang@huawei.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