platform/upstream/libdrm.git
8 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.

8 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.

8 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.

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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.

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agoBump version for release libdrm-2.4.71
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>
8 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>
8 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>
8 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>
8 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>
8 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.

8 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>
8 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agoBump version for release libdrm-2.4.70
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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agotests/drmdevice: be move verbose when using open()
Emil Velikov [Wed, 13 Jul 2016 09:01:34 +0000 (10:01 +0100)]
tests/drmdevice: be move verbose when using open()

Print out the node we're attempting to open and a message if/why we fail
to do so.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agotests/drmdevice: print out the full 'bus' and 'dev' strings
Emil Velikov [Wed, 13 Jul 2016 08:43:26 +0000 (09:43 +0100)]
tests/drmdevice: print out the full 'bus' and 'dev' strings

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodrm: fix drmFreeDevices memory leak on multi GPU setups
Qiang Yu [Thu, 14 Jul 2016 09:10:56 +0000 (17:10 +0800)]
drm: fix drmFreeDevices memory leak on multi GPU setups

When in multi GPU case, devices array may have some
NULL "hole" in between two devices. So check all
array elements and free non-NULL device.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodrm: drmGetDevice return correct device on multi GPU setups
Qiang Yu [Thu, 14 Jul 2016 09:10:55 +0000 (17:10 +0800)]
drm: drmGetDevice return correct device on multi GPU setups

Currently drmGetDevice always returns the first device it finds under
/dev/dri/.

Move the target device to the start of the list during iteration. This
way during deduplication it'll preserve its place and will be returned
to the user.

v2: Keep the memory leak separate.
v3: Move the drmFoldDuplicatedDevices description

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
[Emil Velikov: move drmFoldDuplicatedDevices description, add
changelog, reword commit message]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoBump version to 2.4.69 for release. libdrm-2.4.69
Eric Anholt [Wed, 20 Jul 2016 18:42:45 +0000 (11:42 -0700)]
Bump version to 2.4.69 for release.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agovc4: Update kernel headers for getparam addition.
Eric Anholt [Sat, 2 Jul 2016 21:18:43 +0000 (14:18 -0700)]
vc4: Update kernel headers for getparam addition.

This also brings over the C++ guard introduced recently in the kernel
headers.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agopull in sys/sysmacros.h when available
Mike Frysinger [Tue, 21 Jun 2016 16:18:15 +0000 (12:18 -0400)]
pull in sys/sysmacros.h when available

This header provides major/minor/makedev funcs under most Linux C
libs.  Pull it in to fix building with newer versions that drop the
implicit include via sys/types.h.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94231
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
8 years agoxf86drm.c: Fix mix of tabs and spaces
Jan Vesely [Thu, 30 Jun 2016 18:22:52 +0000 (14:22 -0400)]
xf86drm.c: Fix mix of tabs and spaces

Remove whitespace at the end of line.

8 years agoAndroid: strip out header files from sources list
Rob Herring [Tue, 5 Jul 2016 20:21:18 +0000 (15:21 -0500)]
Android: strip out header files from sources list

AOSP master now errors if LOCAL_SRC_FILES contains headers, so filter
out header files from the source lists.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agointel: Removing PCI IDs that are no longer listed as Kabylake.
Rodrigo Vivi [Tue, 28 Jun 2016 00:02:34 +0000 (17:02 -0700)]
intel: Removing PCI IDs that are no longer listed as Kabylake.

This is unusual. Usually IDs listed on early stages of platform
definition are kept there as reserved for later use.

However these IDs here are not listed anymore in any of steppings
and devices IDs tables for Kabylake on configurations overview
section of BSpec.

So it is better removing them before they become used in any
other future platform.

v2: Rebase.

Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 years agointel: Add more Kabylake PCI IDs.
Rodrigo Vivi [Thu, 23 Jun 2016 21:01:33 +0000 (14:01 -0700)]
intel: Add more Kabylake PCI IDs.

The spec has been updated adding new PCI IDs.

