OSDN Git Service

android-x86/external-mesa.git
5 years agoradv: rework the TC-compat HTILE hardware bug with COND_EXEC
Samuel Pitoiset [Mon, 3 Dec 2018 21:45:03 +0000 (22:45 +0100)]
radv: rework the TC-compat HTILE hardware bug with COND_EXEC

After investigating on this, it appears that COND_WRITE doesn't
work correctly in some situations. I don't know exactly why does
it fail to update DB_Z_INFO.ZRANGE_PRECISION, but as AMDVLK
also uses COND_EXEC I think there is a reason.

Now the driver stores a new metadata value in order to reflect
the last fast depth clear state. If a TC-compat HTILE is fast cleared
with 0.0f, we have to update ZRANGE_PRECISION to 0 in order to
work around that hardware bug.

This fixes rendering issues with The Forest and DXVK and doesn't
seem to introduce any regressions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108914
Fixes: 68dead112e7 ("radv: update the ZRANGE_PRECISION value for the TC-compat bug")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 824cfc1ee5e0aba15b676b9363ff32046d96eb42)

5 years agoradv: use 3d shader for gfx9 copies if dst is 3d
Dave Airlie [Mon, 3 Dec 2018 04:38:28 +0000 (14:38 +1000)]
radv: use 3d shader for gfx9 copies if dst is 3d

This fixes some crucible 3d miptree tests I've been working on
when executed using the compute shader path.

Fixes: d08f267814 (radv/gfx9: fix 3d image to image transfers on compute queues.)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 1363a47c9c4f8482fea9e8a2582a1d8e9db0e8a6)

5 years agoradv/android: Use buffer metadata to determine scanout compat.
Bas Nieuwenhuizen [Mon, 26 Nov 2018 15:26:36 +0000 (16:26 +0100)]
radv/android: Use buffer metadata to determine scanout compat.

These days we don't always allocate scanout compatible textures anymore.
That does mean we have to fix the radv android WSI though.

Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer."
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 3bf48741e128b60f6430b32cc47197f62075b1e9)

5 years agoradv/android: Mark android WSI image as shareable.
Bas Nieuwenhuizen [Mon, 26 Nov 2018 15:26:35 +0000 (16:26 +0100)]
radv/android: Mark android WSI image as shareable.

Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer."
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 51091b3e1f212be956f91ac5214191c14e83ac59)

5 years agoRevert "st/mesa: silenced unhanded enum warning in st_glsl_to_tgsi.cpp"
Matt Turner [Tue, 4 Dec 2018 00:20:43 +0000 (16:20 -0800)]
Revert "st/mesa: silenced unhanded enum warning in st_glsl_to_tgsi.cpp"

This reverts commit 198c50f4873758e9f64d89eea262af5dd1644df9.

This needs to be reverted after commit 017199d2d2e4 ("mesa: Revert
INTEL_fragment_shader_ordering support")

(cherry picked from commit dd53bb7e1f69740a5712decbae79dc79df8ecaa1)

5 years agomesa: Revert INTEL_fragment_shader_ordering support
Matt Turner [Thu, 29 Nov 2018 23:46:18 +0000 (15:46 -0800)]
mesa: Revert INTEL_fragment_shader_ordering support

This extension is not properly tested (testing for
GL_ARB_fragment_shader_interlock is not sufficient), and since this was
noted in review on August 28th no tests have been sent.

Revert "i965: Add INTEL_fragment_shader_ordering support."
Revert "mesa: Add GL/GLSL plumbing for INTEL_fragment_shader_ordering"

This reverts commit 03ecec9ed2099f6e2b62994b33dc948dc731e7b8.
This reverts commit 119435c8778dd26cb7c8bcde9f04b3982239fe60.

Cc: mesa-stable@lists.freedesktop.org
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 017199d2d2e4c57015bc60edfcc656062c3a7472)

5 years agoamd/vulkan: meson build - use radv_deps for libvulkan_radeon
Tobias Klausmann [Sat, 1 Dec 2018 17:30:20 +0000 (18:30 +0100)]
amd/vulkan: meson build - use radv_deps for libvulkan_radeon

Without this the build breaks with:

FAILED: src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o
cc -Isrc/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha -Isrc/amd/vulkan
-I../src/amd/vulkan -Isrc/../include -I../src/../include -Isrc -I../src
-Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include
-Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/amd -I../src/amd
-Isrc/amd/common -I../src/amd/common -Isrc/compiler -I../src/compiler
-Isrc/vulkan/util -I../src/vulkan/util -Isrc/vulkan/wsi -I../src/vulkan/wsi
-Isrc/compiler/nir -I../src/compiler/nir -I/usr/include -I/usr/include/libdrm
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-std=c99 -O2 -g '-DVERSION="18.3.0-rc5"' -DPACKAGE_VERSION=VERSION
'-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"'
-DGLX_USE_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0
-DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING
-DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DENABLE_SHADER_CACHE
-DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ
-DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT
-DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT
-DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE
-DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN
-DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE
-DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
-DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT
-DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
-DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS
-DHAVE_FUNC_ATTRIBUTE_NORETURN -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS
-DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H
-DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP
-DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L
-DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD
-DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LLVM=0x0600
-DMESA_LLVM_VERSION_PATCH=1 -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED
-DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration
-Werror=missing-prototypes -Werror=return-type -fno-math-errno
-fno-trapping-math -Wno-missing-field-initializers -Wno-format-truncation -O2
-Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -fPIC -pthread
-D__STDC_FORMAT_MACROS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_LIMIT_MACROS -fvisibility=hidden -Wno-override-init
-DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR
-DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_DISPLAY_KHR
-DVK_USE_PLATFORM_XLIB_XRANDR_EXT  -MD -MQ
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o' -MF
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o.d' -o
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o' -c
../src/amd/vulkan/radv_pipeline.c
In file included from ../src/vulkan/util/vk_alloc.h:29,
                 from ../src/amd/vulkan/radv_private.h:52,
                 from ../src/amd/vulkan/radv_debug.h:27,
                 from ../src/amd/vulkan/radv_pipeline.c:30:
../src/../include/vulkan/vulkan.h:54:10: fatal error: wayland-client.h: Datei
oder Verzeichnis nicht gefunden
 #include <wayland-client.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

The above command misses the include directory for wayland:
    -I/usr/include/wayland

The missing include is contained in the (until now) unused radv_deps:

if with_platform_wayland
  radv_deps += dep_wayland_client
  radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
  libradv_files += files('radv_wsi_wayland.c')
endif

Fixes: 673dda83307 "meson: build "radv" vulkan driver for radeon hardware"
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 9401a2f2e64bc04401a547d06810adbf0660edb8)

5 years agonv50,nvc0: Fix gallium nine regression regarding sampler bindings
Karol Herbst [Sat, 24 Nov 2018 19:00:00 +0000 (20:00 +0100)]
nv50,nvc0: Fix gallium nine regression regarding sampler bindings

The new approach is that samplers don't get unbound even if they won't be used
in a draw and we should just leave them be as well.

Fixes a regression in multiple windows games using gallium nine and nouveau.

v2: adjust num_samplers to keep track of the highest sampler bound
v3: rework how to set the new value of num_samplers

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106577
Fixes: 4d6fab245eec3880e2a59424a579851f44857ce8
       "cso: don't track the number of sampler states bound"
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit fc0139d28339f58bcbb4946fea7608ecdaff93e7)

