drm/amdgpu: implement the allocation range (v3)
Pass a ttm_placement pointer to amdgpu_bo_create_restricted add min_offset to amdgpu_bo_pin_restricted. This makes it easier to allocate memory with address restrictions. With this patch we can also enable 2-ended allocation again. v2: fix rebase conflicts v3: memset placements before using Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
5fc3aeeb9e
commit
7e5a547f64
@@ -43,6 +43,7 @@
|
||||
#include <ttm/ttm_execbuf_util.h>
|
||||
|
||||
#include <drm/drm_gem.h>
|
||||
#include <drm/amdgpu_drm.h>
|
||||
|
||||
#include "amd_shared.h"
|
||||
#include "amdgpu_family.h"
|
||||
@@ -542,12 +543,14 @@ struct amdgpu_bo_va {
|
||||
struct amdgpu_bo *bo;
|
||||
};
|
||||
|
||||
#define AMDGPU_GEM_DOMAIN_MAX 0x3
|
||||
|
||||
struct amdgpu_bo {
|
||||
/* Protected by gem.mutex */
|
||||
struct list_head list;
|
||||
/* Protected by tbo.reserved */
|
||||
u32 initial_domain;
|
||||
struct ttm_place placements[4];
|
||||
struct ttm_place placements[AMDGPU_GEM_DOMAIN_MAX + 1];
|
||||
struct ttm_placement placement;
|
||||
struct ttm_buffer_object tbo;
|
||||
struct ttm_bo_kmap_obj kmap;
|
||||
|
Reference in New Issue
Block a user