aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-26drm/drivers: add support for using the arch wc mapping API.Dave Airlie1-0/+5
This fixes a regression in all these drivers since the cache mode tracking was fixed for mixed mappings. It uses the new arch API to add the VRAM range to the PAT mapping tracking tables. Fixes: 87744ab3832 (mm: fix cache mode tracking in vm_insert_mixed()) Reviewed-by: Christian König <[email protected]>. Signed-off-by: Dave Airlie <[email protected]>
2016-09-28drm/amdgpu: rename all rbo variable to abo v2Christian König1-8/+8
Just to cleanup some radeon leftovers. sed -i "s/rbo/abo/g" drivers/gpu/drm/amd/amdgpu/*.c sed -i "s/rbo/abo/g" drivers/gpu/drm/amd/amdgpu/*.h v2: rebased Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-28drm/amdgpu: remove unused member from struct amdgpu_boChristian König1-1/+0
Not used in a while. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-28drm/amdgpu: add a custom GTT memory manager v2Christian König1-1/+1
Only allocate address space when we really need it. v2: fix a typo, add correct function description, stop leaking the node in the error case. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-16drm/amdgpu: clean function declarations in amdgpu_ttm.c upBaoyou Xie1-2/+0
We get 2 warnings when building kernel with W=1: drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:985:5: warning: no previous prototype for 'amdgpu_ttm_init' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1092:6: warning: no previous prototype for 'amdgpu_ttm_fini' [-Wmissing-prototypes] In fact, both functions are declared in drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c, but should be declared in a header file, thus can be recognized in other file. So this patch moves the declarations into drivers/gpu/drm/amd/amdgpu/amdgpu.h. Reviewed-by: Christian König <[email protected]> Signed-off-by: Baoyou Xie <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-14drm/amdgpu: add AMDGPU_BO_INVALID_OFFSETChristian König1-0/+1
An invalid offset to be used by custom VRAM/GGT manager when we don't have an offset for an BO. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-14drm/amdgpu: update gart_pin_size if bo is in GTTFlora Cui1-1/+1
Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-14drm/amdgpu: bind GTT on demandChristian König1-0/+7
We don't really need the GTT table any more most of the time. So bind it only on demand. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Acked-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-09-14drm/amdgpu: add a new helper to free a BO in kernel allocationsJunwei Zhang1-0/+29
Free the BO allocated by amdgpu_bo_create_kernel() Signed-off-by: Junwei Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-22drm/amdgpu: stop adding dummy entry in amdgpu_ttm_placement_initChristian König1-5/+3
AMDGPU_GEM_CREATE_NO_CPU_ACCESS and AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED are obviously mutual exclusive. So stop adding a dummy entry without effect when both are specified. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-22drm/amdgpu: cleanup amdgpu_ttm_placement_initChristian König1-52/+60
Make it more clear what this function does. No intendet functional change. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-22drm/amdgpu: link all shadow bo V2Chunming Zhou1-1/+11
V2: 1. use mutex instead of spinlock for shadow list, since its process could sleep. 2. move list_del to bo destroy phase. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-22drm/amdgpu: sync bo and shadow V3Chunming Zhou1-0/+64
Use shadow flag to judge which direction to sync. V2: Don't need bo pin, so remove it. V3: 1. Split to two functions, one is backup_to_shadow, another is restore_from_shadow. 2. Clean up previous shadow direction difinitions. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-19drm/amdgpu: add need backup function V2Chunming Zhou1-1/+1
V2: add checking if need backup in amdgpu_bo_create. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-19drm/amdgpu: use domain's gpu_offset for start addrFlora Cui1-5/+1
Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Ken Wang <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-19drm/amdgpu: update gart_pin_size only if the bo is pined to GTTFlora Cui1-1/+1
Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-19drm/amdgpu: check domain sanity in amdgpu_bo_pin_restricted()Flora Cui1-0/+5
abort if the bo is pined to other domain already Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-16drm/amdgpu: fix coding style in amdgpu_object.cChristian König1-37/+49
Just a few 80 chars problems. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-16drm/amdgpu: add shadow bo support V2Chunming Zhou1-3/+45
shadow bo is the shadow of a bo, which is always in GTT, which can be used to backup the original bo. V2: reference shadow parent, shadow bo will be freed by who allocted him. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-08drm/amdgpu: expose AMDGPU_GEM_CREATE_VRAM_CLEARED to user spaceFlora Cui1-0/+33
V2: fix the return value for fill failure and validate bo before filling data Reviewed-by: Christian König <[email protected]> Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-08drm/amdgpu: add more warning to amdgpu_bo_offsetChristian König1-0/+18
Warn when we try to get the address and the BO isn't locked or reserved. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-08-08drm/amdgpu: add new helper for in kernel allocationsChristian König1-0/+63
We often allocate, pin and map things at the same time in the kernel. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-07-07drm/amd/amdgpu : adding new tracepoints to track memory information.David Mao1-0/+3
- adding amdgpu_cs_bo_status to track total size and total entry count of bo for each submission. - adding amdgpu_ttm_bo_move to track the bo eviction including the size of bo and the location before/after the move Signed-off-by: David Mao <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-05-03drm/amdgpu: set metadata pointer to NULL after freeing.Dave Airlie1-0/+1
Without this there was a double free of the metadata, which ended up freeing the fd table for me here, and taking out the machine more often than not. I reproduced with X.org + modesetting DDX + latest llvm/mesa, also required using dri3. Cc: [email protected] Reviewed-by: Christian König <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-04-06drm/amdgpu: add invisible pin size statisticChunming Zhou1-4/+8
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-04-01drm/amdgpu: print vram type rather than just DDRAlex Deucher1-2/+13
We have the info, so use it rather than reporting just DDR. Reviewed-by: Harish Kasiviswanathan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-03-28drm/amdgpu: Don't move pinned BOsMichel Dänzer1-0/+4
The purpose of pinning is to prevent a buffer from moving. Reviewed-by: Christian König <[email protected]> Tested-by: Rex Zhu <[email protected]> Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-03-14drm/amdgpu: always wait before kmap a BOChristian König1-5/+11
When a BO is currently moving we otherwise would blindly access the new location without checking. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: cleanup gem init/finitChristian König1-23/+0
Remove the double housekeeping and use something sane to forcefuly delete BOs on unload. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-10drm/amdgpu: check userptrs mm earlierChristian König1-1/+1
Instead of when we try to bind it check the usermm when we try to use it in the IOCTLs. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
2016-02-10drm/amdgpu: keep the prefered/allowed domains in the BOChristian König1-6/+9
Stop copying that to the bo list entry, it doesn't change anyway. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-02drm/amdgpu: mask out WC from BO on unsupported archesOded Gabbay1-0/+8
Reviewed-by: Christian König <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Oded Gabbay <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2016-01-22drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2Christian König1-1/+2
We could pin BOs into invisible VRAM otherwise. v2: make logic more readable as suggested by Michel Cc: [email protected] Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1) Reviewed-by: Rex Zhu <[email protected]> (v1) Reviewed-by: Michel Dänzer <[email protected]>
2015-11-30drm/amdgpu: fix VM page table reference countingChristian König1-0/+1
We use the reservation object of the page directory for the page tables as well, because of this the page directory should be freed last. Ensure that by keeping a reference from the page tables to the directory. Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-07drm/amdgpu: add TOPDOWN flag to the whole vramChunming Zhou1-0/+2
need to decrease visible vram usage by default. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: monk.liu <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-09-23drm/amdgpu: use kmemdup rather than duplicating its implementationAndrzej Hajda1-3/+1
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-09-23drm/amdgpu: export reservation_object from dmabuf to ttm (v2)Christian König1-7/+8
Adds an extra argument to amdgpu_bo_create, which is only used in amdgpu_prime.c. Port of radeon commit 831b6966a60fe72d85ae3576056b4e4e0775b112. v2: fix up kfd. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-09-03drm/amdgpu: use top down allocation for non-CPU accessible vramAlex Deucher1-1/+1
Should help avoid fragmentation of vram due to CPU access requirements. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-08-17drm/amdgpu: Don't take dev->struct_mutex in bo_force_deleteDaniel Vetter1-3/+1
It really doesn't protect anything which doesn't have other locks already. Also this is run from driver unload code so not much need for locks anyway. Same changes as for radeon really. Cc: Alex Deucher <[email protected]> Cc: "Christian König" <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-08-17drm/amdgpu: remove VI hw bug workaround v3Christian König1-12/+0
The workaround simply doesn't work because VM mappings are controlled by userspace not the kernel. Additional to that this is just a performance problem which happens if you have holes in your VM mapping. v2: adjust virtual addr alignment as well. v3: fix trivial warning Signed-off-by: Christian König <[email protected]> Reviewed-by: Monk Liu <[email protected]> (v1) Reviewed-by: Jammy Zhou <[email protected]> (v2)
2015-08-17drm/amdgpu: use kernel fence diretly in amdgpu_bo_fenceChunming Zhou1-3/+3
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
2015-08-17drm/amdgpu: remove VM workaround for FijiAlex Deucher1-1/+1
The bug is fixed in fiji. Signed-off-by: Alex Deucher <[email protected]>
2015-08-17drm/amdgpu: merge amdgpu_family.h into amd_shared.h (v2)Jammy Zhou1-1/+1
Make the definitions common for all driver components v2: fix kfd Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-06-05drm/amdgpu: fix user ptr race conditionChristian König1-1/+0
Signed-off-by: Christian König <[email protected]> Reviewed-by: monk liu <[email protected]>
2015-06-03drm/amdgpu: remove mclk_lockChristian König1-2/+0
Not needed any more. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-06-03drm/amdgpu: implement the allocation range (v3)Chunming Zhou1-57/+119
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 <[email protected]> Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-06-03drm/amdgpu: port fault_reserve_notify changes from radeonChristian König1-20/+35
Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-06-03drm/amdgpu: rework tiling flagsMarek Olšák1-42/+1
Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Acked-by: Christian König <[email protected]>
2015-06-03drm/amdgpu: enforce AMDGPU_GEM_CREATE_NO_CPU_ACCESSChristian König1-0/+3
Deny user and kernel mapping if we said we never want to do so. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-06-03drm/amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UCJammy Zhou1-8/+2
This flag isn't used by user mode drivers, remove it to avoid confusion. And rename GTT_WC to GTT_USWC to make it clear. Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>