5 years agost/xvmc: Add X11 include path.
Vinson Lee [Mon, 5 Nov 2018 18:50:41 +0000 (10:50 -0800)]
st/xvmc: Add X11 include path.

This patch fixes this build error.

  CC       tests/xvmc_bench.o
In file included from tests/xvmc_bench.c:35:
tests/testlib.h:38:10: fatal error: 'X11/Xlib.h' file not found
         ^~~~~~~~~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 4f74580d3038eca1b751a71e0c098ea9eb9cdb05)

5 years agoanv: flush pipeline before query result copies
Lionel Landwerlin [Thu, 29 Nov 2018 13:02:03 +0000 (13:02 +0000)]
anv: flush pipeline before query result copies

Pipeline state pending bits should be taken into account when copying
results.

In the particular bug below, the results of the
vkCmdCopyQueryPoolResults() command was being overwritten by the
preceding vkCmdCopyBuffer() with a same destination buffer. This is
because we copy the buffers using the 3D pipeline whereas we copy the
query results using the command streamer. Those pieces of HW work in
parallel and the results are somewhat undefined.

v2: Unconditionally flush the pipeline before copying the results
    (Jason)

v3: Wrap & expressions (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108894
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 37f9788e9a8e443772b5ad6f339567e6ae6a8320)

5 years agowinsys/svga: Fix a memory leak
Thomas Hellstrom [Mon, 26 Nov 2018 18:05:47 +0000 (19:05 +0100)]
winsys/svga: Fix a memory leak

The ioctl.cap_3d member was never freed.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 058f85d41cbe3534b1a06d321fab9afb8fbadfc0)

5 years agost/xa: Fix a memory leak
Thomas Hellstrom [Mon, 26 Nov 2018 18:02:08 +0000 (19:02 +0100)]
st/xa: Fix a memory leak

Free the context after destruction.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 7fce3ca3759e2e156e2e3bf1bcc4ee378dc7fa2d)

5 years agor600: make suballocator 256-bytes align
Dave Airlie [Thu, 11 Oct 2018 03:44:02 +0000 (13:44 +1000)]
r600: make suballocator 256-bytes align

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108311
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2ddd44d941648d49dc0d917e03a579baec3590d9)

5 years agoUpdate version to 18.3.0-rc5
Emil Velikov [Thu, 29 Nov 2018 11:56:27 +0000 (11:56 +0000)]
Update version to 18.3.0-rc5

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agocherry-ignore: egl/wayland: rather obvious build fix
Emil Velikov [Wed, 28 Nov 2018 17:52:54 +0000 (17:52 +0000)]
cherry-ignore: egl/wayland: rather obvious build fix

Commit was squashed into the respective offenders

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agovulkan/wsi: fix s/,/;/ typo
Eric Engestrom [Tue, 20 Nov 2018 17:35:27 +0000 (17:35 +0000)]
vulkan/wsi: fix s/,/;/ typo

Fixes: 59e58c348e6af16a5f2dd "vulkan/wsi: Only wait on semaphores on the first swapchain"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit e0f1f74eda6e1bdb3bcee075f6cc5082d4137069)

5 years agoegl/wayland: plug memory leak in drm_handle_device()
Emil Velikov [Tue, 27 Nov 2018 11:36:01 +0000 (11:36 +0000)]
egl/wayland: plug memory leak in drm_handle_device()

As we fail to open the node, we leak the node/device name.

v2: Log and then free() (Eric)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit ce74a7bb8de7f5b921d53384582de3324290cd60)

5 years agoegl/wayland: bail out when drmGetMagic fails
Emil Velikov [Fri, 23 Nov 2018 12:55:38 +0000 (12:55 +0000)]
egl/wayland: bail out when drmGetMagic fails

Currently as the function fails, we pass uninitialized data to the
authentication function. Stop doing that and print an warning when
the function fails.

v2: Plug memory leak in error path (Eric)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit c59d3aa4b9bc58994e199052171a8119aaa8195c)

5 years agowsi/display: fix mem leak when freeing swapchains
Eric Engestrom [Tue, 27 Nov 2018 13:34:37 +0000 (13:34 +0000)]
wsi/display: fix mem leak when freeing swapchains

Fixes: da997ebec92942193955 "vulkan: Add KHR_display extension using DRM [v10]"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9575cd289325ddbfa96291d7886cfc32a0487e79)

5 years agoradv: Align large buffers to the fragment size.
Bas Nieuwenhuizen [Mon, 26 Nov 2018 02:28:05 +0000 (03:28 +0100)]
radv: Align large buffers to the fragment size.

Improves performance in Talos by about 15% (and significant improvements
in RotR and possibly other but did not bench with final patch) on
kernel 4.19 and earlier.

On 4.20+ a similar effect comes from

433ca054949a "drm/amdgpu: try allocating VRAM as power of two"

v2: Do not impact the alignment of the physical memory.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6569644bb6e1f58fd739d83bd4dc42e6af6b6097)

5 years agoradv: Clamp gfx9 image view extents to the allocated image extents.
Bas Nieuwenhuizen [Sat, 24 Nov 2018 22:21:05 +0000 (23:21 +0100)]
radv: Clamp gfx9 image view extents to the allocated image extents.

Mirrors AMDVLK. Looks like if we go over the alignment of height
we actually start to change the addressing. Seems like the extra
miplevels actually work with this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108245
Fixes: f6cc15dccd5 "radv/gfx9: fix block compression texture views. (v2)"
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 08ea6b9d9bb047603c249468dfe00d7bb9603d5e)

5 years agoanv: correctly use vulkan 1.0 by default
Eric Engestrom [Fri, 23 Nov 2018 17:08:28 +0000 (17:08 +0000)]
anv: correctly use vulkan 1.0 by default

Per chapter 3.2 "Instances":
> Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing
> an apiVersion of 0 is equivalent to providing an apiVersion of
> VK_MAKE_VERSION(1,0,0).

Reported-by: Niklas Haas <git@haasn.xyz>
Fixes: 8c048af5890d43578ca4 "anv: Copy the appliation info into the instance"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 56d126f8fd210dbd2c946bfbc2e3c81b04d27d09)

5 years agomesa/main: fix incorrect depth-error
Erik Faye-Lund [Thu, 22 Nov 2018 10:10:50 +0000 (11:10 +0100)]
mesa/main: fix incorrect depth-error

If glGetTexImage or glGetnTexImage is called with a level that doesn't
exist, we get an error message on this form:

Mesa: User error: GL_INVALID_VALUE in glGetTexImage(depth = 0)

This is clearly nonsensical, because these APIs don't even have a
depth-parameter. The reason is that get_texture_image_dims() return
all-zero dimensions for non-existent texture-images, and we go on to
validate these dimensions as if they were user-input, because
glGetTextureSubImage requires checking.

So let's split this logic in two, so glGetTextureSubImage can have
stricter input-validation. All arguments that are no longer validated
are generated internally by mesa, so there's no use in validating them.

Fixes: 42891dbaa12 "gettextsubimage: verify zoffset and depth are correct"
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit c120dbfe4d18240315ecec9b43a61aeb9ab239ac)