v2: Avoid using "H" instead of HALO to keep names uniform - DK.

Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 years agoradeon: use SAMPLE_SPLIT=2 for better MSAA perf on EG/CM
Marek Olšák [Thu, 26 May 2016 12:33:12 +0000 (14:33 +0200)]
radeon: use SAMPLE_SPLIT=2 for better MSAA perf on EG/CM

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agofreedreno/msm: fix memory leak on ringbuffer free
Rob Clark [Mon, 13 Jun 2016 13:49:46 +0000 (09:49 -0400)]
freedreno/msm: fix memory leak on ringbuffer free

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoxf86drm: ensure proper alignment of pointers in drmProcessPciDevice
Nicolai Hähnle [Fri, 13 May 2016 06:11:13 +0000 (01:11 -0500)]
xf86drm: ensure proper alignment of pointers in drmProcessPciDevice

Previously, (*device)->businfo.pci would end up misaligned, which results
in undefined behavior.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodrm: fix multi GPU drmGetDevices only return one device
Qiang Yu [Mon, 6 Jun 2016 16:29:16 +0000 (12:29 -0400)]
drm: fix multi GPU drmGetDevices only return one device

When multi GPU present, after drmFoldDuplicatedDevices
merge same busid deveces, two different devices may be
seperated by zero in local_devices[]. The for loop
should check all local_devices instead of exit when
meet a zero.

Reviewed-by: Jim Qu <Jim.Qu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
8 years agoamdgpu: fix fence status query
Christian König [Thu, 2 Jun 2016 11:37:05 +0000 (13:37 +0200)]
amdgpu: fix fence status query

Not initializing the ip instance leads to sporadic fails in the tests.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agotests/amdgpu: adapt to new polaris10/11 uvd fw
Sonny Jiang [Thu, 12 May 2016 16:48:43 +0000 (12:48 -0400)]
tests/amdgpu: adapt to new polaris10/11 uvd fw

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agotests/amdgpu: add interface to adapt firmware requirement
Leo Liu [Thu, 17 Mar 2016 15:30:57 +0000 (11:30 -0400)]
tests/amdgpu: add interface to adapt firmware requirement

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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agotests/amdgpu: expand write/copy tests to compute
Alex Deucher [Sat, 20 Feb 2016 00:28:23 +0000 (19:28 -0500)]
tests/amdgpu: expand write/copy tests to compute

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agotests/amdgpu: expand write/copy tests to compute
Alex Deucher [Sat, 20 Feb 2016 00:22:51 +0000 (19:22 -0500)]
tests/amdgpu: expand write/copy tests to compute

Uses same packets as gfx.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoBump version for release libdrm-2.4.68
Kenneth Graunke [Thu, 28 Apr 2016 00:52:50 +0000 (17:52 -0700)]
Bump version for release

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agointel/skl: Add missing SKL PCI IDs
Michał Winiarski [Wed, 17 Feb 2016 10:40:19 +0000 (11:40 +0100)]
intel/skl: Add missing SKL PCI IDs

Used by production devices:
    Intel(R) HD Graphics 510
    Intel(R) HD Graphics 535
    Intel(R) Iris(TM) Graphics 550
    Intel(R) Iris(TM) Graphics P555

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agofreedreno: add dummy fd_bo_from_fbdev implementation when KGSL is disabled
Nicolas Dechesne [Mon, 11 Apr 2016 14:50:23 +0000 (16:50 +0200)]
freedreno: add dummy fd_bo_from_fbdev implementation when KGSL is disabled

Make sure that this function is defined (even empty/dummy) when KGSL support is
disabled, since it's part of the driver i/f and it was reported to cause symbols
issues when building against musl libc implementation.

Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoheaders: Update drm.h
Daniel Vetter [Wed, 30 Mar 2016 13:51:00 +0000 (15:51 +0200)]
headers: Update drm.h

This needs the kernel patch to make sure the C++ protection is in place.

