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/nouveau/kms/nvd9-: Use contiguous memory for CRC notifier context
Date: Tue, 05 May 2026 09:05:55 +1000	[thread overview]
Message-ID: <review-patch1-20260501215856.840898-1-lyude@redhat.com> (raw)
In-Reply-To: <20260501215856.840898-1-lyude@redhat.com>

Patch Review

**Correctness of the core fix:**

The old code called `nvif_mem_ctor_map()` which internally passes `NULL, 0` for the argv/argc parameters to `nvif_mem_ctor()`:

```c
// nvif/mem.c:31-32 (old path)
int ret = nvif_mem_ctor(mmu, name, mmu->mem, NVIF_MEM_MAPPABLE | type,
                        0, size, NULL, 0, mem);
```

The new code replaces this with a direct `nvif_mem_ctor()` call that passes a `gf100_mem_v0` struct with `.contig = true`:

```c
ret = nvif_mem_ctor(mmu, "kmsCrcNtfy", mmu->mem, NVIF_MEM_VRAM | NVIF_MEM_MAPPABLE, 0, len,
                    &(struct gf100_mem_v0) {
                            .contig = true,
                    }, sizeof(struct gf100_mem_v0), &ctx->mem);
```

This is correct. The compound literal zero-initializes `.version` to 0, matching the `v0` convention. The `gf100_mem_v0` data gets copied into `args->data[]` inside `nvif_mem_ctor_type()` (mem.c:70) and forwarded to the firmware/kernel memory handler, which will honor the contiguous flag.

The flags `NVIF_MEM_VRAM | NVIF_MEM_MAPPABLE` match exactly what `nvif_mem_ctor_map()` was computing internally (`NVIF_MEM_MAPPABLE | type` where `type` was `NVIF_MEM_VRAM`).

**Error handling:**

The separate `nvif_object_map()` call after `nvif_mem_ctor()` correctly jumps to `fail_fini` on failure, which calls `nvif_mem_dtor()` to clean up the allocation. This mirrors the cleanup that `nvif_mem_ctor_map()` did internally (mem.c:36).

**Minor style observation (non-blocking):**

The patch adds `struct drm_device *dev` as a new parameter to `nv50_crc_ctx_init()`, but `dev` is already reachable via the existing `head` parameter as `head->base.base.dev`. The parameter is only used once to replace that chain:

```c
-	struct nv50_core *core = nv50_disp(head->base.base.dev)->core;
+	struct nv50_core *core = nv50_disp(dev)->core;
```

For a stable-targeted bug fix, keeping the change minimal by not adding the parameter would be slightly preferable — just use `head->base.base.dev` as before. That said, it's a trivial cleanup and not worth a respin.

**Reviewed-by worthy:** Yes. The fix is well-motivated, correct, and appropriately scoped.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-04 23:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 21:58 [PATCH] drm/nouveau/kms/nvd9-: Use contiguous memory for CRC notifier context Lyude Paul
2026-05-04  4:01 ` Dave Airlie
2026-05-04 23:05 ` Claude Code Review Bot [this message]
2026-05-04 23:05 ` 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-20260501215856.840898-1-lyude@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