OSDN Git Service

android-x86/external-libdrm.git
8 years agoamdgpu: remove sequence mutex
Christian König [Mon, 24 Aug 2015 09:43:29 +0000 (11:43 +0200)]
amdgpu: remove sequence mutex

It's not used any more.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
8 years agoMove -lm link flag to LIBADD
Emil Velikov [Mon, 24 Aug 2015 17:21:51 +0000 (18:21 +0100)]
Move -lm link flag to LIBADD

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodrm: Add -lm to libdrm ldflags to fix build failure.
Jérôme Glisse [Mon, 24 Aug 2015 17:16:56 +0000 (13:16 -0400)]
drm: Add -lm to libdrm ldflags to fix build failure.

Last commit (b556ea127e004b734b2a7bf8e67cdcf56312171d) introduced
use of log2 which require -lm flag for the linker on quite few
distribution. Just add that flag to fix build.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
8 years agodrm: add interface to get drm devices on the system v3
Emil Velikov [Mon, 17 Aug 2015 03:09:06 +0000 (11:09 +0800)]
drm: add interface to get drm devices on the system v3

For mutiple GPU support, the devices on the system should be enumerated
to get necessary information about each device, and the drmGetDevices
interface is added for this. Currently only PCI devices are supported for
the enumeration.

Typical usage:
int count;
drmDevicePtr *foo;
count = drmGetDevices(NULL, 0);
foo = calloc(count, sizeof(drmDevicePtr));
count = drmGetDevices(foo, count);
/* find proper device, open correct device node, etc */
drmFreeDevices(foo, count);
free(foo);

v2: [Jammy Zhou]
 - return a list of devices, rather than nodes
v3: [Jammy Zhou]
 - fix the signed extension for PCI device info

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agodrm: fix the usage after free
Mathias Tillman [Mon, 24 Aug 2015 03:56:13 +0000 (11:56 +0800)]
drm: fix the usage after free

For readdir_r(), the next directory entry is returned in caller-allocted
buffer (pointered by pent here).

https://bugs.freedesktop.org/show_bug.cgi?id=91704

Signed-off-by: Mathias Tillman <master.homer@gmail.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agofreedreno: get bo size for imported dma-buf
Varad Gautam [Fri, 21 Aug 2015 16:44:35 +0000 (22:14 +0530)]
freedreno: get bo size for imported dma-buf

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno: fill bo->fd when importing
Varad Gautam [Fri, 21 Aug 2015 16:44:34 +0000 (22:14 +0530)]
freedreno: fill bo->fd when importing

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno: fix a bo cache segfault with imported bo's
Varad Gautam [Fri, 21 Aug 2015 16:44:33 +0000 (22:14 +0530)]
freedreno: fix a bo cache segfault with imported bo's

Importing a bo whose handle is still in the bo cache crashes during cleanup.
Remove bo from cache when importing.

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agointel: Serialize drmPrimeFDToHandle with struct_mutex
Rafał Sapała [Fri, 24 Jul 2015 09:22:34 +0000 (11:22 +0200)]
intel: Serialize drmPrimeFDToHandle with struct_mutex

It is possible to hit a race condition in create_from_prime, when trying
to import a BO that's currently being freed. In case of prime sharing
we'll succesfully get a handle, but fail on get_tiling call, potentially
confusing the caller (and requiring different locking scheme than with
sharing using flink). Wrap fd_to_handle with struct_mutex to force
a more consistent behaviour between prime/flink, convert fprintf to DBG
when handling errors.

(From Chris:
  The race is that the kernel returns us the same file-private handle as
  the first thread, but that first thread is about to call gem_close
  (thereby removing the handle from the file completely) and does so
  between us acquiring the handle and taking the mutex. If we take
  the mutex, then we acquire the refcnt on the bo prior to the first
  thread completing its unref (and so preventing the early close). Or we
  acquire the handle after the earlier close, in which case we are the new
  owner.
)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Testcase: igt/drm_import_export/import-close-race-prime
Signed-off-by: Rafał Sapała <rafal.a.sapala@intel.com>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
8 years agomodetest: remove the trailing white spaces
Hyungwon Hwang [Wed, 19 Aug 2015 00:58:42 +0000 (09:58 +0900)]
modetest: remove the trailing white spaces

This patch removes the trailing white spaces.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
8 years agoxf86drmMode: remove the trailing white spaces
Hyungwon Hwang [Wed, 19 Aug 2015 00:58:39 +0000 (09:58 +0900)]
xf86drmMode: remove the trailing white spaces