5 years agomesa/main: check cube-completeness in common code
Erik Faye-Lund [Thu, 22 Nov 2018 16:40:47 +0000 (17:40 +0100)]
mesa/main: check cube-completeness in common code

This check is the only part of dimensions_error_check that isn't about
error-checking the offset and size arguments of
glGet[Compressed]TextureSubImage(), so it doesn't really belong in here.

This doesn't make a difference right now, apart for changing the
presedence of this error. But it will make a difference  for the next
patch, where we no longer call this method from the non-sub tex-image
getters.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 38af69adfaf47019926bfe3a8cf352752068d389)

5 years agomesa/main: factor out common error-checking
Erik Faye-Lund [Thu, 22 Nov 2018 11:37:33 +0000 (12:37 +0100)]
mesa/main: factor out common error-checking

This error checking is the same for teximage and texsubimage getters, so
let's factor it out to its own function.

This will be useful when getteximage and gettexsubimage gets their own
error checking routines a bit later.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 42820c572750c30ae86175ae58bb70439dc2e644)

5 years agomesa/main: factor out tex-image error-checking
Erik Faye-Lund [Thu, 22 Nov 2018 11:17:32 +0000 (12:17 +0100)]
mesa/main: factor out tex-image error-checking

This will be useful when we split error-checking for getteximage and
gettexsubimage later.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 5e0a84f31cac14f1ccc5c74ce2e7cd997f267752)

5 years agomesa/main: remove bogus error for zero-sized images
Erik Faye-Lund [Thu, 22 Nov 2018 14:17:13 +0000 (15:17 +0100)]
mesa/main: remove bogus error for zero-sized images

The explanation quotes the spec on the following wording to justify the
error:

"An INVALID_VALUE error is generated if xoffset + width is greater than
 the texture’s width, yoffset + height is greater than the  texture’s
 height, or zoffset + depth is greater than the texture’s depth."

However, this shouldn't generate an error in the case where *all three*
of width, xoffset and the texture's width are zero. In this case, we end
up generating an unspecified error.

So let's remove this check, and instead make sure that we consider this
as an empty texture.

So let's not generate an error, there's non mandated in the spec in
xoffset/yoffset/zoffset = 0 case. We already avoid doing any work in
this case, because of the final, non-error generating check in this
function.

Fixes: b37b35a5d26 "getteximage: assume texture image is empty for non defined levels"
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 38bbb61252aa503571986080afddd98a56bcf2e7)

5 years agoglsl: free or reuse memory allocated for TF varying
Gert Wollny [Fri, 16 Nov 2018 18:12:46 +0000 (19:12 +0100)]
glsl: free or reuse memory allocated for TF varying

When a shader program is de-serialized the gl_shader_program passed in
may actually still hold memory allocations for the transform feedback
varyings. If that is the case, free the varying names and reallocate
the new storage for the names array.

This fixes a memory leak:
Direct leak of 48 byte(s) in 6 object(s) allocated from:
 in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
 in transform_feedback_varyings ../../samba/mesa/src/mesa/main/transformfeedback.c:875
 in _mesa_TransformFeedbackVaryings ../../samba/mesa/src/mesa/main/transformfeedback.c:985
 ...
Indirect leak of 42 byte(s) in 6 object(s) allocated from:
  in __interceptor_strdup (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0x761c8)
  in transform_feedback_varyings ../../samba/mesa/src/mesa/main/transformfeedback.c:887
  in _mesa_TransformFeedbackVaryings ../../samba/mesa/src/mesa/main/transformfeedback.c:985

Fixes: ab2643e4b06f63c93a57624003679903442634a8
   glsl: serialize data from glTransformFeedbackVaryings

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit f5d053702fa976a3112d9c6a2425430365db40f8)

5 years agoradv: Fix opaque metadata descriptor last layer.
Bas Nieuwenhuizen [Sat, 24 Nov 2018 19:52:20 +0000 (20:52 +0100)]
radv: Fix opaque metadata descriptor last layer.

We used the layer count which results in an off by one error.

Not sure this really affects anything.

Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 3c96a1e3a97ba89dad803e7be8f9e3d4f6516fa3)

5 years agowinsys/amdgpu: fix a device handle leak in amdgpu_winsys_create
Marek Olšák [Mon, 19 Nov 2018 23:17:40 +0000 (18:17 -0500)]
winsys/amdgpu: fix a device handle leak in amdgpu_winsys_create

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit d4e7d8b7f053db081a4ffdb59dc53f3531b0e60b)

5 years agowinsys/amdgpu: fix a buffer leak in amdgpu_bo_from_handle
Marek Olšák [Mon, 19 Nov 2018 23:12:12 +0000 (18:12 -0500)]
winsys/amdgpu: fix a buffer leak in amdgpu_bo_from_handle

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 82aa07f81fcc5ed696eea16f48cec7e39c3cd3d1)

5 years agoglapi: add missing visibility args
Eric Engestrom [Thu, 22 Nov 2018 13:33:28 +0000 (13:33 +0000)]
glapi: add missing visibility args

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108829
Fixes: 3218056e0eb375eeda470 "meson: Build i965 and dri stack"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 896c59d690e38e92682f9bc509b5e3658aba5670)

5 years agoanv: Put robust buffer access in the pipeline hash
Jason Ekstrand [Wed, 21 Nov 2018 23:15:37 +0000 (17:15 -0600)]
anv: Put robust buffer access in the pipeline hash

It affects apply_pipeline_layout.  Shaders compiled with the wrong value
will work but they may not be robust as requested by the app.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 617e402b3d1be185f200b1667540096d9a8b2aec)

5 years agoUpdate version to 18.3.0-rc4
Emil Velikov [Thu, 22 Nov 2018 12:58:48 +0000 (12:58 +0000)]
Update version to 18.3.0-rc4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agor600: clean up the GS ring buffers when the context is destroyed
Gert Wollny [Fri, 16 Nov 2018 11:48:08 +0000 (12:48 +0100)]
r600: clean up the GS ring buffers when the context is destroyed

This fixes two memory leaks reported by ASAN:

Direct leak of 248 byte(s) in 1 object(s) allocated from:
   in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
   in r600_alloc_buffer_struct ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:578
   in r600_buffer_create ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:600
   in r600_resource_create_common ../../samba/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1265
   in r600_resource_create ../../samba/mesa/src/gallium/drivers/r600/r600_pipe.c:725
   in pipe_buffer_create ../../samba/mesa/src/gallium/auxiliary/util/u_inlines.h:291
   in update_gs_block_state ../../samba/mesa/src/gallium/drivers/r600/r600_state_common.c:1482

Direct leak of 248 byte(s) in 1 object(s) allocated from:
   in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
   in r600_alloc_buffer_struct ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:578
   in r600_buffer_create ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:600
   in r600_resource_create_common ../../samba/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1265
   in r600_resource_create ../../samba/mesa/src/gallium/drivers/r600/r600_pipe.c:722
   in pipe_buffer_create ../../samba/mesa/src/gallium/auxiliary/util/u_inlines.h:291
   in update_gs_block_state ../../samba/mesa/src/gallium/drivers/r600/r600_state_common.c:1489

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Fixes: 1371d65a7fbd695d3516861fe733685569d890d0
  r600g: initial support for geometry shaders on evergreen (v2)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 61b535437e2ea1115d6915fbd62d9b8745071525)

