summaryrefslogtreecommitdiff
path: root/amdgpu
AgeCommit message (Collapse)AuthorFilesLines
2017-02-15remove the pthread-stub dependencySooChan Lim1-2/+1
Change-Id: I9253557242bb43ec49e4f45eed5d21269bbbb3ac
2017-01-27android: introduce Android.common.mk to reduce boilerplateEmil Velikov1-5/+2
... across the makefiles. Currently this isn't much but that will change shortly. As an added bonus this fixes all present and future cases where we've forgotten to strip out the headers from LOCAL_SRC_FILES. In a couple of cases (the tests) we start setting LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue. Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org>
2017-01-27android: remove LOCAL_MODULE_TAGS := optional tagEmil Velikov1-1/+0
Seems to be the default option since ~2009 with commit 2f31293ba78 "auto import from //branches/cupcake/...@137197". Fleshed out from a larger commit in the AOSP repo/fork. Cc: Dan Willemsen <dwillemsen@google.com> Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org>
2016-11-14amdgpu: Add amdgpu_asic_id.h to Makefile.sources.Matt Turner1-0/+1
2016-11-07amdgpu: add the function to get the marketing name (v4)Junwei Zhang4-0/+191
This function is used to look up the marking name for a specific board. v2: agd: Squash in subsequent updates to the table. v3: [Michel Dänzer] * Make amdgpu_asic_id_table static, so it's not exported from libdrm_amdgpu.so.1 * Add amdgpu_get_marketing_name to amdgpu-symbols-check * Fix indentation of second line of if statement * Squash in another change removing redundant entries * Change spelling of "RADEON" -> "Radeon" * Remove "(TM)" from a minority of entries v4: [Michel Dänzer] * Use const char* instead of fixed size array for marketing_name (Emil Velikov) Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Flora Cui <Flora.Cui@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-31amdgpu: check parameters in amdgpu_query_gpu_infoAlex Deucher1-0/+2
Make sure they aren't NULL. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97993 Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-05amdgpu: add SI supportRonie Salgado1-7/+11
v2: without the amdgpu_drm.h change Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2016-09-05amdgpu: fix valgrind warnings caused by amdgpu_query_firmware_versionMarek Olšák1-1/+1
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>