This patch removes the trailing white spaces.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
8 years agoamdgpu: add Android build support
Mauro Rossi [Tue, 18 Aug 2015 09:43:57 +0000 (11:43 +0200)]
amdgpu: add Android build support

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoamdgpu: add Makefile.sources
Mauro Rossi [Thu, 20 Aug 2015 15:55:20 +0000 (16:55 +0100)]
amdgpu: add Makefile.sources

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
[Emil Velikov: remove duplicate amdgpu.h from LIBDRM_AMDGPU_FILES]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoBump version for release
Rob Clark [Tue, 18 Aug 2015 15:56:50 +0000 (11:56 -0400)]
Bump version for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno: update freedreno-symbol-check
Rob Clark [Tue, 18 Aug 2015 14:53:36 +0000 (10:53 -0400)]
freedreno: update freedreno-symbol-check

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agolibdrm: Make indentation consistent
Thierry Reding [Wed, 9 Apr 2014 07:00:49 +0000 (09:00 +0200)]
libdrm: Make indentation consistent

Use tabs and spaces consistently to align function arguments on
subsequent lines with those of the first line.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
8 years agolibdrm: Remove gratuitous blank lines
Thierry Reding [Wed, 9 Apr 2014 06:59:04 +0000 (08:59 +0200)]
libdrm: Remove gratuitous blank lines

Usage of blank lines can be a matter of taste, of course, but for these
we can surely all agree that they're not needed and inconsistent.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
8 years agoamdgpu: make vamgr per device v2
Jammy Zhou [Mon, 17 Aug 2015 03:09:09 +0000 (11:09 +0800)]
amdgpu: make vamgr per device v2

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>
8 years agoamdgpu: add flag to support 32bit VA address v4
Jammy Zhou [Mon, 17 Aug 2015 03:09:08 +0000 (11:09 +0800)]
amdgpu: add flag to support 32bit VA address v4

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>
8 years agoamdgpu: improve amdgpu_vamgr_init
Jammy Zhou [Mon, 17 Aug 2015 03:09:07 +0000 (11:09 +0800)]
amdgpu: improve amdgpu_vamgr_init

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>
8 years agofreedreno: add fd_pipe_wait_timeout()
Rob Clark [Mon, 17 Aug 2015 14:33:59 +0000 (10:33 -0400)]
freedreno: add fd_pipe_wait_timeout()

We need to pass through a timeout parameter to implement
pipe->fence_finish() properly.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/msm: dump out submit info on error
Rob Clark [Tue, 21 Jul 2015 16:55:29 +0000 (12:55 -0400)]
freedreno/msm: dump out submit info on error

User should only see these with LIBGL_DEBUG=verbose.  But in case you
are hitting issues like "handle X at index Y already on submit list"
errors from the kernel, this gives some useful visibility for debug.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/msm: fix issue where same bo is on multiple rings
Rob Clark [Tue, 21 Jul 2015 15:57:00 +0000 (11:57 -0400)]
freedreno/msm: fix issue where same bo is on multiple rings

It should be a less common case, but it is possible for a single bo to
be on multiple rings, for example when sharing a buffer across multiple
pipe_context's created from same pipe_screen.

So rather than completely fall over in this case, fallback to slow-path
of looping over all bo's in the ring's bo-table (but retain the fast-
path of constant-lookup for the first ring the buffer is on).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/msm: reorg ringbuffer struct
Rob Clark [Tue, 21 Jul 2015 16:11:36 +0000 (12:11 -0400)]
freedreno/msm: reorg ringbuffer struct

Group the parts related to building out submit ioctl into their own
sub-struct.  Split out from next commit since it is just boring churn.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agotests/amdgpu: Remove unused local variable 'i'
Michel Dänzer [Mon, 17 Aug 2015 09:43:39 +0000 (18:43 +0900)]
tests/amdgpu: Remove unused local variable 'i'

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agotests/amdgpu: Include config.h first
Michel Dänzer [Mon, 17 Aug 2015 09:41:11 +0000 (18:41 +0900)]
tests/amdgpu: Include config.h first

Fixes build failure on 32-bit because _FILE_OFFSET_BITS wasn't defined to
64.

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agotests: modetest: Accept connector names in addition to connector IDs
Thierry Reding [Fri, 23 Jan 2015 16:08:21 +0000 (17:08 +0100)]
tests: modetest: Accept connector names in addition to connector IDs

