.editorconfig | 19 Android.common.mk | 14 Android.mk | 19 README | 6 amdgpu/Android.mk | 8 amdgpu/amdgpu-symbol-check | 3 amdgpu/amdgpu.h | 77 ++ amdgpu/amdgpu_bo.c | 30 - amdgpu/amdgpu_cs.c | 106 +++- amdgpu/amdgpu_device.c | 24 amdgpu/amdgpu_gpu_info.c | 92 ++- amdgpu/amdgpu_internal.h | 4 amdgpu/amdgpu_vamgr.c | 6 autogen.sh | 6 configure.ac | 32 - debian/changelog | 65 ++ debian/control | 150 ----- debian/libdrm-amdgpu1.symbols | 3 debian/libdrm-etnaviv1.install | 1 debian/libdrm-etnaviv1.symbols | 32 + debian/libdrm-intel1.symbols | 4 debian/libdrm2.symbols | 3 debian/rules | 47 - debian/source/format | 1 debian/source/local-options | 7 debian/upstream/signing-key.asc | 29 + etnaviv/Android.mk | 8 etnaviv/etnaviv-symbol-check | 1 etnaviv/etnaviv_cmd_stream.c | 33 + etnaviv/etnaviv_drm.h | 8 etnaviv/etnaviv_drmif.h | 2 etnaviv/etnaviv_gpu.c | 72 +- etnaviv/etnaviv_priv.h | 22 exynos/exynos_drm.c | 2 exynos/exynos_drmif.h | 8 exynos/exynos_fimg2d.c | 14 freedreno/Android.mk | 8 freedreno/Makefile.am | 1 freedreno/freedreno_bo.c | 12 freedreno/freedreno_bo_cache.c | 4 freedreno/freedreno_device.c | 5 freedreno/freedreno_priv.h | 56 ++ freedreno/kgsl/kgsl_device.c | 2 freedreno/msm/msm_device.c | 2 freedreno/msm/msm_ringbuffer.c | 7 include/drm/README | 6 include/drm/amdgpu_drm.h | 468 ++++++++++++----- include/drm/drm.h | 3 include/drm/drm_mode.h | 45 + include/drm/i915_drm.h | 276 ++++++++++ intel/Android.mk | 8 intel/intel-symbol-check | 4 intel/intel_bufmgr.h | 11 intel/intel_bufmgr_gem.c | 159 ++++-- intel/intel_decode.c | 3 libkms/Android.mk | 6 libkms/Makefile.am | 4 libkms/exynos.c | 3 libkms/linux.c | 94 --- man/drm-kms.xml | 4 man/drm-memory.xml | 4 man/drm.xml | 6 man/drmAvailable.xml | 4 man/drmHandleEvent.xml | 4 man/drmModeGetResources.xml | 4 nouveau/Android.mk | 8 radeon/Android.mk | 8 tegra/tegra-symbol-check | 7 tests/Makefile.am | 46 - tests/amdgpu/amdgpu_test.c | 259 ++++++++- tests/amdgpu/amdgpu_test.h | 3 tests/amdgpu/basic_tests.c | 134 ++++- tests/amdgpu/bo_tests.c | 13 tests/amdgpu/cs_tests.c | 49 + tests/amdgpu/vce_tests.c | 62 +- tests/auth.c | 138 ----- tests/dristat.c | 285 ---------- tests/drmdevice.c | 60 +- tests/drmstat.c | 419 ---------------- tests/drmtest.c | 135 ----- tests/drmtest.h | 40 - tests/etnaviv/Makefile.am | 1 tests/exynos/Makefile.am | 4 tests/exynos/exynos_fimg2d_test.c | 43 - tests/getclient.c | 61 -- tests/getstats.c | 50 - tests/getversion.c | 49 - tests/lock.c | 264 ---------- tests/modetest/Android.mk | 3 tests/modetest/Makefile.am | 4 tests/modetest/modetest.c | 39 + tests/name_from_fd.c | 58 -- tests/nouveau/Makefile.am | 8 tests/openclose.c | 37 - tests/proptest/Android.mk | 3 tests/setversion.c | 91 --- tests/updatedraw.c | 154 ----- tests/util/Android.mk | 7 tests/util/kms.c | 4 xf86drm.c | 992 ++++++++++++++++++++++++++++++++++---- xf86drm.h | 56 ++ xf86drmMode.c | 26 xf86drmMode.h | 19 103 files changed, 2994 insertions(+), 2816 deletions(-)
New commits: commit 2e333078575f643bf4eb26b3d1ffbaeca8403932 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Fri Jun 23 11:58:40 2017 +0200 Upload to unstable. diff --git a/debian/changelog b/debian/changelog index f650792..05f0e31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.81-2) unstable; urgency=medium + + * Upload to unstable. + + -- Andreas Boll <andreas.boll....@gmail.com> Fri, 23 Jun 2017 11:57:14 +0200 + libdrm (2.4.81-1) experimental; urgency=medium * New upstream release. commit a0fccb4e8e84fc3e51b1109ef0f683609857ca06 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Fri Jun 9 10:41:49 2017 +0200 Upload to experimental. diff --git a/debian/changelog b/debian/changelog index 59c4ec9..f650792 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdrm (2.4.81-1) UNRELEASED; urgency=medium +libdrm (2.4.81-1) experimental; urgency=medium * New upstream release. * Bump libdrm2's and libdrm-amdgpu1's symbols and shlibs. - -- Andreas Boll <andreas.boll....@gmail.com> Fri, 09 Jun 2017 10:23:51 +0200 + -- Andreas Boll <andreas.boll....@gmail.com> Fri, 09 Jun 2017 10:41:36 +0200 libdrm (2.4.80-1) experimental; urgency=medium commit f5c87ed386133650e304eb041dcccbafa5b1cab5 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Fri Jun 9 10:34:51 2017 +0200 Bump libdrm2's and libdrm-amdgpu1's symbols and shlibs. diff --git a/debian/changelog b/debian/changelog index 0ffeff9..59c4ec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libdrm (2.4.81-1) UNRELEASED; urgency=medium * New upstream release. + * Bump libdrm2's and libdrm-amdgpu1's symbols and shlibs. -- Andreas Boll <andreas.boll....@gmail.com> Fri, 09 Jun 2017 10:23:51 +0200 diff --git a/debian/libdrm-amdgpu1.symbols b/debian/libdrm-amdgpu1.symbols index 8ffcb42..842463b 100644 --- a/debian/libdrm-amdgpu1.symbols +++ b/debian/libdrm-amdgpu1.symbols @@ -22,6 +22,7 @@ libdrm_amdgpu.so.1 libdrm-amdgpu1 #MINVER# amdgpu_cs_query_reset_state@Base 2.4.63 amdgpu_cs_signal_semaphore@Base 2.4.67 amdgpu_cs_submit@Base 2.4.63 + amdgpu_cs_wait_fences@Base 2.4.81 amdgpu_cs_wait_semaphore@Base 2.4.67 amdgpu_device_deinitialize@Base 2.4.63 amdgpu_device_initialize@Base 2.4.63 diff --git a/debian/libdrm2.symbols b/debian/libdrm2.symbols index 75aaf4b..0d73704 100644 --- a/debian/libdrm2.symbols +++ b/debian/libdrm2.symbols @@ -36,6 +36,7 @@ libdrm.so.2 libdrm2 #MINVER# drmDelContextTag@Base 2.3.1 drmDestroyContext@Base 2.3.1 drmDestroyDrawable@Base 2.3.1 + drmDevicesEqual@Base 2.4.81 drmDropMaster@Base 2.4.3 drmError@Base 2.3.1 drmFinish@Base 2.3.1 diff --git a/debian/rules b/debian/rules index c49a7be..bf130d6 100755 --- a/debian/rules +++ b/debian/rules @@ -100,7 +100,7 @@ override_dh_install: dh_install --fail-missing override_dh_makeshlibs: - dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.75)' --add-udeb=libdrm2-udeb -- -c4 + dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.81)' --add-udeb=libdrm2-udeb -- -c4 ifeq ($(INTEL), yes) dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.75)' -- -c4 endif @@ -108,7 +108,7 @@ ifeq ($(NOUVEAU), yes) dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.66)' -- -c4 endif dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 - dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.80)' -- -c4 + dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.81)' -- -c4 ifeq ($(ARM), yes) dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4 dh_makeshlibs -plibdrm-exynos1 -V'libdrm-exynos1 (>= 2.4.66)' -- -c4 commit 1b40719c922f5fd8d99022d72e979c2215b19c02 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Fri Jun 9 10:24:13 2017 +0200 Bump changelog diff --git a/debian/changelog b/debian/changelog index 01d3d76..0ffeff9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.81-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Andreas Boll <andreas.boll....@gmail.com> Fri, 09 Jun 2017 10:23:51 +0200 + libdrm (2.4.80-1) experimental; urgency=medium * New upstream release. commit 81312f3730c14a2930a7784493701809c7f04a26 Author: Marek Olšák <marek.ol...@amd.com> Date: Wed May 24 17:01:36 2017 +0200 Bump version to 2.4.81 diff --git a/configure.ac b/configure.ac index 43fcf68..1cfb8c2 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.80], + [2.4.81], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) commit eeb51df3ced003515ba4a71492eeb86c145cb77e Author: Leo Liu <leo....@amd.com> Date: Tue Feb 21 11:14:09 2017 -0500 amdgpu/drm: add AMDGPU_HW_IP_VCN_ENC Signed-off-by: Leo Liu <leo....@amd.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index add5163..8cfe68c 100644 --- a/include/drm/amdgpu_drm.h +++ b/include/drm/amdgpu_drm.h @@ -407,7 +407,8 @@ struct drm_amdgpu_gem_va { #define AMDGPU_HW_IP_VCE 4 #define AMDGPU_HW_IP_UVD_ENC 5 #define AMDGPU_HW_IP_VCN_DEC 6 -#define AMDGPU_HW_IP_NUM 7 +#define AMDGPU_HW_IP_VCN_ENC 7 +#define AMDGPU_HW_IP_NUM 8 #define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1 commit 5faee772721d2d2623e7f5980477de773bc73128 Author: Leo Liu <leo....@amd.com> Date: Tue Feb 7 11:10:48 2017 -0500 amdgpu/drm: add AMDGPU_HW_IP_VCN_DEC Signed-off-by: Leo Liu <leo....@amd.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index 0de4cf6..add5163 100644 --- a/include/drm/amdgpu_drm.h +++ b/include/drm/amdgpu_drm.h @@ -406,7 +406,8 @@ struct drm_amdgpu_gem_va { #define AMDGPU_HW_IP_UVD 3 #define AMDGPU_HW_IP_VCE 4 #define AMDGPU_HW_IP_UVD_ENC 5 -#define AMDGPU_HW_IP_NUM 6 +#define AMDGPU_HW_IP_VCN_DEC 6 +#define AMDGPU_HW_IP_NUM 7 #define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1 commit 3f457d2a6e2dd74820ad7258edef573ab3b114fd Author: Hawking Zhang <hawking.zh...@amd.com> Date: Thu Jan 5 02:24:53 2017 +0800 amdgpu: add raven family id Signed-off-by: Hawking Zhang <hawking.zh...@amd.com> Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Junwei Zhang <jerry.zh...@amd.com> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index 516a9f2..0de4cf6 100644 --- a/include/drm/amdgpu_drm.h +++ b/include/drm/amdgpu_drm.h @@ -816,6 +816,7 @@ struct drm_amdgpu_info_vce_clock_table { #define AMDGPU_FAMILY_VI 130 /* Iceland, Tonga */ #define AMDGPU_FAMILY_CZ 135 /* Carrizo, Stoney */ #define AMDGPU_FAMILY_AI 141 /* Vega10 */ +#define AMDGPU_FAMILY_RV 142 /* Raven */ #if defined(__cplusplus) } commit 41be41f99eb53bd4998b1cd930fa63f0e552d971 Author: Nicolai Hähnle <nicolai.haeh...@amd.com> Date: Sat May 13 23:03:55 2017 +0200 amdgpu: add missing extern "C" headers Signed-off-by: Nicolai Hähnle <nicolai.haeh...@amd.com> Reviewed-by: Michel Dänzer <michel.daen...@amd.com> Reviewed-by: Alex Xie <alexbin....@amd.com> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index fdea905..1901fa8 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -37,6 +37,10 @@ #include <stdint.h> #include <stdbool.h> +#ifdef __cplusplus +extern "C" { +#endif + struct drm_amdgpu_info_hw_ip; /*--------------------------------------------------------------------------*/ @@ -1324,4 +1328,8 @@ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem); */ const char *amdgpu_get_marketing_name(amdgpu_device_handle dev); +#ifdef __cplusplus +} +#endif + #endif /* #ifdef _AMDGPU_H_ */ commit a2fa2e08692483cf9f4d06caa6e0f0add59e3343 Author: Adam Jackson <a...@redhat.com> Date: Thu May 4 15:57:14 2017 -0400 Fix stray caller of drmCompareDevices Signed-off-by: Adam Jackson <a...@redhat.com> diff --git a/xf86drm.c b/xf86drm.c index 29fea33..728ac78 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3669,7 +3669,7 @@ static void drmFoldDuplicatedDevices(drmDevicePtr local_devices[], int count) for (i = 0; i < count; i++) { for (j = i + 1; j < count; j++) { - if (drmCompareDevices(local_devices[i], local_devices[j])) { + if (drmDevicesEqual(local_devices[i], local_devices[j])) { local_devices[i]->available_nodes |= local_devices[j]->available_nodes; node_type = log2(local_devices[j]->available_nodes); memcpy(local_devices[i]->nodes[node_type], commit 7040fea0280bad527ed4b3d5eee7d7bfbf303efc Author: Adam Jackson <a...@redhat.com> Date: Thu May 4 12:25:01 2017 -0400 configure: Fix the <sys/sysmacros.h> check AC_HEADER_MAJOR only defines MAJOR_IN_SYSMACROS if major() is _not_ defined by <sys/types.h> alone. It is, but it warns, and that's ugly. To fix this, push -Werror into CFLAGS when invoking AC_HEADER_MAJOR so the warning makes the compilation test fail. Reviewed-by: Emil Velikov <emil.velil...@collabora.com> Signed-off-by: Adam Jackson <a...@redhat.com> diff --git a/configure.ac b/configure.ac index e5158b7..43fcf68 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,11 @@ AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_FUNC_ALLOCA +save_CFLAGS="$CFLAGS" +export CFLAGS="$CFLAGS -Werror" AC_HEADER_MAJOR +CFLAGS="$save_CFLAGS" + AC_CHECK_HEADERS([sys/sysctl.h sys/select.h]) # Initialize libtool commit 7c27cd7c5da0b87cea0dacd454307e2613d3b415 Author: Adam Jackson <a...@redhat.com> Date: Thu May 4 10:48:56 2017 -0400 Export drmDevicesEqual drmCompareBusInfo was almost this already, but it wasn't exported, its name didn't match its functionality, and while it almost looks like it was usable for sorting due to memcmp it wouldn't work if you had multiple bus types. I don't really want to think about defining a sensible sort order for bus types, so let's at least make it less of a trap for the caller. Invert its boolean sense to be 'true if equal', rename it to describe the types it actually operates on, and export. Reviewed-by: Eric Anholt <e...@anholt.net> Reviewed-by: Emil Velikov <emil.velil...@collabora.com> Signed-off-by: Adam Jackson <a...@redhat.com> diff --git a/xf86drm.c b/xf86drm.c index 685cf69..29fea33 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3029,32 +3029,32 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) #endif } -static int drmCompareBusInfo(drmDevicePtr a, drmDevicePtr b) +int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b) { if (a == NULL || b == NULL) - return -1; + return 0; if (a->bustype != b->bustype) - return -1; + return 0; switch (a->bustype) { case DRM_BUS_PCI: - return memcmp(a->businfo.pci, b->businfo.pci, sizeof(drmPciBusInfo)); + return memcmp(a->businfo.pci, b->businfo.pci, sizeof(drmPciBusInfo)) == 0; case DRM_BUS_USB: - return memcmp(a->businfo.usb, b->businfo.usb, sizeof(drmUsbBusInfo)); + return memcmp(a->businfo.usb, b->businfo.usb, sizeof(drmUsbBusInfo)) == 0; case DRM_BUS_PLATFORM: - return memcmp(a->businfo.platform, b->businfo.platform, sizeof(drmPlatformBusInfo)); + return memcmp(a->businfo.platform, b->businfo.platform, sizeof(drmPlatformBusInfo)) == 0; case DRM_BUS_HOST1X: - return memcmp(a->businfo.host1x, b->businfo.host1x, sizeof(drmHost1xBusInfo)); + return memcmp(a->businfo.host1x, b->businfo.host1x, sizeof(drmHost1xBusInfo)) == 0; default: break; } - return -1; + return 0; } static int drmGetNodeType(const char *name) @@ -3669,7 +3669,7 @@ static void drmFoldDuplicatedDevices(drmDevicePtr local_devices[], int count) for (i = 0; i < count; i++) { for (j = i + 1; j < count; j++) { - if (drmCompareBusInfo(local_devices[i], local_devices[j]) == 0) { + if (drmCompareDevices(local_devices[i], local_devices[j])) { local_devices[i]->available_nodes |= local_devices[j]->available_nodes; node_type = log2(local_devices[j]->available_nodes); memcpy(local_devices[i]->nodes[node_type], diff --git a/xf86drm.h b/xf86drm.h index d75ca8c..74f54f1 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -851,6 +851,8 @@ extern void drmFreeDevices(drmDevicePtr devices[], int count); extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device); extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); +extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); + #if defined(__cplusplus) } #endif commit 00aa2c18810efb896afd9ff0acbadd4aa9540fe6 Author: Edward O'Callaghan <funfunc...@folklore1984.net> Date: Sat Apr 22 16:47:40 2017 +1000 amdgpu: Use the canonical form in branch predicate Suggested-by: Emil Velikov <emil.l.veli...@gmail.com> Signed-off-by: Edward O'Callaghan <funfunc...@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com> diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 0993a6d..868eb7b 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -559,7 +559,7 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, if (ring >= AMDGPU_CS_MAX_RINGS) return -EINVAL; /* must signal first */ - if (NULL == sem->signal_fence.context) + if (!sem->signal_fence.context) return -EINVAL; pthread_mutex_lock(&ctx->sequence_mutex); commit 2ee1fd2470e96473f27080c01c5ecd710a6ab6c8 Author: Eric Anholt <e...@anholt.net> Date: Tue Apr 25 11:31:27 2017 -0700 Add the DPI encoder/connector types to KMS utils. Signed-off-by: Eric Anholt <e...@anholt.net> Reviewed-by: Daniel Stone <dani...@collabora.com> diff --git a/tests/util/kms.c b/tests/util/kms.c index c008f78..028cc8d 100644 --- a/tests/util/kms.c +++ b/tests/util/kms.c @@ -79,6 +79,7 @@ static const struct type_name encoder_type_names[] = { { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, { DRM_MODE_ENCODER_DSI, "DSI" }, { DRM_MODE_ENCODER_DPMST, "DPMST" }, + { DRM_MODE_ENCODER_DPI, "DPI" }, }; const char *util_lookup_encoder_type_name(unsigned int type) @@ -117,6 +118,7 @@ static const struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_eDP, "eDP" }, { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, { DRM_MODE_CONNECTOR_DSI, "DSI" }, + { DRM_MODE_CONNECTOR_DPI, "DPI" }, }; const char *util_lookup_connector_type_name(unsigned int type) commit d75a7ef1d7353cd122e5f8e975e69d2446eaad74 Author: Eric Anholt <e...@anholt.net> Date: Tue Apr 25 11:29:33 2017 -0700 Add pl111 as a KMS driver for utils. Signed-off-by: Eric Anholt <e...@anholt.net> Reviewed-by: Daniel Stone <dani...@collabora.com> diff --git a/tests/util/kms.c b/tests/util/kms.c index 959b688..c008f78 100644 --- a/tests/util/kms.c +++ b/tests/util/kms.c @@ -145,6 +145,7 @@ static const char * const modules[] = { "virtio_gpu", "mediatek", "meson", + "pl111", }; int util_open(const char *device, const char *module) commit 691a21579962d2db2d5cb1de5286fa86ef22214f Author: Ilia Mirkin <imir...@alum.mit.edu> Date: Tue Apr 18 08:54:11 2017 -0400 modetest: fix printing of fourcc on BE machines fourcc is not a string, it's a packed integer. This happens to work out on LE, but gets reversed on BE. Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> Reviewed-by: Michel Dänzer <michel.daen...@amd.com> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index c390d87..b8891ff 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -174,6 +174,15 @@ static const char *mode_flag_names[] = { static bit_name_fn(mode_flag) +static void dump_fourcc(uint32_t fourcc) +{ + printf(" %c%c%c%c", + fourcc, + fourcc >> 8, + fourcc >> 16, + fourcc >> 24); +} + static void dump_encoders(struct device *dev) { drmModeEncoder *encoder; @@ -443,7 +452,7 @@ static void dump_planes(struct device *dev) printf(" formats:"); for (j = 0; j < ovr->count_formats; j++) - printf(" %4.4s", (char *)&ovr->formats[j]); + dump_fourcc(ovr->formats[j]); printf("\n"); if (plane->props) { commit 46437947b197de7b29a44e621d8aa6f8ccb3a29b Author: Andreas Boll <andreas.boll....@gmail.com> Date: Wed Apr 19 15:35:30 2017 +0200 Upload to experimental. diff --git a/debian/changelog b/debian/changelog index 61c8c80..01d3d76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdrm (2.4.80-1) UNRELEASED; urgency=medium +libdrm (2.4.80-1) experimental; urgency=medium * New upstream release. * Bump libdrm-amdgpu1's and libdrm-etnaviv1's symbols and shlibs. * Remove libpthread-stubs0-dev build-dep per configure.ac. - -- Andreas Boll <andreas.boll....@gmail.com> Wed, 19 Apr 2017 14:32:11 +0200 + -- Andreas Boll <andreas.boll....@gmail.com> Wed, 19 Apr 2017 15:35:21 +0200 libdrm (2.4.77-1) experimental; urgency=medium commit b96599896ad49b2a89fd50dddab3cf2300bd0fc9 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Wed Apr 19 15:15:45 2017 +0200 Remove libpthread-stubs0-dev build-dep per configure.ac. diff --git a/debian/changelog b/debian/changelog index 2c063cc..61c8c80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ libdrm (2.4.80-1) UNRELEASED; urgency=medium * New upstream release. * Bump libdrm-amdgpu1's and libdrm-etnaviv1's symbols and shlibs. + * Remove libpthread-stubs0-dev build-dep per configure.ac. -- Andreas Boll <andreas.boll....@gmail.com> Wed, 19 Apr 2017 14:32:11 +0200 diff --git a/debian/control b/debian/control index 28a1788..dc9d271 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ Build-Depends: libx11-dev, pkg-config, xutils-dev (>= 1:7.6+2), - libpthread-stubs0-dev, libudev-dev [linux-any], libpciaccess-dev, valgrind [amd64 armhf i386 mips mipsel powerpc s390x], commit 242b6dce383a533d0c24b134326475b57ede6a8c Author: Andreas Boll <andreas.boll....@gmail.com> Date: Wed Apr 19 15:14:26 2017 +0200 Bump libdrm-amdgpu1's and libdrm-etnaviv1's symbols and shlibs. diff --git a/debian/changelog b/debian/changelog index 655ba84..2c063cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libdrm (2.4.80-1) UNRELEASED; urgency=medium * New upstream release. + * Bump libdrm-amdgpu1's and libdrm-etnaviv1's symbols and shlibs. -- Andreas Boll <andreas.boll....@gmail.com> Wed, 19 Apr 2017 14:32:11 +0200 diff --git a/debian/libdrm-amdgpu1.symbols b/debian/libdrm-amdgpu1.symbols index f9e2702..8ffcb42 100644 --- a/debian/libdrm-amdgpu1.symbols +++ b/debian/libdrm-amdgpu1.symbols @@ -35,6 +35,7 @@ libdrm_amdgpu.so.1 libdrm-amdgpu1 #MINVER# amdgpu_query_hw_ip_count@Base 2.4.63 amdgpu_query_hw_ip_info@Base 2.4.63 amdgpu_query_info@Base 2.4.63 + amdgpu_query_sensor_info@Base 2.4.80 amdgpu_read_mm_registers@Base 2.4.63 amdgpu_va_range_alloc@Base 2.4.63 amdgpu_va_range_free@Base 2.4.63 diff --git a/debian/libdrm-etnaviv1.symbols b/debian/libdrm-etnaviv1.symbols index b64859f..804ea27 100644 --- a/debian/libdrm-etnaviv1.symbols +++ b/debian/libdrm-etnaviv1.symbols @@ -13,6 +13,7 @@ libdrm_etnaviv.so.1 libdrm-etnaviv1 #MINVER# etna_bo_size@Base 0 etna_cmd_stream_del@Base 0 etna_cmd_stream_finish@Base 0 + etna_cmd_stream_flush2@Base 2.4.80 etna_cmd_stream_flush@Base 0 etna_cmd_stream_new@Base 0 etna_cmd_stream_reloc@Base 0 diff --git a/debian/rules b/debian/rules index a86efea..c49a7be 100755 --- a/debian/rules +++ b/debian/rules @@ -108,13 +108,13 @@ ifeq ($(NOUVEAU), yes) dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.66)' -- -c4 endif dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 - dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.77)' -- -c4 + dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.80)' -- -c4 ifeq ($(ARM), yes) dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4 dh_makeshlibs -plibdrm-exynos1 -V'libdrm-exynos1 (>= 2.4.66)' -- -c4 endif ifeq ($(ETNAVIV), yes) - dh_makeshlibs -plibdrm-etnaviv1 -V'libdrm-etnaviv1' -- -c4 + dh_makeshlibs -plibdrm-etnaviv1 -V'libdrm-etnaviv1 (>= 2.4.80)' -- -c4 endif ifeq ($(TEGRA), yes) dh_makeshlibs -plibdrm-tegra0 -V'libdrm-tegra0' -- -c4 commit 86d07ce6ba86dfcfffe34e15f2fb4082e843bf10 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Wed Apr 19 14:32:35 2017 +0200 Bump changelog diff --git a/debian/changelog b/debian/changelog index 2aac5a9..655ba84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.80-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Andreas Boll <andreas.boll....@gmail.com> Wed, 19 Apr 2017 14:32:11 +0200 + libdrm (2.4.77-1) experimental; urgency=medium * Team upload. commit 7cfcd5ef4b394f66c4a6fde705cf7c583a0b0c7b Author: Edward O'Callaghan <funfunc...@folklore1984.net> Date: Wed Apr 19 02:13:19 2017 +1000 amdgpu/: concisely && consistently check null ptrs in canonical form Be consistent and use the canonical form while sanity checking null pointers, also combine a few branches for brevity. v2: rebase on top of 'add amdgpu_cs_wait_fences' series. Signed-off-by: Edward O'Callaghan <funfunc...@folklore1984.net> Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index 9adfffa..5ac456b 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -652,7 +652,7 @@ int amdgpu_bo_list_update(amdgpu_bo_list_handle handle, return -EINVAL; list = malloc(number_of_resources * sizeof(struct drm_amdgpu_bo_list_entry)); - if (list == NULL) + if (!list) return -ENOMEM; args.in.operation = AMDGPU_BO_LIST_OP_UPDATE; diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 779c7db..0993a6d 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -59,13 +59,11 @@ int amdgpu_cs_ctx_create(amdgpu_device_handle dev, int i, j, k; int r; - if (NULL == dev) - return -EINVAL; - if (NULL == context) + if (!dev || !context) return -EINVAL; gpu_context = calloc(1, sizeof(struct amdgpu_context)); - if (NULL == gpu_context) + if (!gpu_context) return -ENOMEM; gpu_context->dev = dev; @@ -110,7 +108,7 @@ int amdgpu_cs_ctx_free(amdgpu_context_handle context) int i, j, k; int r; - if (NULL == context) + if (!context) return -EINVAL; pthread_mutex_destroy(&context->sequence_mutex); @@ -330,9 +328,7 @@ int amdgpu_cs_submit(amdgpu_context_handle context, uint32_t i; int r; - if (NULL == context) - return -EINVAL; - if (NULL == ibs_request) + if (!context || !ibs_request) return -EINVAL; r = 0; @@ -416,11 +412,7 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence, bool busy = true; int r; - if (NULL == fence) - return -EINVAL; - if (NULL == expired) - return -EINVAL; - if (NULL == fence->context) + if (!fence || !expired || !fence->context) return -EINVAL; if (fence->ip_type >= AMDGPU_HW_IP_NUM) return -EINVAL; @@ -493,12 +485,9 @@ int amdgpu_cs_wait_fences(struct amdgpu_cs_fence *fences, uint32_t i; /* Sanity check */ - if (NULL == fences) - return -EINVAL; - if (NULL == status) - return -EINVAL; - if (fence_count <= 0) + if (!fences || !status || !fence_count) return -EINVAL; + for (i = 0; i < fence_count; i++) { if (NULL == fences[i].context) return -EINVAL; @@ -518,11 +507,11 @@ int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle *sem) { struct amdgpu_semaphore *gpu_semaphore; - if (NULL == sem) + if (!sem) return -EINVAL; gpu_semaphore = calloc(1, sizeof(struct amdgpu_semaphore)); - if (NULL == gpu_semaphore) + if (!gpu_semaphore) return -ENOMEM; atomic_set(&gpu_semaphore->refcount, 1); @@ -537,14 +526,12 @@ int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx, uint32_t ring, amdgpu_semaphore_handle sem) { - if (NULL == ctx) + if (!ctx || !sem) return -EINVAL; if (ip_type >= AMDGPU_HW_IP_NUM) return -EINVAL; if (ring >= AMDGPU_CS_MAX_RINGS) return -EINVAL; - if (NULL == sem) - return -EINVAL; /* sem has been signaled */ if (sem->signal_fence.context) return -EINVAL; @@ -565,14 +552,12 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, uint32_t ring, amdgpu_semaphore_handle sem) { - if (NULL == ctx) + if (!ctx || !sem) return -EINVAL; if (ip_type >= AMDGPU_HW_IP_NUM) return -EINVAL; if (ring >= AMDGPU_CS_MAX_RINGS) return -EINVAL; - if (NULL == sem) - return -EINVAL; /* must signal first */ if (NULL == sem->signal_fence.context) return -EINVAL; @@ -585,9 +570,7 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem) { - if (NULL == sem) - return -EINVAL; - if (NULL == sem->signal_fence.context) + if (!sem || !sem->signal_fence.context) return -EINVAL; sem->signal_fence.context = NULL;; @@ -601,7 +584,7 @@ static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem) static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem) { - if (NULL == sem) + if (!sem) return -EINVAL; if (update_references(&sem->refcount, NULL)) diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c index f4b94c9..1efffc6 100644 --- a/amdgpu/amdgpu_gpu_info.c +++ b/amdgpu/amdgpu_gpu_info.c @@ -234,8 +234,9 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev) int amdgpu_query_gpu_info(amdgpu_device_handle dev, struct amdgpu_gpu_info *info) { - if ((dev == NULL) || (info == NULL)) + if (!dev || !info) return -EINVAL; + /* Get ASIC info*/ *info = dev->info; @@ -300,7 +301,7 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev, struct drm_amdgpu_info_gds gds_config = {}; int r; - if (gds_info == NULL) + if (!gds_info) return -EINVAL; r = amdgpu_query_info(dev, AMDGPU_INFO_GDS_CONFIG, commit 90c304584af8e1bac6391530f59bbe9ccac8e06a Author: Nicolai Hähnle <nicolai.haeh...@amd.com> Date: Thu Apr 13 16:43:58 2017 +0200 amdgpu: add a test for amdgpu_cs_wait_fences Signed-off-by: monk.liu <monk....@amd.com> [v2: actually hook up the test case] Signed-off-by: Nicolai Hähnle <nicolai.haeh...@amd.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 4dce67e..8d5844b 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -45,6 +45,7 @@ static void amdgpu_query_info_test(void); static void amdgpu_memory_alloc(void); static void amdgpu_command_submission_gfx(void); static void amdgpu_command_submission_compute(void); +static void amdgpu_command_submission_multi_fence(void); static void amdgpu_command_submission_sdma(void); static void amdgpu_userptr_test(void); static void amdgpu_semaphore_test(void); @@ -59,6 +60,7 @@ CU_TestInfo basic_tests[] = { { "Userptr Test", amdgpu_userptr_test }, { "Command submission Test (GFX)", amdgpu_command_submission_gfx }, { "Command submission Test (Compute)", amdgpu_command_submission_compute }, + { "Command submission Test (Multi-Fence)", amdgpu_command_submission_multi_fence }, { "Command submission Test (SDMA)", amdgpu_command_submission_sdma }, { "SW semaphore Test", amdgpu_semaphore_test }, CU_TEST_INFO_NULL, @@ -1149,6 +1151,104 @@ static void amdgpu_command_submission_sdma(void) amdgpu_command_submission_sdma_copy_linear(); } +static void amdgpu_command_submission_multi_fence_wait_all(bool wait_all) +{ + amdgpu_context_handle context_handle; + amdgpu_bo_handle ib_result_handle, ib_result_ce_handle; + void *ib_result_cpu, *ib_result_ce_cpu; + uint64_t ib_result_mc_address, ib_result_ce_mc_address; + struct amdgpu_cs_request ibs_request[2] = {0}; + struct amdgpu_cs_ib_info ib_info[2]; + struct amdgpu_cs_fence fence_status[2] = {0}; + uint32_t *ptr; + uint32_t expired; + amdgpu_bo_list_handle bo_list;