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/panthor: Handle remap case for repeated mappings
Date: Sat, 14 Mar 2026 06:48:46 +1000	[thread overview]
Message-ID: <review-patch9-20260313150956.1618635-10-adrian.larumbe@collabora.com> (raw)
In-Reply-To: <20260313150956.1618635-10-adrian.larumbe@collabora.com>

Patch Review

The refactoring to extract `panthor_vm_map_range()` is clean. The remap paths now correctly pass through the repeat flag and range.

**Potential issue in prev remap path:**

```c
+		ret = panthor_vm_map_range(vm, op->remap.prev->flags & DRM_GPUVA_REPEAT,
+					   bo->base.sgt, op->remap.prev->va.addr, offset,
+					   size, op->remap.prev->gem.repeat_range,
+					   flags_to_prot(unmap_vma->flags));
```

The `addr` parameter passed is `op->remap.prev->va.addr`, but the `size` is calculated as `op->remap.prev->va.addr + op->remap.prev->va.range - unmap_start`. This `size` represents the portion of the prev region that overlaps with the unmap range (the part that needs remapping). But the mapping starts at `op->remap.prev->va.addr` (the original prev start), not at `unmap_start`. Looking at this more carefully: in the remap flow, the prev region represents the portion *before* the unmap that needs to be re-mapped after the full unmap. The `unmap_start` may have been adjusted by `unmap_hugepage_align`. The `size` here is the extra area that was unmapped beyond what was requested, which needs to be remapped. The address and offset calculations look correct in context.

However, for repeated mappings, `panthor_vm_map_range` is called with `repeat=true`, but the `offset` passed was calculated as `op->remap.prev->gem.offset + unmap_start - op->remap.prev->va.addr`. For a repeated mapping, this offset computation (which adds a VA-space delta to the GEM offset) may not be correct since repeat mappings don't advance the GEM offset linearly with VA. This needs careful verification that patch 6's GPUVM core already handles this (setting offset to the original offset for repeated regions in the remap prev/next operations). Looking back at patch 6, for repeated VAs, the gem.offset is kept the same (offset + 0), so by the time we reach this panthor code, `op->remap.prev->gem.offset` should already be the correct (unchanged) offset. This should be fine.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-13 20:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 15:09 [PATCH v5 00/11] Support repeated mappings in GPUVM and Panthor Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 01/11] drm/panthor: Expose GPU page sizes to UM Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 02/11] drm/gpuvm: Remove dead code Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 03/11] drm/gpuvm: Fix comment to reflect remap operation operand status Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 04/11] drm/gpuvm: Add a helper to check if two VA can be merged Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 05/11] drm/gpuvm: Add a flags field to drm_gpuva_op_map Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 06/11] drm/gpuvm: Add DRM_GPUVA_REPEAT flag and logic Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 07/11] drm/gpuvm: Ensure correctness of unmap/remaps of repeated regions Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 08/11] drm/panthor: Add support for repeated mappings Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 09/11] drm/panthor: Handle remap case " Adrián Larumbe
2026-03-13 20:48   ` Claude Code Review Bot [this message]
2026-03-13 15:09 ` [PATCH v5 10/11] drm/panthor: Pass vm_bind_op to vm_prepare_map_op_ctx Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 15:09 ` [PATCH v5 11/11] drm/panthor: Bump the driver version to 1.8 Adrián Larumbe
2026-03-13 20:48   ` Claude review: " Claude Code Review Bot
2026-03-13 20:48 ` Claude review: Support repeated mappings in GPUVM and Panthor 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-patch9-20260313150956.1618635-10-adrian.larumbe@collabora.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