Allow connector names to be used in the specification of the -s option.
This requires storing the string passed on the command-line so that it
can later be resolved to a connector ID (after the DRM device has been
opened).

Connector names are constructed from the connector type name and
connector type ID using the same format as used internally in the
Linux kernel.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agoBump version for release
Marek Olšák [Fri, 14 Aug 2015 12:19:29 +0000 (14:19 +0200)]
Bump version for release

8 years agoamdgpu: add symbols check test
Emil Velikov [Fri, 7 Aug 2015 16:29:11 +0000 (17:29 +0100)]
amdgpu: add symbols check test

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>
8 years agoamdgpu: hide the final internal functions from global namespace
Emil Velikov [Fri, 7 Aug 2015 16:09:35 +0000 (17:09 +0100)]
amdgpu: hide the final internal functions from global namespace

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>
8 years agoamdgpu/amdgpu_vamgr: hide private symbols from global namespace
Emil Velikov [Fri, 7 Aug 2015 15:54:29 +0000 (16:54 +0100)]
amdgpu/amdgpu_vamgr: hide private symbols from global namespace

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>
8 years agoamdgpu: squash trivial documentation typo
Emil Velikov [Fri, 7 Aug 2015 15:48:02 +0000 (16:48 +0100)]
amdgpu: squash trivial documentation typo

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>
8 years agoamdgpu: cosmetic chances in license boilerplate
Emil Velikov [Fri, 7 Aug 2015 16:20:51 +0000 (17:20 +0100)]
amdgpu: cosmetic chances in license boilerplate

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>
8 years agoamdgpu: add a bunch of missing config.h includes
Emil Velikov [Fri, 7 Aug 2015 16:17:43 +0000 (17:17 +0100)]
amdgpu: add a bunch of missing config.h includes

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>
8 years agoamdgpu/util_hash_table: hide private symbols from global namespace
Emil Velikov [Fri, 7 Aug 2015 15:44:33 +0000 (16:44 +0100)]
amdgpu/util_hash_table: hide private symbols from global namespace

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>
8 years agoamdgpu/util_hash: hide private symbols from global namespace
Emil Velikov [Fri, 7 Aug 2015 15:40:45 +0000 (16:40 +0100)]
amdgpu/util_hash: hide private symbols from global namespace

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>
8 years agoForce enable amdgpu for the dist build/check.
Emil Velikov [Fri, 7 Aug 2015 15:19:49 +0000 (16:19 +0100)]
Force enable amdgpu for the dist build/check.

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>
8 years agoradeon: add new OLAND pci id
Alex Deucher [Mon, 10 Aug 2015 19:37:19 +0000 (15:37 -0400)]
radeon: add new OLAND pci id

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agomodeprint: cleanup, remove compile warnings
Tapani Pälli [Fri, 7 Aug 2015 07:37:58 +0000 (10:37 +0300)]
modeprint: cleanup, remove compile warnings

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agointel: wrap intel_bufmgr.h C code for C++ compilation/linking
Tapani Pälli [Fri, 7 Aug 2015 07:37:57 +0000 (10:37 +0300)]
intel: wrap intel_bufmgr.h C code for C++ compilation/linking

We need this include in porting changes for the OpenGL ES
conformance suite.

v2: remove c_plusplus usage

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoremove usage of 'c_plusplus' preprocessor macro
Tapani Pälli [Fri, 7 Aug 2015 07:37:56 +0000 (10:37 +0300)]
remove usage of 'c_plusplus' preprocessor macro

Use only __cplusplus which is supported by the C++ standard.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoadd a note about which version of cunit is fixed for debian/ubuntu
Alex Deucher [Thu, 6 Aug 2015 17:44:16 +0000 (13:44 -0400)]
add a note about which version of cunit is fixed for debian/ubuntu

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agomove up cunit workaround for ubuntu/debian
Alex Deucher [Thu, 6 Aug 2015 17:38:31 +0000 (13:38 -0400)]
move up cunit workaround for ubuntu/debian

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agofix amdgpu cunit configure test harder
Alex Deucher [Thu, 6 Aug 2015 15:19:55 +0000 (11:19 -0400)]
fix amdgpu cunit configure test harder

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agofix configuration when amdgpu is disabled
Alex Deucher [Thu, 6 Aug 2015 15:13:48 +0000 (11:13 -0400)]
fix configuration when amdgpu is disabled

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: Remove unused local variables bo_size/offset from amdgpu_cs_submit
Michel Dänzer [Tue, 4 Aug 2015 03:37:23 +0000 (12:37 +0900)]
amdgpu: Remove unused local variables bo_size/offset from amdgpu_cs_submit

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: expose the PCI revision ID
Jammy Zhou [Mon, 3 Aug 2015 07:46:42 +0000 (15:46 +0800)]
amdgpu: expose the PCI revision ID

