summaryrefslogtreecommitdiff
path: root/amdgpu
AgeCommit message (Collapse)AuthorFilesLines
2016-07-06Android: strip out header files from sources listRob Herring1-1/+1
AOSP master now errors if LOCAL_SRC_FILES contains headers, so filter out header files from the source lists. Signed-off-by: Rob Herring <robh@kernel.org>
2016-04-07amdgpu: Fix spelling mistakesEric Engestrom1-2/+2
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-02-04amdgpu: fix for submition with no ibsKen Wang2-0/+9
Avoid a crash if no IBs are specified. Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04amdgpu: add libdrm as private requirement/dependencyEmil Velikov1-0/+1
Otherwise libdrm.so won't end up in the --libs, when one static links libdrm_amdgpu. Cc: Christian König <christian.koenig@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-01-20amdgpu: Add new symbols to amdgpu-symbols-checkMichel Dänzer1-0/+4
Fixes make check. Trivial.
2016-01-20amdgpu: list each entry safely for sw semaphore when submit ibJunwei Zhang1-2/+2
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: David Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-20amdgpu: add semaphore supportMarek Olšák3-4/+249
the semaphore is a binary semaphore. the work flow is: 1. create sem 2. signal sem 3. wait sem, reset sem after signalled 4. destroy sem. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-20amdgpu: validate user memory for userptrChunming Zhou1-1/+2
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-20amdgpu: drop address patching logicsmonk.liu1-10/+1
we don't support non-page-aligned cpu pointer anymore Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-11-20amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on errorTom St Denis1-2/+4
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-11-20amdgpu: fix overflow for timeout calculationJammy Zhou1-2/+6
Set the timeout to AMDGPU_TIMEOUT_INFINITE when overflow happens Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-10-22amdgpu: Cleanly handle ENOMEM on result in amdgpu_bo_list_create()Tom St Denis1-2/+9
Move the allocation of result prior to the IOCTL so we can cleanly backtrack if the allocation fails. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-22amdgpu: Fix use-after-free bug in vamgr_deinitTom St Denis1-2/+2
This patch fixes a use-after-free bug in the vamgr_deinit function. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-22amdgpu: Unlock mutex if base_required is invalidTom St Denis1-1/+3
In the function amdgpu_vamgr_find_va() the function would return without unlocking the mutex if the base_required offset was below the va managers base offset. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-09-12Include <alloca.h> when needed before calling allocaAlan Coopersmith1-0/+3
Fixes "error: implicit declaration of function 'alloca'" failures when building on Solaris Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-09-04amdgpu: remove unneeded -Wno-switch-enum flagEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02amdgpu: use EINVAL instead of EBADMSG in amdgpu_bo_cpu_unmap()Jonathan Gray1-1/+1
EBADMSG is a streams errno. OpenBSD does not implement streams and does include the streams errnos, this commit fixes the build on OpenBSD. None of the callers of this function check the return value for -EBADMSG. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2015-09-02amdgpu: fix missing deinit on vamgr_32monk.liu1-0/+2
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: monk.liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-25amdgpu: serialize drmPrimeFDToHandleChristian König1-4/+5
Fixes the same problem as "intel: Serialize drmPrimeFDToHandle with struct_mutex". Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2015-08-25amdgpu: remove sequence mutexChristian König2-13/+0
It's not used any more. Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2015-08-20amdgpu: add Android build supportMauro Rossi1-0/+18
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-20amdgpu: add Makefile.sourcesMauro Rossi2-14/+18
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> [Emil Velikov: remove duplicate amdgpu.h from LIBDRM_AMDGPU_FILES] Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-17amdgpu: make vamgr per device v2Jammy Zhou3-35/+12
Each device can have its own vamgr, so make it per device now. This can fix the failure with multiple GPUs used in one single process. v2: rebase Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-17amdgpu: add flag to support 32bit VA address v4Jammy Zhou4-7/+59
The AMDGPU_VA_RANGE_32_BIT flag is added to request VA range in the 32bit address space for amdgpu_va_range_alloc. The 32bit address space is reserved at initialization time, and managed with a separate VAMGR as part of the global VAMGR. And if no enough VA space available in range above 4GB, this reserved range can be used as fallback. v2: add comment for AMDGPU_VA_RANGE_32_BIT, and add vamgr to va_range v3: rebase to Emil's drm_private series v4: fix one warning Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-17amdgpu: improve amdgpu_vamgr_initJammy Zhou1-5/+8
Make it a generic function independent of the device info. Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-13amdgpu: add symbols check testEmil Velikov2-0/+54
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu: hide the final internal functions from global namespaceEmil Velikov5-46/+42
Thus the only symbols that we export are the ones officially provided by the API. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu/amdgpu_vamgr: hide private symbols from global namespaceEmil Velikov2-13/+22
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu: squash trivial documentation typoEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu: cosmetic chances in license boilerplateEmil Velikov7-5/+7
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu: add a bunch of missing config.h includesEmil Velikov6-0/+24
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu/util_hash_table: hide private symbols from global namespaceEmil Velikov2-16/+26
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-13amdgpu/util_hash: hide private symbols from global namespaceEmil Velikov2-27/+36
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: Remove unused local variables bo_size/offset from amdgpu_cs_submitMichel Dänzer1-2/+0
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: expose the PCI revision IDJammy Zhou2-0/+3
The PCI revision ID can be used to differentiate ASICs. Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05libdrm/amdgpu: Use private fd for amdgpu_device and winsys hash table to fix ↵Mario Kleiner1-4/+13
ZaphodHeads. (v2) The amdgpu_device for a device node needs its own dup'ed fd, instead of using the original fd passed in for a screen, to make multi-x-screen ZaphodHeads configurations work on amdgpu. The original fd's lifetime differs from that of the amdgpu_device, and from the one stored in the hash. The hash key is the fd, and in order to compare hash entries we fstat them, so the fd must be around for as long as the amdgpu_device is. This patch for libdrm/amdgpu is a translation of the radeon-winsys ZaphodHeads fix for mesa's radeon-winsys, from mesa commit 28dda47ae4d974e3e032d60e8e0965c8c068c6d8 "winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads." Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> v2: Check for valid fd's being >= 0, because fd == 0 is in theory a valid, although unlikely, fd and fd == -1 would denote an invalid fd. Thanks to William Lewis for pointing this out. Reported-by: William Lewis <minutemaidpark@hotmail.com> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-08-05amdgpu: add VCE harvesting instance queryLeo Liu2-0/+3
Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: add amdgpu_bo_va_op for va map/unmap support v3Jammy Zhou3-126/+59
The following interfaces are changed accordingly: - amdgpu_bo_alloc - amdgpu_create_bo_from_user_mem v2: update the interfaces v3: remove virtual_mc_base_address from amdgpu_bo Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: add flags parameter for amdgpu_va_range_allocJammy Zhou2-2/+5
The flags is added for extensibility to cover some special requirements in the future, i.e, request VA range in the first 4GB of address space Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu : move management of user fence from libdrm to UMDKen Wang3-122/+52
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: Use drmIoctl in amdgpu_ioctl_wait_csMichel Dänzer1-6/+2
This is safe now because the ioctl uses an absolute timeout. This prevents amdgpu_cs_query_fence_status from returning early e.g. when a signal is delivered, which in turn caused Mesa winsys code to assume a BO was idle when it actually wasn't yet. Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: use common fence structure for dependencies as well.Christian König2-33/+10
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: improve the amdgpu_cs_query_fence_status interfaceJammy Zhou2-10/+9
make amdgpu_cs_query_fence reusable to support multi-fence query Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: add va range query interfaceSabre Shao2-0/+32
amdgpu_va_range_query interface is added so that client can query va range supported by specific device. Signed-off-by: Sabre Shao <Sabre.Shao@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: add va allocation intefacesSabre Shao3-1/+118
Two new interfaces are added to support client request for allocate virtual address without physical memory committed to. The virtual address space can be managed by client itself. Signed-off-by: Sabre Shao <Sabre.Shao@amd.com> Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: add base_preferred parameter to amdgpu_vamgr_find_vaKen Wang3-17/+35
base_preferred parameter is added to amdgpu_vamgr_find_va so UMD can specify preferred va address when allocating. Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: check the user fence only if the IP supports user fencesMarek Olšák1-13/+18
Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05drm/amdgpu: allow passing absolute timeouts to amdgpu_cs_query_fence_statusMarek Olšák2-3/+14
Useful when Mesa wants to wait for a lot of fences at the same time and doesn't want to recalculate the relative timeout after every call. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05amdgpu: remove reference to AMD specific error codesChristian König1-32/+2
We just have never defined any. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: cleanup public interface styleChristian König1-136/+90
Fix some style problems, adjust to a common indentation, reorder two function definitions and remove stale comments. No intended functional change. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>