5 years agoradeonsi: go back to using bottom-of-pipe for beginning of TIME_ELAPSED
Marek Olšák [Tue, 13 Nov 2018 21:19:42 +0000 (16:19 -0500)]
radeonsi: go back to using bottom-of-pipe for beginning of TIME_ELAPSED

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102597

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ea9f95e2a67eca90bb84eea24e7b4b804b3b1345)

5 years agoi965/batch: avoid reverting batch buffer if saved state is an empty
Andrii Simiklit [Mon, 5 Nov 2018 07:48:26 +0000 (09:48 +0200)]
i965/batch: avoid reverting batch buffer if saved state is an empty

There's no point reverting to the last saved point if that save point is
the empty batch, we will just repeat ourselves.

v2: Merge with new commits, changes was minimized, added the 'fixes' tag
v3: Added in to patch series
v4: Fixed the regression which was introduced by this patch
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630
Reported-by: Mark Janes <mark.a.janes@intel.com>
    The solution provided by: Jordan Justen <jordan.l.justen@intel.com>

CC: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring
                     the batchbuffer state."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107626
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630 (fixed in v4)
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b787dcf57b7298868ce9b6885a827d57a6127ba1)

5 years agotravis: adding missing x11-xcb for meson+vulkan
Emil Velikov [Fri, 7 Sep 2018 13:58:56 +0000 (14:58 +0100)]
travis: adding missing x11-xcb for meson+vulkan

Required by the x11 WSI

Fixes: df82012b2cb ("travis: add meson build for vulkan drivers.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 982e012b3ac924dab56b41c5407f722bd2a4c359)

5 years agoglx: make xf86vidmode mandatory for direct rendering
Emil Velikov [Fri, 16 Nov 2018 11:15:37 +0000 (11:15 +0000)]
glx: make xf86vidmode mandatory for direct rendering

Currently we detect the module and if missing, the glXGetMsc* API is
effectively a stub, always returning false.

This is what effectively has been happening with our meson build :-(

Thus users have no chance of using it - they cannot even distinguish
if the failure is due to a misconfigured build.

There's no reason for keeping xf86vidmode optional - it has been
available in all distributions for years.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: a47c525f3281a2753180e "meson: build glx"
(cherry picked from commit 5bc509363b6dbc42af72668fe500b6aec988dbf0)

5 years agotravis: drop unneeded x11proto-xf86vidmode-dev
Emil Velikov [Fri, 16 Nov 2018 11:10:57 +0000 (11:10 +0000)]
travis: drop unneeded x11proto-xf86vidmode-dev

The only place where the package is needed is for building the DRI
based libGL library.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 84445a86d192c0d7f07bc25a84080458de764149)

5 years agoradeonsi: fix an out-of-bounds read reported by ASAN
Nicolai Hähnle [Fri, 16 Nov 2018 16:20:26 +0000 (17:20 +0100)]
radeonsi: fix an out-of-bounds read reported by ASAN

We read 4 values out of sample_locs_8x, so make sure the array is
big enough.

Fixes: ac76aeef20 ("radeonsi: switch back to standard DX sample positions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 46a59ce0262a44d6520787741085a716c99200ed)

5 years agoegl/dri: fix error value with unknown drm format
Lionel Landwerlin [Tue, 13 Nov 2018 14:10:45 +0000 (14:10 +0000)]
egl/dri: fix error value with unknown drm format

According to the EGL_EXT_image_dma_buf_import spec, creating an EGL
image with a DRM format not supported should yield the BAD_MATCH
error :

"
       * If <target> is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
         attribute is set to a format not supported by the EGL, EGL_BAD_MATCH
         is generated.
"

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 20de7f9f226401 ("egl/dri2: support for creating images out of dma buffers")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit 1c56d211563300e8b837378962dd455d45d7956e)

5 years agoUpdate version to 18.3.0-rc3
Emil Velikov [Fri, 16 Nov 2018 11:58:55 +0000 (11:58 +0000)]
Update version to 18.3.0-rc3

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoRevert "radv: disable VK_SUBGROUP_FEATURE_VOTE_BIT"
Connor Abbott [Wed, 17 Oct 2018 14:57:01 +0000 (16:57 +0200)]
Revert "radv: disable VK_SUBGROUP_FEATURE_VOTE_BIT"

This reverts commit 647c2b90e96a9ab8571baf958a7c67c1e816911a. There was
one recently-introduced bug in ac for dvec3 loads, but the other test
failures were actually bugs in the tests. See
https://github.com/KhronosGroup/VK-GL-CTS/commit/9429e621c48848d224e35f30a1ae45a4a079922c

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit ba94a00c7ce1514372bfe9b35c8e0c7fb8cd710e)

5 years agovc4: Make sure we make ro scanout resources for create_with_modifiers.
Eric Anholt [Thu, 25 Oct 2018 16:12:50 +0000 (09:12 -0700)]
vc4: Make sure we make ro scanout resources for create_with_modifiers.

The DRI3 create_with_modifiers paths don't set tmpl.bind to SCANOUT or
SHARED, with the theory that given that you've got modifiers, that's all
you need.  However, we were looking at the tmpl.bind for setting up the
KMS handle in the renderonly case, so we'd end up trying to use vc4's
handle on the hx8357d fd.

Fixes: 84ed8b67c56b ("vc4: Set shareable BOs as T tiled if possible")
(cherry picked from commit cc0bc76a382f908b4412ee8ab7a8409766ecf16a)

5 years agoi965: Fix calculation of layers array length for isl_view
Danylo Piliaiev [Thu, 15 Nov 2018 10:03:31 +0000 (12:03 +0200)]
i965: Fix calculation of layers array length for isl_view

Handle all cases in calculation of layers count for isl_view
taking into account texture view and image unit.
st_convert_image was taken as a reference.

When u->Layered is true the whole level is taken with respect to
image view. In other case only one layer is taken.

v3: (Józef Kucia and Ilia Mirkin)
    - Rewrote patch by taking st_convert_image as a reference
    - Removed now unused get_image_num_layers function
    - Changed commit message

v4: (Jason Ekstrand)
    - Added assert

Fixes: 5a8c8903
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit f9fd0cf4790cb2a530e75d1a2206dbb9d8af7cb2)

5 years agonir/lower_alu_to_scalar: Don't try to lower unpack_32_2x16
Jason Ekstrand [Tue, 13 Nov 2018 19:24:34 +0000 (13:24 -0600)]
nir/lower_alu_to_scalar: Don't try to lower unpack_32_2x16

It messes up when trying to lower.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
(cherry picked from commit 4266932c0b301005dcc747fb6c2fef36a3af6ffe)

5 years agoegl: add missing glvnd entrypoint for EGL_ANDROID_blob_cache
Eric Engestrom [Wed, 14 Nov 2018 12:51:38 +0000 (12:51 +0000)]
egl: add missing glvnd entrypoint for EGL_ANDROID_blob_cache

Fixes dEQP-EGL.functional.get_proc_address.extension.egl_android_blob_cache
on builds with glvnd enabled.

Fixes: 6f5b57093b3462a54e9c7 "egl: add support for EGL_ANDROID_blob_cache"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit c9733649670243a1a6eb7ca2c376bd27960f8d8a)

Squashed with commit:

egl: fix bad rebase