The PCI revision ID can be used to differentiate ASICs.

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agolibdrm/amdgpu: Use private fd for amdgpu_device and winsys hash table to fix ZaphodHe...
Mario Kleiner [Wed, 29 Jul 2015 19:09:04 +0000 (21:09 +0200)]
libdrm/amdgpu: Use private fd for amdgpu_device and winsys hash table to fix 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>
8 years agolibdrm/amdgpu: Fixed drm.h include.
Alexandr Akulich [Thu, 16 Jul 2015 20:19:12 +0000 (01:19 +0500)]
libdrm/amdgpu: Fixed drm.h include.

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>
8 years agoamdgpu/tests: Cast CPU map argument of amdgpu_bo_alloc_and_map to void**
Michel Dänzer [Tue, 21 Jul 2015 08:53:42 +0000 (17:53 +0900)]
amdgpu/tests: Cast CPU map argument of amdgpu_bo_alloc_and_map to void**

Silences incompatible pointer type compiler warnings.

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu/tests: Use buf_handle in amdgpu_bo_alloc_and_map() error paths
Michel Dänzer [Tue, 21 Jul 2015 08:51:27 +0000 (17:51 +0900)]
amdgpu/tests: Use buf_handle in amdgpu_bo_alloc_and_map() error paths

The compiler pointed out that bo has the wrong type.

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: add VCE harvesting instance query
Leo Liu [Mon, 13 Jul 2015 16:51:34 +0000 (12:51 -0400)]
amdgpu: add VCE harvesting instance query

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>
8 years agotest/amdgpu : fix a bug in VCE/UVD test introduced by previous change
Ken Wang [Fri, 17 Jul 2015 11:39:56 +0000 (19:39 +0800)]
test/amdgpu : fix a bug in VCE/UVD test introduced by previous change

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: add amdgpu_bo_va_op for va map/unmap support v3
Jammy Zhou [Mon, 13 Jul 2015 12:57:44 +0000 (20:57 +0800)]
amdgpu: add amdgpu_bo_va_op for va map/unmap support v3

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>
8 years agoamdgpu: add flags parameter for amdgpu_va_range_alloc
Jammy Zhou [Thu, 16 Jul 2015 02:29:58 +0000 (10:29 +0800)]
amdgpu: add flags parameter for amdgpu_va_range_alloc

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>
8 years agoamdgpu : move management of user fence from libdrm to UMD
Ken Wang [Fri, 10 Jul 2015 14:22:27 +0000 (22:22 +0800)]
amdgpu : move management of user fence from libdrm to UMD

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>
8 years agoamdgpu: fix bs buffer size for vce test
Christian König [Wed, 15 Jul 2015 08:56:20 +0000 (10:56 +0200)]
amdgpu: fix bs buffer size for vce test

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agotests/amdgpu: remove the duplicate IB allocation for VCE test
Jammy Zhou [Mon, 13 Jul 2015 14:43:29 +0000 (22:43 +0800)]
tests/amdgpu: remove the duplicate IB allocation for VCE test

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm: fix the ALIGN macro to avoid value clamp
Jammy Zhou [Mon, 13 Jul 2015 08:49:42 +0000 (16:49 +0800)]
drm: fix the ALIGN macro to avoid value clamp

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>
8 years agoamdgpu: Use drmIoctl in amdgpu_ioctl_wait_cs
Michel Dänzer [Tue, 14 Jul 2015 03:42:19 +0000 (12:42 +0900)]
amdgpu: Use drmIoctl in amdgpu_ioctl_wait_cs

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>
8 years agoamdgpu: use common fence structure for dependencies as well.
Christian König [Thu, 9 Jul 2015 09:48:32 +0000 (11:48 +0200)]
amdgpu: use common fence structure for dependencies as well.

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>
8 years agoamdgpu: improve the amdgpu_cs_query_fence_status interface
Jammy Zhou [Thu, 9 Jul 2015 05:51:13 +0000 (13:51 +0800)]
amdgpu: improve the amdgpu_cs_query_fence_status interface

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>
8 years agoamdgpu: add va range query interface
Sabre Shao [Thu, 9 Jul 2015 05:53:24 +0000 (13:53 +0800)]
amdgpu: add va range query interface

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>
8 years agoamdgpu: add va allocation intefaces
Sabre Shao [Thu, 9 Jul 2015 05:50:36 +0000 (13:50 +0800)]
amdgpu: add va allocation intefaces

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>
8 years agoamdgpu: add base_preferred parameter to amdgpu_vamgr_find_va
Ken Wang [Thu, 9 Jul 2015 05:48:25 +0000 (13:48 +0800)]
amdgpu: add base_preferred parameter to amdgpu_vamgr_find_va

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>
8 years agoamdgpu: check the user fence only if the IP supports user fences
Marek Olšák [Wed, 8 Jul 2015 09:12:31 +0000 (11:12 +0200)]
amdgpu: check the user fence only if the IP supports user fences

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>
8 years agodrm/amdgpu: allow passing absolute timeouts to amdgpu_cs_query_fence_status
Marek Olšák [Fri, 26 Jun 2015 19:58:17 +0000 (21:58 +0200)]
drm/amdgpu: allow passing absolute timeouts to amdgpu_cs_query_fence_status

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>
8 years agoamdgpu: remove reference to AMD specific error codes
Christian König [Tue, 30 Jun 2015 14:27:27 +0000 (16:27 +0200)]
amdgpu: remove reference to AMD specific error codes

