summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-30libdrm/amdgpu: Use private fd for amdgpu_device and winsys hash table to fix ↵amdgpuMario 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-07-30libdrm/amdgpu: Fixed drm.h include.Alexandr Akulich1-1/+1
The include type changed from system to own. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alexandr Akulich <akulichalexander@gmail.com>
2015-07-30amdgpu/tests: Cast CPU map argument of amdgpu_bo_alloc_and_map to void**Michel Dänzer1-6/+8
Silences incompatible pointer type compiler warnings. Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu/tests: Use buf_handle in amdgpu_bo_alloc_and_map() error pathsMichel Dänzer1-3/+3
The compiler pointed out that bo has the wrong type. Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: add VCE harvesting instance queryLeo Liu3-0/+5
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-07-30test/amdgpu : fix a bug in VCE/UVD test introduced by previous changeKen Wang2-0/+4
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: add amdgpu_bo_va_op for va map/unmap support v3Jammy Zhou8-243/+391
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-07-30amdgpu: 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-07-30amdgpu : move management of user fence from libdrm to UMDKen Wang6-134/+69
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-07-30amdgpu: fix bs buffer size for vce testChristian König1-1/+1
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30tests/amdgpu: remove the duplicate IB allocation for VCE testJammy Zhou1-8/+0
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30drm: fix the ALIGN macro to avoid value clampJammy Zhou1-1/+2
If the value is 64bit, but the alignment is 32bit type, the high 32bit will be clamped with previous definition Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: 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-07-30amdgpu: use common fence structure for dependencies as well.Christian König5-40/+17
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-07-30amdgpu: improve the amdgpu_cs_query_fence_status interfaceJammy Zhou5-22/+27
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-07-30amdgpu: 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-07-30amdgpu: 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-07-30amdgpu: 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-07-30amdgpu: 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-07-30drm/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-07-30amdgpu: 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-07-30amdgpu: 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>
2015-07-30gitignore: add some generated amdgpu filesChristian König1-0/+2
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: add CS dependencies v2Christian König2-1/+69
This allows the driver to specify on which previous CS to wait. v2: fix spelling in comment Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-30amdgpu: update to the latest kernel headerAlex Deucher1-44/+91
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: remove pointer arithmetic from command submissionChristian König1-12/+6
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-30amdgpu: do NULL check for bo handle in amdgpu_bo_query_infoJammy Zhou1-0/+4
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: cleanup VA IOCTL handlingChristian König2-32/+18
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: remove flink export workaround v2Christian König1-6/+0
Alternative solution to Mareks patch to stop causing trouble with render nodes. v2: rebased Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: explicitly unmap GPU mapping on BO destructionChristian König1-24/+57
That exercises the IOCTL and stops relying us on implicit unmapping. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: merge amdgpu_drm.h from kernelJammy Zhou1-10/+7
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: cleanup gds specific alloc/free functionsJammy Zhou1-60/+0
amdgpu_bo_alloc/free can be used with GDS/OA/QWS domains specified Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: add amdgpu_query_gds_infoJammy Zhou2-3/+27
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: fix double mutex_unlock in amdgpu_bo_importMarek Olšák1-1/+1
The handles array is used below, which is followed by another unlock, so remove the first one. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: fix valgrind warningsMarek Olšák2-2/+2
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: use alloca and malloc in critical codepaths (v2)Marek Olšák2-12/+23
And don't clear the memory when it's unnecessary. v2: use malloc for arrays that can be big Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: allow exporting KMS handles with render nodesMarek Olšák1-3/+5
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: add zero timeout check in amdgpu_cs_query_fence_statusJack Xiao1-0/+5
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: remove bo_handle from amdgpu_cs_ib_info, IBs should be in buffer listMarek Olšák7-27/+68
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: remove amdgpu_ib helpersMarek Olšák6-214/+102
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: remove amdgpu_ibMarek Olšák6-80/+32
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-07-30amdgpu: don't use amdgpu_cs_create_ib for allocation of the fence BOMarek Olšák2-9/+28
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-07-30tests/amdgpu: manage IB in client sideJammy Zhou2-7/+15
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: get rid of IB pool management v3Jammy Zhou3-455/+14
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-07-30amdgpu: add ib_start_alignment and ib_size_alignment for interface queryKen Wang1-0/+4
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: add ce_ram_size for interface queryKen Wang3-0/+5
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: add vram_type and vram_bit_width for interface queryKen Wang3-0/+19
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: add max_memory_clock for interface queryKen Wang3-0/+4
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: rename GEM_OP_SET_INITIAL_DOMAIN -> GEM_OP_SET_PLACEMENTMarek Olšák1-2/+2
No users. Signed-off-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: stop checking flag masksChristian König2-10/+2
The kernel is responsible for parameter checking, not libdrm. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com>