OSDN Git Service

android-x86/external-libdrm.git
5 years agoamdgpu: use handle table for KMS handles
Christian König [Thu, 2 Aug 2018 08:47:02 +0000 (10:47 +0200)]
amdgpu: use handle table for KMS handles

Instead of the hash use the handle table.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agoamdgpu: add handle table implementation v2
Christian König [Thu, 2 Aug 2018 08:42:41 +0000 (10:42 +0200)]
amdgpu: add handle table implementation v2

The kernel handles are dense and the kernel always tries to use the
lowest free id. Use this to implement a more efficient handle table
by using a resizeable array instead of a hash.

v2: add handle_table_fini function, extra key checks,
    fix typo in function name

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agoamdgpu: stop using the hash table for fd_tab
Christian König [Wed, 1 Aug 2018 18:44:44 +0000 (20:44 +0200)]
amdgpu: stop using the hash table for fd_tab

We have so few devices that just walking a linked list is probably
faster.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agoconfigure.ac: bump version to 2.4.93
Marek Olšák [Wed, 1 Aug 2018 01:26:11 +0000 (21:26 -0400)]
configure.ac: bump version to 2.4.93

5 years agofreedreno/msm: "stateobj" support
Rob Clark [Mon, 23 Jul 2018 14:46:12 +0000 (10:46 -0400)]
freedreno/msm: "stateobj" support

Adds support for "state object" cmdstream buffers which can be
constructed once, and re-used many times.  This enables the use
for CP_SET_DRAW_STATE packets on newer hardware, to lower the
CPU overhead.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: slight reordering
Rob Clark [Mon, 23 Jul 2018 14:23:50 +0000 (10:23 -0400)]
freedreno: slight reordering

Splitting code-motion out from next patch.  Once we add stateobj rb's
this loop could add new entries to bos table, so it needs to be before
we set req.bos/req.nr_bos.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: small cleanup
Rob Clark [Mon, 23 Jul 2018 13:42:22 +0000 (09:42 -0400)]
freedreno: small cleanup

Make cheezy growable array thing less open-coded before adding more.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: add fd_ringbuffer_new_object()
Rob Clark [Sun, 22 Jul 2018 15:44:15 +0000 (11:44 -0400)]
freedreno: add fd_ringbuffer_new_object()