We just have never defined any.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: cleanup public interface style
Christian König [Tue, 30 Jun 2015 14:04:44 +0000 (16:04 +0200)]
amdgpu: cleanup public interface style

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>
8 years agogitignore: add some generated amdgpu files
Christian König [Tue, 30 Jun 2015 13:46:29 +0000 (15:46 +0200)]
gitignore: add some generated amdgpu files

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: add CS dependencies v2
Christian König [Wed, 24 Jun 2015 12:17:57 +0000 (14:17 +0200)]
amdgpu: add CS dependencies v2

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>
8 years agoamdgpu: update to the latest kernel header
Alex Deucher [Mon, 29 Jun 2015 16:02:47 +0000 (12:02 -0400)]
amdgpu: update to the latest kernel header

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: remove pointer arithmetic from command submission
Christian König [Wed, 24 Jun 2015 12:13:00 +0000 (14:13 +0200)]
amdgpu: remove pointer arithmetic from command submission

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>
8 years agoamdgpu: do NULL check for bo handle in amdgpu_bo_query_info
Jammy Zhou [Tue, 16 Jun 2015 14:42:43 +0000 (22:42 +0800)]
amdgpu: do NULL check for bo handle in amdgpu_bo_query_info

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: cleanup VA IOCTL handling
Christian König [Mon, 8 Jun 2015 13:05:07 +0000 (15:05 +0200)]
amdgpu: cleanup VA IOCTL handling

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: remove flink export workaround v2
Christian König [Sat, 6 Jun 2015 10:02:29 +0000 (12:02 +0200)]
amdgpu: remove flink export workaround v2

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>
8 years agoamdgpu: explicitly unmap GPU mapping on BO destruction
Christian König [Sat, 6 Jun 2015 10:00:17 +0000 (12:00 +0200)]
amdgpu: explicitly unmap GPU mapping on BO destruction

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>
8 years agoamdgpu: merge amdgpu_drm.h from kernel
Jammy Zhou [Fri, 5 Jun 2015 21:07:56 +0000 (05:07 +0800)]
amdgpu: merge amdgpu_drm.h from kernel

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: cleanup gds specific alloc/free functions
Jammy Zhou [Fri, 5 Jun 2015 21:02:23 +0000 (05:02 +0800)]
amdgpu: cleanup gds specific alloc/free functions

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>
8 years agoamdgpu: add amdgpu_query_gds_info
Jammy Zhou [Fri, 5 Jun 2015 21:00:36 +0000 (05:00 +0800)]
amdgpu: add amdgpu_query_gds_info

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: fix double mutex_unlock in amdgpu_bo_import
Marek Olšák [Thu, 4 Jun 2015 16:57:57 +0000 (18:57 +0200)]
amdgpu: fix double mutex_unlock in amdgpu_bo_import

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>
8 years agoamdgpu: fix valgrind warnings
Marek Olšák [Thu, 4 Jun 2015 16:57:50 +0000 (18:57 +0200)]
amdgpu: fix valgrind warnings

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: use alloca and malloc in critical codepaths (v2)
Marek Olšák [Tue, 2 Jun 2015 12:43:52 +0000 (14:43 +0200)]
amdgpu: use alloca and malloc in critical codepaths (v2)

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>
8 years agoamdgpu: allow exporting KMS handles with render nodes
Marek Olšák [Thu, 4 Jun 2015 10:47:22 +0000 (12:47 +0200)]
amdgpu: allow exporting KMS handles with render nodes

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: add zero timeout check in amdgpu_cs_query_fence_status
Jack Xiao [Thu, 4 Jun 2015 02:41:24 +0000 (10:41 +0800)]
amdgpu: add zero timeout check in amdgpu_cs_query_fence_status

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: remove bo_handle from amdgpu_cs_ib_info, IBs should be in buffer list
Marek Olšák [Tue, 2 Jun 2015 11:05:41 +0000 (13:05 +0200)]
amdgpu: remove bo_handle from amdgpu_cs_ib_info, IBs should be in buffer list

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: remove amdgpu_ib helpers
Marek Olšák [Mon, 1 Jun 2015 12:12:10 +0000 (14:12 +0200)]
amdgpu: remove amdgpu_ib helpers

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: remove amdgpu_ib
Marek Olšák [Fri, 29 May 2015 17:13:41 +0000 (19:13 +0200)]
amdgpu: remove amdgpu_ib

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>
8 years agoamdgpu: don't use amdgpu_cs_create_ib for allocation of the fence BO
Marek Olšák [Fri, 29 May 2015 15:13:12 +0000 (17:13 +0200)]
amdgpu: don't use amdgpu_cs_create_ib for allocation of the fence BO

