aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* amdgpu: implement context priority for amdgpu_cs_ctx_create2 v3Andres Rodriguez2017-10-201-4/+13
| | | | | | | | | | | | | | | | | Add a new context creation function that allows specifying the context priority. A high priority context has the potential of starving lower priority contexts. The current kernel driver implementation allows only apps that hold CAP_SYS_NICE or DRM_MASTER to acquire a priority above AMDGPU_CTX_PRIORITY_NORMAL. v2: corresponding changes for kernel patch v2 v3: Fixed 'make check' symbol error Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
* amdgpu: add amdgpu_cs_fence_to_handleMarek Olšák2017-10-121-0/+22
| | | | | | v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* amdgpu: add amdgpu_cs_syncobj_waitMarek Olšák2017-10-121-0/+12
| | | | | | v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* amdgpu: add sync_file import and export functionsMarek Olšák2017-10-121-0/+20
| | | | | | v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: add new low overhead command submission API. (v2)Dave Airlie2017-07-181-0/+47
| | | | | | | | | | | | | | This just sends chunks to the kernel API for a single command stream. This should provide a more future proof and extensible API for command submission. v2: use amdgpu_bo_list_handle, add two helper functions to access bo and context internals. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/amdgpu: add syncobj create/destroy/import/export apisDave Airlie2017-07-181-0/+38
| | | | | | | | These are just wrappers using the amdgpu device handle. Acked-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* amdgpu: Use the canonical form in branch predicateEdward O'Callaghan2017-05-031-1/+1
| | | | | | | Suggested-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* amdgpu/: concisely && consistently check null ptrs in canonical formEdward O'Callaghan2017-04-191-30/+13
| | | | | | | | | | Be consistent and use the canonical form while sanity checking null pointers, also combine a few branches for brevity. v2: rebase on top of 'add amdgpu_cs_wait_fences' series. Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* amdgpu: add the interface of waiting multiple fencesNicolai Hähnle2017-04-181-0/+71
| | | | | | | | | | | | | | | Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> [v2: allow returning the first signaled fence index] Signed-off-by: monk.liu <Monk.Liu@amd.com> [v3: - cleanup *status setting - fix amdgpu symbols check v4: simplify return from amdgpu_cs_wait_fences (suggested by Edward O'Callaghan)] Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> (v1) Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> (v1) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: fix for submition with no ibsKen Wang2016-02-041-0/+8
| | | | | | | 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>
* amdgpu: list each entry safely for sw semaphore when submit ibJunwei Zhang2016-01-191-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>
* amdgpu: add semaphore supportMarek Olšák2016-01-191-4/+169
| | | | | | | | | | | | 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>
* amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on errorTom St Denis2015-11-201-2/+4
| | | | | Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix overflow for timeout calculationJammy Zhou2015-11-201-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>
* Include <alloca.h> when needed before calling allocaAlan Coopersmith2015-09-121-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>
* amdgpu: remove sequence mutexChristian König2015-08-251-10/+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>
* amdgpu: hide the final internal functions from global namespaceEmil Velikov2015-08-131-1/+1
| | | | | | | | | | 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>
* 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/+5
| | | | | | | 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: Remove unused local variables bo_size/offset from amdgpu_cs_submitMichel Dänzer2015-08-051-2/+0
| | | | Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu : move management of user fence from libdrm to UMDKen Wang2015-08-051-108/+22
| | | | | | 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>
* amdgpu: Use drmIoctl in amdgpu_ioctl_wait_csMichel Dänzer2015-08-051-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>
* amdgpu: use common fence structure for dependencies as well.Christian König2015-08-051-2/+2
| | | | | | 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>
* amdgpu: improve the amdgpu_cs_query_fence_status interfaceJammy Zhou2015-08-051-3/+5
| | | | | | | 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>
* amdgpu: check the user fence only if the IP supports user fencesMarek Olšák2015-08-051-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>
* drm/amdgpu: allow passing absolute timeouts to amdgpu_cs_query_fence_statusMarek Olšák2015-08-051-2/+8
| | | | | | | 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>
* amdgpu: add CS dependencies v2Christian König2015-08-051-1/+33
| | | | | | | | | | 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>
* amdgpu: remove pointer arithmetic from command submissionChristian König2015-08-051-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>
* amdgpu: use alloca and malloc in critical codepaths (v2)Marek Olšák2015-08-051-3/+2
| | | | | | | | 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>
* amdgpu: add zero timeout check in amdgpu_cs_query_fence_statusJack Xiao2015-08-051-0/+5
| | | | | Signed-off-by: Jack Xiao <Jack.Xiao@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu: remove bo_handle from amdgpu_cs_ib_info, IBs should be in buffer listMarek Olšák2015-08-051-3/+2
| | | | Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: remove amdgpu_ib helpersMarek Olšák2015-08-051-88/+0
| | | | | Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: remove amdgpu_ibMarek Olšák2015-08-051-53/+19
| | | | | | | 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>
* amdgpu: don't use amdgpu_cs_create_ib for allocation of the fence BOMarek Olšák2015-08-051-8/+26
| | | | | | | amdgpu_cs_create_ib will go away. Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: get rid of IB pool management v3Jammy Zhou2015-08-051-417/+13
| | | | | | | | | 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>
* amdgpu: add IB sharing support v2Jammy Zhou2015-08-051-1/+11
| | | | | | | | | | | A new 'offset' flag is added to the amdgpu_cs_ib_info structure, which can be used to specify location of PM4 packets to execute in the IB buffer object v2: remove the shared IB flag, etc Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: implement amdgpu_cs_query_reset_stateMarek Olšák2015-08-051-0/+21
| | | | | | | v2: also return the number of hangs Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu: reuse the kernel IB flags v2Jammy Zhou2015-08-051-3/+1
| | | | | | | v2: remove 'CE' from the preamble flag Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: add ctx_id for wait_csJammy Zhou2015-08-051-2/+4
| | | | | | Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: David Zhou <david1.zhou@amd.com>
* amdgpu: fix segfault when resources are NULLmonk.liu2015-08-051-1/+2
| | | | | | Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu: add public bo list interface v3Christian König2015-08-051-84/+4
| | | | | | | | | | 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>
* amdgpu: cleanup public interface v2Christian König2015-08-051-67/+48
| | | | | | | | | | | | 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>
* amdgpu: do not call BO_LIST ioctl when no resource referredmonk.liu2015-08-051-0/+9
| | | | | | 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>
* amdgpu: fix an error of bo_list handlermonk.liu2015-08-051-2/+4
| | | | | | | | | original method is just totally wrong, it loses the bo_list handler at all after command stream accomplished 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>
* drm: add libdrm_amdgpu (v7)Alex Deucher2015-08-051-0/+981
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>