aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
Commit message (Collapse)AuthorAgeFilesLines
...
* amdgpu: use handle table for KMS handlesChristian König2018-08-073-12/+13
| | | | | | | | Instead of the hash use the handle table. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
* amdgpu: add handle table implementation v2Christian König2018-08-073-1/+116
| | | | | | | | | | | | | The kernel handles are dense and the kernel always tries to use the lowest free id. Use this to implement a more efficient handle table by using a resizeable array instead of a hash. v2: add handle_table_fini function, extra key checks, fix typo in function name Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
* amdgpu: stop using the hash table for fd_tabChristian König2018-08-072-33/+17
| | | | | | | | | We have so few devices that just walking a linked list is probably faster. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
* amdgpu: add amdgpu_bo_handle_type_kms_noimportMarek Olšák2018-07-252-1/+10
| | | | | Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: make sure to set CLOEXEC on duplicated FDsChristian König2018-07-171-2/+3
| | | | | | | | Otherwise we leak file descriptors into child processes. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
* Revert "amdgpu: don't call add_handle_to_table for KMS BO exports"Michel Dänzer2018-07-111-1/+1
| | | | | | | | | | | | | This reverts commit fe0488aa13c35952b9f3f37ff2c74b6b858e8e73. It caused messages like amdgpu 0000:23:00.0: bo 000000007dce0b3e va 0x0000101800-0x000010181f conflict with 0x0000101800-0x0000101820 in dmesg, and eventually a Xorg crash while running piglit. Evidently, such BOs can actually be re-imported by other means than via a KMS handle.
* amdgpu: don't call add_handle_to_table for KMS BO exportsMarek Olšák2018-07-101-1/+1
| | | | Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
* amdgpu: Destroy fd_hash table when the last device is removed.Jan Vesely2018-05-251-0/+4
| | | | | | | | Fixes memory leak on module unload. Analogous to mesa commit of the same name. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu/util_hash_table: Add helper function to count the number of entries ↵Jan Vesely2018-05-252-0/+14
| | | | | | | | | in hash table Analogous to the mesa commit of the same name. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Take a lock before removing devices from fd_tab hash table.Jan Vesely2018-05-251-4/+7
| | | | | | | | | Close the file descriptors under lock as well. v2: close fds after removing from hash table Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Deinitialize vamgr_high{,_32}Michel Dänzer2018-04-271-0/+2
| | | | | | Fixes memory leaks. Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
* libdrm: amdgpu: Adding DRM_RDWR flag in amdgpu_bo_exportSatyajit2018-03-221-2/+3
| | | | | | | | | | | | | Currently while exporting prime handle to fd read write access is not granted. mmap fails because of this. mmap was not supported on prime initially. Here is link to related discussion https://lists.freedesktop.org/archives/dri-devel/2017-February/131840.html Adding the DRM_RDWR flag in amdgpu_bo_export to support mmap. Signed-off-by: Satyajit <satyajit.sahu@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
* meson,configure: include config.h automaticallyEric Engestrom2018-03-2012-48/+0
| | | | | | | | | This will prevent any more missing `#include "config.h"` bug, at the cost of having to recompile some files that didn't need to be when changing build options. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* meson: use pkg-config to detect libatomic_opsEric Engestrom2018-03-091-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* drm/amdgpu: Remove IB count checkingSabre Shao2018-03-081-2/+0
| | | | | Signed-off-by: Sabre Shao <Sabre.Shao@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* Revert "amdgpu:support 16 ibs per submit for PAL/SRIOV"Marek Olšák2018-03-081-1/+1
| | | | | | This reverts commit 924f856a9047b87e8bfdc2867f7fe484e3f71343. Wrong patch.
* amdgpu:support 16 ibs per submit for PAL/SRIOVQiang Yu2018-03-081-1/+1
| | | | | | | | | to support SRIOV and MCBP, need 16 IBs per submit Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"Christian König2018-02-281-2/+2
| | | | | | | | | The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation. This fixes crashes when 32bit addresses are in use. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
* amdgpu: add AMDGPU_VA_RANGE_HIGHChristian König2018-02-284-8/+24
| | | | | | | Return high addresses if requested and available. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: mostly revert "use the high VA range if possible v2"Christian König2018-02-282-14/+20
| | | | | | | | | | | | This reverts commit 07ea20d5beb24315b721adf83bbfa72ce016e146. Unfortunately it turned out that this change broke some corner cases in Mesa. Revert it for now, but keep the high range in separate VA managers. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* *-symbol-check: Don't hard-code nm executableHeiko Becker2018-02-232-1/+2
| | | | | | | | | | | | Helpful if your nm executable has a prefix based on the architecture, for example. Signed-off-by: Heiko Becker <heirecka@exherbo.org> Cc: Timo Gurr <timo.gurr@gmail.com> [Eric: v2: rebase and add Meson support] Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* amdgpu: Fix mistake in initial hole size calculation.Andrey Grodzovsky2018-02-191-1/+2
| | | | | Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
* amdgpu: Add amdgpu_query_sw_info to amdgpu-symbol-checkMichel Dänzer2018-02-121-0/+1
| | | | Fixes make check. Trivial.
* amdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address spaceMarek Olšák2018-02-093-0/+36
| | | | Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: clean up non list code path for vamgr v2Chunming Zhou2018-02-092-80/+44
| | | | | | | | v2: Add missing "goto out" Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com>
* Revert "amdgpu: clean up non list code path for vamgr"Michel Dänzer2018-02-082-43/+80
| | | | | | This reverts commit 41b94a3fb6e87d057fad78568d920d29489e5060. It caused crashes with radeonsi in at least glxgears and Xorg.
* amdgpu: clean up non list code path for vamgrChunming Zhou2018-02-082-80/+43
| | | | | Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix inefficient vamgr algorithmChunming Zhou2018-02-081-3/+1
| | | | | | | | | | | | | | | | | issue: UMD allocates top 4GB, but don't do anything, just reserve top 4GB space, but the performance of VP13 drops from 162fps to 99fps. root cause: our va hole list of vamgr is too long by time going. fix: reusing old hole as much as possible can make the list shortest. result: performance recovers as non-list path, next patch will remove non-list code path. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* remove unnecessary double-semicolonEric Engestrom2018-01-291-1/+1
| | | | | | Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* amdgpu: fix high VA maskChristian König2018-01-231-1/+1
| | | | | | | | | That constant needs to be 64bits. Fixes: amdgpu: use the high VA range if possible v2 Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* meson: fix the install path of amdgpu.idsChristoph Haag2018-01-181-2/+2
| | | | Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
* amdgpu: Don't print error message if parse_one_line returned -EAGAINMichel Dänzer2018-01-151-1/+1
| | | | | | | | | | | | | It means it just didn't find an entry for the GPU in the amdgpu.ids file. Fixes spurious amdgpu_parse_asic_ids: Cannot parse ASIC IDs: Resource temporarily unavailable error messages in that case. Reported-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* Add meson build systemDylan Baker2018-01-122-0/+69
| | | | | | | | | | This patch adds a complete meson build system, including tests and install. It has the necessary hooks to allow it be used as a subproject for other meson based builds such as mesa. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* amdgpu: use the high VA range if possible v2Christian König2018-01-091-4/+14
| | | | | | | | | Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM. v2: keep the 32bit range working. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: fix 32bit VA manager max addressChristian König2018-01-091-1/+1
| | | | | | | The range is exclusive not inclusive. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: Add syncobj reset & signal wrappers.Bas Nieuwenhuizen2017-12-183-0/+48
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* amdgpu: Only remember the device's marketing nameMichel Dänzer2017-12-055-102/+28
| | | | | | | | | There's no point in keeping around the full table of marketing names, when amdgpu_get_marketing_name only ever returns the device's marketing name. Acked-by: Slava Abramov <slava.abramov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Simplify error handling in parse_one_lineMichel Dänzer2017-12-051-29/+16
| | | | | | | | | | * Move empty/commented line check before the strdup and return -EAGAIN directly * Initialize r = -EAGAIN and remove redundant assignments * Set r = -ENOMEM if last strdup fails, and remove redundant goto Acked-by: Slava Abramov <slava.abramov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Clean up amdgpu_parse_asic_ids error handlingMichel Dänzer2017-12-013-12/+12
| | | | | | | | | | | * Move error message printing into amdgpu_parse_asic_ids and make it return void * Print only "Invalid format" error message if parse_one_line returns -EINVAL * Use strerror instead of printing the (negative) error code in hex Acked-by: Slava Abramov <slava.abramov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Add amdgpu_cs_create_syncobj2 to amdgpu-symbol-checkMichel Dänzer2017-11-301-0/+1
| | | | Fixes make check. Trivial.
* amdgpu: Adding amdgpu_cs_create_syncobj2 to create syncobj as signaled initiallyDavid Mao2017-11-292-0/+25
| | | | | | Signed-off-by: David Mao <david.mao@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* Revert "amdgpu: fix 32bit VA manager max address"Christian König2017-11-091-1/+1
| | | | | | | | This reverts commit 944f6665de36b6a6c36263f23b7b9d1730e544fa. Accidentially pushed an imcomplete patch. Signed-off-by: Christian König <christian.koenig@amd.com>
* Revert "amdgpu: use the high VA range if possible"Christian König2017-11-091-7/+2
| | | | | | | | This reverts commit 6c0ea4b0c5452bfc1e67b74ce723696ef3c80b25. Accidentially pushed an incomplete patch. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: use the high VA range if possibleChristian König2017-11-081-2/+7
| | | | | | This frees up the low range for HMM. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix 32bit VA manager max addressChristian König2017-11-081-1/+1
| | | | | | The range is exclusive not inclusive. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: sanitize 64bit VA managerChristian König2017-11-083-27/+8
| | | | | | | Adding the extra reservation of the 32bit space to the 64bit manager is complete nonsense and just a waste of memory and CPU cycles. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdpgu: fix coding style in amdgpu_vamgr.cChristian König2017-11-071-13/+14
| | | | | | No functional change. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: Fix wrappers for AMDGPU_VM IOCTL.Andrey Grodzovsky2017-11-032-6/+6
| | | | | | | | | Rmove amdgpu_context_handle from the interface and use amdgpu_device_handle instead. Uupdate VMID reservation test accordingly. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix 32-bit buildMarek Olšák2017-10-311-0/+3
|
* amdgpu: Add wrappers for AMDGPU_VM IOCTL.Andrey Grodzovsky2017-10-274-0/+71
| | | | | | | | | v2: Rename wrappers to match the IOCTL naming, fix identation and fix make check error. Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>