This departs a bit from the first two revisions. This series is split into two parts: 1. Patches 1-17: clean up the duplicated code across GMC 9-12 and move most of it to common GMC code. No intended functional change. It also adds an new SDMA invalidation path which is unused until the second part of the series. 2. Patches 18-23: switch to using SDMA (or MES) for invalidations on GMC 10-12. Conditions that currently use MES continue to use MES. Using SDMA for the other cases aligns with the hubs team's advice and what other OSes do.
I think part 1 is a worthwile cleanup, part 2 is open to debate. Code is available on this branch as well: https://gitlab.freedesktop.org/agd5f/linux/-/commits/tlb_inv_rework?ref_type=heads V2: - Add missing hub callbacks in gmc9 hubs V3: - Move the code clean up to the start drop most of the behavior changes. *** BLURB HERE *** Alex Deucher (23): drm/amdgpu/gmc9: disallow gfxoff around TLB flushes drm/amdgpu/gmc10: disallow gfxoff around TLB flushes drm/amdgpu/gmc11: disallow gfxoff around TLB flushes drm/amdgpu/gmc12: disallow gfxoff around TLB flushes drm/amdgpu/gmc9: set vmhub funcs for gfxhub and mmhub drm/amdgpu: add a buffer funcs callback for TLB invalidation drm/amdgpu/sdma5.0: add tlb invalidation buffer func callback drm/amdgpu/sdma5.2: add tlb invalidation buffer func callback drm/amdgpu/sdma6: add tlb invalidation buffer func callback drm/amdgpu/sdma7: add tlb invalidation buffer func callback drm/amdgpu: add tlb invalidation method enum drm/amdgpu: plumb tlb inv method in amdgpu_gmc_flush_gpu_tlb() drm/amdgpu: uplevel reset check in amdgpu_gmc_flush_gpu_tlb() drm/amdgpu/gmc: add new callback to lookup vmid to pasid mapping drm/amdgpu: add a gmc callback for the inv semaphore drm/amdgpu/gmc: rework pasid flushing drm/amdgpu/gmc: add helpers for various tlb inv functions drm/amdgpu/gmc10: use SDMA for gart TLB invalidation drm/amdgpu/gmc11: use SDMA for gart TLB invalidation drm/amdgpu/gmc12: use SDMA for gart TLB invalidation drm/amdgpu/gmc10: use SDMA for pasid TLB invalidation drm/amdgpu/gmc11: use SDMA for pasid TLB invalidation drm/amdgpu/gmc12: use MES or SDMA for pasid TLB invalidation drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 474 ++++++++++++++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 27 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 18 + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 + drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 33 ++ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 33 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 199 +--------- drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 204 +--------- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 237 +----------- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 224 +---------- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 127 +----- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 4 + drivers/gpu/drm/amd/amdgpu/mes_v12_1.c | 4 + drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 33 ++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c | 32 ++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 32 ++ drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 32 ++ drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 49 +++ drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 49 +++ drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 49 +++ drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 48 +++ 21 files changed, 909 insertions(+), 1001 deletions(-) -- 2.55.0
