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: writeback: Refactor drm_writeback_connector structure
Date: Mon, 25 May 2026 20:57:35 +1000	[thread overview]
Message-ID: <review-patch1-20260521053708.1475129-2-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20260521053708.1475129-2-suraj.kandpal@intel.com>

Patch Review

This is the core patch. The structural change is sound: `drm_writeback_connector` loses its `struct drm_connector base` member and instead gets embedded inside `struct drm_connector` in a union with `hdmi`. The helper `drm_connector_to_writeback()` is replaced with the inverse `drm_writeback_to_connector()` using `container_of`.

**Issues:**

1. **Typo in doc comment** — the `@writeback` kdoc says "valriables" instead of "variables":
   ```c
   /**
    * @writeback: Writeback related valriables.
    */
   struct drm_writeback_connector writeback;
   ```

2. **`drm_writeback_to_connector()` is only safe if the writeback is actually embedded in a `drm_connector`** — the `container_of` relies on the `writeback` field being part of `drm_connector`. This is now always true by construction, but there's no runtime assertion. The existing `WARN_ON` in `drm_writeback_get_out_fence` checking `connector_type` is good defensive practice; consider whether `drm_writeback_to_connector()` itself should have a similar check.

3. **Inconsistency in `dm_set_writeback`** — the amdgpu code changes `drm_connector_to_writeback(connector)` to a direct `&connector->writeback` access:
   ```c
   -	struct drm_writeback_connector *wb_conn = drm_connector_to_writeback(connector);
   +	struct drm_writeback_connector *wb_conn = &connector->writeback;
   ```
   This is fine functionally, but inconsistent with other places in the same patch that use the new `drm_writeback_to_connector()` helper. Since the helper now goes the other direction (wb -> connector), this is correct but could use `&connector->writeback` consistently throughout.

4. **malidp_hw.c changes** — This file is modified in patch 1 (changing `drm_writeback_signal_completion` calls from `&malidp->mw_connector` to `&malidp->mw_connector.writeback`) and then again in patch 4 (changing them back from `.writeback` to taking the connector directly). This creates a transient churn. Consider squashing or reordering to avoid changing these lines twice.

5. **vkms_writeback.c `vkms_wb_cleanup_job`** — Uses a raw `container_of` instead of `drm_writeback_to_connector()`:
   ```c
   struct drm_connector *connector = container_of(wb_conn,
                                                   struct drm_connector,
                                                   writeback);
   ```
   This is functionally identical to `drm_writeback_to_connector()` but inconsistent. Since patch 7 removes this entirely, it's a transient issue but still worth noting for bisectability.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-25 10:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  5:37 [PATCH v4 0/7] Refactor drm_writeback_connector structure Suraj Kandpal
2026-05-21  5:37 ` [PATCH v4 1/7] drm: writeback: " Suraj Kandpal
2026-05-21 23:28   ` John Harrison
2026-05-25 10:57   ` Claude Code Review Bot [this message]
2026-05-21  5:37 ` [PATCH v4 2/7] drm: writeback: Modify writeback init helpers Suraj Kandpal
2026-05-21 23:30   ` John Harrison
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21  5:37 ` [PATCH v4 3/7] drm: writeback: Modify drm_writeback_queue_job helper Suraj Kandpal
2026-05-21 23:31   ` John Harrison
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21  5:37 ` [PATCH v4 4/7] drm: writeback: Modify drm_writeback_signal_completion helper Suraj Kandpal
2026-05-21 23:31   ` John Harrison
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21  5:37 ` [PATCH v4 5/7] drm: writeback: Modify drm_writeback_get_out_fence helper Suraj Kandpal
2026-05-21 23:35   ` John Harrison
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21  5:37 ` [PATCH v4 6/7] drm: writeback: Modify prepare_writeback_job helper Suraj Kandpal
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21  5:37 ` [PATCH v4 7/7] drm: writeback: Modify cleanup_writeback_job helper Suraj Kandpal
2026-05-25 10:57   ` Claude review: " Claude Code Review Bot
2026-05-21 18:56 ` [PATCH v4 0/7] Refactor drm_writeback_connector structure John Harrison
2026-05-22  4:21   ` Kandpal, Suraj
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-22  5:03 [PATCH v5 0/7] " Suraj Kandpal
2026-05-22  5:03 ` [PATCH v5 1/7] drm: writeback: " Suraj Kandpal
2026-05-25  9:19   ` Claude review: " 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-20260521053708.1475129-2-suraj.kandpal@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