Commit Graph

6844 Commits (1d29e1df8b140b7ad3466d5122e703435ef5e436)

Author SHA1 Message Date
Karol Herbst 1d29e1df8b nouveau: print bo address in the GPU/CPU vm and its size
v2: print bo->offset as 64 bit

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
2021-08-04 18:27:13 +02:00
Jordan Justen 8d0fb9b3f2
libdrm: NOTE! Default branch is now main
To update your local repository to use the new default branch, these
commands may help:

$ git fetch origin
$ git checkout master
$ git branch -m main
$ git branch --set-upstream-to=origin/main
$ git remote set-head origin --auto

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2021-08-02 15:31:26 -07:00
Mario Kleiner 149b99fe54 headers: drm: Sync with drm-next
Generated using make headers_install from the drm-next
tree - git://anongit.freedesktop.org/drm/drm
branch - drm-next
commit - 8a02ea42bc1d4c448caf1bab0e05899dad503f74

Some changes were omitted, e.g., to nouveau_drm.h, i915_drm.h, and
msm_drm.h, as the nouveau and i915 changes looked to me as if they
could break compatibility or require other compatibility fixes to
libdrm which i can not judge. msm_drm.h broke the build, as there
are definitely changes needed to libdrm's msm support code.

The shortlog below is edited to only list what corresponds to files
that are included here, because it looked safe to me.

The changes were as follows (shortlog from
b10733527bfd864605c33ab2e9a886eec317ec39..HEAD):

Aaron Liu (1):
      drm/amdgpu: add uapi to define yellow carp series

Alex Deucher (1):
      drm/amdgpu: add INFO ioctl support for querying video caps (v4)

Christian Gmeiner (1):
      drm/etnaviv: provide more ID values via GET_PARAM ioctl.

Felix Kuehling (1):
      drm/amdgpu: Add new placement for preemptible SG BOs

Jiawei Gu (1):
      drm/amdgpu: Add vbios info ioctl interface

Lionel Landwerlin (1):
      drm: fix drm_mode_create_blob comment

Mario Kleiner (1):
      drm/fourcc: Add 16 bpc fixed point framebuffer formats.

Nirmoy Das (1):
      drm/amdgpu: remove AMDGPU_GEM_CREATE_SHADOW flag

Noralf Trønnes (1):
      drm/uapi: Add USB connector type

Radhakrishna Sripada (1):
      drm/framebuffer: Format modifier for Intel Gen 12 render compression with Clear Color

Simon Ser (13):
      drm: improve kernel-docs in drm_mode.h
      drm: document drm_mode_get_connector
      drm: document drm_mode_modeinfo
      drm: document that user-space should force-probe connectors
      drm/doc: atomic implicitly enables other caps
      drm/doc: re-format drm.h file comment
      drm/doc: demote old doc-comments in drm.h
      drm/fourcc: fix Amlogic format modifier masks
      drm/uapi: document kernel capabilities
      drm/connector: demote connector force-probes for non-master clients
      drm: reference mode flags in DRM_CLIENT_CAP_* docs
      drm: clarify and linkify DRM_CLIENT_CAP_WRITEBACK_CONNECTORS docs
      drm: document minimum kernel version for DRM_CLIENT_CAP_*

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2021-08-02 02:39:12 +00:00
Eric Anholt e6fb9ccf2a meson: Don't build libkms for Android.
Nobody wants that that I know of.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2021-07-30 10:58:11 -07:00
Eric Anholt a819b9ad3b meson: Build libdrm.so as an unversioned lib on Android.
Android vendor libraries don't have sonames, and libdrm.so shouldn't
either.  This lets a Mesa built against a libdrm.so built for Android
be copied directly to a Chrome OS ARC installation.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2021-07-30 10:58:11 -07:00
Aaron Liu 4ac7d6bf5d test/amdgpu: Bob to Alice copy should be TMZ in secure bounce test
SDMA copy from Alice to Bob is in TMZ mode. Therefore
SDMA copy back from Bob to Alice should be in TMZ mode too.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
2021-07-23 10:24:22 +08:00
Luben Tuikov 87a68fe9e4 tests/amdgpu: Fix TMZ secure bounce test
Fix the TMZ secure bounce test, in that Bob's
buffer has to be created encrypted (with the
encrypted flag set), so that when we copy from
Alice's buffer, which is also encrypted, to Bob's
buffer, the copy can be successful and the data
actually copied.

