summaryrefslogtreecommitdiff
path: root/amdgpu/amdgpu_internal.h
AgeCommit message (Collapse)AuthorFilesLines
2018-08-07amdgpu: use handle table for flink namesChristian König1-1/+1
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>
2018-08-07amdgpu: use handle table for KMS handlesChristian König1-1/+2
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>
2018-08-07amdgpu: stop using the hash table for fd_tabChristian König1-0/+1
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>
2018-03-20meson,configure: include config.h automaticallyEric Engestrom1-4/+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>
2018-02-28amdgpu: add AMDGPU_VA_RANGE_HIGHChristian König1-1/+0
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>
2018-02-28amdgpu: mostly revert "use the high VA range if possible v2"Christian König1-1/+5
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>
2018-02-09amdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address spaceMarek Olšák1-0/+1
Reviewed-by: Christian König <christian.koenig@amd.com>
2018-02-09amdgpu: clean up non list code path for vamgr v2Chunming Zhou1-2/+0
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>
2018-02-08Revert "amdgpu: clean up non list code path for vamgr"Michel Dänzer1-0/+2
This reverts commit 41b94a3fb6e87d057fad78568d920d29489e5060. It caused crashes with radeonsi in at least glxgears and Xorg.
2018-02-08amdgpu: clean up non list code path for vamgrChunming Zhou1-2/+0
Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2017-12-05amdgpu: Only remember the device's marketing nameMichel Dänzer1-9/+2
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>
2017-12-01amdgpu: Clean up amdgpu_parse_asic_ids error handlingMichel Dänzer1-1/+1
* 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>
2017-11-08amdgpu: sanitize 64bit VA managerChristian König1-7/+0
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>
2017-08-08amdgpu: merge and cleanup amdgpu_bo_freeMonk Liu1-33/+0
since bo_reference and bo_internal_free are all only used by bo_free, so we just merge them together 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>
2017-08-08amdgpu: fix race issue between two bo functions(v2)Monk Liu1-2/+11
there is race issue between two threads on amdgpu_bo_reference and amdgpu_bo_import, this patch tends to fix it by moving the pthread_mutex_lock out of bo_free_internal and move to bo_reference to cover the update_reference part. The mutex_unlock in bo_import should also cover bo refcount increasement. 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>
2017-06-13amdgpu: move asic id table to a separate fileXiaojie Yuan1-0/+10
v2: fix an off by one error and leading white spaces v3: use thread safe strtok_r(); initialize len before calling getline(); change printf() to drmMsg(); add initial amdgpu.ids v4: integrate some recent internal changes, including format changes v5: fix line number for empty/commented lines; realloc to save memory; indentation changes v6: remove a line error v7: [Michel Dänzer] * Move amdgpu.ids to new data directory * Remove placeholder entries from amdgpu.ids * Set libdrmdatadir variable in configure.ac instead of Makefile.am [Emil Velikov] * Use isblank() instead of open-coding it [Emil Velikov] * Don't leak asic_id_table memory if realloc fails [Emil Velikov] * Check and bump table_max_size at the beginning of the while loop [Emil Velikov] * Initialize table_max_size to the number of entries in data/amdgpu.ids v8: [Michel Dänzer] * Make sure amdgpu_asic_id.c gets rebuilt when amdgpu.ids changes Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Samuel Li <Samuel.Li@amd.com>
2017-02-02amdgpu: vamgr can be a struct instead of a pointerAlex Xie1-1/+1
vamgr is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> [Grazvydas Ignotas: rebase, correct a typo in commit message] Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-02amdgpu: vamgr_32 can be a struct instead of a pointerAlex Xie1-1/+1
vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> [Grazvydas Ignotas: rebase, correct a typo in commit message] Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04amdgpu: fix for submition with no ibsKen Wang1-0/+1
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-01-20amdgpu: add semaphore supportMarek Olšák1-0/+15
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>
2015-08-25amdgpu: remove sequence mutexChristian König1-3/+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-17amdgpu: make vamgr per device v2Jammy Zhou1-8/+0
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 Zhou1-0/+9
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-13amdgpu: hide the final internal functions from global namespaceEmil Velikov1-21/+3
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 Velikov1-6/+12
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 Velikov1-0/+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-05amdgpu: add amdgpu_bo_va_op for va map/unmap support v3Jammy Zhou1-1/+0
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 : move management of user fence from libdrm to UMDKen Wang1-5/+0
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: add va allocation intefacesSabre Shao1-1/+8
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 Wang1-2/+2
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: remove amdgpu_ibMarek Olšák1-7/+0
Not useful if we're gonna use BO handles directly. Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: don't use amdgpu_cs_create_ib for allocation of the fence BOMarek Olšák1-1/+2
amdgpu_cs_create_ib will go away. Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: get rid of IB pool management v3Jammy Zhou1-19/+1
v1: by Jammy Zhou v2: remove bo wait when destroy IB by Jammy Zhou v3: more cleanups by Marek Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: make vamgr globalKen Wang1-5/+8
This is the first sub-patch of va interface task, the va task is about adding more va management interfaces for UMD, by design, the vamgr should be per-process rather than per-device. Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: remove bo_vas hash table v2Christian König1-2/+0
Not used any more. v2: Keep accidental removed lines. Signed-off-by: Christian König <christian.koenig@amd.com>
2015-08-05amdgpu: validate the upper limit of virtual address v2Jammy Zhou1-0/+3
Only 8GB virtual address space is used by default now v2: use -ENOSPC for the error case Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: fix round down/up page size errorJack Xiao1-2/+3
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com> Reviewed-by: Monk Liu monk.liu@amd.com Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05amdgpu: add public bo list interface v3Christian König1-0/+6
v2: cleanup comments and function parameter v3: rebased on internal branch Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05amdgpu: cleanup public interface v2Christian König1-0/+2
Remove the mostly unused device parameter, for the few cases where we really need it keep a copy in the context structure. v2: rebased on internal branch Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05amdgpu: support non-page-aligned userptrmonk.liu1-0/+3
Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05drm: add libdrm_amdgpu (v7)Alex Deucher1-0/+208
This is the new ioctl wrapper used by the new admgpu driver. It's primarily used by xf86-video-amdgpu and mesa. v2: fix amdgpu_drm.h install v3: Integrate some of the sugestions from Emil: clean up Makefile.am, configure.ac capitalize header guards fix _FILE_OFFSET_BITS with config.h use drm_mmap/drm_munmap Remove unused ARRAY_SIZE macro use shared list implementation use shared math implementation use drmGetNodeTypeFromFd helper v4: remove unused tiling defines v5: include amdgpu.h in Makefile.am v6: update amdgpu_drm.h v7: libdrm.h -> libdrm_macros.h Signed-off-by: Alex Deucher <alexander.deucher@amd.com>