Il 11/03/26 10:49, Chen-Yu Tsai ha scritto:
In commit 9b54a32c7c6a ("drm/mediatek: mtk_gem: Partial refactor and use drm_gem_dma_object") the MediaTek DRM driver was refactored to use drm_gem_dma_object, but custom callbacks were still needed to deal with using the first device of the pipeline as the DMA device, instead of the MMSYS device that the DRM driver binds to.Turns out there is already partial support for dedicated DMA devices in the DRM subsystem for PRIME imports. The preceding patches add support for dedicated DMA devices to the GEM DMA helpers. This allows us to just set the dedicated DMA device for the DRM device, and drop all the custom GEM callbacks. Also drop the .dma_dev field from the driver private data as it is no longer needed. There are slight differences in the mmap helper: the VM_DONTDUMP and VM_IO flags are no longer set. Both were lifted from drm_gem_mmap_obj(). VM_IO probably doesn't make sense since the buffer is allocated using dma_alloc_attrs(). Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Chen-Yu Tsai <[email protected]>
Aaaaah you're removing all my code! :-P ...but it's so pleasant to see that. Brilliant cleanup. Kudos! Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
