summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-30tests/amdgpu: implement VCE unit testsLeo Liu6-1/+2749
Signed-off-by: Leo Liu <leo.liu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: make vamgr globalKen Wang4-19/+50
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-07-30tests/amdgpu: add shared IB submission test v2Jammy Zhou1-1/+65
v2: some function renaming Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: add IB sharing support v2Jammy Zhou2-1/+14
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>
2015-07-30amdgpu: add new AMDGPU_TILING flagsMarek Olšák1-18/+22
Copied from the kernel. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: add helper for VM mapping v2Christian König1-62/+44
Less code and also provides the map_size parameter. v2: Also set offset_in_bo, use *_handle defines. Signed-off-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: remove bo_vas hash table v2Christian König3-15/+0
Not used any more. v2: Keep accidental removed lines. Signed-off-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: add amdgpu_bo_list_update interface v2Jammy Zhou2-0/+54
v2: some minor improvement Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: replace alloca with calloc v2Jammy Zhou1-3/+8
use heap memory instead of stack memory to avoid potential stack overflow when a large number of resources are used for the bo_list. v2: some minor improvement Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: remove unused AMDGPU_IB_RESOURCE_PRIORITYJammy Zhou1-11/+0
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: fix the number of IB size enumsJammy Zhou1-6/+6
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: fix a valgrind warningMarek Olšák1-1/+1
==10307== Conditional jump or move depends on uninitialised value(s) ==10307== at 0xB9F4CFA: amdgpu_device_initialize (amdgpu_device.c:193) Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: implement amdgpu_cs_query_reset_stateMarek Olšák3-23/+34
v2: also return the number of hangs Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-30amdgpu: fix vamgr_free_va logicmonk.liu1-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>
2015-07-30amdgpu: fix code alignmentmonk.liu1-118/+118
Signed-off-by: monk.liu <monk.liu@amd.com>
2015-07-30amdgpu: validate the upper limit of virtual address v2Jammy Zhou4-1/+31
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-07-30amdgpu: reuse the kernel IB flags v2Jammy Zhou4-10/+5
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>
2015-07-30amdgpu: add ctx_id for wait_csJammy Zhou2-3/+5
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>
2015-07-30amdgpu: 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-07-30amdgpu: fix 32-on-64 support (v2)Jammy Zhou1-1/+1
0xffffffff was appended to the higher 32bit with (intptr_t) when use 32bit libdrm_amdgpu.so with 64bit kernel, and it caused segmentation fault for 32bit application. v2: switch to uintptr_t Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-30amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UCJammy Zhou2-16/+10
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30amdgpu: remove active_rb_pipes from amdgpu_gpu_infoJammy Zhou2-3/+0
The active RB pipes can be retrieved from enabled_rb_pipes_mask, for which each bit indicates one active pipe if it is '1'. Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: fix segfault when resources are NULLmonk.liu1-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>
2015-07-30amdgpu: compare the primary device names insteadChristian König1-18/+27
Instead of taking a look at the device major/minor we just compare the primary device name to figure out if two fds are pointing to the same device. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2015-07-30amdgpu: add public bo list interface v3Christian König6-98/+123
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-07-30amdgpu: cleanup public interface v2Christian König5-110/+78
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-07-30amdgpu: do not call BO_LIST ioctl when no resource referredmonk.liu1-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>
2015-07-30amdgpu: fix an error of bo_list handlermonk.liu1-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>
2015-07-30amdgpu: add missing mutex lock/unlock pairmonk.liu1-0/+2
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-07-30amdgpu: support non-page-aligned userptrmonk.liu2-1/+14
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-07-30drm: add tests/amdgpu (v3)Alex Deucher10-0/+2347
This adds some basic unit tests for the new amdgpu driver. v2: use common util_math.h v3: implement suggestions from Emil replace malloc/memset with calloc make header guards all caps use posix_memalign rather than mem_align replace malloc with calloc for pm4 allocations make CU_SuiteInfo static fix Makefile.am fix fd numbering use drmGetVersion/drmFreeVersion rather than open coding it close fd, clean up CU registry on error Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30drm: add libdrm_amdgpu (v7)Alex Deucher17-0/+5258
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>
2015-07-30drm: add util_math.hAlex Deucher2-1/+34
Used by amdgpu, could be used by other components. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-30drm: consolidate common list implementations (v2)Alex Deucher7-143/+5
This is used by radeon and freedreno and will be used by amdgpu. I looked at switching to libdrm_lists.h, but it's pretty horrible. E.g., DRMLISTFOREACHENTRYSAFE. v2: remove missed list.h from tests/radeon/Makefile.am Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-29xf86drm: use the correct device minor names on OpenBSDJonathan Gray2-3/+20
Add defines for the device minor names and make use of them in drmGetMinorName() so the correct paths will be used on OpenBSD. v2: don't add new defines to xf86drm.h to keep them out of the API as requested by Emil. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-29xf86drm: correct the OpenBSD DRM_MAJOR defineJonathan Gray1-3/+7
As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007. Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88. v2: rearrange ifdefs as suggested by Emil. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-29xf86drmMode: Implement drmCheckModesettingSupported() for OpenBSDJonathan Gray1-1/+18
This is implemented with kms ioctls so it could also be used as a generic fallback. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-29man: remove .man_fixup workaroundEmil Velikov1-8/+3
The whole thing is quite messy - the file is used to indicate that the man pages were correctly generated prior to applying the "fixup" (alias) At the same time we use a rule with the same name, to create the same file if the generation has failed. In other words - it attempts to create the file either way. So there is little point in it and we can remove it. Spotted while attempting to build with bmake which kindly blocked on the following (non compliant construct) .man_fixup: | $(miscman_DATA) Cc: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-28drm: Detect no-op drmModeAtomicRequest and return earlyChris Wilson1-2/+6
If the number of items to process in the request is zero, we can forgo duplicating, sorting the request and feeding it into the kernel and instead report success immediately. This prevents a NULL dereference of the sorted->items for the no-op request. Fixes: ed44e0b9585c563905447eceed12af9c1c7ca8d4 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Rob Clark <robclark@freedesktop.org> Cc: Daniel Stone <daniels@collabora.com> Cc: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-20Build vbltest irrespective of the presence of libudev.Joonyoung Shim1-5/+1
The vbltest doesn't have any dependency of LIBUDEV. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-16Consistently check the fd valueEmil Velikov2-2/+2
Follow the approach used through the rest of the project. Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}Emil Velikov1-1/+1
Spotted by looking for similar "let's assume fd == 0 is invalid" bugs. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16omap: zero is a valid fd number, treat it as suchEmil Velikov1-2/+2
Equivalent to the previous patch. Cc: Rob Clark <robdclark@gmail.com> Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16freedreno: zero is a valid fd number, treat it as suchEmil Velikov4-4/+6
Abeit quite unlikely to get hit by this bug here, let just fix it. v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD) when we already have the fd). v3: Fix kgsl_pipe.c, suggested by Thierry. Cc: freedreno@lists.freedesktop.org Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
2015-07-13include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()Alan Coopersmith1-0/+4
Linux seems to pick these up via another header, but Solaris needs them explicitly included, or we get undefined symbol errors for major & minor. v2: use headers documented in makedev(3C) man page instead of sysmacros.h Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> v3 [Emil Velikov]: include sys/mkdev.h only when available. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-11Fix headers inclusion in xf86drmMode.cJulien Cristau2-1/+4
Add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD Updated by Thorsten “mirabilos” Glaser <t.glaser@tarent.de> to add autoconf check and only include <sys/sysctl.h> if it is detected by configure as it’s unusable on Linux/x32 (and others, e.g. other new architectures). Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-06Set alignment value in drm_intel_add_validate_buffer()Anuj Phogat1-2/+2
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-07-06i965/gen9: Pass alignment as function parameter in ↵Anuj Phogat1-14/+21
drm_intel_gem_bo_alloc_internal() In case of YF/YS tiled buffers libdrm need not know about the tiling format because these buffers don't have hardware support to be tiled or detiled through a fenced region. But, libdrm still need to know about buffer alignment restrictions because kernel uses it when resolving the relocation. Mesa uses drm_intel_gem_bo_alloc_for_render() to allocate Yf/Ys buffers. So, use the passed alignment value in this function to initialize the align variable in drm_intel_bo. Note that we continue ignoring the alignment value passed to drm_intel_gem_bo_alloc() to follow the previous behavior. V2: Add a condition to avoid allocation from cache. (Ben) V3: Make no changes in cache allocation strategy. Just update the alignment. Update the aperture size estimate including the alignment. (Ben, Chris) V4: Move aperture size adjustments inside drm_intel_bo_gem_set_in_aperture_size() Don't split sentences across the one-line header and the changelog. (Chris) Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-30configure: default --enable-valgrind to autoEmil Velikov1-1/+1
... as the help text says. Reported-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29configure.ac: bump version to 2.4.62 for releaseEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>