Add new API for reusable "state objects" which can be re-used multiple
times.  Backend implementation for msm will follow.  (Probably not
needed to support this for any device that uses kgsl backend, since this
is mostly useful for a5xx+.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agoxf86drm: Fix error path in drmGetDevice2
Mariusz Ceier [Sun, 29 Jul 2018 08:20:14 +0000 (10:20 +0200)]
xf86drm: Fix error path in drmGetDevice2

In drmGetDevice2 when no local device is found or when
drm_device_has_rdev filters out all devices, *device might be left
uninitialized causing drmGetDevice2 to not return error - since
it's only returned when *device == NULL.

Above leads to crash in the firefox in system with amdgpu.

With this change firefox displays:

libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu

and doesn't crash.

Bugzilla: https://bugs.freedesktop.org/107384
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Mariusz Ceier <mceier+mesa-dev@gmail.com>
5 years agoamdgpu: add amdgpu_bo_handle_type_kms_noimport
Marek Olšák [Thu, 12 Jul 2018 00:35:19 +0000 (20:35 -0400)]
amdgpu: add amdgpu_bo_handle_type_kms_noimport

Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
5 years agodrmdevice: print the correct host1x information
Emil Velikov [Mon, 25 Jun 2018 17:31:35 +0000 (18:31 +0100)]
drmdevice: print the correct host1x information

While fairly close, the host1x and platform are two separate things.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agodrmdevice: convert the tabbed output into a tree
Emil Velikov [Mon, 25 Jun 2018 17:29:35 +0000 (18:29 +0100)]
drmdevice: convert the tabbed output into a tree

Making the output a little bit easier to parse by human beings.

v2: Add extra whitespace (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
5 years agotests/drmdevice: add a couple of printf headers
Emil Velikov [Mon, 25 Jun 2018 17:07:49 +0000 (18:07 +0100)]
tests/drmdevice: add a couple of printf headers

Add a few printf statements, which should make the output easier to
parse.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agotests/drmdevices: install alongside other utilities
Emil Velikov [Mon, 25 Jun 2018 16:45:23 +0000 (17:45 +0100)]
tests/drmdevices: install alongside other utilities

It's mildly useful program, to ship it when the user wants the "tests"
installed. Obviously the "tests" in the name is a misnomer.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agoxf86drm: Add drmDevice support for virtio_gpu
Emil Velikov [Tue, 15 May 2018 16:37:49 +0000 (17:37 +0100)]
xf86drm: Add drmDevice support for virtio_gpu

The GPU almost exclusively lives on the PCI bus, so we expose it as a
normal PCI one.

This allows all existing drmDevice users to work without any changes.

One could wonder why a separate typeset is not introduced, alike say
host1x. Unlike host1x the PCI/platform distinction for virtio provides
no extra information. Plus if needed we can add the separate set at a
later stage.

Here are a few 'features' that virtio seems to be missing:
 - provides extra information on top the plaform devices
 - supports a range of GPU devices
 - is considered hardware description (DT)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agoxf86drm: introduce a get_real_pci_path() helper
Emil Velikov [Tue, 15 May 2018 16:29:44 +0000 (17:29 +0100)]
xf86drm: introduce a get_real_pci_path() helper

Introduce a helper which gets the real sysfs path for the given pci
device.

In other words, instead opening the /sys/dev/char/*/device symlink, we
opt for the actual /sys/devices/pci*/*/

It folds three (nearly identical) snprintf's and paves the way of adding
extra devices (see next patch) a piece of pie.

v2: use a caller (on stack) provided real_path (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
5 years agoxf86drm: Allocate drmDevicePtr's on stack
Emil Velikov [Tue, 15 May 2018 15:32:10 +0000 (16:32 +0100)]
xf86drm: Allocate drmDevicePtr's on stack

Currently we dynamically allocate 16 pointers and reallocate more as
needed.

Instead, allocate the maximum number (256) on stack - the number is
small enough and is unlikely to change in the foreseeable future.

This allows us to simplify the error handling and even shed a few bytes
off the final binary.

v2:
 - add a define & description behind the magic 256
 - report error to strerr and skip when over 256 device nodes

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
5 years agoxf86drm: Fold drmDevice processing into process_device() helper
Emil Velikov [Tue, 15 May 2018 14:02:52 +0000 (15:02 +0100)]
xf86drm: Fold drmDevice processing into process_device() helper

Don't duplicate the nearly identical code across the two call sites.
It improves legibility and the diff stat seems nice.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agoxf86drm: introduce drm_device_has_rdev() helper
Emil Velikov [Thu, 21 Jun 2018 15:06:35 +0000 (16:06 +0100)]
xf86drm: introduce drm_device_has_rdev() helper

Currently we match the opened drmDevice fd with each drmDevice we
process.

Move that after all the devices are processed and folded, via the
drm_device_has_rdev(). This makes the code easier to follow and allows
us to unify the massive process loop across drmGetDevice2 and
drmGetDevices2. That in itself is coming with a later commit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agoxf86drm: drmGetDevice2: error out if the fd has unknown subsys
Emil Velikov [Tue, 15 May 2018 15:43:58 +0000 (16:43 +0100)]
xf86drm: drmGetDevice2: error out if the fd has unknown subsys

Currently one can open() any /dev node. If it's unknown
drmParseSubsystemType() will return an error.

Track that and bail as needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
5 years agoamdgpu: make sure to set CLOEXEC on duplicated FDs
Christian König [Tue, 17 Jul 2018 09:04:31 +0000 (11:04 +0200)]
amdgpu: make sure to set CLOEXEC on duplicated FDs

Otherwise we leak file descriptors into child processes.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agoRevert "amdgpu: don't call add_handle_to_table for KMS BO exports"
Michel Dänzer [Wed, 11 Jul 2018 13:43:59 +0000 (15:43 +0200)]
Revert "amdgpu: don't call add_handle_to_table for KMS BO exports"

This reverts commit fe0488aa13c35952b9f3f37ff2c74b6b858e8e73.

It caused messages like

 amdgpu 0000:23:00.0: bo 000000007dce0b3e va 0x0000101800-0x000010181f conflict with 0x0000101800-0x0000101820

in dmesg, and eventually a Xorg crash while running piglit.

Evidently, such BOs can actually be re-imported by other means than via
a KMS handle.

5 years agoamdgpu: don't call add_handle_to_table for KMS BO exports
Marek Olšák [Fri, 6 Jul 2018 20:15:31 +0000 (16:15 -0400)]
amdgpu: don't call add_handle_to_table for KMS BO exports

Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agointel: Introducing Amber Lake platform
José Roberto de Souza [Tue, 19 Jun 2018 23:45:21 +0000 (16:45 -0700)]
intel: Introducing Amber Lake platform

Amber Lake uses the same gen graphics as Kaby Lake, including a id
that were previously marked as reserved on Kaby Lake, but that now is
moved to AML page.

So, let's just move it to AML macro that will feed into KBL macro
just to keep it better organized to make easier future code review
but it will be handled as a KBL.

This is a copy of merged i915's
commit e364672477a1 ("drm/i915/aml: Introducing Amber Lake platform")

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agointel: Introducing Whiskey Lake platform
José Roberto de Souza [Tue, 19 Jun 2018 23:45:20 +0000 (16:45 -0700)]
intel: Introducing Whiskey Lake platform

Whiskey Lake uses the same gen graphics as Coffe Lake, including some
ids that were previously marked as reserved on Coffe Lake, but that
now are moved to WHL page.

So, let's just move them to WHL macros that will feed into CFL macro
just to keep it better organized to make easier future code review
but it will be handled as a CFL.

This is a copy of merged i915's
commit b9be78531d27 ("drm/i915/whl: Introducing Whiskey Lake platform")

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agofreedreno: add user ptr to fd_ringbuffer
Rob Clark [Mon, 18 Jun 2018 17:05:01 +0000 (13:05 -0400)]
freedreno: add user ptr to fd_ringbuffer

Something for users of fd_ringbuffer to use as they see fit.  (For now,
just so mesa can add some debugging state.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agoamdgpu: Destroy fd_hash table when the last device is removed.
Jan Vesely [Fri, 18 May 2018 15:39:15 +0000 (11:39 -0400)]
amdgpu: Destroy fd_hash table when the last device is removed.

Fixes memory leak on module unload.
Analogous to mesa commit of the same name.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu/util_hash_table: Add helper function to count the number of entries in hash...
Jan Vesely [Fri, 18 May 2018 15:36:20 +0000 (11:36 -0400)]
amdgpu/util_hash_table: Add helper function to count the number of entries in hash table

Analogous to the mesa commit of the same name.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu: Take a lock before removing devices from fd_tab hash table.
Jan Vesely [Thu, 10 May 2018 23:22:17 +0000 (19:22 -0400)]
amdgpu: Take a lock before removing devices from fd_tab hash table.

Close the file descriptors under lock as well.
v2: close fds after removing from hash table

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoAlways pass O_CLOEXEC when opening DRM file descriptors
Michel Dänzer [Fri, 18 May 2018 09:16:51 +0000 (11:16 +0200)]
Always pass O_CLOEXEC when opening DRM file descriptors

Reviewed-by: Christian König <christian.koenig@amd.com>
5 years agoxf86drm: Be sure to closedir before return
Kevin Strasser [Fri, 18 May 2018 19:48:17 +0000 (12:48 -0700)]
xf86drm: Be sure to closedir before return

removed in commit bb45ce4e3ac751315bfd7fbfd9e1425bf515ec0d

Adding it back as it is still needed in the case where we don't find a
match.

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Fixes: bb45ce4e3ac751315bfd "libdrm: Use readdir instead of readdir_r to
                             avoid build warnings"$
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agobump version for release
Rob Clark [Wed, 9 May 2018 22:03:45 +0000 (18:03 -0400)]
bump version for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: add fd_pipe refcounting
Rob Clark [Wed, 9 May 2018 11:40:29 +0000 (07:40 -0400)]
freedreno: add fd_pipe refcounting

In mesa/gallium, a pipe_fence can outlive the pipe_context it was
created from.  But to wait on the fence we need to know the submit-
queue (ie. the fd_pipe).

The most straightforward way to fix this is to add reference counting
to the fd_pipe and let the fence hold a reference to the pipe (rather
than hanging on to the context, which might have been destroyed before
the fence).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
6 years agointel: add support for ICL 11
Paulo Zanoni [Thu, 26 Apr 2018 00:09:37 +0000 (17:09 -0700)]
intel: add support for ICL 11

Add the PCI IDs and the basic code to enable ICL.  This is the current
PCI ID list in our documentation.

Kernel commit: d55cb4fa2cf0 ("drm/i915/icl: Add the ICL PCI IDs")

v2: Michel provided a fix to IS_9XX that was broken by rebase bot.
v3: Fix double definition of PCI IDs, update IDs according to bspec
    and keep them in the same order and rebase (Lucas)

Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
6 years agoamdgpu: Deinitialize vamgr_high{,_32}
Michel Dänzer [Fri, 27 Apr 2018 14:42:26 +0000 (16:42 +0200)]
amdgpu: Deinitialize vamgr_high{,_32}

Fixes memory leaks.

Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
6 years agoIntel: Add a Kaby Lake PCI ID
Matt Atwood [Tue, 24 Apr 2018 19:42:39 +0000 (12:42 -0700)]
Intel: Add a Kaby Lake PCI ID

Based on kernel commit '672e314b21dc ("drm/i915/kbl: Add KBL GT2 sku")'

v2: name change M -> ULX, add enumeration in KBL ULX
v3: add entry to IS_KABYLAKE

Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
6 years agoamdgpu: enlarge the maximum number of cards supported
Xiaojie Yuan [Thu, 19 Apr 2018 13:50:49 +0000 (21:50 +0800)]
amdgpu: enlarge the maximum number of cards supported

128 is the maximum number of cards that the kernel can support
at the moment.

Change-Id: I155b7b21635306d8ecc440b85fb8954501ab5599
Signed-off-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
6 years agotests/amdgpu: add vce mv tests support and sets
James Zhu [Wed, 4 Apr 2018 13:36:07 +0000 (09:36 -0400)]
tests/amdgpu: add vce mv tests support and sets

Signed-off-by: James Zhu <James.Zhu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
6 years agolibdrm: gralloc_handle.h: Fix build issue with Android
John Stultz [Tue, 3 Apr 2018 03:37:33 +0000 (20:37 -0700)]
libdrm: gralloc_handle.h: Fix build issue with Android

In trying to integrate the new gralloc_handle.h with the
drm_hwcomposer, I started seeing the following compilation
errors:

In file included from external/drm_hwcomposer/platformdrmgeneric.cpp:28:
external/libdrm/android/gralloc_handle.h:108:9: error: cannot initialize return object of type 'native_handle_t *' (aka 'native_handle *') with an lvalue of type 'struct gralloc_handle_t *'
        return handle;
               ^~~~~~
1 error generated.

This seems to be due to the gralloc_handle_create() definition
needs to return a native_handle_t * type, rather then a
gralloc_handle_t *, which is what the code actually returns.

After talking w/ Rob Herring, having the code return the
native handle should be the proper fix, so that is what
this patch changes.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Stefan Schake <stschake@gmail.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
6 years agoheaders: Update README
Daniel Stone [Fri, 30 Mar 2018 12:23:45 +0000 (13:23 +0100)]
headers: Update README

Nouveau has made a very deliberate choice to hide its actual kernel ABI
behind libdrm. i915 is no longer out of date.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoheaders: Sync with drm-next
Daniel Stone [Fri, 30 Mar 2018 12:04:30 +0000 (13:04 +0100)]
headers: Sync with drm-next

Taken from the drm-next pull for 4.17-rc1 (694f54f680f7), and manually
reconciled:

  core:
    - Dropped DRM_MODE_TYPE_ALL and DRM_MODE_FLAG_ALL; these are purely
      internal details of the bits accepted by the currently running
      kernel, and can not be generally relied on by userspace
    - Add HDCP flags
    - Note CTM entry representation is sign-magnitude format, not
      two's-complement
  amdgpu:
    - Add QUERY_STATE2 context op
    - Add VCN firmware version query
  etnaviv:
    - Add more GPU feature flags
  i915:
    - Add caps, params and ioctls for PMU / perf-stream
    - Add support for explicit fencing
  nouveau:
    - Add TILE_COMP layout
  vc4:
    - Add perfmon ioctls
  virtgpu:
    - Add capset-fix param
  vmware:
    - Add handle-close ioctl and explicit-fencing support

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoheaders: sync up amdgpu_drm.h with drm-next
Rex Zhu [Tue, 20 Mar 2018 06:08:09 +0000 (14:08 +0800)]
headers: sync up amdgpu_drm.h with drm-next

Add sensor_info type
AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK
AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
6 years agoRevert "libdrm: intel/Android.mk: Filter libdrm_intel library requirements on x86...
Emil Velikov [Tue, 20 Mar 2018 17:32:37 +0000 (17:32 +0000)]
Revert "libdrm: intel/Android.mk: Filter libdrm_intel library requirements on x86/x86_64"

This reverts commit ed07718ae7bab596297abf210bb0c37c6dba58ed.

The commit added a guard since libpciaccess may be missing on some
setups. As of last commit there are no traces of the project, from
Android POV.

Hence, we can revert this workaround - which caused similar breakage to
the one it's trying to fix. This time in Mesa.

Cc: Rob Herring <rob.herring@linaro.org>
Acked-by: John Stultz <john.stultz@linaro.org>
6 years agointel: Do not use libpciaccess on Android
Tomasz Figa [Mon, 14 Dec 2015 10:46:34 +0000 (19:46 +0900)]
intel: Do not use libpciaccess on Android

This patch makes the code not rely anymore on libpciaccess when compiled
for Android to eliminate ioperm() and iopl() syscalls required by that
library. As a side effect, the mappable aperture size is hardcoded to 64
MiB on Android, however nothing seems to rely on this value anyway, as
checked be grepping relevant code in drm_gralloc and Mesa.

Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: Tomasz Figa <tfiga@google.com>
[Emil Velikov: rebase against master. add missing __func__, Eric]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: John Stultz <john.stultz@linaro.org>
6 years agoxf86drmMode: merge successive mutually-exclusive #ifs
Eric Engestrom [Thu, 22 Mar 2018 17:08:37 +0000 (17:08 +0000)]
xf86drmMode: merge successive mutually-exclusive #ifs

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agolibdrm: Use readdir instead of readdir_r to avoid build warnings
John Stultz [Tue, 20 Mar 2018 17:48:23 +0000 (17:48 +0000)]
libdrm: Use readdir instead of readdir_r to avoid build warnings

Building libdrm under AOSP, we see the following build warning:
external/libdrm/xf86drm.c:2861:12: warning: 'readdir_r' is deprecated: readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations]
    while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {
           ^

Building on Linux with glibc produces the same warning.
Thus, this patch replaces readdir_r with readdir.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102031
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Stefan Schake <stschake@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil Velikov: remove unused variables, Eric]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agoandroid: Add missing include exports
Stefan Schake [Sun, 18 Mar 2018 01:26:59 +0000 (02:26 +0100)]
android: Add missing include exports

They were set for the static library but not the shared variant.

Signed-off-by: Stefan Schake <stschake@gmail.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoomap: add Android build support
Gowtham Tammana [Wed, 28 Feb 2018 18:54:51 +0000 (12:54 -0600)]
omap: add Android build support

Add Android.mk file to build libdrm_omap library.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agolibdrm: amdgpu: Adding DRM_RDWR flag in amdgpu_bo_export
Satyajit [Mon, 26 Feb 2018 12:37:03 +0000 (18:07 +0530)]
libdrm: amdgpu: Adding DRM_RDWR flag in amdgpu_bo_export

Currently while exporting prime handle to fd read write access is
not granted. mmap fails because of this. mmap was not supported on
prime initially.
Here is link to related discussion
https://lists.freedesktop.org/archives/dri-devel/2017-February/131840.html

Adding the DRM_RDWR flag in amdgpu_bo_export to support mmap.

Signed-off-by: Satyajit <satyajit.sahu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
6 years agomeson: drop unnecessary variable
Eric Engestrom [Tue, 20 Mar 2018 14:59:40 +0000 (14:59 +0000)]
meson: drop unnecessary variable

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: move line to allow using `config` earlier
Eric Engestrom [Tue, 20 Mar 2018 14:54:45 +0000 (14:54 +0000)]
meson: move line to allow using `config` earlier

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: drop unneeded dependency to libudev
Eric Engestrom [Tue, 20 Mar 2018 14:55:50 +0000 (14:55 +0000)]
meson: drop unneeded dependency to libudev

libdrm only needed libudev for a few days 3 years ago,
between fde4969176822fe54197 and its revert 5b0e76f143887c4ec7db.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson,configure: include config.h automatically
Eric Engestrom [Thu, 1 Feb 2018 11:12:05 +0000 (11:12 +0000)]
meson,configure: include config.h automatically

This will prevent any more missing `#include "config.h"` bug, at the
cost of having to recompile some files that didn't need to be when
changing build options.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: replace `if(compiles) have=true` with `have=compiles`
Eric Engestrom [Fri, 16 Mar 2018 17:10:26 +0000 (17:10 +0000)]
meson: replace `if(compiles) have=true` with `have=compiles`

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson,configure: always define UDEV
Eric Engestrom [Fri, 16 Mar 2018 17:04:50 +0000 (17:04 +0000)]
meson,configure: always define UDEV

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson,configure: always define HAVE_VISIBILITY
Eric Engestrom [Fri, 16 Mar 2018 17:07:08 +0000 (17:07 +0000)]
meson,configure: always define HAVE_VISIBILITY

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson,configure: always define HAVE_OPEN_MEMSTREAM
Eric Engestrom [Fri, 26 Jan 2018 17:04:28 +0000 (17:04 +0000)]
meson,configure: always define HAVE_OPEN_MEMSTREAM

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agotests: fix memory leak issue
Inki Dae [Tue, 20 Mar 2018 03:47:33 +0000 (12:47 +0900)]
tests: fix memory leak issue

Fixed memory leak issue to drmModeRes and drmModePlaneRes objects.

These objects were allocated by drmModeGetResources and
drmModeGetPlaneResources functions but not freed properly.

So this patch frees them by calling drmModeFreeResources
drmModeFreePlaneResources functions at failure case.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agolibdrm: intel/Android.mk: Filter libdrm_intel library requirements on x86/x86_64
John Stultz [Wed, 14 Mar 2018 16:47:36 +0000 (09:47 -0700)]
libdrm: intel/Android.mk: Filter libdrm_intel library requirements on x86/x86_64

When building AOSP after updating libdrm project to the
freedesktop/master branch, I've seen the following build errors:

external/libdrm/intel/Android.mk: error: libdrm_intel
(SHARED_LIBRARIES android-arm64) missing libpciaccess
(SHARED_LIBRARIES android-arm64) You can set
ALLOW_MISSING_DEPENDENCIES=true in your environment if this is
intentional, but that may defer real problems until later in the
build.

Using ALLOW_MISSING_DEPENDENCIES=true when building allows
things to function properly, but is not ideal.

So basically, while I'm not including the libdrm_intel package
into the build, just the fact that the Android.mk file references
libpciaccess which isn't a repo included in AOSP causes the build
failure.

So it seems we need some sort of conditional filter in the
Android.mk to skip over it if we're not building for intel.

Cc: Chad Versace <chad.versace@linux.intel.com>
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dan Willemsen <dwillemsen@google.com>
Cc: Tomasz Figa <tfiga@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agotests/exynos: remove dead condition
Seung-Woo Kim [Wed, 14 Mar 2018 05:48:37 +0000 (14:48 +0900)]
tests/exynos: remove dead condition

There is already condition checking input values between 2 and 4096
so condition checking 0 is always false. Remove the dead condition.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agomeson: detect alloca.h
Eric Engestrom [Tue, 13 Mar 2018 14:31:29 +0000 (14:31 +0000)]
meson: detect alloca.h

amdgpu makes use of it

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson: make it easy to add headers to check
Eric Engestrom [Mon, 12 Mar 2018 16:17:55 +0000 (16:17 +0000)]
meson: make it easy to add headers to check

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson: don't use compiler.has_header
Dylan Baker [Mon, 12 Mar 2018 17:10:51 +0000 (10:10 -0700)]
meson: don't use compiler.has_header

Meson's compiler.has_header is completely useless, it only checks that a
header exists, not whether it's usable. This creates problems if a
header contains a conditional #error declaration, like so:

> #if __x86_64__
> # error "Doesn't work with x86_64!"
> #endif

Compiler.has_header will return true in this case, even when compiling
for x86_64. This is useless.

Instead, we'll do a compile check so that any #error declarations will
be treated as errors, and compilation will work.

Fixes compilation on x32 architecture.

Gentoo Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=649746
meson bug: https://github.com/mesonbuild/meson/issues/2246
CC: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agomeson: use pkg-config to detect libatomic_ops
Eric Engestrom [Wed, 7 Feb 2018 14:20:52 +0000 (14:20 +0000)]
meson: use pkg-config to detect libatomic_ops

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agodrm/amdgpu: Remove IB count checking
Sabre Shao [Fri, 8 Sep 2017 09:43:51 +0000 (17:43 +0800)]
drm/amdgpu: Remove IB count checking

Signed-off-by: Sabre Shao <Sabre.Shao@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoRevert "amdgpu:support 16 ibs per submit for PAL/SRIOV"
Marek Olšák [Fri, 9 Mar 2018 01:04:01 +0000 (20:04 -0500)]
Revert "amdgpu:support 16 ibs per submit for PAL/SRIOV"

This reverts commit 924f856a9047b87e8bfdc2867f7fe484e3f71343.

Wrong patch.

6 years agoamdgpu:support 16 ibs per submit for PAL/SRIOV
Qiang Yu [Tue, 7 Mar 2017 07:00:34 +0000 (15:00 +0800)]
amdgpu:support 16 ibs per submit for PAL/SRIOV

to support SRIOV and MCBP, need 16 IBs per submit

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
6 years agofreedreno: add missing symbols to symbol-check
Eric Engestrom [Tue, 6 Mar 2018 15:37:55 +0000 (15:37 +0000)]
freedreno: add missing symbols to symbol-check

Fixes: 1384c081233751569473 "freedreno: add interface to get buffer address"
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
6 years agodrm/atomic: Refuse to add invalid objects to requests
Daniel Stone [Wed, 7 Mar 2018 12:41:12 +0000 (12:41 +0000)]
drm/atomic: Refuse to add invalid objects to requests

Object and property IDs cannot be zero. Prevent them from being added to
the request stream at all, rather than breaking at commit time.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agointel/intel_chipset.h: Sync Cannonlake IDs.
Rodrigo Vivi [Thu, 8 Feb 2018 06:46:43 +0000 (22:46 -0800)]
intel/intel_chipset.h: Sync Cannonlake IDs.

Let's sync CNL ids with Spec and kernel.

Sync with kernel commit '3f43031b1693 ("drm/i915/cnl:
Add Cannonlake PCI IDs for another SKU.")' and
commit 'e3890d05b342 ("drm/i915/cnl: Sync PCI ID with Spec.")'

Cc: James Ausmus <james.ausmus@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agobump version for release
Rob Clark [Mon, 5 Mar 2018 20:55:51 +0000 (15:55 -0500)]
bump version for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
6 years agomeson: add configuration summary
Eric Engestrom [Mon, 26 Feb 2018 15:42:18 +0000 (15:42 +0000)]
meson: add configuration summary

The message block printed is the same as the one in configure.ac

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agotests/amdgpu: Fix misspellings of "suite"
Michel Dänzer [Thu, 1 Mar 2018 10:15:42 +0000 (11:15 +0100)]
tests/amdgpu: Fix misspellings of "suite"

Acked-by: Christian König <christian.koenig@amd.com>
6 years agotest/amdgpu: disable bo eviction test by default
Chunming Zhou [Thu, 1 Mar 2018 10:04:07 +0000 (18:04 +0800)]
test/amdgpu: disable bo eviction test by default

if some system has no swap space and memory is less, than the test
could fail.
And bo eviction test takes much more time in some system, which effects
automation test result and efficiency.
So disable it by default now, only be used by developer manually.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
6 years agoamdgpu: fix "add AMDGPU_VA_RANGE_HIGH"
Christian König [Wed, 28 Feb 2018 14:39:46 +0000 (15:39 +0100)]
amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"

The range is stored as exclusive, not inclusive. Subtracts one to get
the inclusive interval for the calculation. This fixes crashes when 32bit
addresses are in use.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agoamdgpu: add AMDGPU_VA_RANGE_HIGH
Christian König [Mon, 26 Feb 2018 13:11:52 +0000 (14:11 +0100)]
amdgpu: add AMDGPU_VA_RANGE_HIGH

Return high addresses if requested and available.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoamdgpu: mostly revert "use the high VA range if possible v2"
Christian König [Mon, 26 Feb 2018 11:30:36 +0000 (12:30 +0100)]
amdgpu: mostly revert "use the high VA range if possible v2"

This reverts commit 07ea20d5beb24315b721adf83bbfa72ce016e146.

Unfortunately it turned out that this change broke some corner cases in
Mesa.

Revert it for now, but keep the high range in separate VA managers.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agofreedreno: add interface to get buffer address
Rob Clark [Sun, 25 Feb 2018 19:56:18 +0000 (14:56 -0500)]
freedreno: add interface to get buffer address

Needed for clover/OpenCL.  Fortunately the kernel interface is already
in place.

Include a stub _put_iova() so mesa can tell us when it no longer needs
the buffer to be pinned.  There is no kernel interface for this (yet),
but at least if we want to unpin buffers we won't need mesa changes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
6 years ago*-symbol-check: Don't hard-code nm executable
Heiko Becker [Mon, 19 Feb 2018 15:13:15 +0000 (15:13 +0000)]
*-symbol-check: Don't hard-code nm executable

Helpful if your nm executable has a prefix based on the
architecture, for example.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
Cc: Timo Gurr <timo.gurr@gmail.com>
[Eric: v2: rebase and add Meson support]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoandroid: fix gralloc_handle_create() problems
Rob Herring [Wed, 14 Feb 2018 23:03:56 +0000 (17:03 -0600)]
android: fix gralloc_handle_create() problems

There's a number of problems with gralloc_handle_create starting with it
doesn't even compile. More importantly, it doesn't really create (i.e.
allocate) a handle. It allocates a native_handle_t, copies it to a
struct gralloc_handle_t on the stack and returns the struct (not a ptr).
So the caller still has to allocate a struct gralloc_handle_t to hold
the returned struct.

Rework gralloc_handle_create() to allocate a new handle and return the
pointer to the allocated handle. Callers should free the handle with
native_handle_close() and native_handle_delete(). In the interest of
making gralloc_handle_t opaque, return a native_handle_t ptr instead.

Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoandroid: add helper to convert buffer_handle_t to gralloc_handle_t ptr
Rob Herring [Wed, 14 Feb 2018 23:05:42 +0000 (17:05 -0600)]
android: add helper to convert buffer_handle_t to gralloc_handle_t ptr

Clients frequently need to convert a buffer_handle_t (aka
native_handle_t *) to a gralloc_handle_t ptr. This is a simple cast, but
add an inline function to do the conversion.

Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoandroid: fix mis-named alloc_handle_t
Rob Herring [Wed, 14 Feb 2018 23:06:46 +0000 (17:06 -0600)]
android: fix mis-named alloc_handle_t

Fix a typo where alloc_handle_t should be gralloc_handle_t. One still
remains in gralloc_handle_create, but a subsequent commit will fix that
along with other problems in gralloc_handle_create.

Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoandroid: revert making handle magic and version members const
Rob Herring [Wed, 14 Feb 2018 23:10:25 +0000 (17:10 -0600)]
android: revert making handle magic and version members const

Const members are problematic for dynamically allocating struct
gralloc_handle_t, so just drop the const modifier.

Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agomeson/configure.ac: pthread-stubs not present on OpenBSD
Jonathan Gray [Tue, 20 Feb 2018 06:09:14 +0000 (17:09 +1100)]
meson/configure.ac: pthread-stubs not present on OpenBSD

pthread-stubs is no longer required on OpenBSD and has been removed.
libpthread parts involved moved to libc.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Eric: add meson equivalent]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: do not use cairo/valgrind if disabled
Igor Gnatenko [Mon, 19 Feb 2018 12:55:27 +0000 (13:55 +0100)]
meson: do not use cairo/valgrind if disabled

-Dcairo-tests=false currently results into enabling cairo support if it
was found. Same for valgrind.

v2:
* Use underscore-prefixed variables to not change type of variable
* Use empty array for "fake" dependency instead of real empty object

v3:
* Fix typo

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
6 years agoamdgpu: Fix mistake in initial hole size calculation.
Andrey Grodzovsky [Mon, 19 Feb 2018 07:18:36 +0000 (02:18 -0500)]
amdgpu: Fix mistake in initial hole size calculation.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
6 years agodrm/tegra: Sanitize format modifiers
Thierry Reding [Tue, 14 Nov 2017 17:50:30 +0000 (18:50 +0100)]
drm/tegra: Sanitize format modifiers

The existing format modifier definitions were merged prematurely, and
recent work has unveiled that the definitions are suboptimal in several
ways:

  - The format specifiers, except for one, are not Tegra specific, but
    the names don't reflect that.
  - The number space is split into two, reserving 32 bits for some
    "parameter" which most of the modifiers are not going to have.
  - Symbolic names for the modifiers are not using the standard
    DRM_FORMAT_MOD_* prefix, which makes them awkward to use.
  - The vendor prefix NV is somewhat ambiguous.

Fortunately, nobody's started using these modifiers, so we can still fix
the above issues. Do so by using the standard prefix. Also, remove TEGRA
from the name of those modifiers that exist on NVIDIA GPUs as well. In
case of the block linear modifiers, make the "parameter" smaller (4
bits, though only 6 values are valid) and don't let that leak into any
of the other modifiers.

Finally, also use the more canonical NVIDIA instead of the ambiguous NV
prefix.

This is based on commit 5843f4e02fbe86a59981e35adc6cabebee46fdc0 from
Linux v4.16-rc1 and also updates modetest to use the new defines.

Acked-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/fourcc: Fix fourcc_mod_code() definition
Thierry Reding [Tue, 14 Nov 2017 17:51:26 +0000 (18:51 +0100)]
drm/fourcc: Fix fourcc_mod_code() definition

Avoid compiler warnings when the val parameter is an expression.

This is based on commit 5843f4e02fbe86a59981e35adc6cabebee46fdc0 from
Linux v4.16-rc1.

Acked-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoRELEASING: mention meson
Marek Olšák [Sat, 17 Feb 2018 19:25:02 +0000 (20:25 +0100)]
RELEASING: mention meson

6 years agomeson: bump the version number
Marek Olšák [Sat, 17 Feb 2018 19:20:33 +0000 (20:20 +0100)]
meson: bump the version number

6 years agoconfigure.ac: bump version to 2.4.90
Marek Olšák [Sat, 17 Feb 2018 03:28:42 +0000 (04:28 +0100)]
configure.ac: bump version to 2.4.90

6 years agoandroid: Change gralloc_handle_t members to be fixed width
Robert Foss [Tue, 16 Jan 2018 17:07:15 +0000 (18:07 +0100)]
android: Change gralloc_handle_t members to be fixed width

In order to lessen future alignment issues, lets switch to
fixed width integers where possible.

This excludes the data_owner since it is a pid_t which
in theory could be larger than 32 bits.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoandroid: Remove member name from gralloc_handle_t
Robert Foss [Tue, 16 Jan 2018 13:38:41 +0000 (14:38 +0100)]
android: Remove member name from gralloc_handle_t

The name member of gralloc_handle_t is no longer needed and has been removed.
The version field has also been bumped.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoandroid: Mark gralloc_handle_t magic variable as const
Robert Foss [Tue, 16 Jan 2018 14:19:15 +0000 (15:19 +0100)]
android: Mark gralloc_handle_t magic variable as const

Mark magic member of gralloc_handle_t as const.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoandroid: Add version variable to gralloc_handle_t
Robert Foss [Tue, 16 Jan 2018 13:36:13 +0000 (14:36 +0100)]
android: Add version variable to gralloc_handle_t

The version variable will be used for versioning of this
struct and the corresponding accessor functions.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoandroid: Move gralloc handle struct to libdrm
Robert Foss [Wed, 6 Dec 2017 18:28:13 +0000 (19:28 +0100)]
android: Move gralloc handle struct to libdrm

This struct is used in mesa and drm_hwcomposer.
Versions of if have been implemented in several grallocs:
drm_gralloc, gbm_gralloc, minigbm and intel-minigbm.

Other than the 1:1 move of the struct a new generic name
has been chosen and variables have had comments added to them.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoamdgpu: Add amdgpu_query_sw_info to amdgpu-symbol-check
Michel Dänzer [Mon, 12 Feb 2018 14:47:55 +0000 (15:47 +0100)]
amdgpu: Add amdgpu_query_sw_info to amdgpu-symbol-check

Fixes make check. Trivial.

6 years agoamdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address space
Marek Olšák [Fri, 2 Feb 2018 17:15:00 +0000 (18:15 +0100)]
amdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address space

Reviewed-by: Christian König <christian.koenig@amd.com>
6 years agomeson: include headers in root directory in ext_libdrm
Dylan Baker [Wed, 7 Feb 2018 23:35:24 +0000 (15:35 -0800)]
meson: include headers in root directory in ext_libdrm

Which is used in wraps.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agoamdgpu: clean up non list code path for vamgr v2
Chunming Zhou [Thu, 8 Feb 2018 06:52:11 +0000 (14:52 +0800)]
amdgpu: clean up non list code path for vamgr v2

v2: Add missing "goto out"

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>