diff options
author | Dave Airlie <airlied@redhat.com> | 2020-08-07 02:04:50 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-08-10 03:33:35 +0300 |
commit | 4f297b9c82e1a43d2c02a687aa134e1b7318b7e6 (patch) | |
tree | c77f5992bd548848f03324c5e8688aace8422798 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | |
parent | 87154ff86bf69ecf76600e56ecab0b79fc3f71ea (diff) | |
download | linux-4f297b9c82e1a43d2c02a687aa134e1b7318b7e6.tar.xz |
drm/amdgpu/ttm: move vram/gtt mgr allocations to mman.
Christian suggested this and it makes sense.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200806233459.4057784-2-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index 433156c2e8fb..67022ed6c643 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -41,6 +41,22 @@ #define AMDGPU_POISON 0xd0bed0be +struct amdgpu_vram_mgr { + struct ttm_resource_manager manager; + struct drm_mm mm; + spinlock_t lock; + atomic64_t usage; + atomic64_t vis_usage; + struct amdgpu_device *adev; +}; + +struct amdgpu_gtt_mgr { + struct ttm_resource_manager manager; + struct drm_mm mm; + spinlock_t lock; + atomic64_t available; +}; + struct amdgpu_mman { struct ttm_bo_device bdev; bool mem_global_referenced; @@ -59,6 +75,9 @@ struct amdgpu_mman { struct mutex gtt_window_lock; /* Scheduler entity for buffer moves */ struct drm_sched_entity entity; + + struct amdgpu_vram_mgr vram_mgr; + struct amdgpu_gtt_mgr gtt_mgr; }; struct amdgpu_copy_mem { |