I screwed up a rebase over a refactor and didn't notice locally because
the uncommitted refactor hid the issue.

Fixes: c9733649670243a1a6eb "egl: add missing glvnd entrypoint for EGL_ANDROID_blob_cache"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 2b2f790e594cde3aa0d4dcebafc9a072651cd62a)

5 years agoradeonsi: fix video APIs on Raven2
Marek Olšák [Tue, 13 Nov 2018 23:37:39 +0000 (18:37 -0500)]
radeonsi: fix video APIs on Raven2

This was missed when I added the new enum.

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Leo Liu <leo.liu@amd.com>
(cherry picked from commit 9367514524f70faad99c721bac92339c8ff8bad9)

5 years agobin/get-pick-list.sh: handle reverts prior to the branchpoint
Emil Velikov [Wed, 14 Nov 2018 18:49:54 +0000 (18:49 +0000)]
bin/get-pick-list.sh: handle reverts prior to the branchpoint

Currently we detect when a breaking commit:
 - has landed in stable, and
 - is referenced by a untagged fix in master

Yet we did not consider the case of breaking commit:
 - prior to the branchpoint, and
 - is referenced by a untagged fix in master

Addressing the latter is extremely slow, due to the size of the lookup.

That said, we can trivially use the existing is_sha_nomination() helper
to catch reverts.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit adbdfc6666052d604a97009d736b6dee957908a0)

5 years agobin/get-pick-list.sh: use test instead of [ ]
Emil Velikov [Thu, 8 Nov 2018 15:05:21 +0000 (15:05 +0000)]
bin/get-pick-list.sh: use test instead of [ ]

Latter is rather picky wrt surrounding white space. The explicit `test`
doesn't have that problem, plus the statements read a bit easier.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit c0012a07088e86f6d30405d0522a0d72801e2ec7)

5 years agobin/get-pick-list.sh: handle unofficial "broken by" tag
Emil Velikov [Thu, 8 Nov 2018 15:05:20 +0000 (15:05 +0000)]
bin/get-pick-list.sh: handle unofficial "broken by" tag

We have a number of cases were devs will use a tag "broken by".
While it's not something officially documented or recommended, checking
for it is trivial enough.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 77ff0bfb5f915bb841623ec181ee359a099f2c52)

5 years agobin/get-pick-list.sh: handle fixes tag with missing colon
Emil Velikov [Thu, 8 Nov 2018 15:05:19 +0000 (15:05 +0000)]
bin/get-pick-list.sh: handle fixes tag with missing colon

Every so often, we forget to add the colon after "fixes". Trivially
tweak the script to catch it.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 209525aafb8314f827838dedeb771b72c256a4d3)

5 years agobin/get-pick-list.sh: flesh out is_sha_nomination
Emil Velikov [Thu, 8 Nov 2018 15:05:18 +0000 (15:05 +0000)]
bin/get-pick-list.sh: flesh out is_sha_nomination

Refactor is_fixes_nomination into a is_sha_nomination helper. This way
we can reuse it for more than the usual "Fixes:" tag.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit b7418d1f3f102aeed8d3d38195f9b7d672216df0)

5 years agobin/get-pick-list.sh: tweak the commit sha matching pattern
Emil Velikov [Thu, 8 Nov 2018 15:05:17 +0000 (15:05 +0000)]
bin/get-pick-list.sh: tweak the commit sha matching pattern

Currently we match on:
 - any arbitrary length of,
 - any a-z A-Z and 0-9 characters

At the same time, a commit sha consists of lowercase hexadecimal
numbers. Any sha shorter than 8 characters is ambiguous - in some cases
even 11+ are required.

So change the pattern to a-f0-9 and adjust the length to 8-40.

As we're here we could use a single grep, instead of the grep/sed combo.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 533fead4236459c3f04700ff130ffaee1503cb69)

5 years agobin/get-pick-list.sh: handle the fixes tag
Emil Velikov [Thu, 8 Nov 2018 15:05:16 +0000 (15:05 +0000)]
bin/get-pick-list.sh: handle the fixes tag

Having a separate script to handle the fixes tag, brings a number of
issues, so let's fold it in get-pick-list.sh.

v2:
 - pass the sha as argument to the function
 - Keep original sed pattern

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 181203f3c5e9c6b3e95e0b93ad3b22630c3c0437)

5 years agobin/get-pick-list.sh: handle "typod" usecase.
Emil Velikov [Thu, 8 Nov 2018 15:05:15 +0000 (15:05 +0000)]
bin/get-pick-list.sh: handle "typod" usecase.

As the comment in get-typod-pick-list.sh says, there's little point in
having a duplicate file.

Add the new pattern + tag to get-pick-list.sh and nuke this file.

v2:
 - pass the sha as argument to the function
 - grep -q instead of using a variable (Eric)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit e6b3a3b2014413366110f6deeced8095e7262b1d)

5 years agobin/get-pick-list.sh: prefix output with "[stable] "
Emil Velikov [Thu, 8 Nov 2018 15:05:14 +0000 (15:05 +0000)]
bin/get-pick-list.sh: prefix output with "[stable] "

With later commits we'll fold all the different scripts into one.
Add the explicit prefix, so that we know the origin of the nomination

v2:
 - pass the sha as argument to the function
 - swap $tag = none for an else statment (Juan)
 - grep -q instead of using a variable (Eric)
 - print the tag and commit oneline separately (Eric)

v3:
 - drop unused "tag=none" assignment (Juan)
 - typo nomination

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v2)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit fac10169bbad2da918ef07a62c01e0b321508cfe)

5 years agobin/get-pick-list.sh: simplify git oneline printing
Emil Velikov [Thu, 8 Nov 2018 15:05:13 +0000 (15:05 +0000)]
bin/get-pick-list.sh: simplify git oneline printing

Currently we force disable the pager via "|cat" where --no-pager
exists. Additionally we could use git show instead of git log -n1.

Use those for a slightly more understandable code.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 559c32d2412b2ea602bb59aa61da75403d01a872)

5 years agonir/spirv: cast shift operand to u32
Karol Herbst [Thu, 26 Apr 2018 14:54:26 +0000 (16:54 +0200)]
nir/spirv: cast shift operand to u32

v2: fix for specialization constants as well

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Karol Herbst <kherbst@redhat.com>
(cherry picked from commit b4380cb070c0865f1fbfb3720056545665759bc3)

5 years agomeson: fix wayland-less builds
Eric Engestrom [Thu, 11 Oct 2018 15:00:04 +0000 (16:00 +0100)]
meson: fix wayland-less builds

Those empty variables in the !wayland case are useless and running that
meson.build with them breaks the build:

  [287/850] Generating wayland-drm-client-protocol.h with a custom command.
  FAILED: src/egl/wayland/wayland-drm/wayland-drm-client-protocol.h
  client-header ../src/egl/wayland/wayland-drm/wayland-drm.xml src/egl/wayland/wayland-drm/wayland-drm-client-protocol.h
  /bin/sh: client-header: command not found
  ninja: build stopped: subcommand failed.

Fixes: d1992255bb29054fa5176 "meson: Add build Intel "anv" vulkan driver"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 4fa2fb35245448f8b5d81fb5b37afec4f343f18a)

5 years agogbm: remove unnecessary meson include
Eric Engestrom [Thu, 11 Oct 2018 15:27:07 +0000 (16:27 +0100)]
gbm: remove unnecessary meson include