amdgpu_cs_create_ib will go away.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agotests/amdgpu: manage IB in client side
Jammy Zhou [Mon, 25 May 2015 12:38:03 +0000 (20:38 +0800)]
tests/amdgpu: manage IB in client side

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoamdgpu: get rid of IB pool management v3
Jammy Zhou [Fri, 29 May 2015 10:59:59 +0000 (12:59 +0200)]
amdgpu: get rid of IB pool management v3

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>
8 years agoamdgpu: add ib_start_alignment and ib_size_alignment for interface query
Ken Wang [Wed, 3 Jun 2015 09:23:37 +0000 (17:23 +0800)]
amdgpu: add ib_start_alignment and ib_size_alignment for interface query

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: add ce_ram_size for interface query
Ken Wang [Wed, 3 Jun 2015 09:21:27 +0000 (17:21 +0800)]
amdgpu: add ce_ram_size for interface query

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: add vram_type and vram_bit_width for interface query
Ken Wang [Wed, 3 Jun 2015 09:15:29 +0000 (17:15 +0800)]
amdgpu: add vram_type and vram_bit_width for interface query

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: add max_memory_clock for interface query
Ken Wang [Wed, 3 Jun 2015 09:07:44 +0000 (17:07 +0800)]
amdgpu: add max_memory_clock for interface query

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
8 years agoamdgpu: rename GEM_OP_SET_INITIAL_DOMAIN -> GEM_OP_SET_PLACEMENT
Marek Olšák [Wed, 27 May 2015 12:31:12 +0000 (14:31 +0200)]
amdgpu: rename GEM_OP_SET_INITIAL_DOMAIN -> GEM_OP_SET_PLACEMENT

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>
8 years agoamdgpu: stop checking flag masks
Christian König [Tue, 19 May 2015 14:06:50 +0000 (16:06 +0200)]
amdgpu: stop checking flag masks

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>
8 years agotests/amdgpu: implement VCE unit tests
Leo Liu [Tue, 19 May 2015 16:51:15 +0000 (12:51 -0400)]
tests/amdgpu: implement VCE unit tests

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>
8 years agoamdgpu: make vamgr global
Ken Wang [Thu, 21 May 2015 09:21:21 +0000 (17:21 +0800)]
amdgpu: make vamgr global

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>
8 years agotests/amdgpu: add shared IB submission test v2
Jammy Zhou [Wed, 20 May 2015 20:20:26 +0000 (04:20 +0800)]
tests/amdgpu: add shared IB submission test v2

v2: some function renaming

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>