From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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:45:58 +1000 Message-ID: In-Reply-To: <20260310032511.2545500-4-wenst@chromium.org> References: <20260310032511.2545500-1-wenst@chromium.org> <20260310032511.2545500-4-wenst@chromium.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the main payoff patch, deleting the entire `mtk_gem.c` (231 lines) and `mtk_gem.h` (17 lines) files. The key changes: 1. Replaces the per-private-data `dma_dev` loop with a single `drm_dev_set_dma_dev(drm, dma_dev)` call: ```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); ``` 2. Replaces custom driver ops with `DRM_GEM_DMA_DRIVER_OPS`: ```c - .dumb_create = mtk_gem_dumb_create, + DRM_GEM_DMA_DRIVER_OPS, DRM_FBDEV_DMA_DRIVER_OPS, - - .gem_prime_import = mtk_gem_prime_import, - .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table, ``` **Minor observation**: The old `mtk_gem_dumb_create` had a manual pitch calculation with `DIV_ROUND_UP(args->width * args->bpp, 8)` and explicit overflow-safe size computation (`args->size = args->pitch; args->size *= args->height`). The new `drm_gem_dma_dumb_create` uses `drm_mode_size_dumb()` which should handle this equivalently. This is fine. **Minor observation**: As the commit message notes, the old mmap helper set `VM_IO | VM_DONTDUMP` flags that the standard GEM DMA mmap helper does not set. The commit message correctly argues that `VM_IO` doesn't make sense for `dma_alloc_attrs()` buffers. `VM_DONTDUMP` absence means these mappings will now appear in core dumps, which is a very minor behavioral change but acceptable. No blocking issues. --- Generated by Claude Code Patch Reviewer