Message ID | 20240629052247.2653363-2-uwu@icenowy.me (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/ttm: support device w/o coherency | expand |
diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 434cf0258000e..b923c14861c1a 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -237,6 +237,8 @@ int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *func list_add_tail(&bdev->device_list, &glob->device_list); mutex_unlock(&ttm_global_mutex); + bdev->dma_coherent = dev->dma_coherent; + return 0; } EXPORT_SYMBOL(ttm_device_init); diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h index c22f30535c848..9daf7f47d6507 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -225,6 +225,11 @@ struct ttm_device { */ const struct ttm_device_funcs *funcs; + /** + * @dma_coherent: if the device backed is dma-coherent. + */ + bool dma_coherent; + /** * @sysman: Resource manager for the system domain. * Access via ttm_manager_type.
Currently TTM utilizes cached memory regardless of whether the device have full DMA coherency (can snoop CPU cache). Save the device's DMA coherency status in struct ttm_device, to allow further support of devices w/o snooping capability (the capability missing on at least one part of the transmission between the CPU and the device). Signed-off-by: Icenowy Zheng <uwu@icenowy.me> --- drivers/gpu/drm/ttm/ttm_device.c | 2 ++ include/drm/ttm/ttm_device.h | 5 +++++ 2 files changed, 7 insertions(+)