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/i915/reset: Reorganize display reset code
Date: Sun, 12 Apr 2026 12:04:47 +1000	[thread overview]
Message-ID: <review-patch2-20260408233458.22666-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260408233458.22666-3-ville.syrjala@linux.intel.com>

Patch Review

This patch does two things: (1) extracts an `intel_display_reset_supported()` helper returning `HAS_DISPLAY(display)`, and (2) changes `intel_display_reset_prepare()` from returning `bool` to `void`, moving the `HAS_DISPLAY` guard into the caller (`intel_gt_reset_global`).

Looking at the caller in `intel_reset.c`, after this patch the `reset_display` flag is no longer conditionally updated by `intel_display_reset_prepare()`'s return value — it stays `true` once set, and `intel_display_reset_finish()` is always called when `reset_display` is true:

```c
if (reset_display)
    intel_display_reset_prepare(display,
                                display_reset_modeset_stuck,
                                gt);

intel_gt_reset(gt, engine_mask, reason);

if (reset_display)
    intel_display_reset_finish(display, !need_display_reset);
```

In the old code, if `intel_display_reset_prepare()` returned `false` (only happened when `!HAS_DISPLAY`), `reset_display` would be cleared and `intel_display_reset_finish()` wouldn't be called. Now with `HAS_DISPLAY` checked earlier via `intel_display_reset_supported()`, the `reset_display` flag correctly guards both prepare and finish.

However, `intel_display_reset_finish()` still has its own `if (!HAS_DISPLAY(display)) return;` guard in the current tree version, which this patch removes. That's fine because the caller already gates on `intel_display_reset_supported()`.

But there's a subtle behavioral change: previously when `intel_display_reset_prepare()` failed to duplicate state (returned `true` but set `modeset_state = NULL`), `intel_display_reset_finish()` would still be called and would drop locks. Now with `void` return type, the same thing happens — this is preserved correctly since the `if (!state) goto unlock;` path in `_finish` handles this.

**Looks correct.**

One minor nit: `intel_display_reset_test()` now also checks `HAS_DISPLAY(display)` redundantly — the caller already gates on `intel_display_reset_supported()`. Not a bug, just belt-and-suspenders.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-04-12  2:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 23:34 [PATCH 0/6] drm/i915/reset: Solve display vs. GPU reset deadlock, again Ville Syrjala
2026-04-08 23:34 ` [PATCH 1/6] dma-buf: Remove old lies about dma_fence_wait_any_timeout() not accepting some fences Ville Syrjala
2026-04-09  8:09   ` Jani Nikula
2026-04-09 10:39   ` Christian König
2026-04-12  2:04   ` Claude review: " Claude Code Review Bot
2026-04-08 23:34 ` [PATCH 2/6] drm/i915/reset: Reorganize display reset code Ville Syrjala
2026-04-09  8:13   ` Jani Nikula
2026-04-12  2:04   ` Claude Code Review Bot [this message]
2026-04-08 23:34 ` [PATCH 3/6] drm/i915/reset: Move pending_fb_pin handling to i915 Ville Syrjala
2026-04-09  8:17   ` Jani Nikula
2026-04-12  2:04   ` Claude review: " Claude Code Review Bot
2026-04-08 23:34 ` [PATCH 4/6] drm/xe/display: Add init_clock_gating.h stubs Ville Syrjala
2026-04-09  8:19   ` Jani Nikula
2026-04-12  2:04   ` Claude review: " Claude Code Review Bot
2026-04-08 23:34 ` [PATCH 5/6] drm/i915/reset: Handle the display vs. GPU reset deadlock using a custom dma-fence Ville Syrjala
2026-04-09 10:37   ` Jani Nikula
2026-04-09 10:46   ` Christian König
2026-04-09 11:19     ` Ville Syrjälä
2026-04-09 12:17       ` Christian König
2026-04-12  2:04   ` Claude review: " Claude Code Review Bot
2026-04-08 23:34 ` [PATCH 6/6] drm/i915/display: Make fence timeout infinite Ville Syrjala
2026-04-09 10:51   ` Jani Nikula
2026-04-12  2:04   ` Claude review: " Claude Code Review Bot
2026-04-12  2:04 ` Claude review: drm/i915/reset: Solve display vs. GPU reset deadlock, again 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-patch2-20260408233458.22666-3-ville.syrjala@linux.intel.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