aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu/amdgpu_vamgr.c
Commit message (Collapse)AuthorAgeFilesLines
* amdgpu: annotate public functionsLucas De Marchi2018-09-191-12/+12
| | | | | | | | | | | | | | | | | | | | | | | This was done with: nm --dynamic --defined-only build/amdgpu/libdrm_amdgpu.so | \ grep amdgpu_ | \ cut -d' ' -f3 > /tmp/a.txt while read sym; do read f func line _ <<<$(cscope -d -L -1 $sym) if [ ! -z "$f" ]; then line=$((line-1)) sed -i "${line}s/^/drm_public /" $f fi done < /tmp/a.txt Then the alignment of function arguments were manually fixed all over. The idea here will be to switch the default visibility to hidden so we don't export symbols we shouldn't. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
* meson,configure: include config.h automaticallyEric Engestrom2018-03-201-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>
* amdgpu: add AMDGPU_VA_RANGE_HIGHChristian König2018-02-281-5/+19
| | | | | | | 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: 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: clean up non list code path for vamgr v2Chunming Zhou2018-02-091-78/+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-081-43/+78
| | | | | | 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-081-78/+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>
* amdgpu: sanitize 64bit VA managerChristian König2017-11-081-2/+2
| | | | | | | 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: vamgr can be a struct instead of a pointerAlex Xie2017-02-021-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>
* amdgpu: vamgr_32 can be a struct instead of a pointerAlex Xie2017-02-021-2/+2
| | | | | | | | | | | | 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>
* amdgpu: Fix use-after-free bug in vamgr_deinitTom St Denis2015-10-221-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>
* amdgpu: Unlock mutex if base_required is invalidTom St Denis2015-10-221-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>
* amdgpu: make vamgr per device v2Jammy Zhou2015-08-171-25/+1
| | | | | | | | | | | 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>
* amdgpu: add flag to support 32bit VA address v4Jammy Zhou2015-08-171-7/+25
| | | | | | | | | | | | | | | | | 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>
* amdgpu: improve amdgpu_vamgr_initJammy Zhou2015-08-171-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>
* amdgpu/amdgpu_vamgr: hide private symbols from global namespaceEmil Velikov2015-08-131-7/+10
| | | | | | | 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>
* amdgpu: cosmetic chances in license boilerplateEmil Velikov2015-08-131-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>
* amdgpu: add a bunch of missing config.h includesEmil Velikov2015-08-131-0/+4
| | | | | | | 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>
* amdgpu: add flags parameter for amdgpu_va_range_allocJammy Zhou2015-08-051-1/+2
| | | | | | | | 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>
* amdgpu: add va range query interfaceSabre Shao2015-08-051-0/+11
| | | | | | | | 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>
* amdgpu: add va allocation intefacesSabre Shao2015-08-051-0/+44
| | | | | | | | | | 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>
* amdgpu: add base_preferred parameter to amdgpu_vamgr_find_vaKen Wang2015-08-051-14/+32
| | | | | | | | 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>
* amdgpu: make vamgr globalKen Wang2015-08-051-10/+38
| | | | | | | | | 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>
* amdgpu: fix vamgr_free_va logicmonk.liu2015-08-051-0/+3
| | | | | | | | va+size will overflow if va equals to AMDGPU_INVALID_VA_ADDRESS, just return when hit that condition Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
* amdgpu: fix code alignmentmonk.liu2015-08-051-118/+118
| | | | Signed-off-by: monk.liu <monk.liu@amd.com>
* amdgpu: validate the upper limit of virtual address v2Jammy Zhou2015-08-051-0/+7
| | | | | | | | 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>
* drm: add libdrm_amdgpu (v7)Alex Deucher2015-08-051-0/+169
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>