This fixes the test and it no longer fails. Tested
on Sienna Cichlid.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Aaron Liu <aaron.liu@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Alex Deucher <Alexander.Deucher@amd.com>
2021-07-16 12:10:06 -04:00
Bas Nieuwenhuizen 9cef5dee3c Bump version to 2.4.107
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2021-07-02 03:12:30 +02:00
Alex Deucher ab72fde87e amdgpu: update marketing names
From 21.20 release.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-06-29 21:06:42 -04:00
Marius Vlad 5d97031e8a README.rst: Include some notes about syncing uapi headers
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Marius Vlad 65d8939808 xf86drm: Add support for decoding AMLOGIC format modifiers
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Marius Vlad 9ae8f17d56 xf86drm: Add support for decoding AMD format modifiers
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Marius Vlad 99a0522aef xf86drm: Add support for decoding Nvidia format modifiers
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Marius Vlad a04b674887 xf86drm: Add a vendor function to decode the format modifier
As format modifiers can be encoded in quite complex forms, the static
table previously added is not sufficient to retrieve, extract and decode
the token formats to a human-readable string.  This patch introduces a
vendor specific callback which could be used to perform an additional
search to match up with vendor encoding scheme, which, will be used
first, before resorting to searching the static table.

With it, add support for decoding the ARM format modifiers.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Marius Vlad 67e911977f xf86drm: Add a human readable representation for format modifiers
Introduces two new methods to retrieve a human readable representation of a
format modifier:

drmGetFormatModifierName() - returns a format modifier as a string,
from a token modifier
drmGetFormatModifierVendor() - returns the vendor as a string, from a
token modifier

and the fourcc_mod_get_vendor macro that returns the vendor.

New format modifiers added in drm_fourcc.h uapi kernel header should be
sync'ed up with libdrm and should include a human readable
representation for that format modifier, in order to display it
correctly as a string.

That happens with the help of a python script that reads up drm_fourcc
header file and outputs a static table comprised of token modifiers
alongside a vendor table (Suggested-by Simon Ser <contact@emersion.fr>).

The reason for doing it in libdrm is to have a unified place instead of each
user of libdrm having a way to keep track of the format modifiers.

