-
- Downloads
drm/ttm: Add a generic TTM memcpy move for page-based iomem
The internal ttm_bo_util memcpy uses ioremap functionality, and while it probably might be possible to use it for copying in- and out of sglist represented io memory, using io_mem_reserve() / io_mem_free() callbacks, that would cause problems with fault(). Instead, implement a method mapping page-by-page using kmap_local() semantics. As an additional benefit we then avoid the occasional global TLB flushes of ioremap() and consuming ioremap space, elimination of a critical point of failure and with a slight change of semantics we could also push the memcpy out async for testing and async driver development purposes. A special linear iomem iterator is introduced internally to mimic the old ioremap behaviour for code-paths that can't immediately be ported over. This adds to the code size and should be considered a temporary solution. Looking at the code we have a lot of checks for iomap tagged pointers. Ideally we should extend the core memremap functions to also accept uncached memory and kmap_local functionality. Then we could strip a lot of code. Cc: Christian König <christian.koenig@amd.com> Signed-off-by:Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by:
Christian König <christian.koenig@amd.com> Link: https://lore.kernel.org/r/20210602083818.241793-4-thomas.hellstrom@linux.intel.com
Showing
- drivers/gpu/drm/ttm/ttm_bo_util.c 98 additions, 181 deletionsdrivers/gpu/drm/ttm/ttm_bo_util.c
- drivers/gpu/drm/ttm/ttm_module.c 35 additions, 0 deletionsdrivers/gpu/drm/ttm/ttm_module.c
- drivers/gpu/drm/ttm/ttm_resource.c 193 additions, 0 deletionsdrivers/gpu/drm/ttm/ttm_resource.c
- drivers/gpu/drm/ttm/ttm_tt.c 45 additions, 0 deletionsdrivers/gpu/drm/ttm/ttm_tt.c
- include/drm/ttm/ttm_bo_driver.h 28 additions, 0 deletionsinclude/drm/ttm/ttm_bo_driver.h
- include/drm/ttm/ttm_caching.h 2 additions, 0 deletionsinclude/drm/ttm/ttm_caching.h
- include/drm/ttm/ttm_kmap_iter.h 61 additions, 0 deletionsinclude/drm/ttm/ttm_kmap_iter.h
- include/drm/ttm/ttm_resource.h 61 additions, 0 deletionsinclude/drm/ttm/ttm_resource.h
- include/drm/ttm/ttm_tt.h 16 additions, 0 deletionsinclude/drm/ttm/ttm_tt.h
Loading