summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-29modetest: Make modetest availble to vendor on AndroidHEADmainRob Barnes3-0/+3
Make modetest available to vendors on Android. libdrm_util and libdrm_test_headers is also made available to vendors since these are depenencies of modetest. This results in the module target modetest.vendor being availble to vendor modules. Signed-off-by: Rob Barnes <robbarnes at google.com>
2024-10-20android: add genrule for generated_static_table_fourcc.hMauro Rossi1-0/+12
Fixes the following building error: external/libdrm/xf86drm.c:158:10: fatal error: 'generated_static_table_fourcc.h' file not found ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Change-Id: I1b0cac498ed63ebec6e8c03629bbf4a1b6a9618d Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
2024-10-15xf86drm: print AMD modifiers properlyMarek Olšák1-136/+125
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
2024-09-29include/drm/README: update drm-next link to use gitlab instead of cgitAlan Coopersmith1-1/+1
2024-09-23modetest: add support for YUV422 and YUV444 plane formatDmitry Baryshkov3-0/+24
Currently modetest supports only the YUV420 and YVU420 planar YCbCr plane formats (aka YV12 and YU12). Extend the code to add support for YUV422 / YVU422 and YUV444 / YVU444 plane formats. Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-09-23modetest: simplify planar YUV handlingDmitry Baryshkov1-20/+22
In preparation to adding more planar YUV formats, introduce X, Y subsampling ratios and use them to calculate plane offsets and buffer size. Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-09-08build: simplify Linux system checkSimon Ser1-1/+1
No need for contains() here. Signed-off-by: Simon Ser <contact@emersion.fr>
2024-09-03tests/util: Call `drmGetDevices2()` instead of `drmOpen()`ing all modulesMarijn Suijten1-40/+35
Whenever `util_open()` is called to open a device for the first matching module, it will skip devices for the `nvidia_drm` kernel module which is not in the list. We could add this module for now, but keeping this list of DRM modules up to date is cumbersome. At the same time walking a list of modules and calling `drmOpen()` for each of them is incredibly expensive (when the user doesn't explicitly specify one with `-M`), as each each call opens every DRM node just to see if they are associated to the requested module. And for no good reason: all we want is the first `DRM_NODE_PRIMARY` (which is what `drmOpen()` also returns) to use by default. For example on the `"msm"` driver, which used to be the 9th in the modules list, all nodes are opened for the 9th time before e.g. `modetest` returns a useful result, which takes ages unless the user painstakingly provides the module for the currently known device on the cmdline. This is very simply solved by calling `drmGetDevices(2)()`, which iterates through all DRM nodes only once and allows us to immediately find + `open()` the first device that has a PRIMARY node. A random search for the error shows that this was also attempted in (a fork of?) kmscube: https://git.ti.com/cgit/glsdk/kmscube/commit/?id=456cabc661caac5c60729751d45efd668faa8e97 Finally we add a `drmIsKMS()` check to make sure we only include primary nodes that actually support rendering, and also print the values from `drmGetVersion()` on success to make it easier to identify the device. In the future we could extrapolate this feature by letting query commands like `modetest -c` list connectors for every device/module, not just the first PRIMARY node that we found.
2024-08-26build: bump version to 2.4.123libdrm-2.4.123Matt Turner1-1/+1
2024-08-22Disable ioctl signed overload for Bionic libcMark Collins1-0/+4
Bionic libc ships with `ioctl` that has two signatures, one with an unsigned `request` parameter and one with a signed request parameter. This leads to compilation failing due to `__typeof__(ioctl)` being used by DRM which fails to resolve which overload to use, this has been fixed by defining `BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD` on Android. Signed-off-by: Mark Collins <mark@igalia.com>
2024-08-01tests: Make modetest and proptest cc_binary in Android.bpSu Hong Koo2-2/+2
Change module type of modetest and proptest from cc_test to cc_binary, as neither are tests. Signed-off-by: Su Hong Koo <sukoo@google.com>
2024-08-01libs: Tie DSO minor versions to libdrm versionDaniel Stone10-10/+17
There is an excellent writeup explaining this requirement here: https://gitlab.freedesktop.org/wayland/wayland/-/issues/175 In short, for mixed environments such as the Steam Runtime and other container-like environments, choosing which libdrm to link into the client's address space is a hard problem. If the runtime has a newer libdrm than the host, then it should be preferred, because the client may be using newly-added symbols. But if the host has a newer libdrm, then that should be used, because drivers may be depending on those. Bumping the DSO minor version is transparent to all users because apps only link against the major version, e.g. DT_NEEDED libdrm.so.2; the fact that libdrm.so.2 is a link to libdrm.so.2.122.0 is a detail known only to the loader, but it does let a smart runtime make better decisions. Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-07-30Enable GPU in crosvmJiyong Park1-0/+4
When the GPU feature is turned on in crosvm, these modules are added as dependencies. Since crosvm is included in the virt APEX, add the APEX to the apex_available properties of the modules to make them available in the APEX.
2024-07-30add crosvm to com.android.virtJiyong Park1-0/+4
To do so, crosvm and its dependencies have the apex_available property set to "//apex_available:platform", "com.android.virt" to explicitly acknowledge the joining.
2024-07-30Adds libdrm_headersJason Macnak1-0/+8
... as being able to use cc_library in header_libs is not intended and does not work on all branches which blocks aosp/1497292.
2024-07-30Export include dirs with -isystemInseob Kim1-1/+1
drm_property_type_is function in xf86drmMode.h file can cause compiler error because it performs unsigned to signed conversion. Some Android.mk modules have been avoiding this by adding "-isystem external/libdrm" flag, because warnings from system headers are suppressed. This changes exported_include_dirs to export_system_include_dirs to workaround the potential error with the same manner above.
2024-07-30Makes libdrm available on hostJason Macnak1-1/+4
... to make drm format header visible for host wayland server. Adds -Wno-implicit-function-declaration for vasprintf() on xf86drm.c:2965. Adds -Wno-int-conversion for drm_mmap() on libdrm_macros.h:60. Also, drive-by alphabetize cflags.
2024-07-30Make libdrm recovery_availableJerry Zhang1-0/+1
2024-07-30Android.bp: Add include exports for android dirJohn Stultz1-1/+1
This forward ports Stefan Schake's patch 32ee9c0e0566 "android: Add missing include exports" to the Android.bp file.
2024-07-30readdir_r is deprecated.Elliott Hughes1-0/+1
Add -Wno-deprecated-declarations to suppress compiler warning about using readdir_r, which is deprecated.
2024-07-30Delete all Makefile.sources filesSu Hong Koo11-161/+0
Delete all Makefile.sources as all the makefiles that use them have been replaced with Android.*.bp files for Soong.
2024-07-29Convert to Android.bpDan Willemsen37-299/+371
See build/soong/README.md for more information about Soong. Removes BOARD_GPU_DRIVERS, which wasn't affecting anything, since none of the HAVE_* macros are defined. Even if they were, we'd prefer to compile all of them so that a single library can support multiple boards.
2024-07-11amdgpu: add new marketing namesAlex Deucher1-0/+4
Updated from 6.1 branch. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-07-11amdgpu: add new marketing namesAlex Deucher1-0/+7
https://www.amd.com/en/processors/ryzen-processors-laptop-business https://www.amd.com/en/products/ryzen-pro-processors-laptop Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-06-27Fix FTBS on undefined clock_gettime() and asprintf()Enrico Weigelt, metux IT consult1-0/+6
Some platforms (eg. SunOS) explicitly need extra symbols in order to define those functions. There're many files needing the __EXTENSIONS__ symbol, so doing this on a global scale. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-26build: bump version to 2.4.122libdrm-2.4.122Simon Ser1-1/+1
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-06-26Sync headers with drm-nextSimon Ser2-14/+44
Synchronize drm_fourcc.h and drm_mode.h to drm-next. Generated using make headers_install. Generated from drm-next branch commit 541b1b0a8fc235bca355921eb7f3f59a8efa3e9a Signed-off-by: Simon Ser <contact@emersion.fr>
2024-06-25ci: upgrade FreeBSD VM to 14.1Enrico Weigelt, metux IT consult1-2/+2
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-25ci: upgrade debian container to bookwormEnrico Weigelt, metux IT consult1-4/+3
Buster is oldoldstable and EOL in a few days. Bookworm is the current stable. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-25etnaviv: fix FTBS on undefined linux/* headers on non-Linux platforms.Enrico Weigelt, metux IT consult1-1/+1
Using C standard headers instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-24freedreno: fix FTBS on non-Linux platforms (unused header)Enrico Weigelt, metux IT consult1-2/+0
The <linux/fb.h> header only exists on Linux, but isn't used anymore, so drop it entirely. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-24fix FTBS on FreeBSD (or non-Linux in general)Enrico Weigelt, metux IT consult5-5/+0
Several drivers still including <linux/stddef.h>, but not using anything from it, thus breaking build on non-Linux platforms (eg. FreeBSD). Since not needed at all, just stop including it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-24OpenBSD: fix FTBS on misspelled and missing variablesEnrico Weigelt, metux IT consult1-2/+3
../xf86drm.c:4622:9: error: use of undeclared identifier 'written'; did you mean 'write'? if (written + 1 > max_node_length) ^~~~~~~ write ../xf86drm.c:4624:21: error: use of undeclared identifier 'sbuf'; did you mean 'sbrk'? if (stat(node, &sbuf)) ^~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-02Remove libm in libdrm dependenciesNicolas Caramelli2-3/+1
Signed-off-by: Nicolas Caramelli <caramelli.devel@gmail.com>
2024-06-01Bump version to 2.4.121libdrm-2.4.121Marek Olšák1-1/+1
2024-06-01amdgpu: sync amdgpu_drm.hMarek Olšák1-1/+25
2024-05-27tests/amdgpu: fix compile error with gcc14Flora Cui1-1/+1
../../drm/tests/amdgpu/shader_code.h:114:9: error: initialization of ‘const uint32_t *’ {aka ‘const unsigned int *’} from incompatible pointer type ‘const uint32_t (*)[10][6]’ {aka ‘const unsigned int (*)[10][6]’} [-Wincompatible-pointer-types] 114 | ps_##_ps##_shader_patchinfo_code_gfx##_n, \ | ^~~ ../../drm/tests/amdgpu/shader_code.h:119:10: note: in expansion of macro ‘SHADER_PS_INFO’ 119 | {SHADER_PS_INFO(const, 9), SHADER_PS_INFO(tex, 9)}, | ^~~~~~~~~~~~~~ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-05-27tests/amdgpu: fix compile error with gcc7.5Flora Cui4-34/+35
fix commit cc3c80c6("tests/amdgpu: refactor dispatch/draw test") ../../SOURCES/drm/tests/amdgpu/shader_code.h:113:2: error: initializer element is not constant ps_##_ps##_shader_patchinfo_code_size_gfx##_n, \ ^ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-05-27tests/amdgpu: fix compile warning with the guard enum valueFlora Cui1-0/+28
../../drm/tests/amdgpu/shader_test_util.c: In function ‘amdgpu_dispatch_init’: ../../drm/tests/amdgpu/shader_test_util.c:296:9: warning: enumeration value ‘AMDGPU_TEST_GFX_MAX’ not handled in switch [-Wswitch] 296 | switch (test_priv->info->version) { | ^~~~~~ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-05-23amdgpu: Make amdgpu_cs_signal_semaphore() thread-safeJosé Expósito1-4/+11
The issue was found by a static analysis tool: Error: LOCK_EVASION (CWE-543): libdrm-2.4.115/amdgpu/amdgpu_cs.c:596: thread1_checks_field: Thread1 uses the value read from field "context" in the condition "sem->signal_fence.context". It sees that the condition is false. Control is switched to Thread2. libdrm-2.4.115/amdgpu/amdgpu_cs.c:596: thread2_checks_field: Thread2 uses the value read from field "context" in the condition "sem->signal_fence.context". It sees that the condition is false. libdrm-2.4.115/amdgpu/amdgpu_cs.c:598: thread2_acquires_lock: Thread2 acquires lock "amdgpu_context.sequence_mutex". libdrm-2.4.115/amdgpu/amdgpu_cs.c:599: thread2_modifies_field: Thread2 sets "context" to a new value. Note that this write can be reordered at runtime to occur before instructions that do not access this field within this locked region. After Thread2 leaves the critical section, control is switched back to Thread1. libdrm-2.4.115/amdgpu/amdgpu_cs.c:598: thread1_acquires_lock: Thread1 acquires lock "amdgpu_context.sequence_mutex". libdrm-2.4.115/amdgpu/amdgpu_cs.c:599: thread1_overwrites_value_in_field: Thread1 sets "context" to a new value. Now the two threads have an inconsistent view of "context" and updates to fields of "context" or fields correlated with "context" may be lost. libdrm-2.4.115/amdgpu/amdgpu_cs.c:596: use_same_locks_for_read_and_modify: Guard the modification of "context" and the read used to decide whether to modify "context" with the same set of locks. # 597| return -EINVAL; # 598| pthread_mutex_lock(&ctx->sequence_mutex); # 599|-> sem->signal_fence.context = ctx; # 600| sem->signal_fence.ip_type = ip_type; # 601| sem->signal_fence.ip_instance = ip_instance; Check `sem->signal_fence.context` in the locked region to avoid a race condition. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Signed-off-by: José Expósito <jexposit@redhat.com>
2024-04-11xf86drm: document drmDevicesEqual()Simon Ser1-0/+5
I always need to double-check what the return value means when using that function (since it's not a bool). Signed-off-by: Simon Ser <contact@emersion.fr>
2024-04-10include poll.h instead of sys/poll.hDavid Heidelberg2-2/+2
Fixes: f803a45e7442 ("add libsync.h helper") Fixes: 4c18828e16f0 ("tegra: Add job and push buffer APIs") Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-29ci: use "meson setup" sub-commandSimon Ser1-2/+2
"meson" without a sub-command is deprecated. Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-29ci: build with meson --fatal-meson-warningsSimon Ser1-2/+2
This catches uses of deprecated features. Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-29meson: Fix broken str.format usageJoaquim Monteiro1-1/+1
str.format used to allow any type as an argument, which often resulted in using an internal string representation. This is considered broken behavior, and is deprecated since Meson 1.3.0. Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com>
2024-03-29meson: Replace usages of deprecated ExternalProgram.path()Joaquim Monteiro4-4/+4
!347 fixed some of these, but not all. Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com>
2024-03-27amdgpu: fix deinit logicPierre-Eric Pelloux-Prayer1-4/+10
The devices weren't removed from dev_list. Instead of just fixing the issue by adding: if (*node) *node = dev->next; after the while loop, use this opportunity to use a clearer control flow. Fixes: 7275ef8e ("amdgpu: add amdgpu_device_initialize2") Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Tested-by: Mike Lothian <mike@fireburn.co.uk>
2024-03-25symbols-check: Add _fbss, _fdata, _ftextMatt Turner1-0/+3
These are exported on mips/mips64. See also: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11955
2024-03-25symbols-check: Add _GLOBAL_OFFSET_TABLE_Matt Turner1-0/+1
This is exported on hppa/parisc. See also: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26978 Bug: https://bugs.gentoo.org/927204
2024-03-21amdgpu: add amdgpu_device_initialize2Pierre-Eric Pelloux-Prayer3-12/+48
Allows to opt-out from the device deduplication logic. This is not the recommended way of using dev handles, but it's necessary for native context: in this situation one process (eg: Qemu) will init many devices and we want independent devices to make sure guest applications are isolated from each other. Reviewed-by: Marek Olšák <marek.olsak@amd.com>