OSDN Git Service

android-x86/external-libdrm.git
7 years agoautogen.sh: set format.subjectPrefix and sendemail.to if needed
Emil Velikov [Mon, 12 Dec 2016 17:50:46 +0000 (17:50 +0000)]
autogen.sh: set format.subjectPrefix and sendemail.to if needed

Just set the rules automatically rather than asking each contributor to
update thing locally.

v2: Silence errors if run outside of git repo. (Eric)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoxf86drm: fix sign-compare warning
Grazvydas Ignotas [Sun, 11 Dec 2016 18:03:56 +0000 (20:03 +0200)]
xf86drm: fix sign-compare warning

xf86drm.c:3601:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (expected < sizeof(match)) {
                     ^

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoxf86drm: implement an OpenBSD specific drmGetDevice2
Jonathan Gray [Thu, 1 Dec 2016 04:18:43 +0000 (15:18 +1100)]
xf86drm: implement an OpenBSD specific drmGetDevice2

DRI devices on OpenBSD are not in their own directory.  They reside in
/dev with a large number of statically generated /dev nodes.

Avoid stat'ing all of /dev on OpenBSD by implementing this custom path.

v2:
   - use drmGetMinorType to get node type
   - adapt to drmProcessPciDevice changes
   - verify drmParseSubsystemType type is PCI
   - add a comment describing why this was added

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoxf86drm: implement drmParsePciBusInfo for OpenBSD
Jonathan Gray [Thu, 1 Dec 2016 04:18:42 +0000 (15:18 +1100)]
xf86drm: implement drmParsePciBusInfo for OpenBSD

Implement drmParsePciBusInfo for OpenBSD by using the new
DRM_IOCTL_GET_PCIINFO ioctl.

v2: use drmGetMinorType to get node type instead of always
    using DRM_NODE_PRIMARY.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoxf86drm: implement drmParsePciDeviceInfo for OpenBSD
Jonathan Gray [Thu, 1 Dec 2016 04:18:41 +0000 (15:18 +1100)]
xf86drm: implement drmParsePciDeviceInfo for OpenBSD

Implement drmParsePciDeviceInfo for OpenBSD by using the new
DRM_IOCTL_GET_PCIINFO ioctl.

v2: adapt to drmParsePciDeviceInfo changes and use drmOpenMinor

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoxf86drm: implement drmParseSubsystemType for OpenBSD
Jonathan Gray [Thu, 1 Dec 2016 04:18:40 +0000 (15:18 +1100)]
xf86drm: implement drmParseSubsystemType for OpenBSD

Implement drmParseSubsystemType for OpenBSD by always returning
DRM_BUS_PCI.  No non-pci drm drivers are in the kernel and this is
unlikely to change anytime soon as the existing ones aren't permissively
licensed.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoxf86drm: implement drmGetMinorNameForFD for non-sysfs
Jonathan Gray [Thu, 1 Dec 2016 04:18:39 +0000 (15:18 +1100)]
xf86drm: implement drmGetMinorNameForFD for non-sysfs

Implement drmGetMinorNameForFD for systems without sysfs by
adapting drm_get_device_name_for_fd() from the Mesa loader.

v2: use type parameter to select dev name instead of always
    using DRM_DEV_NAME

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agotests: automake: reorder makefile contents
Emil Velikov [Wed, 30 Nov 2016 19:04:33 +0000 (19:04 +0000)]
tests: automake: reorder makefile contents

Purely cosmetic changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoconfigure: remove libudev checks
Emil Velikov [Wed, 30 Nov 2016 18:43:18 +0000 (18:43 +0000)]
configure: remove libudev checks

Library is no longer used.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agokms: remove commented out libudev code
Emil Velikov [Wed, 30 Nov 2016 18:39:07 +0000 (18:39 +0000)]
kms: remove commented out libudev code

Cc: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agotests: remove useless legacy tests
Emil Velikov [Wed, 30 Nov 2016 18:23:51 +0000 (18:23 +0000)]
tests: remove useless legacy tests

All of these 'tests' cover UMS functionality which is neither being
worked on or actively maintained.

The only cases where developers touch UMS code is to unwrap it from the
KMS codepaths and ensure that those are secure.

Anyone who feels strong about having these around can revive them, but
in all honestly do consider _seriously_ what you're doing ;-)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
7 years agotests/drmdevice: use drmGetDevice[s]2
Emil Velikov [Wed, 30 Nov 2016 19:13:04 +0000 (19:13 +0000)]
tests/drmdevice: use drmGetDevice[s]2

Pass along DRM_DEVICE_GET_PCI_REVISION only when the individual nodes
are opened and update the printed messages accordingly.

v2: Attribute for the flag rename, call drmGetDevices2 w/o the flag.

v3: Keep drmParsePciDeviceInfo() hunk in previous patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoxf86drm: introduce drmGetDevice[s]2
Emil Velikov [Wed, 30 Nov 2016 17:24:21 +0000 (17:24 +0000)]
xf86drm: introduce drmGetDevice[s]2

Relative to the original version, here one can provide a flags bitmask.
Currently only DRM_DEVICE_IGNORE_PCI_REVISION is supported.

Implementation detail:
If it's set, we will only parse the separate sysfs files and we won't
touch the config one. The latter awakes the device (causing delays)
which is the core reason why this API was introduced.

v2:
 - Initialize revision to 0xff if it's unread.
 - Change DRM_DEVICE_IGNORE_PCI_REVISION to DRM_DEVICE_GET_PCI_REVISION
 - Add explicit note that drmGetDevice[s]2 does not retrieve the
revision by default.

v3:
 - Correctly fold drmParsePciDeviceInfo() hunk in this patch.

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nicolai Hähnle <nhaehnle@gmail.com>
Cc: Mauro Santos <registo.mailling@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoxf86drm: parse the separate sysfs files for vendor... info
Emil Velikov [Tue, 1 Nov 2016 18:04:06 +0000 (18:04 +0000)]
xf86drm: parse the separate sysfs files for vendor... info

Up-to recently (patch should land in 4.10) the kernel did not expose the
PCI device revision field as a separate sysfs file.

Thus one needed too parse the config file to retrieve it. This in
itself wakes up the device, which in some cases can be quite slow.

To avoid that, just check for the separate files and fall-back to the
original if kernel is not new enough.

v3: rework alongside drmGetDevice[s]2

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nicolai Hähnle <nhaehnle@gmail.com>
Cc: Mauro Santos <registo.mailling@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoxf86drm: add plumbing to not retrieve PCI device revision
Emil Velikov [Wed, 30 Nov 2016 17:13:51 +0000 (17:13 +0000)]
xf86drm: add plumbing to not retrieve PCI device revision

Will be used with the drmGetDevice[s]2 API.

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nicolai Hähnle <nhaehnle@gmail.com>
Cc: Mauro Santos <registo.mailling@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoxf86drm: use maj/min in drmParsePciDeviceInfo()
Emil Velikov [Wed, 30 Nov 2016 16:41:27 +0000 (16:41 +0000)]
xf86drm: use maj/min in drmParsePciDeviceInfo()

Be consistent with drmParsePciBusInfo() and use solely the device
major/minor pair.

Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoBump version for release
Robert Bragg [Tue, 29 Nov 2016 10:42:38 +0000 (10:42 +0000)]
Bump version for release

7 years agovc4: Add new GETPARAMs that have been merged to drm-next.
Eric Anholt [Thu, 17 Nov 2016 01:06:10 +0000 (17:06 -0800)]
vc4: Add new GETPARAMs that have been merged to drm-next.

Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agofreedreno: 64bit support
Rob Clark [Wed, 9 Nov 2016 14:02:09 +0000 (09:02 -0500)]
freedreno: 64bit support

a5xx and later are 64bit devices.. make reloc's handle that.  A new
public symbol is introduced to avoid silent problems with new mesa and
old libdrm (since on 64b reloc consumes two dwords).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoetnaviv: add etna_pipe_wait_ns(..)
Christian Gmeiner [Wed, 23 Nov 2016 21:09:11 +0000 (22:09 +0100)]
etnaviv: add etna_pipe_wait_ns(..)

We need to pass through a timeout parameter to implement
pipe->fence_finish() properly. The new fxn accepts a timeout
in nanoseconds. Simplify etna_pipe_wait(..) by using
etna_pipe_wait_ns(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoetnaviv: change get_abs_timeout(..) to use ns.
Christian Gmeiner [Wed, 23 Nov 2016 21:02:25 +0000 (22:02 +0100)]
etnaviv: change get_abs_timeout(..) to use ns.

Also update all callers.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agolibdrm: random typo fixes
Grazvydas Ignotas [Sun, 20 Nov 2016 18:25:46 +0000 (20:25 +0200)]
libdrm: random typo fixes

Just some trivial boring typo fixes all over the tree.
READMEs and comments only.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agotests: kms: fix shadowed declaration warning
Grazvydas Ignotas [Sun, 20 Nov 2016 18:25:47 +0000 (20:25 +0200)]
tests: kms: fix shadowed declaration warning

There is no need to maintain the value in the shadowed variable from
what I can see.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoxf86drm: introduce drmGetDeviceNameFromFd2
Emil Velikov [Thu, 10 Nov 2016 17:26:50 +0000 (17:26 +0000)]
xf86drm: introduce drmGetDeviceNameFromFd2

The original version considered only card devices, while this will pick
the device/node name regardless - card, control, renderD, other...

Current implementation is "linux" specific, in such that it relies on
sysfs/uevent file. At the same time this gives us the flexibility to
support any nodes even future ones, as long as they're within DRM_MAJOR.

Shamelessly copied from mesa, latter by: Gary Wong <gtw@gnu.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoautomake: make the build less chatty
Emil Velikov [Sat, 12 Nov 2016 20:45:25 +0000 (20:45 +0000)]
automake: make the build less chatty

Having the "Entering|Leaving directory X" messages it not required nor
useful in vast majority of the cases.

One can always have them printed by `make -w' or by overriding the
AM_MAKEFLAGS variable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agointel: Add drm_intel_gem_context_get_id to intel-symbols-check
Michel Dänzer [Tue, 22 Nov 2016 06:48:12 +0000 (15:48 +0900)]
intel: Add drm_intel_gem_context_get_id to intel-symbols-check

Fixes make check. Trivial.

7 years agointel: Add a getter for the intel_context ctx_id
Robert Bragg [Mon, 26 Jan 2015 16:11:26 +0000 (16:11 +0000)]
intel: Add a getter for the intel_context ctx_id

Exposing the u32 context ID makes it possible to define new drm kernel
interfaces based on the same IDs that e.g. execbuf uses to identify a
gem context, that aren't themselves abstracted by libdrm but need to be
used by libdrm/drm_intel_context based clients such as (parts of) i-g-t
or Mesa.

For example this can be used to configure an i915-perf stream to collect
metrics for a specific context.

v2: s/drm_intel_gem_context_get_context_id/drm_intel_gem_context_get_id/

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
7 years agoetnaviv: add API to create etna_device from private dup() fd
Christian Gmeiner [Sun, 13 Nov 2016 20:29:22 +0000 (21:29 +0100)]
etnaviv: add API to create etna_device from private dup() fd

Like etna_device_new() but creates it's own private dup() of the fd
which is close()d when the device is finalized.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
7 years agoetnaviv: add API to get drm fd from etna_device
Christian Gmeiner [Sun, 13 Nov 2016 20:14:57 +0000 (21:14 +0100)]
etnaviv: add API to get drm fd from etna_device

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
7 years agointel: Add Geminilake PCI IDs
Ben Widawsky [Thu, 10 Nov 2016 18:28:02 +0000 (10:28 -0800)]
intel: Add Geminilake PCI IDs

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoBump version for release
Emil Velikov [Mon, 14 Nov 2016 19:48:38 +0000 (19:48 +0000)]
Bump version for release

7 years agoxd86drm: read more than 128 bytes of uevent in drmParsePciBusInfo
Emil Velikov [Fri, 11 Nov 2016 19:04:11 +0000 (19:04 +0000)]
xd86drm: read more than 128 bytes of uevent in drmParsePciBusInfo

Some platforms (such as Macs using OF) can have more information in the
uevent file thus reading only the first 128 might not be sufficient.

Bump it to 512, which "should be enough for everybody" ;-)

v2: Use sizeof(data)-1 over hardcoded number (Eric).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98629
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Mingcong Bai <jeffbai@aosc.xyz>
Tested-by: Mingcong Bai <jeffbai@aosc.xyz> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoheaders: Add README file
Emil Velikov [Mon, 14 Nov 2016 17:59:28 +0000 (17:59 +0000)]
headers: Add README file

Since we're trying to standardise and make things more consistent in
the area, add a basic README which covers some of the more popular
topics.

v2:
 - Drop drm-misc (Daniel Vetter)
v3:
 - Elaborate on when and which headers to update
 - Add a list of headers and the respective "issues"
 - Add file to EXTRA_DIST

Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoBump version for release
Matt Turner [Mon, 14 Nov 2016 18:34:47 +0000 (10:34 -0800)]
Bump version for release

7 years agofreedreno: Add fd_ringbuffer_flush2 to symbol check.
Matt Turner [Mon, 14 Nov 2016 18:23:17 +0000 (10:23 -0800)]
freedreno: Add fd_ringbuffer_flush2 to symbol check.

7 years agoamdgpu: Add amdgpu_asic_id.h to Makefile.sources.
Matt Turner [Mon, 14 Nov 2016 18:16:27 +0000 (10:16 -0800)]
amdgpu: Add amdgpu_asic_id.h to Makefile.sources.

7 years agointel: Add uthash.h to Makefile.sources.
Matt Turner [Mon, 14 Nov 2016 18:13:22 +0000 (10:13 -0800)]
intel: Add uthash.h to Makefile.sources.

7 years agointel: Allow some codenames in INTEL_DEVID_OVERRIDE
Neil Roberts [Mon, 9 Nov 2015 15:27:52 +0000 (16:27 +0100)]
intel: Allow some codenames in INTEL_DEVID_OVERRIDE

As well as allowing a hexadecimal PCI ID number, the
INTEL_DEVID_OVERRIDE environment variable can now contain one of a few
short codenames. The codenames are stored in a small table to map them
to a corresponding PCI ID. This makes it easier to use without having
to look up the PCI IDs manually.

The PCI IDs used are the same as those chosen for the -p option of
run.c in shader-db but SKL has been added as well.

Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoamdgpu: add the function to get the marketing name (v4)
Junwei Zhang [Mon, 12 Sep 2016 15:14:11 +0000 (11:14 -0400)]
amdgpu: add the function to get the marketing name (v4)

This function is used to look up the marking name
for a specific board.

v2: agd: Squash in subsequent updates to the table.
v3: [Michel Dänzer]
* Make amdgpu_asic_id_table static, so it's not exported from
  libdrm_amdgpu.so.1
* Add amdgpu_get_marketing_name to amdgpu-symbols-check
* Fix indentation of second line of if statement
* Squash in another change removing redundant entries
* Change spelling of "RADEON" -> "Radeon"
* Remove "(TM)" from a minority of entries
v4: [Michel Dänzer]
* Use const char* instead of fixed size array for marketing_name (Emil
  Velikov)

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Flora Cui <Flora.Cui@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agofreedreno: add fence fd support
Rob Clark [Mon, 15 Aug 2016 17:26:18 +0000 (13:26 -0400)]
freedreno: add fence fd support

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: sync uapi header
Rob Clark [Mon, 15 Aug 2016 16:52:31 +0000 (12:52 -0400)]
freedreno: sync uapi header

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoadd libsync.h helper
Rob Clark [Mon, 15 Aug 2016 18:45:35 +0000 (14:45 -0400)]
add libsync.h helper

Rather than cut/pasting these couple ioctl wrappers everywhere, just
stuff them as static-inline into a header.

This is probably mostly used from mesa, but some drivers, test apps, etc
may also want to use it from libdrm.

v2: handle EINTR, add sync_accumulate() based on #dri-devel discussion,
    etc

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoamdgpu: check parameters in amdgpu_query_gpu_info
Alex Deucher [Fri, 28 Oct 2016 20:56:13 +0000 (16:56 -0400)]
amdgpu: check parameters in amdgpu_query_gpu_info

Make sure they aren't NULL.

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

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agointel: Look prime handle up in handle hash table
Chris Wilson [Mon, 24 Oct 2016 20:17:13 +0000 (21:17 +0100)]
intel: Look prime handle up in handle hash table

A slightly confused copy'n'paste from the open path where we pass in
handle but use it as a global name, in the prime handle-from-fd pass we
pass in handle and do mean handle!

References: https://bugs.freedesktop.org/show_bug.cgi?id=98416
Fixes: 2f23bf1b7b89 ("intel: Migrate handle/name lookups from linear lists...")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Add new symbols to intel-symbol-check
Michel Dänzer [Mon, 24 Oct 2016 02:14:36 +0000 (11:14 +0900)]
intel: Add new symbols to intel-symbol-check

Fixes make check.

Trivial.

7 years agointel: Migrate handle/name lookups from linear lists to hashtables
Chris Wilson [Thu, 22 Sep 2016 13:44:50 +0000 (14:44 +0100)]
intel: Migrate handle/name lookups from linear lists to hashtables

Walking a linear list to find a matching PRIME handle or flinked name
does not scale and becomes a major burden with just a few objects.
That said, the fixed size hash is not much better, it just buckets the
look into a few separate chains rather than one long one.

References: https://bugs.freedesktop.org/show_bug.cgi?id=94631
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Export raw GEM mmap interfaces
Chris Wilson [Fri, 1 May 2015 12:39:55 +0000 (13:39 +0100)]
intel: Export raw GEM mmap interfaces

Export a set of interfaces to allow the caller to have precise control
over mapping the buffer - but still provide caching of the mmaps between
callers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoSilence runtime complaints on platform devices
Eric Anholt [Fri, 21 Oct 2016 17:09:47 +0000 (10:09 -0700)]
Silence runtime complaints on platform devices

glxgears was spamming this 12 times at startup because of Mesa's
probing of the DRM device code, which doesn't support platform
devices.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoReturn an -ENODEV from drmGetDevice() when no device was found.
Rob Herring [Fri, 21 Oct 2016 17:07:59 +0000 (10:07 -0700)]
Return an -ENODEV from drmGetDevice() when no device was found.

Fixes crashes in Mesa on platform devices, which expected *device to
have a device when 0 was returned.

(code from a paste by Rob, commit message by anholt)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAdd drmModePageFlipTarget
Michel Dänzer [Wed, 29 Jun 2016 09:07:25 +0000 (18:07 +0900)]
Add drmModePageFlipTarget

It supports the DRM_MODE_PAGE_FLIP_TARGET_* flags.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
7 years agoheaders: Sync drm{,_mode}.h with the kernel
Michel Dänzer [Thu, 13 Oct 2016 07:53:36 +0000 (16:53 +0900)]
headers: Sync drm{,_mode}.h with the kernel

Generated using make headers_install, based on linus master commit
b67be92feb486f800d80d72c67fd87b47b79b18e.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
7 years agoBump version for release
Rob Clark [Tue, 4 Oct 2016 00:46:19 +0000 (20:46 -0400)]
Bump version for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agotests/amdgpu: update vce encRefPic addr mode to tiled
Leo Liu [Fri, 30 Sep 2016 17:20:55 +0000 (13:20 -0400)]
tests/amdgpu: update vce encRefPic addr mode to tiled

Adapt to recent firmware update, it's also compatible with previous
firmware version

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoAdd drmModeAddFB2WithModifiers() which takes format modifiers
Kristian H. Kristensen [Thu, 8 Sep 2016 20:08:59 +0000 (13:08 -0700)]
Add drmModeAddFB2WithModifiers() which takes format modifiers

The only other user of this feature open codes the ioctl. Let's add an
entry point for this to libdrm.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
7 years agolibdrm: add etnaviv tests
The etnaviv authors [Tue, 6 Sep 2016 16:16:02 +0000 (18:16 +0200)]
libdrm: add etnaviv tests

This adds the following basic unit tests:

- etnaviv_2d_test
  Let the 2D core render a defined pattern into a bo
  and store it as bmp.

- etnaviv_bo_cache_test
  Basic tests to validate the bo-cache behavior.

- etnaviv_cmd_stream_test
  Tests for the etna_cmd_stream API.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agolibdrm: add etnaviv drm support
The etnaviv authors [Tue, 6 Sep 2016 16:15:53 +0000 (18:15 +0200)]
libdrm: add etnaviv drm support

Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific
interfaces to the DRM.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Rob Herring <robh@kernel.org>
7 years agointel: Add new symbols to intel-symbol-check
Michel Dänzer [Thu, 8 Sep 2016 06:19:49 +0000 (15:19 +0900)]
intel: Add new symbols to intel-symbol-check

Fixes make check.

Trivial.

7 years agointel: Export pooled EU and min no. of eus in a pool.
Yang Rong [Tue, 2 Aug 2016 07:50:34 +0000 (15:50 +0800)]
intel: Export pooled EU and min no. of eus in a pool.

Update kernel interface with new I915_GETPARAM ioctl entries for
pooled EU and min no. of eus in a pool. Add a wrapping function
for each parameter. Userspace drivers need these values when decide
the thread count. This kernel enabled pooled eu by default for BXT
and for fused down 2x6 parts it is advised to turn it off.

But there is another HW issue in these parts (fused
down 2x6 parts) before C0 that requires Pooled EU to be enabled as a
workaround. In this case the pool configuration changes depending upon
which subslice is disabled and the no. of eus in a pool is different,
So userspace need to know min no. of eus in a pool.

V2: use return value as the query results.
    ret < 0 when error, ret = 0 when not support, and ret > 0 indicate
    query results.(Chris)
V3: Correct V2 errors.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoamdgpu: add SI support
Ronie Salgado [Wed, 13 Apr 2016 19:56:15 +0000 (21:56 +0200)]
amdgpu: add SI support

v2: without the amdgpu_drm.h change

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
7 years agoamdgpu: fix valgrind warnings caused by amdgpu_query_firmware_version
Marek Olšák [Wed, 17 Aug 2016 17:09:38 +0000 (19:09 +0200)]
amdgpu: fix valgrind warnings caused by amdgpu_query_firmware_version

7 years agoamdgpu: sync amdgpu_drm.h with the kernel
Marek Olšák [Fri, 19 Aug 2016 14:10:58 +0000 (16:10 +0200)]
amdgpu: sync amdgpu_drm.h with the kernel

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoradeon: sync radeon_drm.h with the kernel
Marek Olšák [Fri, 19 Aug 2016 14:07:50 +0000 (16:07 +0200)]
radeon: sync radeon_drm.h with the kernel

the CIK tile mode definitions are moved out,
userspace doesn't use them

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoamdgpu: expose the AMDGPU_GEM_CREATE_VRAM_CLEARED flag
Flora Cui [Fri, 22 Jul 2016 03:56:52 +0000 (11:56 +0800)]
amdgpu: expose the AMDGPU_GEM_CREATE_VRAM_CLEARED flag

With this flag specified, VRAM buffer will be cleared at
allocation time.

Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Alexandre Demers <alexandre.f.demers@gmail.com>
7 years agomodetest: Also print the pixel clock
Stéphane Marchesin [Thu, 1 Sep 2016 02:45:45 +0000 (19:45 -0700)]
modetest: Also print the pixel clock

This can be useful for debugging. xrandr prints it, so why not.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agomodetest: add mediatek to module list
Daniel Kurtz [Thu, 1 Sep 2016 01:48:17 +0000 (09:48 +0800)]
modetest: add mediatek to module list

There is a mediatek drm kms driver: Add "mediatek" to the static
lists of driver names.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: JB Tsai <jb.tsai@mediatek.com>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomodetest: Adding amdgpu to module list
satsahu [Tue, 9 Aug 2016 07:17:51 +0000 (12:47 +0530)]
modetest: Adding amdgpu to module list

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agolist: fix an issue with android build using clang
Rob Clark [Tue, 2 Aug 2016 20:16:02 +0000 (16:16 -0400)]
list: fix an issue with android build using clang

Sorry, I don't understand the android build system enough to say *which*
version of clang this effects, but either "clang-2812033" or
"clang-3016494" (probably the later).

But when 'sample' is undefined (ie. unitialized variable), the result is
not as well defined as it is with gcc.  Instead use a typeof() cast with
a defined value (ie. zero).

This fixes a crash that was reported on android.

Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoandroid: use static library libpciaccess android-x86-6.0-r1
Chih-Wei Huang [Fri, 23 Jan 2015 06:26:28 +0000 (14:26 +0800)]
android: use static library libpciaccess

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
7 years agoAdding VLV PCI IDs.
Piotr Luc [Thu, 27 Sep 2012 12:58:47 +0000 (14:58 +0200)]
Adding VLV PCI IDs.

Change-Id: Id1d1d563d52b8e897b72a68ac3976cd2635d6477
Signed-off-by: Piotr Luc <piotr.luc@intel.com>
7 years agoSimplify the RELEASING steps based on current release.sh.
Eric Anholt [Wed, 20 Jul 2016 19:24:00 +0000 (12:24 -0700)]
Simplify the RELEASING steps based on current release.sh.

Since release.sh creates and pushes a libdrm-$VERSION tag for us,
there's no need to also have the user manually generating a $VERSION
tag as well.

I also dropped the "optional" part of distcheck.  You shouldn't have
pushed master with a version bump that hasn't passed distcheck.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoBump version for release
Rob Clark [Sat, 23 Jul 2016 13:25:48 +0000 (09:25 -0400)]
Bump version for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoradeon: Fix typo in stderr message
Andreas Boll [Thu, 21 Jul 2016 12:27:33 +0000 (14:27 +0200)]
radeon: Fix typo in stderr message

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoman: Fix typo
Andreas Boll [Thu, 21 Jul 2016 12:25:41 +0000 (14:25 +0200)]
man: Fix typo

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoautomake: Include virtgpu_drm.h in the release tarball
Andreas Boll [Thu, 21 Jul 2016 12:03:33 +0000 (14:03 +0200)]
automake: Include virtgpu_drm.h in the release tarball

The plan is to use this version of virtgpu_drm.h in mesa and drop mesa's
local copy.
To actually use this header it needs to be shipped in the tarball.

This was missed in c745e541a9d8dfd3fb5e1ac57297e58d34d9328f

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agovirtgpu: Update kernel header
Andreas Boll [Fri, 22 Jul 2016 09:45:36 +0000 (11:45 +0200)]
virtgpu: Update kernel header

Generated using make headers_install.

This brings the C++ guard, proper include path for drm.h and the
switching to kernel types for fixed-with integers.

Generated from drm-next commit c11dea5b0290984fa48111957ba3fdc5b3bdae5a

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoautomake: Don't include Android Makefiles in the release tarball
Andreas Boll [Thu, 21 Jul 2016 10:05:03 +0000 (12:05 +0200)]
automake: Don't include Android Makefiles in the release tarball

Currently only some Android Makefiles are included in the release tarball.
To be more consistent one could either add the remaining files or don't
ship Android Makefiles altogether.

According to Emil the Android folk doesn't use our release tarballs.
Thus it makes sense to remove those files from distribution which also
means less work for maintenance in the future.

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoradeon: Wire up radeon-symbol-check to make check
Andreas Boll [Thu, 21 Jul 2016 08:54:15 +0000 (10:54 +0200)]
radeon: Wire up radeon-symbol-check to make check

This was missed in 552de225bf2740ba0cb52312c21353d71d934b8c

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agofreedreno: fix warnings
Rob Clark [Thu, 21 Jul 2016 17:59:53 +0000 (13:59 -0400)]
freedreno: fix warnings

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Rob Herring <robh@kernel.org>
7 years agofreedreno: fix android build break
Rob Clark [Thu, 21 Jul 2016 17:19:35 +0000 (13:19 -0400)]
freedreno: fix android build break

The 'deprecated' #define was causing problems with bionic system headers
which used __attribute__((deprecated)).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Rob Herring <robh@kernel.org>
7 years agofreedreno: fix distcheck errors
Rob Clark [Thu, 21 Jul 2016 14:54:49 +0000 (10:54 -0400)]
freedreno: fix distcheck errors

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: move legacy kgsl related README
Rob Clark [Wed, 20 Jul 2016 17:11:58 +0000 (13:11 -0400)]
freedreno: move legacy kgsl related README

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno/msm: use hashtable to track bo idx
Rob Clark [Tue, 28 Jun 2016 17:33:07 +0000 (13:33 -0400)]
freedreno/msm: use hashtable to track bo idx

Note: cache the last ring the bo was emitted on, to avoid excess
hashtable lookups.  We do this by tracking ring seqno to avoid
problems with dangling pointers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: support growable cmdstream buffers
Rob Clark [Mon, 20 Jun 2016 18:06:24 +0000 (14:06 -0400)]
freedreno: support growable cmdstream buffers

The issue that userspace needed to solve is that there is ~two orders of
magnitude size difference in cmdstream buffers (both for gmem commands
and for draw commands), and that the previous practice of allocating
worst-case sizes is quite wasteful.  Previously a submit would be
constructed (for example) like:

  CMD  TARGET  DESCRIPTION
   g0    N     gmem/tiling commands
   b0    Y     binning commands
   d0    Y     draw commands

Which, after the one non-IB-target cmd buffer is inserted into the
kernel controlled ringbuffer, looks like (not to scale):

         b0:           d0:
        +-----+       +-----+
   IB1  | ... |       | ... |
        +-----+       +-----+
         ^             ^
         |             |
         +-----+       +-+---------+
         g0:   |         |         |
        +----+----+----+----+----+----+----
   IB0  | .. | IB | .. | IB | .. | IB | ...
        +----+----+----+----+----+----+----
         ^              tile0     tile1
         |
         +-----------+
  userspace          |
  ~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  kernel             |
               ----+----+----
   ringbuffer  ... | IB | ...
               ----+----+----

Now, multiple physical cmdstream buffers per fd_ringbuffer are supported,
so this becomes:

  CMD  TARGET  DESCRIPTION
   g0    N
   ...   N     gmem/tiling commands
   gN    N
   b0    Y
   ...   Y     binning commands
   bN    Y
   d0    Y
   ...   Y     draw commands
   dN    Y

Which, after the non-IB-target cmd buffers (g0..gN) are inserted into
the kernel controlled ringbuffer, looks like:

             b0:      b1            d0:      d1
            +-----+  +-----+        +-----+  +-----+
       IB1  | ... |  | ... | ...    | ... |  | ... | ...
            +-----+  +-----+        +-----+  +-----+
             ^        ^              ^        ^
             |        |              |        |
             |        +-+            |  +-----+------+
             +-----+    |            |  |            |
                   |    |         +--+----------+    |
             g0:   |    |         |     |       |    |
            +----+----+----+----+----+----+---+----+----+----
       IB0  | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
            +----+----+----+----+----+----+---+----+----+----
             ^                   tile0         tile1
             | to b0  to b1
             |   |      |          to|d0    to|d1
             |   |      +----+       |      +-+-----------+
             |   |           |       |      |             |
             |   +------+    |       +-+-------------+    |
             |    g1:   |    |         |    |        |    |
             |   +----+----+----+----+----+----+---+----+----+----
       IB0   |   | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
             |   +----+----+----+----+----+----+---+----+----+----
             |    ^                   tileX         tileY
             |    |
             |    +-----------+
             +-----------+    |
      userspace          |    |
      ~~~~~~~~~~~~~~~~~~~|~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      kernel             |    |
                   ----+----+----+----
       ringbuffer  ... | IB | IB | ...
                   ----+----+----+----

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno/msm: split out dump_submit() helper
Rob Clark [Wed, 22 Jun 2016 14:41:24 +0000 (10:41 -0400)]
freedreno/msm: split out dump_submit() helper

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agolist: add first/last entry macros
Rob Clark [Tue, 21 Jun 2016 15:33:30 +0000 (11:33 -0400)]
list: add first/last entry macros

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno/msm: split out cmd buffer tracking from ring
Rob Clark [Fri, 3 Jun 2016 19:41:20 +0000 (15:41 -0400)]
freedreno/msm: split out cmd buffer tracking from ring

First step towards supporting a single logical ringbuffer mapping to
multiple physical cmd buffers, which will enable dynamically growing
ringbuffers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno/msm: drop return from get_cmd()
Rob Clark [Sat, 18 Jun 2016 13:08:53 +0000 (09:08 -0400)]
freedreno/msm: drop return from get_cmd()

Not actually needed.  It just needs to ensure that there is a
corresponding entry in the submit's cmds table.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno/msm: use private bo-cache for ringbuffer bo's
Rob Clark [Wed, 1 Jun 2016 20:11:52 +0000 (16:11 -0400)]
freedreno/msm: use private bo-cache for ringbuffer bo's

Since they get vmap'd on the kernel side, they are a bit more costly.
Don't let them mingle with the riffraff.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: fix potential leak at free
Rob Clark [Wed, 1 Jun 2016 20:04:13 +0000 (16:04 -0400)]
freedreno: fix potential leak at free

If user has emit'd reloc's, and then resets or deletes the ring, we want
to drop the ref's that the ring holds to the bo's to avoid a leak.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: ocd
Rob Clark [Wed, 1 Jun 2016 19:42:55 +0000 (15:42 -0400)]
freedreno: ocd

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: support either coarse or fine-grained bucket sizes
Rob Clark [Wed, 1 Jun 2016 19:37:52 +0000 (15:37 -0400)]
freedreno: support either coarse or fine-grained bucket sizes

The normal bo cache uses some intermediate steps between power of two
jumps to reduce memory wastage.  But for a ringbuffer bo cache, we do
not need this.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: expose kernel driver version
Rob Clark [Wed, 1 Jun 2016 18:35:44 +0000 (14:35 -0400)]
freedreno: expose kernel driver version

gallium needs to know if the kernel is new enough to support explicit
fencing, dynamically grown ringbuffers, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: fix potential fd leak in error path
Rob Clark [Wed, 1 Jun 2016 18:35:06 +0000 (14:35 -0400)]
freedreno: fix potential fd leak in error path

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: add madvise support
Rob Clark [Tue, 31 May 2016 16:06:50 +0000 (12:06 -0400)]
freedreno: add madvise support

With a new enough drm/msm, we can let the kernel know about buffers that
are in the bo cache, so the kernel can free them under memory pressure.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: sync uapi
Rob Clark [Tue, 31 May 2016 15:49:46 +0000 (11:49 -0400)]
freedreno: sync uapi

(from drm-next for 4.8)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: move bo-cache to it's own file
Rob Clark [Tue, 31 May 2016 14:46:59 +0000 (10:46 -0400)]
freedreno: move bo-cache to it's own file

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: refactor bo-cache API
Rob Clark [Mon, 30 May 2016 16:45:33 +0000 (12:45 -0400)]
freedreno: refactor bo-cache API

Split out interface to allocate from and release to bo-cache, and get
rid of direct usage of bucket level API from fd_bo/etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: split out fd_bo_cache
Rob Clark [Mon, 30 May 2016 15:49:39 +0000 (11:49 -0400)]
freedreno: split out fd_bo_cache

Eventually we'll want a separate bo-cache for ringbuffer bo's, since
ringbuffer bo's get vmap'd on the kernel side, it is preferrable to
re-use them as ringbuffers rather than something else.  Plus should
help to add madvise support if it is a bit better decoupled from bo
allocation (next patch).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: add simpler ring-reloc
Rob Clark [Fri, 20 May 2016 21:19:04 +0000 (17:19 -0400)]
freedreno: add simpler ring-reloc

Provide a way to insert a reference (ie. OUT_IB()) to a target ring,
executing all the cmds in the target ring from the start.

Sometimes the ringmarker stuff is just overkill.  And it will won't
really work properly once we support multiple physical cmdstream buffers
per fd_ringbuffer.  So in the future the old ringmarker related APIs
will be deprecated in a few releases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: rework internal ring->emit_reloc_ring()
Rob Clark [Fri, 20 May 2016 21:14:43 +0000 (17:14 -0400)]
freedreno: rework internal ring->emit_reloc_ring()

No need for it to deal with ringmarkers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>