Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm: move msm_gpummu.c to adreno/a2xx_gpummu.c

The msm_gpummu.c implementation is used only on A2xx and it is tied to
the A2xx registers. Rename the source file accordingly.

Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/585846/
Link: https://lore.kernel.org/r/20240401-fd-xml-shipped-v5-4-4bdb277a85a1@linaro.org

+31 -29
+1 -1
drivers/gpu/drm/msm/Makefile
··· 8 8 adreno/adreno_device.o \ 9 9 adreno/adreno_gpu.o \ 10 10 adreno/a2xx_gpu.o \ 11 + adreno/a2xx_gpummu.o \ 11 12 adreno/a3xx_gpu.o \ 12 13 adreno/a4xx_gpu.o \ 13 14 adreno/a5xx_gpu.o \ ··· 114 113 msm_ringbuffer.o \ 115 114 msm_submitqueue.o \ 116 115 msm_gpu_tracepoints.o \ 117 - msm_gpummu.o 118 116 119 117 msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o \ 120 118 dp/dp_debug.o
+2 -2
drivers/gpu/drm/msm/adreno/a2xx_gpu.c
··· 113 113 uint32_t *ptr, len; 114 114 int i, ret; 115 115 116 - msm_gpummu_params(gpu->aspace->mmu, &pt_base, &tran_error); 116 + a2xx_gpummu_params(gpu->aspace->mmu, &pt_base, &tran_error); 117 117 118 118 DBG("%s", gpu->name); 119 119 ··· 469 469 static struct msm_gem_address_space * 470 470 a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev) 471 471 { 472 - struct msm_mmu *mmu = msm_gpummu_new(&pdev->dev, gpu); 472 + struct msm_mmu *mmu = a2xx_gpummu_new(&pdev->dev, gpu); 473 473 struct msm_gem_address_space *aspace; 474 474 475 475 aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
+4
drivers/gpu/drm/msm/adreno/a2xx_gpu.h
··· 19 19 }; 20 20 #define to_a2xx_gpu(x) container_of(x, struct a2xx_gpu, base) 21 21 22 + struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu); 23 + void a2xx_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base, 24 + dma_addr_t *tran_error); 25 + 22 26 #endif /* __A2XX_GPU_H__ */
+24 -21
drivers/gpu/drm/msm/msm_gpummu.c drivers/gpu/drm/msm/adreno/a2xx_gpummu.c
··· 5 5 6 6 #include "msm_drv.h" 7 7 #include "msm_mmu.h" 8 - #include "adreno/adreno_gpu.h" 9 - #include "adreno/a2xx.xml.h" 10 8 11 - struct msm_gpummu { 9 + #include "adreno_gpu.h" 10 + #include "a2xx_gpu.h" 11 + 12 + #include "a2xx.xml.h" 13 + 14 + struct a2xx_gpummu { 12 15 struct msm_mmu base; 13 16 struct msm_gpu *gpu; 14 17 dma_addr_t pt_base; 15 18 uint32_t *table; 16 19 }; 17 - #define to_msm_gpummu(x) container_of(x, struct msm_gpummu, base) 20 + #define to_a2xx_gpummu(x) container_of(x, struct a2xx_gpummu, base) 18 21 19 22 #define GPUMMU_VA_START SZ_16M 20 23 #define GPUMMU_VA_RANGE (0xfff * SZ_64K) 21 24 #define GPUMMU_PAGE_SIZE SZ_4K 22 25 #define TABLE_SIZE (sizeof(uint32_t) * GPUMMU_VA_RANGE / GPUMMU_PAGE_SIZE) 23 26 24 - static void msm_gpummu_detach(struct msm_mmu *mmu) 27 + static void a2xx_gpummu_detach(struct msm_mmu *mmu) 25 28 { 26 29 } 27 30 28 - static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, 31 + static int a2xx_gpummu_map(struct msm_mmu *mmu, uint64_t iova, 29 32 struct sg_table *sgt, size_t len, int prot) 30 33 { 31 - struct msm_gpummu *gpummu = to_msm_gpummu(mmu); 34 + struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu); 32 35 unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; 33 36 struct sg_dma_page_iter dma_iter; 34 37 unsigned prot_bits = 0; ··· 56 53 return 0; 57 54 } 58 55 59 - static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) 56 + static int a2xx_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) 60 57 { 61 - struct msm_gpummu *gpummu = to_msm_gpummu(mmu); 58 + struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu); 62 59 unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; 63 60 unsigned i; 64 61 ··· 71 68 return 0; 72 69 } 73 70 74 - static void msm_gpummu_resume_translation(struct msm_mmu *mmu) 71 + static void a2xx_gpummu_resume_translation(struct msm_mmu *mmu) 75 72 { 76 73 } 77 74 78 - static void msm_gpummu_destroy(struct msm_mmu *mmu) 75 + static void a2xx_gpummu_destroy(struct msm_mmu *mmu) 79 76 { 80 - struct msm_gpummu *gpummu = to_msm_gpummu(mmu); 77 + struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu); 81 78 82 79 dma_free_attrs(mmu->dev, TABLE_SIZE, gpummu->table, gpummu->pt_base, 83 80 DMA_ATTR_FORCE_CONTIGUOUS); ··· 86 83 } 87 84 88 85 static const struct msm_mmu_funcs funcs = { 89 - .detach = msm_gpummu_detach, 90 - .map = msm_gpummu_map, 91 - .unmap = msm_gpummu_unmap, 92 - .destroy = msm_gpummu_destroy, 93 - .resume_translation = msm_gpummu_resume_translation, 86 + .detach = a2xx_gpummu_detach, 87 + .map = a2xx_gpummu_map, 88 + .unmap = a2xx_gpummu_unmap, 89 + .destroy = a2xx_gpummu_destroy, 90 + .resume_translation = a2xx_gpummu_resume_translation, 94 91 }; 95 92 96 - struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu) 93 + struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu) 97 94 { 98 - struct msm_gpummu *gpummu; 95 + struct a2xx_gpummu *gpummu; 99 96 100 97 gpummu = kzalloc(sizeof(*gpummu), GFP_KERNEL); 101 98 if (!gpummu) ··· 114 111 return &gpummu->base; 115 112 } 116 113 117 - void msm_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base, 114 + void a2xx_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base, 118 115 dma_addr_t *tran_error) 119 116 { 120 - dma_addr_t base = to_msm_gpummu(mmu)->pt_base; 117 + dma_addr_t base = to_a2xx_gpummu(mmu)->pt_base; 121 118 122 119 *pt_base = base; 123 120 *tran_error = base + TABLE_SIZE; /* 32-byte aligned */
-5
drivers/gpu/drm/msm/msm_mmu.h
··· 42 42 43 43 struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks); 44 44 struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsigned long quirks); 45 - struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu); 46 45 47 46 static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg, 48 47 int (*handler)(void *arg, unsigned long iova, int flags, void *data)) ··· 51 52 } 52 53 53 54 struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent); 54 - 55 - void msm_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base, 56 - dma_addr_t *tran_error); 57 - 58 55 59 56 int msm_iommu_pagetable_params(struct msm_mmu *mmu, phys_addr_t *ttbr, 60 57 int *asid);