From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks
Date: Wed, 11 Mar 2026 13:48:35 +1000 [thread overview]
Message-ID: <review-patch3-20260310032012.2542334-4-wenst@chromium.org> (raw)
In-Reply-To: <20260310032012.2542334-4-wenst@chromium.org>
Patch Review
This is the big payoff: replaces the loop setting `private->all_drm_private[i]->dma_dev` and drops `mtk_gem.c` / `mtk_gem.h` entirely.
```c
- for (i = 0; i < private->data->mmsys_dev_num; i++)
- private->all_drm_private[i]->dma_dev = dma_dev;
+ drm_dev_set_dma_dev(drm, dma_dev);
```
One observation: the old code set `.dma_dev` on **all** `mmsys_dev_num` drm_private instances, while the new code only calls `drm_dev_set_dma_dev()` on the single `drm` device. For multi-MMSYS configurations (e.g., MT8195 which has 2 MMSYS blocks), are there multiple `drm_device` instances that need the DMA device set? Looking at the code, all the `all_drm_private[i]` share the same `drm` device (they're all private data for sub-components bound to the same master), and `dma_dev` is stored in the private struct, not in `drm_device`. The new code sets it on `drm->dma_dev` which is the single DRM device, so this should be fine -- all paths now go through `drm_dev_dma_dev(drm)` which reads the single `drm->dma_dev` field. But it's worth confirming that none of the old `private->dma_dev` references remain elsewhere in the mediatek driver code beyond what's being removed.
The replacement of custom driver ops with `DRM_GEM_DMA_DRIVER_OPS` is clean:
```c
- .dumb_create = mtk_gem_dumb_create,
+ DRM_GEM_DMA_DRIVER_OPS,
...
- .gem_prime_import = mtk_gem_prime_import,
- .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table,
```
The commit message correctly notes the VM_DONTDUMP and VM_IO flag difference in the mmap path. The GEM DMA helpers don't set these because `dma_mmap_wc()` handles the mapping directly and the backing pages come from DMA-coherent allocations, making VM_IO inappropriate as the author notes.
**Minor**: No remaining references to `mtk_gem.h` in other mediatek files besides `mtk_crtc.c` (which is cleaned up)? The patch looks complete.
**Reviewed-by worthy**: Yes, with confirmation that multi-MMSYS setups work correctly with only one `drm_dev_set_dma_dev()` call.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-11 3:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 3:20 [PATCH 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-10 3:20 ` [PATCH 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
2026-03-11 3:48 ` Claude review: " Claude Code Review Bot
2026-03-10 3:20 ` [PATCH 2/4] drm/gem-dma: Support dedicated DMA device for allocation and mapping Chen-Yu Tsai
2026-03-11 3:48 ` Claude review: " Claude Code Review Bot
2026-03-10 3:20 ` [PATCH 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-11 3:48 ` Claude Code Review Bot [this message]
2026-03-10 3:20 ` [PATCH 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-11 3:48 ` Claude review: " Claude Code Review Bot
2026-03-11 3:48 ` Claude review: drm/gem-dma: Support dedicated DMA device for allocation Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-10 3:25 [PATCH RESEND 0/4] " Chen-Yu Tsai
2026-03-10 3:25 ` [PATCH RESEND 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-11 3:45 ` Claude review: " Claude Code Review Bot
2026-03-11 9:49 [PATCH v2 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-11 9:49 ` [PATCH v2 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-11 21:08 ` 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-patch3-20260310032012.2542334-4-wenst@chromium.org \
--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