With this patch, modetest has also been modified to make use of it.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-06-22 11:16:04 +00:00
Eleni Maria Stea f287d1990b Conditionally include <linux/limits.h> and <sys/params.h> on Linux, BSD
<linux/limits.h> should be included conditionally for Linux only, also
SPECNAMELEN used conditionally when the OS is FreeBSD requires to
include <sys/params.h>.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2021-06-20 14:32:33 +03:00
Eleni Maria Stea 8bc56fe0fb _WANT_KERNEL_ERRNO must be defined in FreeBSD for ERESTART to be used
In FreeBSD's errno.h ERESTART is not defined by default, only when the
user requests the pseudo-errors returned inside the kernel to be
enabled. As a result the block where drmCommandWriteRead is
called returns compile error. Defined _WANT_KERNEL_ERRNO to fix it (see
FreeBSD's /usr/include/errno.h)

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2021-06-20 09:20:08 +03:00
Eleni Maria Stea 90c9175c81 include <sys/types.h> in xf86drmMode when the OS is FreeBSD
<sys/types.h> need to be included in xf86drmMode.c for type u_int in
<sys/sysctl.h> (that is included when OS is FreeBSD) to be recognized.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2021-06-20 09:20:08 +03:00
Bas Nieuwenhuizen 085ee3e488 amdgpu: Add vamgr for capture/replay.
In Vulkan we have extensions to assist with capture in replay in a
world where addresses are returned to the application. This involves
creating buffers at the same VA during replay as they were during
capture.

By itself libdrm_amdgpu already has support for this, but there is
the obvious failure mode that if another buffer is already allocated
at that VA things fail spectacularly. This is an actual issue as
internal buffers, like winsys images or shader binaries also
participate in the same VA allocation.

To avoid this problem applications have to create buffers which
are going to be captured with a flag, and the implementation is to
separate VA allocation for those buffers to reduce the collision risk:

"Implementations are expected to separate such buffers in the GPU address
space so normal allocations will avoid using these addresses. Apps/tools
should avoid mixing app-provided and implementation-provided addresses for
buffers created with VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT,
to avoid address space allocation conflicts."

This patch implements that by adding a flag for these buffers and allocating
address space from the top of the address range instead of the bottom.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Christian König <christian.koenig@amd.com>
2021-06-15 13:08:20 +00:00
Andrey Grodzovsky d615430c68 tests/amdgpu/hotunplug: Add hotunplug with exported fence
Disconnect device while fence is exported.
Also disable this test for sytem with single GPU.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Andrey Grodzovsky 93a4708ac0 tests/amdgpu/hotunplug: Add hotunplug with exported bo test
Disconnect device while BO is exported.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Andrey Grodzovsky b5f611cc37 tests/amdgpu/hotunplug: Add unplug with cs test.
Same as simple test but while doing cs

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Andrey Grodzovsky d4b780a735 test/amdgpu/hotunplug: Add test suite for GPU unplug
Add plug/unplug device and open/close device file
infrastructure.
Add basic test - unplug device while device file still
open. Close device file afterwards and replug the device.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Andrey Grodzovsky d330f68c11 test/amdgpu: Add helper functions for hot unplug
Expose close device and add open device wich preserves
test index.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Andrey Grodzovsky ae2e2bd68a tests/amdgpu: Fix valgrind warning
Struct access after free

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher alexander.deucher@amd.com
2021-06-09 20:27:09 +00:00
Rahul Kumar 140ce56dcb amdgpu: Added product name for E9390,E9560 and E9565 dgpu
Update marketing names.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-06-07 10:59:19 -04:00
Lang Yu 4e178807b9 Revert "tests/amdgpu: fix bo eviction test issue"
This reverts commit a5a400c958.

Bo evict test was disabled by default per below commit.
So still keep it as disabled.

1f6a85cc test/amdgpu: disable bo eviction test by default

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2021-06-01 12:56:24 +00:00
Tejas Upadhyay 4c8365183e intel: Add support for ADLP
Add ADLP platform support and PCIIDs

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
2021-05-20 12:01:25 +00:00
Dave Airlie 77b642b6de Bump version to 2.4.106
Signed-off-by: Dave Airlie <airlied@redhat.com>
2021-05-18 13:38:07 +10:00
Karol Herbst cfbea78fdf nouveau: add debug option to sync pushbuffer submissions
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:16 +02:00
Karol Herbst 91c3eb1700 novueau: document debug flags
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:14 +02:00
Karol Herbst 17a51b0b31 nouveau: rework debugging so we can also dump into a file
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:12 +02:00
Karol Herbst c0ae9cfa00 nouveau: make debug features accessible in normal builds
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:10 +02:00
Karol Herbst 2f04bd2d89 nouveau: mask push buffer length pushbuf_dump
nvc0 sets the NVC0_IB_ENTRY_1_NO_PREFETCH bit on some pushbuffers

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:09 +02:00
Karol Herbst 52fd2a2542 nouveau: fix crash in pushbuf_dump with an unmapped bo
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:40:57 +02:00
Eric Engestrom bf08984682 ci: use `base-devel` tag of archlinux image instead of `base` and then installing `base-devel` after
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
2021-04-30 10:13:37 +02:00
Eric Engestrom b4847d97df ci: use archlinux/archlinux docker image instead of deprecated and now removed archlinux/base
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
2021-04-30 10:13:37 +02:00
Bas Nieuwenhuizen 40f73d0b0b Revert "xf86drmMode: set FB_MODIFIERS flag when modifiers are supplied"
This reverts commit b362850689.

This breaks when the kernel driver does not support modifiers and the
application properly zeroes the modifiers.

Acked-by: Simon Ser <contact@emersion.fr>
2021-04-22 20:24:11 +02:00
Jinzhou Su c7dc0465cf test/amdgpu: Add emit mem sync flag for test IB
In syncobj test, 3 threads will be created. Sometimes
the first gfx IB and the third sdma IB will use same
physical page. There will be risk that sdma engine will
read gfx IB in the same physical page. So better to flush
the cache before commit the sdma IB.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2021-04-19 14:04:22 +08:00
Huang Rui 67a64bb946 test/amdgpu: use tmz ids to check whether enable security tests
Using tmz ids that reported from kernel to decide whether enable
security tests.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
2021-04-14 09:52:33 +02:00
James Zhu 3c02304c04 tests/amdgpu/vcn: update to support aldebaran
VCN is supported after AI family Arcturus.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2021-04-14 02:41:56 +00:00
Feifei Xu 7b844dabf9 tests/amdgpu:retire asic_id check on unsupported cases
Retire the asic_id check for AI family.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2021-04-12 17:46:31 +08:00
Feifei Xu 991e95fd13 tests/amdgpu: update gfx9 BufferCopy/BufferClear
buffer_load/store_format_xyzw require 64bit vgpr_a[2].
The original parameter is one u32. Modify the shader binary to
fit the 64bit parameter.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Tested-by: Gang Long <Gang.Long@amd.com>
2021-04-09 15:11:08 +08:00
Leo Liu 6b4e956d29
Bump version to 2.4.105
Signed-off-by: Leo Liu <leo.liu@amd.com>
2021-04-07 09:54:11 -04:00
Leo Liu 1d13cc1032 amdgpu: add function of INFO ioctl for querying video caps
via the newly added uapi/amdgpu_drm interface

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2021-04-06 08:58:57 -04:00
Leo Liu 50c98335c7 amdgpu: sync up amdgpu_drm.h with latest from kernel
From drm-next:

commit 2cbcb78c9ee5520c8d836c7ff57d1b60ebe8e9b7
Merge: 06debd6e1b28 8c44390d8872
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Mar 26 15:52:01 2021 +0100

    Merge tag 'amd-drm-next-5.13-2021-03-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

    amd-drm-next-5.13-2021-03-23:

    amdgpu:
    ...

    UAPI:
    - amdgpu: Add a new INFO ioctl interface to query video capabilities
      rather than hardcoding them in userspace.  This allows us to provide
      fine grained asic capabilities (e.g., if a particular part is
      bandwidth limited, we can limit the capabilities).  Proposed userspace:
      https://gitlab.freedesktop.org/leoliu/drm/-/commits/info_video_caps
      https://gitlab.freedesktop.org/leoliu/mesa/-/commits/info_video_caps
    ...

    Danvet: A bunch of conflicts all over, but it seems to compile ... I
    did put the call to dc_allow_idle_optimizations() on a single line
    since it looked a bit too jarring to be left alone.

    Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
    From: Alex Deucher <alexander.deucher@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210324040147.1990338-1-alexander.deucher@amd.com

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2021-04-06 08:58:54 -04:00
Simon Ser b362850689 xf86drmMode: set FB_MODIFIERS flag when modifiers are supplied
The kernel will always return EINVAL if modifiers are supplied but
the flag DRM_MODE_FB_MODIFIERS isn't set. That's a pretty nice
footgun.

Be a little more helpful and set the flag if the user has supplied
a modifier array.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2021-04-06 10:37:03 +02:00
Lang Yu a5a400c958 tests/amdgpu: fix bo eviction test issue
On Raven2/Picasso, the default VRAM size is 2048M,
and the default GTT size is 3072M. If max_allocation
of VRAM exceeds half of GTT size, GTT memory can't
hold evicted bo from VRAM and bo in itself at the
same time. Then amdgpu_cs_list_validate will failed
with "Not enough memory for command submission" error.

NOTE:
The installed DRAM should be larger than 8GB,
if the VRAM size is 2048M.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2021-04-01 11:41:51 -04:00
Lang Yu af871ec1a6 drm/tests/amdgpu: fix Metadata test failed issue
The unit of size_metadata is one byte not four bytes.
Enable Metadata test.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2021-04-01 11:41:49 -04:00
Simon Ser 6d821612d9 xf86drmMode: introduce drmModeGetPropertyType
We already have drm_property_type_is, but it's needlessly complicated
and doesn't cover all use-cases (requires the caller to provide a
type).

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2021-03-31 07:42:15 +00:00