drm/ttm: do not keep GPU dependent addresses
authorNirmoy Das <nirmoy.aiemd@gmail.com>
Wed, 24 Jun 2020 18:26:48 +0000 (20:26 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 26 Jun 2020 12:41:24 +0000 (14:41 +0200)
GPU address handling is device specific and should be handle by its device
driver.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/372937/
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c
include/drm/ttm/ttm_bo_api.h
include/drm/ttm/ttm_bo_driver.h

index f73b81c..f78cfc7 100644 (file)
@@ -85,7 +85,6 @@ static void ttm_mem_type_debug(struct ttm_bo_device *bdev, struct drm_printer *p
        drm_printf(p, "    has_type: %d\n", man->has_type);
        drm_printf(p, "    use_type: %d\n", man->use_type);
        drm_printf(p, "    flags: 0x%08X\n", man->flags);
-       drm_printf(p, "    gpu_offset: 0x%08llX\n", man->gpu_offset);
        drm_printf(p, "    size: %llu\n", man->size);
        drm_printf(p, "    available_caching: 0x%08X\n", man->available_caching);
        drm_printf(p, "    default_caching: 0x%08X\n", man->default_caching);
@@ -343,12 +342,6 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 moved:
        bo->evicted = false;
 
-       if (bo->mem.mm_node)
-               bo->offset = (bo->mem.start << PAGE_SHIFT) +
-                   bdev->man[bo->mem.mem_type].gpu_offset;
-       else
-               bo->offset = 0;
-
        ctx->bytes_moved += bo->num_pages << PAGE_SHIFT;
        return 0;
 
index 0a9d042..a6ec610 100644 (file)
@@ -213,8 +213,6 @@ struct ttm_buffer_object {
         * either of these locks held.
         */
 
-       uint64_t offset; /* GPU address space is independent of CPU word size */
-
        struct sg_table *sg;
 };
 
index 54a527a..aa1f398 100644 (file)
@@ -177,7 +177,6 @@ struct ttm_mem_type_manager {
        bool has_type;
        bool use_type;
        uint32_t flags;
-       uint64_t gpu_offset; /* GPU address space is independent of CPU word size */
        uint64_t size;
        uint32_t available_caching;
        uint32_t default_caching;