`inc_wayland_drm` is only used if wayland is built, and it's already
added in that case a few lines below.

Fixes: a29869e8720b385d3692f "gbm: Don't traverse backwards for includes"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 7df80de6e645ba8c20d97f5f2b1f6c12aa962e29)

5 years agomeson: only run vulkan's meson.build when building vulkan
Eric Engestrom [Thu, 11 Oct 2018 15:21:14 +0000 (16:21 +0100)]
meson: only run vulkan's meson.build when building vulkan

Fixes: d1992255bb29054fa5176 "meson: Add build Intel "anv" vulkan driver"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 3832db275efdb235b3b7b27c9b41e64d5507aa2c)

5 years agomesa: Reference count shaders that are used by transform feedback objects
Gert Wollny [Mon, 12 Nov 2018 11:34:26 +0000 (12:34 +0100)]
mesa: Reference count shaders that are used by transform feedback objects

Transform feedback objects may hold a pointer to a shader program, and
at least in Gallium, this must be a valid pointer until
ctx->Driver.EndTransformFeedback in glEndTransformFeedback has been called
- which is conform with the spec that any program that is part of a
current rendering state should only be flagged for deletion by glDeleteProgram.
This was not handled properly for the transform feedback objects so that
a call sequence

  glUseProgram(x)
  glBeginTransformFreedback(...)
  glPauseTransformFeedback(...)
  glDeleteProgram(x)
  glEndTransformFeedback(...)

would result in a use after free bug. With this patch the transform
feedback object also updates the reference count to the used program
thereby keeping the program valid as long as the transform feedback
objects links to it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108713
Fixes: 654587696b4234d09a6b471b70e9629cf2887c27
       mesa: add end_transform_feedback() helper

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit caa964b422152788a95a1b248c884df8918a2bbd)

5 years agoradv: binding streamout buffers doesn't change context regs
Samuel Pitoiset [Mon, 12 Nov 2018 10:37:20 +0000 (11:37 +0100)]
radv: binding streamout buffers doesn't change context regs

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit b5f213bb1dcde22949dffe9d3a431fecd5d0f33b)

5 years agoutil/ralloc: Make sizeof(linear_header) a multiple of 8
Matt Turner [Sun, 11 Nov 2018 21:44:41 +0000 (13:44 -0800)]
util/ralloc: Make sizeof(linear_header) a multiple of 8

Prior to this patch sizeof(linear_header) was 20 bytes in a
non-debug build on 32-bit platforms. We do some pointer arithmetic to
calculate the next available location with

   ptr = (linear_size_chunk *)((char *)&latest[1] + latest->offset);

in linear_alloc_child(). The &latest[1] adds 20 bytes, so an allocation
would only be 4-byte aligned.

On 32-bit SPARC a 'sttw' instruction (which stores a consecutive pair of
4-byte registers to memory) requires an 8-byte aligned address. Such an
instruction is used to store to an 8-byte integer type, like intmax_t
which is used in glcpp's expression_value_t struct.

As a result of the 4-byte alignment returned by linear_alloc_child() we
would generate a SIGBUS (unaligned exception) on SPARC.

According to the GNU libc manual malloc() always returns memory that has
at least an alignment of 8-bytes [1]. I think our allocator should do
the same.

So, simple fix with two parts:

   (1) Increase SUBALLOC_ALIGNMENT to 8 unconditionally.
   (2) Mark linear_header with an aligned attribute, which will cause
       its sizeof to be rounded up to that alignment. (We already do
       this for ralloc_header)

With this done, all Mesa's unit tests now pass on SPARC.

[1] https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html

Fixes: 47e17586924f ("glcpp: use the linear allocator for most objects")
Bug: https://bugs.gentoo.org/636326
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit efb1ccadca89b1b3f39fb52b7b83154dff764a15)

Conflicts:
src/util/ralloc.c

5 years agomeson: fix libatomic tests
Dylan Baker [Fri, 9 Nov 2018 20:56:00 +0000 (12:56 -0800)]
meson: fix libatomic tests

There are two problems:
1) the extra underscore in MISSING_64BIT_ATOMICS
2) we should link with libatomic if the previous test decided we needed
   it

Fixes: d1992255bb29054fa51763376d125183a9f602f3
       ("meson: Add build Intel "anv" vulkan driver")
Reviewed-and-Tested-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 4eab98b66e7dc495f26ac3b0e356e405c0796b74)

5 years agost/mesa: disable L3 thread pinning
Marek Olšák [Mon, 12 Nov 2018 20:43:58 +0000 (15:43 -0500)]
st/mesa: disable L3 thread pinning

This implementation can have massive drawbacks.

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
(cherry picked from commit e0c7114eb3c19d4c2653f661698a6baa3bc9bedf)

5 years agomeson: Don't set -Wall
Dylan Baker [Fri, 9 Nov 2018 21:27:56 +0000 (13:27 -0800)]
meson: Don't set -Wall

meson does this for you with its warn levels, so we don't need to set
it ourselves.

Fixes: d1992255bb29054fa51763376d125183a9f602f3
       ("meson: Add build Intel "anv" vulkan driver")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 9c2a95b29868f1388408b5eb9193fff39f942217)

5 years agonir: don't pack varyings ints with floats unless flat
Timothy Arceri [Mon, 12 Nov 2018 02:25:27 +0000 (13:25 +1100)]
nir: don't pack varyings ints with floats unless flat

Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit a068958692cc662203f04e488356005533568a56)

5 years agonir: add glsl_type_is_integer() helper
Timothy Arceri [Mon, 12 Nov 2018 02:24:42 +0000 (13:24 +1100)]
nir: add glsl_type_is_integer() helper

Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 9dd737bb02923d26d4d947ebf265b05f13dd2c0c)

5 years agost/nine: fix stack corruption due to ABI mismatch
Andre Heider [Tue, 6 Nov 2018 08:27:12 +0000 (09:27 +0100)]
st/nine: fix stack corruption due to ABI mismatch

This fixes various crashes and hangs when using nine's 'thread_submit'
feature.

On 64bit, the thread function's data argument would just be NULL.
On 32bit, the data argument would be garbage depending on the compiler
flags (in my case -march>=core2).

Fixes: f3fa7e3068512d ("st/nine: Use WINE thread for threadpool")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
(cherry picked from commit 10598c9667a9c5ea04ac8279549b1df8c026ef51)

5 years agoradv: only expose VK_SUBGROUP_FEATURE_ARITHMETIC_BIT for VI+
Samuel Pitoiset [Wed, 7 Nov 2018 16:06:27 +0000 (17:06 +0100)]
radv: only expose VK_SUBGROUP_FEATURE_ARITHMETIC_BIT for VI+

Inclusive and exclusives scan are missing because older chips
don't have llvm.amdgcn.update.dpp.

This fixes crashes with dEQP-VK.subgroups.arithmetic.*.

CC: mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0dcd99c6870aae5b15c8709a8afcc942d116c976)

5 years agoRevert "i965/batch: avoid reverting batch buffer if saved state is an empty"
Mark Janes [Thu, 1 Nov 2018 22:44:45 +0000 (15:44 -0700)]
Revert "i965/batch: avoid reverting batch buffer if saved state is an empty"

