Makefile.am | 2 amdgpu/Android.mk | 18 + amdgpu/Makefile.am | 20 -- amdgpu/Makefile.sources | 14 + amdgpu/amdgpu_bo.c | 11 - amdgpu/amdgpu_cs.c | 13 - amdgpu/amdgpu_device.c | 2 amdgpu/amdgpu_internal.h | 3 configure.ac | 6 debian/changelog | 5 debian/libdrm2.symbols | 2 debian/rules | 2 debian/upstream/signing-key.asc | 76 ++++++++ freedreno/freedreno-symbol-check | 1 freedreno/freedreno_bo.c | 38 ++-- freedreno/freedreno_device.c | 5 freedreno/freedreno_drmif.h | 1 freedreno/freedreno_priv.h | 6 freedreno/freedreno_ringbuffer.h | 2 freedreno/kgsl/kgsl_bo.c | 2 freedreno/kgsl/kgsl_device.c | 2 freedreno/kgsl/kgsl_pipe.c | 2 freedreno/kgsl/kgsl_ringbuffer.c | 2 freedreno/msm/msm_bo.c | 2 freedreno/msm/msm_device.c | 2 freedreno/msm/msm_pipe.c | 2 freedreno/msm/msm_ringbuffer.c | 2 include/drm/drm.h | 1 include/drm/drm_fourcc.h | 93 +++++++++ include/drm/drm_mode.h | 11 + intel/intel_bufmgr_fake.c | 2 intel/intel_bufmgr_gem.c | 31 +-- intel/intel_decode.c | 10 - libkms/linux.c | 2 nouveau/abi16.c | 13 + nouveau/nouveau.c | 6 omap/omap_drm.c | 1 radeon/radeon_bo_gem.c | 23 +- radeon/radeon_bo_int.h | 2 radeon/radeon_cs_gem.c | 20 +- radeon/radeon_cs_int.h | 2 tests/Makefile.am | 2 tests/amdgpu/amdgpu_test.c | 32 ++- tests/amdgpu/basic_tests.c | 3 tests/amdgpu/cs_tests.c | 4 tests/amdgpu/uvd_messages.h | 10 - tests/amdgpu/vce_ib.h | 24 +- tests/modetest/cursor.c | 10 - tests/modetest/modetest.c | 7 tests/vbltest/vbltest.c | 1 xf86drm.c | 368 ++++++++++++++++++++++++++++++++++++++- xf86drm.h | 34 +++ xf86drmMode.c | 4 53 files changed, 797 insertions(+), 162 deletions(-)
New commits: commit b874d9877871d075425450cb9be219f940f476ea Author: Andreas Boll <[email protected]> Date: Thu Oct 8 12:11:23 2015 +0200 Update symbols file and bump shlibs for libdrm2. diff --git a/debian/changelog b/debian/changelog index 238b625..eea3177 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ libdrm (2.4.65-1) UNRELEASED; urgency=medium * New upstream release. * Update debian/upstream/signing-key.asc. + * Update symbols file and bump shlibs for libdrm2. * Enable libdrm-amdgpu1 on kfreebsd-*. * Fix Vcs-* fields. * Add upstream url. diff --git a/debian/libdrm2.symbols b/debian/libdrm2.symbols index 8c65b19..2d86bd4 100644 --- a/debian/libdrm2.symbols +++ b/debian/libdrm2.symbols @@ -42,6 +42,7 @@ libdrm.so.2 libdrm2 #MINVER# drmFree@Base 2.3.1 drmFreeBufs@Base 2.3.1 drmFreeBusid@Base 2.3.1 + drmFreeDevices@Base 2.4.65-1 drmFreeReservedContextList@Base 2.3.1 drmFreeVersion@Base 2.3.1 drmGetBufInfo@Base 2.3.1 @@ -52,6 +53,7 @@ libdrm.so.2 libdrm2 #MINVER# drmGetContextPrivateMapping@Base 2.3.1 drmGetContextTag@Base 2.3.1 drmGetDeviceNameFromFd@Base 2.4.16 + drmGetDevices@Base 2.4.65-1 drmGetEntry@Base 2.3.1 drmGetHashTable@Base 2.3.1 drmGetInterruptFromBusID@Base 2.3.1 diff --git a/debian/rules b/debian/rules index a00c59e..bd93023 100755 --- a/debian/rules +++ b/debian/rules @@ -94,7 +94,7 @@ endif dh_strip -s --remaining-packages override_dh_makeshlibs: - dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.62)' --add-udeb=libdrm2-udeb -- -c4 + dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.65)' --add-udeb=libdrm2-udeb -- -c4 ifeq ($(INTEL), yes) dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.60)' -- -c4 endif commit dbde17499edfaa528c0dd02b9ef0d3cc96ca19e1 Author: Andreas Boll <[email protected]> Date: Thu Oct 8 11:57:21 2015 +0200 Update debian/upstream/signing-key.asc. diff --git a/debian/changelog b/debian/changelog index 2293f1b..238b625 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libdrm (2.4.65-1) UNRELEASED; urgency=medium * New upstream release. + * Update debian/upstream/signing-key.asc. * Enable libdrm-amdgpu1 on kfreebsd-*. * Fix Vcs-* fields. * Add upstream url. diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc index a99bceb..aaad3be 100644 --- a/debian/upstream/signing-key.asc +++ b/debian/upstream/signing-key.asc @@ -191,3 +191,79 @@ kLK/gqBFGHh/TO5DEl6X/TP380DYdazZpa31S+Ixwt+RkP9ZkvOWGMIG7Nf+G+r+ Omj3BC4KcQ== =XQbm -----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFNo4lgBEADhvCNfuln1i6N2LIzVUZCmSgGZMZy9OAmhQSg5XdvbnFrq86NF +X+oKDuwzlFiK4k3vUhPFH1U7NJsuo1DT71gC5b8Rm44Tk5PkZ+NBsjma3/i9KJAi +0xVq19lXoK55QjLfrYcBsq0C/r4IR7DKKUnjLOFQN6W0kgqjsWwir2J3fblQ+fUs +fRfQlNwt3EzXQGGiaixq+ePuUEVO72YAsxAptvEhMFcM2xGb5eUP011I0i352mav +Vm5YODUjxujd7dQl83w8qJK4jnm2WQP3IXqbOEjsDVX6z6OyhEo44AWS4EpjAFUe +d0k46YSZAVxixFpyaoeCb9vZDU3gnwOaCvaLzEwzz+1Daus0kBbJa4JG1ytaGsYA +Hf+yQdFUXuGKRu3xsNcKZmBDQ+8YCG9o2VdfIbS8RsNmiwJJI9yfQT2d3HMq/nKS +OJFLcQrjvI8Zh+SdKu3/K3IOFO9xocwDnnxiutN8FD5D8ZbkTUGzjcoOXBqOZfbM +NMaxKlDa9/1c3tLf5TI8om/Q87L8RPbUsHlrXcs/ZGw2MlEG4RycTlpJ2mW96lNN +zGZICaqk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9rMeAHR5O0Voxo2ZiRDyuZzTYDpOVGl0fZwohWC3 +Q+BAGs81MxbJ6FmBeJiMIWDbg72a9kymV0KLNl6LDlz95X7r0Y5VfeWD4331CMTp +N88C7wARAQABiQIlBBgBAgAPBQJTaOJYAhsMBQkB4TOAAAoJEBkcm5BVIrBFVEsP +/iAlMrNcmL/1Fl8reNpfcif/1KNk3Kix2/GXYR15zutzCYNv2fEpQCrOSYiYBi4e +kcn3GLWW5yBg++YhiFzY/5M+GYeWs3t8K1G8IIKBU8s3a40EWyamVI0oRQQ0rCkb +W/PumKU1dUY7PbG6oKr5CsghgbLEjqeyKgdBtfU/7UMU5u3uIptAWca02gxxjXxJ +vcomatWueR9wANnWx443ECCidcRVsrNRkCn1Pi48D/kTQ6BHdwdjtENS5nM3NBmS +qtqPd69W7l3+VdbYL15KF5w1A/0sZT1Ef/kWYDM6/SMPJvaz353DhXpLn3L9p5x1 +fKWoGkstHUPxw5WpPN8FKvwDNEUltiUU1+pnCNCP9uLjDZuEIwARn1vbLUJCy4Co +PXCBoXLIjgktn2e4B/kf+5MmF83n2AdMn/G5O0CW0zgjb2sj1RsRD3/aOm+YMEph +gnsJJZfLyoFxjmpSJXX4hWr518dWcoF+iEzcZvQGDBDUr4Bez0LDzLR9ciQHC8lR +khhp7a6BTUe753JXbxB86z7tRaNgEGbzh04smh0veYFfuep7a9iZdaCVZGd8pToJ +PbhMPfeaGCH4dFPDkD6kmpbHtPKm/5JI/4YfurNAL4INW8EYJoZgpddB9QDwMWkv +lPS0zfDC+hiRF5twRXRVzP3jYFe6+cyQ0FqMayLcdnov +=lkAG +-----END PGP PUBLIC KEY BLOCK----- commit a592fc2c2359a2bc8d0d013bc0dcec465df7d429 Author: Andreas Boll <[email protected]> Date: Thu Oct 8 11:55:12 2015 +0200 Bump changelog. diff --git a/debian/changelog b/debian/changelog index c535b80..2293f1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -libdrm (2.4.64-2) UNRELEASED; urgency=medium +libdrm (2.4.65-1) UNRELEASED; urgency=medium + * New upstream release. * Enable libdrm-amdgpu1 on kfreebsd-*. * Fix Vcs-* fields. * Add upstream url. commit c3496167637e35cf8a52d5e7e53a412e79d80db0 Author: Rob Clark <[email protected]> Date: Wed Sep 16 09:03:40 2015 -0400 Bump version for release Signed-off-by: Rob Clark <[email protected]> diff --git a/configure.ac b/configure.ac index 1d7bd5b..cf10ef2 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.64], + [2.4.65], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) commit 94ecdcb8b11dd3eb6b047ad72030d775014aadee Author: Alan Coopersmith <[email protected]> Date: Sun Sep 6 09:34:31 2015 -0700 Include <alloca.h> when needed before calling alloca Fixes "error: implicit declaration of function 'alloca'" failures when building on Solaris Signed-off-by: Alan Coopersmith <[email protected]> Reviewed-by: Marek Olšák <[email protected]> diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index c7910ad..4da9821 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -32,6 +32,9 @@ #include <pthread.h> #include <sched.h> #include <sys/ioctl.h> +#ifdef HAVE_ALLOCA_H +# include <alloca.h> +#endif #include "xf86drm.h" #include "amdgpu_drm.h" diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 7874039..e489e6e 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -28,6 +28,9 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#ifdef HAVE_ALLOCA_H +# include <alloca.h> +#endif #include "CUnit/Basic.h" commit 8983fe5497e89a3ffaba3ad1ee06a30a1c7e6daf Author: Tvrtko Ursulin <[email protected]> Date: Mon Aug 3 10:48:03 2015 +0100 libdrm: Add framebuffer modifiers uapi Sync up with new kernel features as per commits: e3eb3250d84ef97b766312345774367b6a310db8 93b81f5102a7cd270a305c2741b17c8d44bb0629 b5ff6e1637b683d5996ae11ac29afe406c0bee90 8c4f83fb1e8bf317e894f62d17a63c32b7a6b75e 570655b09b065d2fff1b8ab9bdb8308f4c5a05a3 Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: [email protected] Cc: Rob Clark <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Rob Clark <[email protected]> diff --git a/include/drm/drm.h b/include/drm/drm.h index 167b7b8..a950b58 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -816,6 +816,7 @@ struct drm_event_vblank { #define DRM_CAP_PRIME 0x5 #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 #define DRM_CAP_ASYNC_PAGE_FLIP 0x7 +#define DRM_CAP_ADDFB2_MODIFIERS 0x10 #define DRM_PRIME_CAP_IMPORT 0x1 #define DRM_PRIME_CAP_EXPORT 0x2 diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 85facb0..63a80ca 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -127,4 +127,97 @@ #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ + +/* + * Format Modifiers: + * + * Format modifiers describe, typically, a re-ordering or modification + * of the data in a plane of an FB. This can be used to express tiled/ + * swizzled formats, or compression, or a combination of the two. + * + * The upper 8 bits of the format modifier are a vendor-id as assigned + * below. The lower 56 bits are assigned as vendor sees fit. + */ + +/* Vendor Ids: */ +#define DRM_FORMAT_MOD_NONE 0 +#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 +#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 +#define DRM_FORMAT_MOD_VENDOR_NV 0x03 +#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 +#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 +/* add more to the end as needed */ + +#define fourcc_mod_code(vendor, val) \ + ((((u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL)) + +/* + * Format Modifier tokens: + * + * When adding a new token please document the layout with a code comment, + * similar to the fourcc codes above. drm_fourcc.h is considered the + * authoritative source for all of these. + */ + +/* Intel framebuffer modifiers */ + +/* + * Intel X-tiling layout + * + * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) + * in row-major layout. Within the tile bytes are laid out row-major, with + * a platform-dependent stride. On top of that the memory can apply + * platform-depending swizzling of some higher address bits into bit6. + * + * This format is highly platforms specific and not useful for cross-driver + * sharing. It exists since on a given platform it does uniquely identify the + * layout in a simple way for i915-specific userspace. + */ +#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) + +/* + * Intel Y-tiling layout + * + * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) + * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes) + * chunks column-major, with a platform-dependent height. On top of that the + * memory can apply platform-depending swizzling of some higher address bits + * into bit6. + * + * This format is highly platforms specific and not useful for cross-driver + * sharing. It exists since on a given platform it does uniquely identify the + * layout in a simple way for i915-specific userspace. + */ +#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) + +/* + * Intel Yf-tiling layout + * + * This is a tiled layout using 4Kb tiles in row-major layout. + * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which + * are arranged in four groups (two wide, two high) with column-major layout. + * Each group therefore consits out of four 256 byte units, which are also laid + * out as 2x2 column-major. + * 256 byte units are made out of four 64 byte blocks of pixels, producing + * either a square block or a 2:1 unit. + * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width + * in pixel depends on the pixel depth. + */ +#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) + +/* + * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks + * + * Macroblocks are laid in a Z-shape, and each pixel data is following the + * standard NV12 style. + * As for NV12, an image is the result of two frame buffers: one for Y, + * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer). + * Alignment requirements are (for each buffer): + * - multiple of 128 pixels for the width + * - multiple of 32 pixels for the height + * + * For more information: see http://linuxtv.org/downloads/v4l-dvb-apis/re32.html + */ +#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + #endif /* DRM_FOURCC_H */ diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 69c1ac3..115f36e 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h @@ -322,7 +322,8 @@ struct drm_mode_fb_cmd { __u32 handle; }; -#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ +#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ +#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ struct drm_mode_fb_cmd2 { __u32 fb_id; @@ -343,10 +344,18 @@ struct drm_mode_fb_cmd2 { * So it would consist of Y as offset[0] and UV as * offset[1]. Note that offset[0] will generally * be 0. + * + * To accommodate tiled, compressed, etc formats, a per-plane + * modifier can be specified. The default value of zero + * indicates "native" format as specified by the fourcc. + * Vendor specific modifier token. This allows, for example, + * different tiling/swizzling pattern on different planes. + * See discussion above of DRM_FORMAT_MOD_xxx. */ __u32 handles[4]; __u32 pitches[4]; /* pitch for each plane */ __u32 offsets[4]; /* offset of each plane */ + __u64 modifier[4]; /* ie, tiling, compressed (per plane) */ }; #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 commit a814152187ab4130544319c0d9b7eb4f16791cf4 Author: Michel Dänzer <[email protected]> Date: Mon Sep 7 19:02:14 2015 +0900 tests: Add -lm to LDADD for dristat Fixes build failure due to unresolved log2. Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Emil Velikov <[email protected]> diff --git a/tests/Makefile.am b/tests/Makefile.am index 9a2d932..a511d28 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,6 +33,8 @@ check_PROGRAMS = \ dristat \ drmstat +dristat_LDADD = -lm + if HAVE_NOUVEAU SUBDIRS += nouveau endif commit 7faedc9efcff12e7620f3a679cff33b1f818b539 Author: Emil Velikov <[email protected]> Date: Sat Aug 15 17:00:37 2015 +0100 configure: remove -Wno-missing-field-initializers Signed-off-by: Emil Velikov <[email protected]> diff --git a/configure.ac b/configure.ac index c2a8ed1..1d7bd5b 100644 --- a/configure.ac +++ b/configure.ac @@ -173,7 +173,7 @@ MAYBE_WARN="-Wall -Wextra \ -Wpacked -Wswitch-enum -Wmissing-format-attribute \ -Wstrict-aliasing=2 -Winit-self \ -Wdeclaration-after-statement -Wold-style-definition \ --Wno-missing-field-initializers -Wno-unused-parameter \ +-Wno-unused-parameter \ -Wno-attributes -Wno-long-long -Winline -Wshadow" # invalidate cached value if MAYBE_WARN has changed commit 23667f566a5622490237d753cc514d4f95cf10ff Author: Emil Velikov <[email protected]> Date: Sun Aug 23 14:20:17 2015 +0100 intel: ignore missing-field-initializers warnings We're about to remove the -Wno flag from configure.ac which will lead to a lot of unnecessary spam. Signed-off-by: Emil Velikov <[email protected]> diff --git a/intel/intel_decode.c b/intel/intel_decode.c index 345d457..e7aef74 100644 --- a/intel/intel_decode.c +++ b/intel/intel_decode.c @@ -38,6 +38,9 @@ #include "intel_chipset.h" #include "intel_bufmgr.h" +/* The compiler throws ~90 warnings. Do not spam the build, until we fix them. */ +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" + /* Struct for tracking drm_intel_decode state. */ struct drm_intel_decode { /** stdio file where the output should land. Defaults to stdout. */ commit a9e5880b3e93f2fc981c910d16a9eab2ca81c7a0 Author: Emil Velikov <[email protected]> Date: Sat Aug 15 18:01:53 2015 +0100 nouveau: use designated initializers Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> diff --git a/nouveau/abi16.c b/nouveau/abi16.c index 4ca0bfb..59bc436 100644 --- a/nouveau/abi16.c +++ b/nouveau/abi16.c @@ -38,7 +38,10 @@ abi16_chan_nv04(struct nouveau_object *obj) { struct nouveau_device *dev = (struct nouveau_device *)obj->parent; struct nv04_fifo *nv04 = obj->data; - struct drm_nouveau_channel_alloc req = {nv04->vram, nv04->gart}; + struct drm_nouveau_channel_alloc req = { + .fb_ctxdma_handle = nv04->vram, + .tt_ctxdma_handle = nv04->gart + }; int ret; ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, @@ -105,7 +108,9 @@ drm_private int abi16_engobj(struct nouveau_object *obj) { struct drm_nouveau_grobj_alloc req = { - obj->parent->handle, obj->handle, obj->oclass + .channel = obj->parent->handle, + .handle = obj->handle, + .class = obj->oclass, }; struct nouveau_device *dev; int ret; @@ -125,7 +130,9 @@ abi16_ntfy(struct nouveau_object *obj) { struct nv04_notify *ntfy = obj->data; struct drm_nouveau_notifierobj_alloc req = { - obj->parent->handle, ntfy->object->handle, ntfy->length + .channel = obj->parent->handle, + .handle = ntfy->object->handle, + .size = ntfy->length, }; struct nouveau_device *dev; int ret; diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 7393474..97fd77b 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -177,7 +177,7 @@ nouveau_device_del(struct nouveau_device **pdev) int nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) { - struct drm_nouveau_getparam r = { param, 0 }; + struct drm_nouveau_getparam r = { .param = param }; int fd = dev->fd, ret = drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r)); *value = r.value; @@ -187,7 +187,7 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) int nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value) { - struct drm_nouveau_setparam r = { param, value }; + struct drm_nouveau_setparam r = { .param = param, .value = value }; return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r)); } @@ -348,7 +348,7 @@ nouveau_bo_del(struct nouveau_bo *bo) { struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct drm_gem_close req = { bo->handle }; + struct drm_gem_close req = { .handle = bo->handle }; if (nvbo->head.next) { pthread_mutex_lock(&nvdev->lock); commit ae2cf4507c32f0e16fdb41472ac68d72bfb007ac Author: Emil Velikov <[email protected]> Date: Sun Aug 23 14:44:55 2015 +0100 tests/amdgpu: ensure tests work by using c99 initializers In the latest version of CUnit the fourth parameter of the CU_SuiteInfo struct is pSetUpFunc rather than *pTests. Seems like the CUnit ABI broke at some point, so let's the the robust thing and use c99 designated initializers to correctly populate the struct(s). Cc: Leo Liu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c index 6568990..71f357c 100644 --- a/tests/amdgpu/amdgpu_test.c +++ b/tests/amdgpu/amdgpu_test.c @@ -58,14 +58,30 @@ int drm_amdgpu[MAX_CARDS_SUPPORTED]; /** The table of all known test suites to run */ static CU_SuiteInfo suites[] = { - { "Basic Tests", suite_basic_tests_init, - suite_basic_tests_clean, basic_tests }, - { "BO Tests", suite_bo_tests_init, - suite_bo_tests_clean, bo_tests }, - { "CS Tests", suite_cs_tests_init, - suite_cs_tests_clean, cs_tests }, - { "VCE Tests", suite_vce_tests_init, - suite_vce_tests_clean, vce_tests }, + { + .pName = "Basic Tests", + .pInitFunc = suite_basic_tests_init, + .pCleanupFunc = suite_basic_tests_clean, + .pTests = basic_tests, + }, + { + .pName = "BO Tests", + .pInitFunc = suite_bo_tests_init, + .pCleanupFunc = suite_bo_tests_clean, + .pTests = bo_tests, + }, + { + .pName = "CS Tests", + .pInitFunc = suite_cs_tests_init, + .pCleanupFunc = suite_cs_tests_clean, + .pTests = cs_tests, + }, + { + .pName = "VCE Tests", + .pInitFunc = suite_vce_tests_init, + .pCleanupFunc = suite_vce_tests_clean, + .pTests = vce_tests, + }, CU_SUITE_INFO_NULL, }; commit f7568777365abbdd8079c2b51b2e68d603391816 Author: Emil Velikov <[email protected]> Date: Sat Aug 15 17:35:58 2015 +0100 tests/amdgpu: annotate (most of) the vce templates as const data The remaining two templates are modified on the fly, depending on the type of test to be performed. Cc: Leo Liu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> diff --git a/tests/amdgpu/vce_ib.h b/tests/amdgpu/vce_ib.h index c5afed0..bd0bf94 100644 --- a/tests/amdgpu/vce_ib.h +++ b/tests/amdgpu/vce_ib.h @@ -24,7 +24,7 @@ #ifndef _vce_ib_h_ #define _vce_ib_h_ -static uint32_t vce_session[3] = { +static const uint32_t vce_session[] = { 0x0000000c, 0x00000001, 0x400c0001, @@ -41,7 +41,7 @@ static uint32_t vce_taskinfo[8] = { 0x00000000, }; -static uint32_t vce_create[12] = { +static const uint32_t vce_create[] = { 0x00000030, 0x01000001, 0x00000000, @@ -56,7 +56,7 @@ static uint32_t vce_create[12] = { 0x00000000, }; -static uint32_t vce_rate_ctrl[28] = { +static const uint32_t vce_rate_ctrl[] = { 0x00000070, 0x04000005, 0x00000000, @@ -87,13 +87,13 @@ static uint32_t vce_rate_ctrl[28] = { 0x00000000, }; -static uint32_t vce_config_ext[3] = { +static const uint32_t vce_config_ext[] = { 0x0000000c, 0x04000001, 0x00000003, }; -static uint32_t vce_motion_est[26] = { +static const uint32_t vce_motion_est[] = { 0x00000068, 0x04000007, 0x00000001, @@ -122,7 +122,7 @@ static uint32_t vce_motion_est[26] = { 0x00000000, }; -static uint32_t vce_rdo[19] = { +static const uint32_t vce_rdo[] = { 0x0000004c, 0x04000008, 0x00000000, @@ -144,7 +144,7 @@ static uint32_t vce_rdo[19] = { 0x00000000, }; -static uint32_t vce_pic_ctrl[29] = { +static const uint32_t vce_pic_ctrl[] = { 0x00000074, 0x04000002, 0x00000000, @@ -176,7 +176,7 @@ static uint32_t vce_pic_ctrl[29] = { 0x00000000, }; -static uint32_t vce_feedback[5] = { +static const uint32_t vce_feedback[] = { 0x00000014, 0x05000005, 0x00000000, @@ -184,14 +184,14 @@ static uint32_t vce_feedback[5] = { 0x00000001, }; -static uint32_t vce_context_buffer[4] = { +static const uint32_t vce_context_buffer[] = { 0x00000010, 0x05000001, 0x00000000, 0xffffffff, }; -static uint32_t vce_bs_buffer[5] = { +static const uint32_t vce_bs_buffer[] = { 0x00000014, 0x05000004, 0x00000000, @@ -199,7 +199,7 @@ static uint32_t vce_bs_buffer[5] = { 0x00154000, }; -static uint32_t vce_aux_buffer[18] = { +static const uint32_t vce_aux_buffer[] = { 0x00000048, 0x05000002, 0x0000f000, @@ -311,7 +311,7 @@ static uint32_t vce_encode[88] = { 0x00000000, }; -static uint32_t vce_destroy[2] = { +static const uint32_t vce_destroy[] = { 0x00000008, 0x02000001, }; commit 05185fa054c21e212ca4ab5075c72d62f7ec2108 Author: Emil Velikov <[email protected]> Date: Sat Aug 15 17:25:21 2015 +0100 tests/amdgpu: annotate the uvd message templates as const data Cc: Leo Liu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> diff --git a/tests/amdgpu/uvd_messages.h b/tests/amdgpu/uvd_messages.h index 44bcacc..00235cb 100644 --- a/tests/amdgpu/uvd_messages.h +++ b/tests/amdgpu/uvd_messages.h @@ -24,7 +24,7 @@ #ifndef _UVD_MESSAGES_H_ #define _UVD_MESSAGES_H_ -static uint8_t uvd_create_msg[] = { +static const uint8_t uvd_create_msg[] = { 0xe4,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x44,0x40,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x03,0x00,0x00, 0xe0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xf9,0xf2,0x00,0x00,0x00,0x00,0x00, @@ -250,7 +250,7 @@ static uint8_t uvd_create_msg[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -static uint8_t uvd_bitstream[] ={ +static const uint8_t uvd_bitstream[] ={ 0x00,0x00,0x01,0x25,0xb8,0x20,0x20,0x21,0x44,0xc5,0x00,0x01,0x57,0x9b,0xef,0xbe, 0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb, 0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef,0xbe,0xfb,0xef, @@ -341,7 +341,7 @@ static uint8_t uvd_bitstream[] ={ 0xeb,0xae,0xba,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -static uint8_t uvd_decode_msg[] = { +static const uint8_t uvd_decode_msg[] = { 0xe4,0x0d,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x44,0x40,0x01,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x03,0x00,0x00,0xe0,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0xf9,0xf2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -567,7 +567,7 @@ static uint8_t uvd_decode_msg[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -static uint8_t uvd_destroy_msg[] = { +static const uint8_t uvd_destroy_msg[] = { 0xe4,0x0d,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x44,0x40,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -793,7 +793,7 @@ static uint8_t uvd_destroy_msg[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -static uint8_t uvd_it_scaling_table[] = { +static const uint8_t uvd_it_scaling_table[] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, commit 150ebe49ac0db2e0bb4dc194b0a6f0329c18f3fa Author: Emil Velikov <[email protected]> Date: Sat Aug 15 17:24:21 2015 +0100 tests/amdgpu: reference the correct variable for memcpy Cc: Leo Liu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> diff --git a/tests/amdgpu/cs_tests.c b/tests/amdgpu/cs_tests.c index 416f36b..dfbf5af 100644 --- a/tests/amdgpu/cs_tests.c +++ b/tests/amdgpu/cs_tests.c @@ -266,7 +266,7 @@ static void amdgpu_cs_uvd_decode(void) r = amdgpu_bo_cpu_map(buf_handle, (void **)&ptr); CU_ASSERT_EQUAL(r, 0); - memcpy(ptr, uvd_decode_msg, sizeof(uvd_create_msg)); + memcpy(ptr, uvd_decode_msg, sizeof(uvd_decode_msg)); if (family_id >= AMDGPU_FAMILY_VI) ptr[0x10] = 7; @@ -362,7 +362,7 @@ static void amdgpu_cs_uvd_destroy(void) r = amdgpu_bo_cpu_map(buf_handle, &msg); CU_ASSERT_EQUAL(r, 0); - memcpy(msg, uvd_destroy_msg, sizeof(uvd_create_msg)); + memcpy(msg, uvd_destroy_msg, sizeof(uvd_destroy_msg)); if (family_id >= AMDGPU_FAMILY_VI) ((uint8_t*)msg)[0x10] = 7; commit 6a6d668fad9833350deaddc61e917de3dcb38262 Author: Emil Velikov <[email protected]> Date: Sat Aug 15 17:17:52 2015 +0100 freedreno: annotate the device/bo/pipe/ringbuffer funcs as const data Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h index 1dddcc3..4e442e4 100644 --- a/freedreno/freedreno_priv.h +++ b/freedreno/freedreno_priv.h @@ -83,7 +83,7 @@ struct fd_device { */ void *handle_table, *name_table; - struct fd_device_funcs *funcs; + const struct fd_device_funcs *funcs; struct fd_bo_bucket cache_bucket[14 * 4]; int num_buckets; @@ -107,7 +107,7 @@ struct fd_pipe_funcs { struct fd_pipe { struct fd_device *dev; enum fd_pipe_id id; - struct fd_pipe_funcs *funcs; + const struct fd_pipe_funcs *funcs; }; struct fd_ringmarker { @@ -141,7 +141,7 @@ struct fd_bo { int fd; /* dmabuf handle */ void *map; atomic_t refcnt; - struct fd_bo_funcs *funcs; + const struct fd_bo_funcs *funcs; int bo_reuse; struct list_head list; /* bucket-list entry */ diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h index a5e1d03..578cdb2 100644 --- a/freedreno/freedreno_ringbuffer.h +++ b/freedreno/freedreno_ringbuffer.h @@ -44,7 +44,7 @@ struct fd_ringbuffer { int size; uint32_t *cur, *end, *start, *last_start; struct fd_pipe *pipe; - struct fd_ringbuffer_funcs *funcs; + const struct fd_ringbuffer_funcs *funcs; uint32_t last_timestamp; struct fd_ringbuffer *parent; }; diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c index 3407c76..b8ac102 100644 --- a/freedreno/kgsl/kgsl_bo.c +++ b/freedreno/kgsl/kgsl_bo.c @@ -123,7 +123,7 @@ static void kgsl_bo_destroy(struct fd_bo *bo) } -static struct fd_bo_funcs funcs = { +static const struct fd_bo_funcs funcs = { .offset = kgsl_bo_offset, .cpu_prep = kgsl_bo_cpu_prep, .cpu_fini = kgsl_bo_cpu_fini, diff --git a/freedreno/kgsl/kgsl_device.c b/freedreno/kgsl/kgsl_device.c index 8352d60..175e837 100644 --- a/freedreno/kgsl/kgsl_device.c +++ b/freedreno/kgsl/kgsl_device.c @@ -42,7 +42,7 @@ static void kgsl_device_destroy(struct fd_device *dev) free(kgsl_dev); } -static struct fd_device_funcs funcs = { +static const struct fd_device_funcs funcs = { .bo_new_handle = kgsl_bo_new_handle, .bo_from_handle = kgsl_bo_from_handle, .pipe_new = kgsl_pipe_new, diff --git a/freedreno/kgsl/kgsl_pipe.c b/freedreno/kgsl/kgsl_pipe.c index e2fd65c..58b3b4d 100644 --- a/freedreno/kgsl/kgsl_pipe.c +++ b/freedreno/kgsl/kgsl_pipe.c @@ -108,7 +108,7 @@ static void kgsl_pipe_destroy(struct fd_pipe *pipe) free(kgsl_pipe); } -static struct fd_pipe_funcs funcs = { +static const struct fd_pipe_funcs funcs = { .ringbuffer_new = kgsl_ringbuffer_new, .get_param = kgsl_pipe_get_param, .wait = kgsl_pipe_wait, diff --git a/freedreno/kgsl/kgsl_ringbuffer.c b/freedreno/kgsl/kgsl_ringbuffer.c index f013307..6f68f2f 100644 --- a/freedreno/kgsl/kgsl_ringbuffer.c +++ b/freedreno/kgsl/kgsl_ringbuffer.c @@ -191,7 +191,7 @@ static void kgsl_ringbuffer_destroy(struct fd_ringbuffer *ring) free(kgsl_ring); } -static struct fd_ringbuffer_funcs funcs = { +static const struct fd_ringbuffer_funcs funcs = { .hostptr = kgsl_ringbuffer_hostptr, .flush = kgsl_ringbuffer_flush, .emit_reloc = kgsl_ringbuffer_emit_reloc, diff --git a/freedreno/msm/msm_bo.c b/freedreno/msm/msm_bo.c index fd94413..ee668ab 100644 --- a/freedreno/msm/msm_bo.c +++ b/freedreno/msm/msm_bo.c

