diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-19 20:47:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-10-19 20:47:19 -0400 |
commit | 6585d4274b0baf1d09318539c4a726a96b51af34 (patch) | |
tree | 179aacc9409db45966595893ae4842104b314442 /drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | |
parent | 40d86701a625eed9e644281b9af228d6a52d8ed9 (diff) | |
parent | 96687ec0bb478088cb6941a7dca3bb6808a19313 (diff) |
Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next
Last set of features for 4.15. Highlights:
- Add a bo flag to allow buffers to opt out of implicit sync
- Add ctx priority setting interface
- Lots more powerplay cleanups
- Start to plumb through vram lost infrastructure for gpu reset
- ttm support for huge pages
- misc cleanups and bug fixes
* 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux: (73 commits)
drm/amd/powerplay: Place the constant on the right side of the test
drm/amd/powerplay: Remove useless variable
drm/amd/powerplay: Don't cast kzalloc() return value
drm/amdgpu: allow GTT overcommit during bind
drm/amdgpu: linear validate first then bind to GART
drm/amd/pp: Fix overflow when setup decf/pix/disp dpm table.
drm/amd/pp: thermal control not enabled on vega10.
drm/amdgpu: busywait KIQ register accessing (v4)
drm/amdgpu: report more amdgpu_fence_info
drm/amdgpu:don't check soft_reset for sriov
drm/amdgpu:fix duplicated setting job's vram_lost
drm/amdgpu:reduce wb to 512 slot
drm/amdgpu: fix regresstion on SR-IOV gpu reset failed
drm/amd/powerplay: Tidy up cz_dpm_powerup_vce()
drm/amd/powerplay: Tidy up cz_dpm_powerdown_vce()
drm/amd/powerplay: Tidy up cz_dpm_update_vce_dpm()
drm/amd/powerplay: Tidy up cz_dpm_update_uvd_dpm()
drm/amd/powerplay: Tidy up cz_dpm_powerup_uvd()
drm/amd/powerplay: Tidy up cz_dpm_powerdown_uvd()
drm/amd/powerplay: Tidy up cz_start_dpm()
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index 0d15eb7d31d7..33535d347734 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | |||
@@ -169,7 +169,8 @@ static int amdgpu_gtt_mgr_new(struct ttm_mem_type_manager *man, | |||
169 | int r; | 169 | int r; |
170 | 170 | ||
171 | spin_lock(&mgr->lock); | 171 | spin_lock(&mgr->lock); |
172 | if (atomic64_read(&mgr->available) < mem->num_pages) { | 172 | if ((&tbo->mem == mem || tbo->mem.mem_type != TTM_PL_TT) && |
173 | atomic64_read(&mgr->available) < mem->num_pages) { | ||
173 | spin_unlock(&mgr->lock); | 174 | spin_unlock(&mgr->lock); |
174 | return 0; | 175 | return 0; |
175 | } | 176 | } |
@@ -244,8 +245,9 @@ static void amdgpu_gtt_mgr_del(struct ttm_mem_type_manager *man, | |||
244 | uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man) | 245 | uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man) |
245 | { | 246 | { |
246 | struct amdgpu_gtt_mgr *mgr = man->priv; | 247 | struct amdgpu_gtt_mgr *mgr = man->priv; |
248 | s64 result = man->size - atomic64_read(&mgr->available); | ||
247 | 249 | ||
248 | return (u64)(man->size - atomic64_read(&mgr->available)) * PAGE_SIZE; | 250 | return (result > 0 ? result : 0) * PAGE_SIZE; |
249 | } | 251 | } |
250 | 252 | ||
251 | /** | 253 | /** |
@@ -265,7 +267,7 @@ static void amdgpu_gtt_mgr_debug(struct ttm_mem_type_manager *man, | |||
265 | drm_mm_print(&mgr->mm, printer); | 267 | drm_mm_print(&mgr->mm, printer); |
266 | spin_unlock(&mgr->lock); | 268 | spin_unlock(&mgr->lock); |
267 | 269 | ||
268 | drm_printf(printer, "man size:%llu pages, gtt available:%llu pages, usage:%lluMB\n", | 270 | drm_printf(printer, "man size:%llu pages, gtt available:%lld pages, usage:%lluMB\n", |
269 | man->size, (u64)atomic64_read(&mgr->available), | 271 | man->size, (u64)atomic64_read(&mgr->available), |
270 | amdgpu_gtt_mgr_usage(man) >> 20); | 272 | amdgpu_gtt_mgr_usage(man) >> 20); |
271 | } | 273 | } |