This reverts commit a9031bf9b55602d93cccef6c926e2179c23205b4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630
(cherry picked from commit 5f312e95f8775e050ef9f8218be0eed6da1ee21d)

5 years agoUpdate version to 18.3.0-rc2
Emil Velikov [Fri, 9 Nov 2018 11:00:00 +0000 (11:00 +0000)]
Update version to 18.3.0-rc2

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agovirgl/vtest-winsys: Use virgl version of bind flags
Gert Wollny [Thu, 1 Nov 2018 09:49:58 +0000 (10:49 +0100)]
virgl/vtest-winsys: Use virgl version of bind flags

The bind flags defined by mesa/gallium might not always be in sync
with the ones copied to virglrenderer/gallium. Therefore, use the
flags defined in virgl like it is done for all the other calls to
create resources.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b710680093a29d4f7dcde2e5a3ee61bba80404ca)

5 years agoglsl: do not allow implicit casts of unsized array initializers
Erik Faye-Lund [Thu, 25 Oct 2018 19:33:52 +0000 (21:33 +0200)]
glsl: do not allow implicit casts of unsized array initializers

The GLSL 4.6 specification (section 4.1.14. "Implicit Conversions")
says:

  "There are no implicit array or structure conversions. For
   example, an array of int cannot be implicitly converted to an
   array of float."

So let's add a check in place when assigning array initializers to
implicitly sized arrays, to avoid incorrectly allowing code on the
form:

int[] foo = float[](1.0, 2.0, 3.0)

This fixes the following dEQP test-cases:
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_fragment

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 742dace8251b764775ee049cf529715f90afecc1)

5 years agoautotools: library-dependency when no sse and 32-bit
Sergii Romantsov [Thu, 1 Nov 2018 11:02:43 +0000 (13:02 +0200)]
autotools: library-dependency when no sse and 32-bit

Building of 32bit Mesa may fail if __SSE__ is not specified.
Added missed dependency from libm.

v2: avoided dependecy on any flag, just link

v3: meson doesn't fail, but have added dependency on libm

CC: Dylan Baker <dylan@pnwbakers.com>
CC: Lionel G Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit ce837a537282f10bc48c4ac426fa9a31241beea2)

5 years agoradv: disable conditional rendering for vkCmdCopyQueryPoolResults()
Samuel Pitoiset [Mon, 5 Nov 2018 08:54:28 +0000 (09:54 +0100)]
radv: disable conditional rendering for vkCmdCopyQueryPoolResults()

VK_EXT_conditional_rendering says that copy commands should not be
affected by conditional rendering.

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0a0aa2ba6c37085948cc7efe11695ebe4fdf12fe)

Conflicts:
src/amd/vulkan/radv_query.c

5 years agoac/nir_to_llvm: fix b2f for f64
Timothy Arceri [Fri, 2 Nov 2018 02:33:52 +0000 (13:33 +1100)]
ac/nir_to_llvm: fix b2f for f64

Fixes: d7e0d47b9de3 ("nir: Add a bunch of b2[if] optimizations")

Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9aa3c1915ea039a0301849f2ac78fbe579972864)

5 years agodocs: document the staging branch and add reference to it
Emil Velikov [Wed, 7 Nov 2018 15:59:07 +0000 (15:59 +0000)]
docs: document the staging branch and add reference to it

A while back we agreed that having a live/staging branch is beneficial.
Sadly we forgot to document that, so here is my first attempt.

Document the caveat that the branch history is not stable.

CC: Andres Gomez <agomez@igalia.com>
CC: Dylan Baker <dylan@pnwbakers.com>
CC: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 0a60708870e256432bdef1a22c98b09f83d8a440)

5 years agoanv/android: mark gralloc allocated BOs as external
Lionel Landwerlin [Tue, 6 Nov 2018 11:37:51 +0000 (11:37 +0000)]
anv/android: mark gralloc allocated BOs as external

Allocating through Gralloc implies buffers are going to be used
outside the driver. We have special MOCS settings for external BOs and
we probably want to use them here too.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a1220e73116bad7 ("anv/android: Set the BO flags in bo_cache_import (v2)")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 421fa01d64d9f2a7191ded3a819118d216436ab8)

5 years agowayland/egl: Resize EGL surface on update buffer for swrast
Olivier Fourdan [Thu, 25 Oct 2018 12:48:15 +0000 (14:48 +0200)]
wayland/egl: Resize EGL surface on update buffer for swrast

After commit a9fb331ea ("wayland/egl: update surface size on window
resize"), the surface size is updated as soon as the resize is done, and
`update_buffers()` would resize only if the surface size differs from
the attached size.

However, in the case of swrast, there is no resize callback and the
attached size is updated in `dri2_wl_swrast_commit_backbuffer()` prior
to the `swrast_update_buffers()` so the attached size is always up to
date when it reaches `swrast_update_buffers()` and the surface is never
resized.

This can be observed with "totem" using the GDK backend on Wayland (the
default) when running on software rendering:

  $ LIBGL_ALWAYS_SOFTWARE=true CLUTTER_BACKEND=gdk totem

Resizing the window would leave the EGL surface size unchanged.

To avoid the issue, partially revert the part of commit a9fb331ea for
`swrast_update_buffers()` and resize on the win size and not the
attached size.

Fixes: a9fb331ea - wayland/egl: update surface size on window resize
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
CC: Daniel Stone <daniel@fooishbar.org>
CC: Juan A. Suarez Romero <jasuarez@igalia.com>
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 55af17ffed289bdcc1396829e461245644175ed4)

5 years agointel/decoders: fix instruction base address parsing
Lionel Landwerlin [Mon, 5 Nov 2018 20:42:40 +0000 (20:42 +0000)]
intel/decoders: fix instruction base address parsing

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 00103db04ab879 ("intel: Fix decoding for partial STATE_BASE_ADDRESS updates.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b47a69ed4c907df5917de10cbe5ef12e2d900bce)

5 years agost/va: fix incorrect use of resource_destroy
Marek Olšák [Sat, 3 Nov 2018 00:56:42 +0000 (20:56 -0400)]
st/va: fix incorrect use of resource_destroy

Fixes: 4373dd32154 ("st/va: Support YUV formats in vaCreateSurfaces")
Cc: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 04298a2f24455541f28ccffd2f0f73b831833d57)

5 years agowsi/wayland: only finish() a successfully init()ed display
Eric Engestrom [Mon, 5 Nov 2018 09:57:09 +0000 (09:57 +0000)]
wsi/wayland: only finish() a successfully init()ed display

Fixes: 43691024982b3ea734ad0 "vulkan/wsi/wayland: Stop caching Wayland displays"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry picked from commit d515ded4d951b830b560c352d64918a89027bee5)

5 years agowsi/wayland: use proper VkResult type
Eric Engestrom [Mon, 5 Nov 2018 09:55:02 +0000 (09:55 +0000)]
wsi/wayland: use proper VkResult type

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit dcee22afed935a434118935bcdad5c4fc7246077)

5 years agoradv: add missing TFB queries support to CmdCopyQueryPoolsResults()
Samuel Pitoiset [Wed, 31 Oct 2018 10:43:34 +0000 (11:43 +0100)]
radv: add missing TFB queries support to CmdCopyQueryPoolsResults()

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Fixes: b4eb029062a ("radv: implement VK_EXT_transform_feedback")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b1b2dd06a7b777e862b525302b15bcaf407d3648)

