diff options
author | Dave Airlie <airlied@redhat.com> | 2017-04-06 15:41:42 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-04-06 15:49:12 -0400 |
commit | 0168778115687486575a6831df865dbc4f5369fe (patch) | |
tree | 29a3f1e3348f1ddbc9924611fa0cad738507ba64 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | aed93ee7d03eac9b7d21f08aebe8a7d9ea069e20 (diff) | |
parent | f4e7c7c1b4ed4c28caf679bc94ca5aa096310c10 (diff) |
Merge branch 'drm-next-4.12' of git://people.freedesktop.org/~agd5f/linux into drm-next
A few more things for 4.12:
- ttm and amdgpu support for non-contiguous vram CPU mappings
- lots of bug fixes and cleanups for vega10
- misc bug fixes and code cleanups
[airlied: fix do_div error on 32-bit arm, not sure it's 100% correct]
* 'drm-next-4.12' of git://people.freedesktop.org/~agd5f/linux: (58 commits)
drm/amdgpu: use uintptr_t instead of unsigned long to store pointer
drm/amdgpu: Avoid using signed integer to store pointer value
drm/amdgpu:invoke new implemented AI MB func
drm/amdgpu/vega10:timeout set to equal with VI
drm/amdgpu:implement the reset MB func for vega10
drm/amdgpu:fix typo for mxgpu_ai
drm/amdgpu:no need to involv HDP in KIQ
drm/amdgpu:add PSP block only load_type=PSP (v2)
drm/amdgpu/smu9: update to latest driver interface
drm/amd/amdgpu: cleanup gfx_v9_0_gpu_init()
drm/amd/amdgpu: cleanup gfx_v9_0_rlc_reset()
drm/amd/amdgpu: cleanup gfx_v9_0_rlc_start()
drm/amd/amdgpu: simplify gfx_v9_0_cp_gfx_enable()
drm/amd/amdgpu: cleanup gfx_v9_0_kiq_init_register()
drm/amd/amdgpu: Drop gfx_v9_0_print_status()
drm/amd/amdgpu: cleanup gfx_v9_0_set_gfx_eop_interrupt_state()
drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_reg_fault_state()
drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_inst_fault_state()
drm/amd/amdgpu: cleanup gfx_v9_0_init_queue()
drm/amdgpu: Move function amdgpu_has_atpx near other similar functions
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 5aac350b007f..758d8cf8fd17 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -122,20 +122,19 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev, | |||
122 | 122 | ||
123 | if (domain & AMDGPU_GEM_DOMAIN_VRAM) { | 123 | if (domain & AMDGPU_GEM_DOMAIN_VRAM) { |
124 | unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT; | 124 | unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT; |
125 | unsigned lpfn = 0; | ||
126 | |||
127 | /* This forces a reallocation if the flag wasn't set before */ | ||
128 | if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) | ||
129 | lpfn = adev->mc.real_vram_size >> PAGE_SHIFT; | ||
130 | 125 | ||
131 | places[c].fpfn = 0; | 126 | places[c].fpfn = 0; |
132 | places[c].lpfn = lpfn; | 127 | places[c].lpfn = 0; |
133 | places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | | 128 | places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | |
134 | TTM_PL_FLAG_VRAM; | 129 | TTM_PL_FLAG_VRAM; |
130 | |||
135 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) | 131 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) |
136 | places[c].lpfn = visible_pfn; | 132 | places[c].lpfn = visible_pfn; |
137 | else | 133 | else |
138 | places[c].flags |= TTM_PL_FLAG_TOPDOWN; | 134 | places[c].flags |= TTM_PL_FLAG_TOPDOWN; |
135 | |||
136 | if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) | ||
137 | places[c].flags |= TTM_PL_FLAG_CONTIGUOUS; | ||
139 | c++; | 138 | c++; |
140 | } | 139 | } |
141 | 140 | ||
@@ -928,8 +927,7 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
928 | size = bo->mem.num_pages << PAGE_SHIFT; | 927 | size = bo->mem.num_pages << PAGE_SHIFT; |
929 | offset = bo->mem.start << PAGE_SHIFT; | 928 | offset = bo->mem.start << PAGE_SHIFT; |
930 | /* TODO: figure out how to map scattered VRAM to the CPU */ | 929 | /* TODO: figure out how to map scattered VRAM to the CPU */ |
931 | if ((offset + size) <= adev->mc.visible_vram_size && | 930 | if ((offset + size) <= adev->mc.visible_vram_size) |
932 | (abo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) | ||
933 | return 0; | 931 | return 0; |
934 | 932 | ||
935 | /* Can't move a pinned BO to visible VRAM */ | 933 | /* Can't move a pinned BO to visible VRAM */ |
@@ -937,7 +935,6 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
937 | return -EINVAL; | 935 | return -EINVAL; |
938 | 936 | ||
939 | /* hurrah the memory is not visible ! */ | 937 | /* hurrah the memory is not visible ! */ |
940 | abo->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; | ||
941 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM); | 938 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM); |
942 | lpfn = adev->mc.visible_vram_size >> PAGE_SHIFT; | 939 | lpfn = adev->mc.visible_vram_size >> PAGE_SHIFT; |
943 | for (i = 0; i < abo->placement.num_placement; i++) { | 940 | for (i = 0; i < abo->placement.num_placement; i++) { |