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: The Apple iMac11, 1 (late 2009) has an integrated ATI Mobility Radeon HD 4850. This machine suffers from a similar problem as the iMac10, 1 (late 2009) and the iMac11, 2 (mid 2010). This small patch fixes the issue on this machine.
Date: Sat, 16 May 2026 15:26:37 +1000	[thread overview]
Message-ID: <review-patch1-20260510185426.4264-1-gilles.risch@gmail.com> (raw)
In-Reply-To: <20260510185426.4264-1-gilles.risch@gmail.com>

Patch Review

**Commit message formatting issues:**

- The subject line contains the entire commit description, which is against kernel patch conventions. It should be a short imperative line like `drm/radeon: Fix display on iMac11,1 with HD 4850` with details in the body.
- **Missing `Signed-off-by:` line** — required by the kernel's Developer Certificate of Origin policy. The patch cannot be accepted without it.
- The `Fixes:` tag format is wrong. It references a freedesktop.org xf86-video-ati issue, not a kernel commit. If a kernel commit introduced the regression, that commit hash should be cited with the standard `Fixes: <hash> ("subject")` format.

**Incorrect macro definition — the central problem:**

```c
#define ASIC_IS_DCE31(rdev) ((rdev->family >= CHIP_RV770))
#define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730))
```

From `radeon_family.h`, the enum ordering is:
```
CHIP_RS780  = 72  (DCE 3.1)
CHIP_RS880  = 73  (DCE 3.1)
CHIP_RV770  = 74  (DCE 3.2)
CHIP_RV730  = 75  (DCE 3.2)
```

The new `ASIC_IS_DCE31` defined as `>= CHIP_RV770` does **not** match any actual DCE 3.1 hardware (RS780, RS880). It only matches DCE 3.2 hardware — it is effectively a corrected version of `ASIC_IS_DCE32`. The naming is misleading and will confuse future maintainers.

The real bug is that `ASIC_IS_DCE32` itself is wrong: it should be `>= CHIP_RV770` instead of `>= CHIP_RV730`, since RV770 is DCE 3.2 hardware. The correct fix is to fix `ASIC_IS_DCE32` directly, not introduce a new macro with a confusing name. This would also fix the other ~7 callsites in `r600.c` and `radeon_audio.c` that currently exclude RV770 from DCE 3.2 logic.

**PLL changes are broader than necessary:**

```c
if (ASIC_IS_DCE31(rdev) && mode->clock > 200000)	/* range limits??? */
    radeon_crtc->pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
```

and:

```c
if (ASIC_IS_DCE31(rdev) && mode->clock > 165000)
    radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
```

These changes affect **all** RV770 systems, not just Apple iMac11,1. Since RV770 genuinely is DCE 3.2 hardware, these PLL flags arguably should apply to it — but this represents a behavior change for all RV770 users and should be explicitly acknowledged and tested. It's worth noting that line 588 already uses `rdev->family < CHIP_RV770` as a boundary, suggesting the code already knows RV770 belongs with the newer chips.

**Encoder selection change is correctly scoped:**

```c
if (ASIC_IS_DCE31(rdev)) {
    if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1") ||
        dmi_match(DMI_PRODUCT_NAME, "iMac11,1") ||
        dmi_match(DMI_PRODUCT_NAME, "iMac11,2"))
        enc_idx = (dig->linkb) ? 1 : 0;
```

This part is fine — the DMI matching gates the Apple-specific quirk so only the listed machines are affected. Adding `iMac11,1` here is the right thing to do. The comment update is also appropriate.

**Recommended approach for a v2:**

1. Fix `ASIC_IS_DCE32` to be `>= CHIP_RV770` instead of creating a new `ASIC_IS_DCE31` macro. This fixes the root cause (RV770 being wrongly excluded from DCE 3.2) and cleans up all callsites at once.
2. Add the `iMac11,1` DMI match in `atombios_encoders.c` — this is unambiguously correct.
3. Use a proper short subject line: `drm/radeon: Fix display on Apple iMac11,1 (HD 4850/RV770)`.
4. Add `Signed-off-by:`.
5. Write a proper commit message explaining that `ASIC_IS_DCE32` incorrectly excluded RV770 due to the enum ordering.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-16  5:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 18:54 [PATCH] The Apple iMac11, 1 (late 2009) has an integrated ATI Mobility Radeon HD 4850. This machine suffers from a similar problem as the iMac10, 1 (late 2009) and the iMac11, 2 (mid 2010). This small patch fixes the issue on this machine Gilles Risch
2026-05-16  5:26 ` Claude review: " Claude Code Review Bot
2026-05-16  5:26 ` Claude Code Review Bot [this message]
2026-05-16  9:24 ` [PATCH v2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Gilles Risch
2026-05-16 18:09   ` Lukas Wunner
2026-05-17 13:53     ` Gilles Risch
2026-05-17 14:05       ` Lukas Wunner
2026-05-18  6:36     ` Claude review: " Claude Code Review Bot
2026-05-16 18:52   ` [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
2026-05-17  3:28     ` kernel test robot
2026-05-17  5:12     ` kernel test robot
2026-05-18  6:57   ` Claude review: drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-10 19:05 [PATCH] The Apple iMac11, 1 (late 2009) has an integrated ATI Mobility Radeon HD 4850. This machine suffers from a similar problem as the iMac10, 1 (late 2009) and the iMac11, 2 (mid 2010). This small patch fixes the issue on this machine Gilles Risch
2026-05-16  5:30 ` Claude review: " Claude Code Review Bot
2026-05-16  5:30 ` 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-20260510185426.4264-1-gilles.risch@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