5 years agor600/sb: Fix constant logical operand in assert.
Vinson Lee [Wed, 31 Oct 2018 22:35:23 +0000 (15:35 -0700)]
r600/sb: Fix constant logical operand in assert.

Fixes: da977ad90747 ("r600/sb: start adding GDS support")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
(cherry picked from commit 64a9ed8848ed5c2c909b59e0e4b600b2b01bba28)

5 years agoandroid: radv: add libmesa_git_sha1 static dependency
Mauro Rossi [Tue, 30 Oct 2018 21:35:43 +0000 (22:35 +0100)]
android: radv: add libmesa_git_sha1 static dependency

libmesa_git_sha1 whole static dependency is added to get git_sha1.h header
and avoid following building error:

external/mesa/src/amd/vulkan/radv_device.c:46:10:
fatal error: 'git_sha1.h' file not found
         ^
1 error generated.

Fixes: 9d40ec2cf6 ("radv: Add support for VK_KHR_driver_properties.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 5c0cff868a48202df1ddb30d1dca848101063cb6)

5 years agomeson: link gallium nine with pthreads
Dylan Baker [Thu, 1 Nov 2018 21:12:57 +0000 (14:12 -0700)]
meson: link gallium nine with pthreads

In some cases (not building with llvm, which automatically pulls in
pthreads) nine needs to be directly linked with pthreads. Fixes building
on x86 (32 bit) without llvm.

Distro bug: https://bugs.gentoo.org/670094
Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
       ("meson: build gallium nine state_tracker")
Tested-by: Rafal Lalik <rafallalik@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 7652931d33b36c93b2e84713baa8c283d568402e)

5 years agonir: fix condition propagation when src has a swizzle
Timothy Arceri [Fri, 2 Nov 2018 11:10:36 +0000 (22:10 +1100)]
nir: fix condition propagation when src has a swizzle

We cannot use nir_build_alu() to create the new alu as it has no
way to know how many components of the src we will use. This
results in it guessing the max number of components from one of
its inputs.

Fixes the following CTS tests:

dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_frag
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_geom
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_tessc
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_vert

Fixes: 2975422ceb6c ("nir: propagates if condition evaluation down some alu chains")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 769ae9fb7f8cea1d4a03e31f7f4a1c988e424c03)

5 years agonir: allow propagation of if evaluation for bcsel
Timothy Arceri [Thu, 1 Nov 2018 21:53:16 +0000 (08:53 +1100)]
nir: allow propagation of if evaluation for bcsel

Shader-db results Skylake:

total instructions in shared programs: 13109035 -> 13109024 (<.01%)
instructions in affected programs: 4777 -> 4766 (-0.23%)
helped: 11
HURT: 0

total cycles in shared programs: 332090418 -> 332090443 (<.01%)
cycles in affected programs: 19474 -> 19499 (0.13%)
helped: 6
HURT: 4

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit c7bdda8aa5f1fb1d797512a0a54a032153755c6c)

5 years agoandroid: gallium/auxiliary: add include to get u_debug.h header
Mauro Rossi [Wed, 31 Oct 2018 14:53:21 +0000 (15:53 +0100)]
android: gallium/auxiliary: add include to get u_debug.h header

To avoid build error in u_debug_stack_android.cpp
due to now missing u_debug.h header:

external/mesa/src/gallium/auxiliary/util/u_debug_stack_android.cpp:26:10:
fatal error: 'u_debug.h' file not found
#include "u_debug.h"
         ^
1 error generated.

Fixes: 37db383abb ("util: Move u_debug to utils")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit b9dec214f5151f3ad87eb2faf982c57e5323f534)

5 years agoradv: fix begin/end transform feedback with 0 counter buffers.
Dave Airlie [Wed, 31 Oct 2018 23:55:29 +0000 (23:55 +0000)]
radv: fix begin/end transform feedback with 0 counter buffers.

If the user gives 0 counterBuffers then the driver should still
enable transform feedback on all targets. This changes the
driver to always enable xfb, and use counter buffers where
one is defined for the target in question.

Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 677b496b6bd07cbe05dd429344ba525619cdd08c)

5 years agoradv: apply xfb buffer offset at buffer binding time not later. (v2)
Dave Airlie [Wed, 31 Oct 2018 23:38:20 +0000 (23:38 +0000)]
radv: apply xfb buffer offset at buffer binding time not later. (v2)

In order to handle pause/resume properly, the offset should
be added to the buffer binding not to the begin/end paths.

v2: don't add offset to size
Fixes ext_transform_feedback-alignment* under zink

Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 7f37a52a21a15fc28b2c452fff54dd871d5dfe53)

5 years agoUpdate version to 18.3.0-rc1
Emil Velikov [Tue, 6 Nov 2018 15:30:57 +0000 (15:30 +0000)]
Update version to 18.3.0-rc1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoegl/glvnd: correctly report errors when vendor cannot be found
Emil Velikov [Fri, 2 Nov 2018 18:34:19 +0000 (18:34 +0000)]
egl/glvnd: correctly report errors when vendor cannot be found

If the user provides an invalid display or device the ToVendor lookup
will fail.

In this case, the local [Mesa vendor] error code will be set. Thus on
sequential eglGetError(), the error will be EGL_SUCCESS.

To be more specific, GLVND remembers the last vendor and calls back
into it's eglGetError, although there's no guarantee to ever have had
one.

v2:
 - Add _eglError call, so the debug callback is executed (Kyle)
 - Drop XXX comment.

Piglit: tests/egl/spec/egl_ext_device_query
Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Cc: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kyle Brenneman <kbrenneman@nvidia.com>
(cherry picked from commit b3ade6538798ad9bf397d8b386eab3dd8af57f3d)

5 years agoegl: add EGL_EXT_device_base entrypoints
Emil Velikov [Fri, 2 Nov 2018 18:50:48 +0000 (18:50 +0000)]
egl: add EGL_EXT_device_base entrypoints

eglQueryDevicesEXT (unlike the other three functions) does not depend
on the display. It is implemented in GLVND, which calls into each
driver collecting the list of devices and presenting it to the user.

For the other entrypoints, GLVND acts as pass through stub calling into
the vendor library. The vendor implementation calls back into GLVND to
get the vendor dispatch. Then the driver proceeds to call itself via
the said dispatch.

This design makes is possible to keep using "old" GLVND with newer
vendor drivers. Since effectively all the extension code is within the
latter itself.

Without said entrypoints, any user will outright crash - as reported in
the bug report.

Note: there's a follow-up fix needed to our GLVND code, to make piglit
happy.

v2: add some beefy documentation in the commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108635
Fixes: 7552fcb7b9b ("egl: add base EGL_EXT_device_base implementation")
Reported-by: kyle.devir@mykolab.com
Cc: kyle.devir@mykolab.com
Acked-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 2a8fefdeb0f4e259cc01e32dae40bc2f3063f5e0)

5 years agomeson: don't install translation files
Dylan Baker [Thu, 1 Nov 2018 16:02:39 +0000 (09:02 -0700)]
meson: don't install translation files

Tested-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 7834926a4f5ca0a60ec3d18c87a1e0a68b615820
       ("meson: add support for generating translation mo files")