Otherwise just new defines, using the right fixed-width types and
some shuffling in where stuff is defined (the DRM_CAP list moved, but
the #defines are the same).

Generated using make headers_install.

Generated fromd drm-misc commit 249c4f538b1aae55d41699f8bafc6cb762a7f48f

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoheaders: Update drm_mode.h
Daniel Vetter [Wed, 30 Mar 2016 13:44:42 +0000 (15:44 +0200)]
headers: Update drm_mode.h

Generated using make headers_install.

Only cosmetics&new definitions here now.

Generated fromd drm-misc commit 249c4f538b1aae55d41699f8bafc6cb762a7f48f

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoheaders: Update drm_fourcc.h
Daniel Vetter [Wed, 30 Mar 2016 13:39:12 +0000 (15:39 +0200)]
headers: Update drm_fourcc.h

Only real difference is switching to kernel types for fixed-width
integers, like we should.

Generated fromd drm-misc commit 249c4f538b1aae55d41699f8bafc6cb762a7f48f

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoheaders: Update drm_sarea.h
Daniel Vetter [Wed, 30 Mar 2016 13:38:28 +0000 (15:38 +0200)]
headers: Update drm_sarea.h

Generated using make headers_install. Only difference is a new value
of SAREA_MAX for mips. Not that we ever shipped a dri1 driver on that
platform probably ...

Generated fromd drm-misc commit 249c4f538b1aae55d41699f8bafc6cb762a7f48f

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoheaders: Update drm_i915.h
Daniel Vetter [Wed, 30 Mar 2016 13:36:55 +0000 (15:36 +0200)]
headers: Update drm_i915.h

Generated using make header_install.

Generated fromd drm-intel-next-queued commit
55c561a708eec328822721233b1148119e80f5c3

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agotests/kms-steal-crtc: Use correct includes
Daniel Vetter [Wed, 30 Mar 2016 14:18:53 +0000 (16:18 +0200)]
tests/kms-steal-crtc: Use correct includes

It was relying on drm_fourcc.h providing <stdint.h>, which is silly.
Fix it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
8 years agoheaders: Remove _DRM_GEM
Daniel Vetter [Wed, 30 Mar 2016 13:40:26 +0000 (15:40 +0200)]
headers: Remove _DRM_GEM

This was purely a kernel-internal type used in a early patch version
to add GEM bo mmap support. It was never used in-kernel in merged code
nor in userspace. Nuke it to align with kernel headers.

For reference the kernel patch:

commit 05f51722a154e73019434bd020e50ddb941046c5
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Dec 11 11:34:32 2013 +0100

    drm/bufs: remove handling of _DRM_GEM mappings

    Gone with the new gem vma offset manager from David.

    We can also ditch the uapi header definition from the enum since
    userspace never used this. It ended up in there purely for historical
    reasons (for reusing the old drm mmap code essentially), not because
    userspace ever needed it.

Cc: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agotegra: Sync with Linux kernel UAPI header
Thierry Reding [Thu, 31 Mar 2016 10:41:10 +0000 (12:41 +0200)]
tegra: Sync with Linux kernel UAPI header

Update the UAPI header to the latest version in the Linux kernel. This
changes the struct drm_tegra_gem_mmap to properly handle offsets on 64-
bit architectures.

See commit bdf765071a8b ("drm/tegra: gem: Return 64-bit offset for
mmap(2)") in the Linux kernel (as of v4.1).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoxf86drm: Fix spelling mistakes
Eric Engestrom [Sun, 3 Apr 2016 18:48:12 +0000 (19:48 +0100)]
xf86drm: Fix spelling mistakes

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agotests: Fix spelling mistakes
Eric Engestrom [Sun, 3 Apr 2016 18:48:11 +0000 (19:48 +0100)]
tests: Fix spelling mistakes

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agointel: Fix spelling mistakes
Eric Engestrom [Sun, 3 Apr 2016 18:48:09 +0000 (19:48 +0100)]
intel: Fix spelling mistakes

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agofreedreno: Fix spelling mistakes
Eric Engestrom [Sun, 3 Apr 2016 18:48:08 +0000 (19:48 +0100)]
freedreno: Fix spelling mistakes

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoexynos: Fix spelling mistake
Eric Engestrom [Sun, 3 Apr 2016 18:48:07 +0000 (19:48 +0100)]
exynos: Fix spelling mistake

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>