platform/upstream/mesa.git
3 years agoaco: allow 64-bit literals if they can be sign/zero-extended from 32-bit
Rhys Perry [Mon, 30 Nov 2020 14:46:54 +0000 (14:46 +0000)]
aco: allow 64-bit literals if they can be sign/zero-extended from 32-bit

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798>

3 years agoaco: remove sign-extension in constantValue64()
Rhys Perry [Thu, 3 Dec 2020 11:05:16 +0000 (11:05 +0000)]
aco: remove sign-extension in constantValue64()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798>

3 years agoaco: test self-intersecting copies when src=higher
Rhys Perry [Fri, 4 Dec 2020 10:26:06 +0000 (10:26 +0000)]
aco: test self-intersecting copies when src=higher

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798>

3 years agoaco: don't assume src=lower when splitting self-intersecting copies
Rhys Perry [Thu, 3 Dec 2020 19:55:10 +0000 (19:55 +0000)]
aco: don't assume src=lower when splitting self-intersecting copies

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 09c584caeb2 ("aco: split self-intersecting copies instead of swapping")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798>

3 years agopanfrost: Update the resource layout before calling util_copy_rect()
Boris Brezillon [Sat, 28 Nov 2020 10:22:57 +0000 (11:22 +0100)]
panfrost: Update the resource layout before calling util_copy_rect()

If we don't do that, the line_stride might be wrong. We also need
to create a new BO if the previous one is too small to hold the
linear version, which can happen with the tile alignment done on
linear+renderable resources.

Suggested-by: Icecream95
Fixes: d4f662a25227 ("panfrost: Update the resource layout when doing a tile -> linear conversion")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7821>

3 years agoiris: store copy of the border color in the border color hash table
Marcin Ślusarz [Wed, 2 Dec 2020 13:40:02 +0000 (14:40 +0100)]
iris: store copy of the border color in the border color hash table

Color can be allocated on the stack since 809a81ec3a0.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3909
Fixes: 809a81ec3a0 ("iris: Properly support alpha and luminance-alpha formats")

Debugged-by: Filip Strömbäck
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7885>

3 years agoradv: reduce maxTransformFeedbackBufferDataSize to 512
Samuel Pitoiset [Thu, 3 Dec 2020 15:15:46 +0000 (16:15 +0100)]
radv: reduce maxTransformFeedbackBufferDataSize to 512

DRAW_OPAQUE_VERTEX_STRIDE only has 9 bits, so the register can
represent 511 bytes at most.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7900>

3 years agoutil: Add os_get_page_size support for macOS.
Vinson Lee [Fri, 4 Dec 2020 01:54:11 +0000 (17:54 -0800)]
util: Add os_get_page_size support for macOS.

Fix build error on macOS.

src/util/os_misc.c:352:2: error: unexpected platform in os_sysinfo.c
error unexpected platform in os_sysinfo.c
 ^

Fixes: ("cdf3a6a83b50 util: Add os_get_page_size query")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7911>

3 years agoradeon/vcn: support hevc SAO enc for VCN2+
Ruijing Dong [Mon, 14 Sep 2020 00:42:47 +0000 (20:42 -0400)]
radeon/vcn: support hevc SAO enc for VCN2+

Add support of sample adaptive offset (SAO) in HEVC encode for VCN2 and above.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6942>

3 years agoradeon/vcn: use cdw to calculate slice header index
Boyuan Zhang [Mon, 14 Sep 2020 00:04:28 +0000 (20:04 -0400)]
radeon/vcn: use cdw to calculate slice header index

Use DWORD count to calculate the number of DWORD filled in slice header template.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6942>

3 years agoradeon/vcn: add 0x02 to enc emulation prevention
Ruijing Dong [Sun, 13 Sep 2020 23:53:24 +0000 (19:53 -0400)]
radeon/vcn: add 0x02 to enc emulation prevention

Add 0x02 as a new case that triggers adding emulation prevention byte.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6942>

3 years agoamd/addrlib: Initialize Lib members in constructors.
Vinson Lee [Wed, 25 Nov 2020 03:20:01 +0000 (19:20 -0800)]
amd/addrlib: Initialize Lib members in constructors.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member m_maxBaseAlign is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_maxMetaBaseAlign is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7768>

3 years agomeson: Make the glvnd vendor name configurable
Adam Jackson [Wed, 18 Nov 2020 15:26:19 +0000 (10:26 -0500)]
meson: Make the glvnd vendor name configurable

Leave the default as "mesa", but this enables parallel Mesa installs.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7674>

3 years agoradv: Don't invalidate the SCACHE for image barriers.
Bas Nieuwenhuizen [Sat, 17 Oct 2020 23:52:52 +0000 (01:52 +0200)]
radv: Don't invalidate the SCACHE for image barriers.

Even ACO never uses the constant cache for images.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7875>

3 years agost/mesa: move cso_context next to the other pointers
Marek Olšák [Thu, 3 Dec 2020 16:12:23 +0000 (11:12 -0500)]
st/mesa: move cso_context next to the other pointers

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agost/mesa: put pipe_screen * into st_context and use it
Marek Olšák [Sun, 29 Nov 2020 08:27:37 +0000 (03:27 -0500)]
st/mesa: put pipe_screen * into st_context and use it

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agocso: inline struct cso_cache to remove dereferences
Marek Olšák [Sun, 29 Nov 2020 06:33:40 +0000 (01:33 -0500)]
cso: inline struct cso_cache to remove dereferences

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agogallium: inline struct u_suballocator to remove dereferences
Marek Olšák [Sun, 29 Nov 2020 06:16:25 +0000 (01:16 -0500)]
gallium: inline struct u_suballocator to remove dereferences

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agocso: remove unused code
Marek Olšák [Sun, 29 Nov 2020 06:39:01 +0000 (01:39 -0500)]
cso: remove unused code

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agovbo: remove gl_context dereferences when we can just subtract the pointer
Marek Olšák [Sun, 29 Nov 2020 07:22:06 +0000 (02:22 -0500)]
vbo: remove gl_context dereferences when we can just subtract the pointer

vbo_exec_context and vbo_save_context are inside gl_context.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>

3 years agofreedreno: Remove fd_log()
Rob Clark [Mon, 30 Nov 2020 21:05:49 +0000 (13:05 -0800)]
freedreno: Remove fd_log()

Now that it is superceeded by u_trace

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agofreedreno: Add trace-parser.py
Rob Clark [Mon, 30 Nov 2020 19:15:12 +0000 (11:15 -0800)]
freedreno: Add trace-parser.py

Similar to log-parser.py, but uses u_trace tracepoint log.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agofreedreno: Add GPU tracepoints
Rob Clark [Mon, 30 Nov 2020 16:38:18 +0000 (08:38 -0800)]
freedreno: Add GPU tracepoints

Add support for u_trace, and freedreno tracepoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agofreedreno: Don't emit log/trace points in gmem for nondraw
Rob Clark [Mon, 30 Nov 2020 16:35:44 +0000 (08:35 -0800)]
freedreno: Don't emit log/trace points in gmem for nondraw

For blit/compute non-draw batches, we are already emitting traces in the
draw cmdstream, which means we cannot also have traces in the GMEM ring
(as that breaks the FIFO ordering of traces)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agofreedreno: Remove unused fxn
Rob Clark [Mon, 30 Nov 2020 16:32:33 +0000 (08:32 -0800)]
freedreno: Remove unused fxn

Unused since aa2f6bd4f5688034bb716a50104c93c2881b29d9

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agofreedreno: Small log-parser.py cleanup
Rob Clark [Sun, 29 Nov 2020 19:27:20 +0000 (11:27 -0800)]
freedreno: Small log-parser.py cleanup

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agogallium/aux: Add GPU tracepoint mechanism
Rob Clark [Thu, 26 Nov 2020 19:14:22 +0000 (11:14 -0800)]
gallium/aux: Add GPU tracepoint mechanism

This adds a mechanism, loosely inspired by the linux kernel's tracepoint
mechanism, to declare and emit tracepoints.  A driver provided callback
is used to emit cmdstream to capture timestamps on the GPU, which are
used to later "render" the emitted tracepoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agoutil: Add helper to get FILE* options
Rob Clark [Tue, 1 Dec 2020 18:16:36 +0000 (10:16 -0800)]
util: Add helper to get FILE* options

Add a helper to get debug options that specify a file path, with
additional checking for suid to prevent unintended file access via
mesa's debug features.

Unlike other DEBUG_GET_ONCE_*, this returns a new file ptr each time
it is called (although it only does the lookup of the path once).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7818>

3 years agoasm: Try to fix sparc assembly for inverse matrix operations
Kenneth Graunke [Wed, 2 Dec 2020 22:38:07 +0000 (14:38 -0800)]
asm: Try to fix sparc assembly for inverse matrix operations

This is completely untested!

In commit 3175b63a0dfa290430f9f7eb651387788933a02b, Marek stopped
allocating the GLmatrix::inv field with malloc, instead embedding
it directly in the structure.  So, we need to drop a level of
indirection here and use (matrix pointer + MATRIX_INV) as the
inverse matrix array directly, rather than reading a pointer at
that offset and chasing it.

Fixes: 3175b63a0df ("mesa: don't allocate matrices with malloc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7889>

3 years agoasm: Fix x86 assembly for inverse matrix operations
Kenneth Graunke [Wed, 2 Dec 2020 22:38:07 +0000 (14:38 -0800)]
asm: Fix x86 assembly for inverse matrix operations

In commit 3175b63a0dfa290430f9f7eb651387788933a02b, Marek stopped
allocating the GLmatrix::inv field with malloc, instead embedding
it directly in the structure.  So, we need to drop a level of
indirection here and use (matrix pointer + MATRIX_INV) as the
inverse matrix array directly, rather than reading a pointer at
that offset and chasing it.

Fixes: 3175b63a0df ("mesa: don't allocate matrices with malloc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7889>

3 years agodocs: add release schedule for 20.3
Dylan Baker [Thu, 3 Dec 2020 18:30:04 +0000 (10:30 -0800)]
docs: add release schedule for 20.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: update calendar and link releases notes for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 18:28:25 +0000 (10:28 -0800)]
docs: update calendar and link releases notes for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: Add sha256 sums for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 18:22:55 +0000 (10:22 -0800)]
docs: Add sha256 sums for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: add release notes for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 17:49:56 +0000 (09:49 -0800)]
docs: add release notes for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agoturnip: implement z-scaling and z-mirroring BlitImage
Jonathan Marek [Thu, 26 Nov 2020 01:54:32 +0000 (20:54 -0500)]
turnip: implement z-scaling and z-mirroring BlitImage

Z scaling case without nearest filter needs a 3D texture, so add a 3D
texture path and use it to cover all scaling/mirroring cases.

The "rotation" argument for the clear/blit "setup" function is replaced
with a more generic "blit_param", which has a different meaning for the
3D blit path. (to avoid having too many arguments)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7781>

3 years agomeson.build: Order the flex/bison by odds of them working
Zack Rusin [Thu, 26 Nov 2020 16:50:06 +0000 (08:50 -0800)]
meson.build: Order the flex/bison by odds of them working

Some flex/bison installs on windows include yacc and lex
as bash scripts that call bison/flex binaries. That creates
an extra layer of dependencies because those won't work from
plain cmd.exe/powershell. Lets switch the lookup order so that
by default we pickup vanilla binaries instead of scripts.

Reviewd-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson.build: Disable zlib as per -Dzlib option
Neha Bhende [Thu, 26 Nov 2020 16:48:38 +0000 (08:48 -0800)]
meson.build: Disable zlib as per -Dzlib option

Disable use of zlib as per -Dzlib option.
Default value is true. To disable zlib usage, specify -Dzlib=false

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson.build: Use SSE math for MinGW X86 build as per sse2 option
Neha Bhende [Thu, 26 Nov 2020 16:47:10 +0000 (08:47 -0800)]
meson.build: Use SSE math for MinGW X86 build as per sse2 option

This patch adds missing compiler flags to build 32bit driver. It helps to build 32bit
using mingw successfully

Generated GL driver is tested using piglit, glretrace, conform and
some opengl apps

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson: Don't build svgadrm on windows
Neha Bhende [Thu, 26 Nov 2020 16:45:54 +0000 (08:45 -0800)]
meson: Don't build svgadrm on windows

Building svgadrm module on window platform is not required.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agogallium/targets/libgl-gdi: prefer d3d12 driver
Erik Faye-Lund [Sun, 26 May 2019 08:43:57 +0000 (10:43 +0200)]
gallium/targets/libgl-gdi: prefer d3d12 driver

Unlike the other drivers, the D3D12 driver is hardware accelerated, so
it's going to be a more reasonable choice. So let's prefer it.

This only matters for people who build with the D3D12 driver. And they
can set the GALLIUM_DRIVER environment variable as appropriate to
override it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7534>

3 years agolavapipe: set some basic usage-flags
Erik Faye-Lund [Wed, 2 Dec 2020 16:18:21 +0000 (17:18 +0100)]
lavapipe: set some basic usage-flags

Setting these avoids a few warnings while running glxgears on Zink on
Lavapipe. There's a lot more flags to set here, but this is better than
nothing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7879>

3 years agonir/opt_sink: use common instruction removal/insertion helpers
Rhys Perry [Wed, 2 Dec 2020 16:03:32 +0000 (16:03 +0000)]
nir/opt_sink: use common instruction removal/insertion helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7880>

3 years agogallium/u_threaded: disable forced staging upload at runtime
Pierre-Eric Pelloux-Prayer [Fri, 27 Nov 2020 14:14:07 +0000 (15:14 +0100)]
gallium/u_threaded: disable forced staging upload at runtime

If a conflict caused by the forced staging optimization is detected,
disable it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agogallium/u_threaded: fix staging and non-staging conflicts
Pierre-Eric Pelloux-Prayer [Mon, 12 Oct 2020 11:28:37 +0000 (13:28 +0200)]
gallium/u_threaded: fix staging and non-staging conflicts

In the following sequence:
  - transfer_map(buffer, DISCARD) // use staging upload
  - memcpy(...)
  - transfer_unmap
  - draw
  - transfer_map(buffer, UNSYNCHRONIZED) // non-staging upload
  - memcpy(...)
  - draw

Currently the order of operations is:
  - map#1 - staging buffer
  - memcpy to staging buffer
  - map#2
  - memcpy to buffer
  - staging buffer copy to real buffer
  - draw#1
  - draw#2

When the 2nd map operation doesn't use UNSYNCHRONIZED, the tc_sync_msg() call
will make sure that the bo is unused before mapping it.

But, if it does use UNSYNCHRONIZED and the mapped intervals overlap this commit
clears the UNSYNCHRONIZED to make sure ordering is maintained.

This will affect performance, but correct output is better than fast output.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/3611.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agoRevert "Revert "radeonsi: use staging buffer uploads for most VRAM buffers""
Pierre-Eric Pelloux-Prayer [Mon, 16 Nov 2020 14:29:15 +0000 (15:29 +0100)]
Revert "Revert "radeonsi: use staging buffer uploads for most VRAM buffers""

This reverts commit af0435cbfe61632407ce135fbea9cab6fe1e4fb6.

This optimization is useful for some applications (eg: issue 3759), so re-enable it.

The next 2 commits will address 2 short comings of this optimization.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3759
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agonir: gather if a fragment shader uses sample shading
Samuel Pitoiset [Wed, 2 Dec 2020 15:18:13 +0000 (16:18 +0100)]
nir: gather if a fragment shader uses sample shading

This introduces a new flag in shader_info to know if a fragment
shader uses sample shading, even if there is no inputs.

During NIR linking, constants varyings are optimized and the
per-sample interpolation info (ie. the sample qualifier) might
be removed if nir_shader_gather_info() is called again.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7876>

3 years agoglx: Claim to support more GL versions in __glX_send_client_info
Adam Jackson [Thu, 29 Oct 2020 18:29:49 +0000 (14:29 -0400)]
glx: Claim to support more GL versions in __glX_send_client_info

It's a little unclear from the GLX_ARB_create_context spec whether the
list of supported extensions means what the client supports at all, or
what it knows an indirect GLX encoding for. You'd think it could only
really matter for indirect, since the only way the server would know
about GL commands (as opposed to GLX commands) is if the context was
indirect. And indeed for Xorg's GLX it doesn't matter, because it
doesn't check this, assuming that anything a direct client says works
works, and clamping the GL version based on the protocol it has code
for.

But if you're NVIDIA, apparently, you check this even for direct
contexts. And since drisw creates a nominally "direct" context, this
means llvmpipe and friends get clamped to 3.0 for desktop GL (since
that's as far as the protocol is defined) and can't do GLES at all.

So, whatever, just go ahead and claim to support everything. The wire
representation of the supported versions is strange (see comments in the
code) but it matches what NVIDIA does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7369>

3 years agoglx/indirect: Validate the context version in CreateContextAttribs
Adam Jackson [Tue, 10 Nov 2020 21:23:23 +0000 (16:23 -0500)]
glx/indirect: Validate the context version in CreateContextAttribs

This is Sort Of handled by nerfing GL_VERSION in __indirect_glGetString,
but that doesn't cover GLES contexts which we also don't have any
indirect support for. Xorg's GLX would reject this for us since it has
the same limitation, but NVIDIA's GLX seems to interpret a request for
ES 2.0 as desktop, despite having the ES2 profile bit set, leading to a
very confusing GL_VERSION string and probably not the ES2-compatible
context you were hoping for.

Since we may now return NULL from indirect_create_context_attribs for
reasons other than malloc failure, we need to reasonably handle the case
where gc == NULL by the time we get to the XCB call. We rely on the
server to generate correct return values in this case, but if it
succeeds despite our client-side failure we just throw GLXBadFBConfig
(chosen to keep piglit/glx-create-context-core-profile happy, since
nothing else seems to hit it).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7369>

3 years agolavapipe: add support for VK_KHR_indirect_draw_count
Dave Airlie [Fri, 27 Nov 2020 08:21:17 +0000 (18:21 +1000)]
lavapipe: add support for VK_KHR_indirect_draw_count

Just hooks up the new cmds to the gallium draw API

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agolavapipe: enable post depth coverage
Dave Airlie [Mon, 23 Nov 2020 19:43:48 +0000 (05:43 +1000)]
lavapipe: enable post depth coverage

This just works.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agolavapipe: enable VK_EXT_shader_stencil_export
Dave Airlie [Mon, 23 Nov 2020 07:28:07 +0000 (17:28 +1000)]
lavapipe: enable VK_EXT_shader_stencil_export

This should just work.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agoCI: Add llvmpipe- prefix to Piglit jobs
Daniel Stone [Wed, 2 Dec 2020 14:01:17 +0000 (14:01 +0000)]
CI: Add llvmpipe- prefix to Piglit jobs

To make it easier to differentiate now that llvmpipe & softpipe are
lumped into the same stage.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Reorder non-hardware stages last
Daniel Stone [Wed, 2 Dec 2020 13:57:47 +0000 (13:57 +0000)]
CI: Reorder non-hardware stages last

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse lima & panfrost stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse lima & panfrost stages into one

This is now called 'arm'; even though they're two separate drivers, it
does help cut down on some of the more egregious horizontal scrolling.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse virgl & d3d12 stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse virgl & d3d12 stages into one

This is now called 'layered-backends'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse radv & radeonsi stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse radv & radeonsi stages into one

This is now called 'amd'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse llvmpipe & softpipe stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse llvmpipe & softpipe stages into one

This is now called 'software-renderer'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse SCons & meson-misc stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse SCons & meson-misc stages into one

This is now called 'build-misc'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoutil: unbreak on BSDs after MSVC changes
Jan Beich [Thu, 3 Dec 2020 00:22:38 +0000 (00:22 +0000)]
util: unbreak on BSDs after MSVC changes

src/util/os_misc.c:352:2: error: unexpected platform in os_sysinfo.c
 #error unexpected platform in os_sysinfo.c
  ^

Fixes: cdf3a6a83b50 ("util: Add os_get_page_size query")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7887>

3 years agofreedreno: Break out of "should we free the entry" loop once we've freed.
Eric Anholt [Tue, 1 Dec 2020 21:47:28 +0000 (13:47 -0800)]
freedreno: Break out of "should we free the entry" loop once we've freed.

Fixes a use-after-free of the state on the next iteration when it was
probably just destroyed.

Fixes: 6de01faac5a2 ("freedreno/a6xx: invalidate tex state cache entries on rebind")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of currently bound UBOs at CSO context destruction.
Eric Anholt [Wed, 18 Nov 2020 19:31:33 +0000 (11:31 -0800)]
gallium: Fix leak of currently bound UBOs at CSO context destruction.

Cc: mesa-stable
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallivm: Fix max const buffer count.
Eric Anholt [Mon, 30 Nov 2020 23:23:04 +0000 (15:23 -0800)]
gallivm: Fix max const buffer count.

llvmpipe was reporting 32 max const buffers, while sizing its arrays to 16
according to gallivm's #define.

Fixes: 1d35f77228ad ("gallivm,llvmpipe,draw: Support multiple constant buffers.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of bound SSBOs at CSO context destruction.
Eric Anholt [Wed, 18 Nov 2020 19:23:30 +0000 (11:23 -0800)]
gallium: Fix leak of bound SSBOs at CSO context destruction.

Cc: mesa-stable
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agomeson: Remove old todo comment about pthread stubs.
Eric Anholt [Wed, 18 Nov 2020 18:18:21 +0000 (10:18 -0800)]
meson: Remove old todo comment about pthread stubs.

Noticed while making my last change.  pthread stubs are long dead, we
actually use threads all over now.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agoegl: Skip closing drivers when building with AddressSanitizer.
Eric Anholt [Wed, 18 Nov 2020 00:50:36 +0000 (16:50 -0800)]
egl: Skip closing drivers when building with AddressSanitizer.

If you dlclose your driver, the leak reports look like:

    #0 0xffff9c7e5e7c in malloc (/lib/aarch64-linux-gnu/libasan.so.6+0x9ee7c)
    #1 0xffff94aaaa48  (<unknown module>)
    #2 0xffff94aa5ff4  (<unknown module>)
    #3 0xffff94d1867c  (<unknown module>)
    #4 0xffff94d184f0  (<unknown module>)
    #5 0xffff94c9a990  (<unknown module>)
    #6 0xffff94c92e30  (<unknown module>)
    #7 0xffff94c91d48  (<unknown module>)
    #8 0xffff946eb800  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0xfe800)
    #9 0xffff94c72874  (<unknown module>)
    #10 0xffff946ede68  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0x100e68)
    #11 0xffff94bf7134  (<unknown module>)
    #12 0xffff9c686450 in dri2_create_screen ../src/egl/drivers/dri2/egl_dri2.c:1079

which is not terribly useful.  Probe if we're building with asan and just
skip closing the driver in the happy path (which seems to be the standard
practice for loadable modules with this tool).

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agofreedreno: Fix leak of u_transfer_helper.
Eric Anholt [Wed, 18 Nov 2020 00:42:00 +0000 (16:42 -0800)]
freedreno: Fix leak of u_transfer_helper.

Fixes: d1465b3aeee3 ("freedreno: use u_transfer_helper")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of the merged driconf options.
Eric Anholt [Wed, 18 Nov 2020 00:37:41 +0000 (16:37 -0800)]
gallium: Fix leak of the merged driconf options.

Fixes: 8a05d6ffc65d ("driconf: Make the driver's declarations be structs instead of XML.")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agofreedreno/afuc: Fix up some sprintf format security warnings.
Eric Anholt [Tue, 17 Nov 2020 23:48:48 +0000 (15:48 -0800)]
freedreno/afuc: Fix up some sprintf format security warnings.

Showed up when I tried enabling asan.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agoegl/dri2: Drop some pointless ifdeffery
Rob Clark [Wed, 2 Dec 2020 17:08:41 +0000 (09:08 -0800)]
egl/dri2: Drop some pointless ifdeffery

The fallback is already `return true;`

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7864>

3 years agoegl/surfaceless: glthread support
Rob Clark [Wed, 25 Nov 2020 19:38:00 +0000 (11:38 -0800)]
egl/surfaceless: glthread support

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7864>

3 years agoutil: Disable [[fallthrough]] for C17
James Park [Tue, 1 Dec 2020 19:12:56 +0000 (11:12 -0800)]
util: Disable [[fallthrough]] for C17

[[fallthrough]] is not a C17 feature, and MSVC does not support it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7862>

3 years agoci: Go back to previous ci-templates commit for debian.yml
Michel Dänzer [Wed, 2 Dec 2020 16:37:16 +0000 (17:37 +0100)]
ci: Go back to previous ci-templates commit for debian.yml

The newer commit broke the arm64_test container build.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3910

v2:
* Also bump all image tags which had been bumped in the meantime

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7883>

3 years agozink: do not require VK_KHR_external_memory
Erik Faye-Lund [Wed, 2 Dec 2020 16:21:12 +0000 (17:21 +0100)]
zink: do not require VK_KHR_external_memory

This is only required for the DRI-path. For the swrast code-path, we
don't need this.

We also don't need to explicitly test for it in the DRI-path, because we
test for KHR_external_memory_fd, which depends on KHR_external_memory. So
no implementation will expose the former without the latter.

Fixes: f1432fd3e2d ("zink: generate extension infrastructure using a python script")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7882>

3 years agoclover: Use .def files for exports on Windows
Jesse Natalie [Thu, 19 Nov 2020 16:47:02 +0000 (08:47 -0800)]
clover: Use .def files for exports on Windows

v2: Move .def files to opencl target

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/api: Support MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:37:54 +0000 (18:37 -0800)]
clover/api: Support MSVC

Three things:
1. MSVC dislikes mismatching declaration/definition of __declspec(dllexport).
   Since CL headers don't have the declspec, the implementations should't either.
2. An unnamed brace-initialization gets deduced as an initializer list, instead
   of a brace-constructed string. Just add the type name.
3. posix_memalign doesn't exist on Windows.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/core: Support MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:37:03 +0000 (18:37 -0800)]
clover/core: Support MSVC

Constructing a class where the class name is wrapped in parens
doesn't work with MSVC. I see no good reason to do that so drop
the parens. Also, use a generic page size helper instead of hardcoding
something OS-specific.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/llvm: Work around MSVC quirks
Jesse Natalie [Thu, 19 Nov 2020 02:34:07 +0000 (18:34 -0800)]
clover/llvm: Work around MSVC quirks

Two things:
1. While instantiating a template where clover::llvm and ::llvm are
   both resolvable for unscoped llvm, MSVC complains about ambiguity.
   Resolve by not using namespace clover, leaving only ::llvm as a
   valid namespace.
2. LLVM headers (specifically Allocator.h) use __declspec(restrict),
   but Mesa's util headers #define restrict to __restrict for C++.
   Since __declspec(__restrict) is invalid, make sure we always include
   Allocator.h first before the util header.
3. Change a uint/int to uint64_t to match the type returned from LLVM.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Fix property_element::as for MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:32:27 +0000 (18:32 -0800)]
clover: Fix property_element::as for MSVC

MSVC doesn't like reinterpret_cast<T>(val) where neither T nor val
are pointers. It needs to be a static cast instead.

v2: Update assert to static_assert

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agomeson: Adjust Clover's required LLVM modules
Jesse Natalie [Thu, 19 Nov 2020 02:30:30 +0000 (18:30 -0800)]
meson: Adjust Clover's required LLVM modules

When coming from CMake, all-targets doesn't exist, and Clover's
mechanism for finding Clang apparently requires the OpenMP frontend
lib but doesn't automatically pull it in.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Add version.lib dependency for Clang on Windows
Jesse Natalie [Thu, 19 Nov 2020 02:29:25 +0000 (18:29 -0800)]
clover: Add version.lib dependency for Clang on Windows

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Support LLVM coming from CMake instead of config-tool
Jesse Natalie [Thu, 19 Nov 2020 02:28:49 +0000 (18:28 -0800)]
clover: Support LLVM coming from CMake instead of config-tool

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Add opencl-native build flag
Jesse Natalie [Thu, 19 Nov 2020 02:27:07 +0000 (18:27 -0800)]
clover: Add opencl-native build flag

This flag controls whether to include native codegen functionality
for the AMD backend

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agogallium: Remove unnecessary forward declaration of swrast_driver_descriptor
Jesse Natalie [Thu, 19 Nov 2020 02:19:13 +0000 (18:19 -0800)]
gallium: Remove unnecessary forward declaration of swrast_driver_descriptor

MSVC complains that the definition has __declspec(dllexport) but the
forward declaration doesn't. I can't find any users of this decl in
the header.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agogallium: Include winsock lib as a dependency for Windows
Jesse Natalie [Thu, 19 Nov 2020 02:17:45 +0000 (18:17 -0800)]
gallium: Include winsock lib as a dependency for Windows

The gallium aux lib includes code that calls socket APIs. On Windows,
these APIs come from ws2_32.lib/dll (winsock2), so make sure consumers
link against that lib.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agodriconf: Avoid empty macro resulting in empty initializer braces
Jesse Natalie [Thu, 19 Nov 2020 02:16:10 +0000 (18:16 -0800)]
driconf: Avoid empty macro resulting in empty initializer braces

MSVC is unhappy with empty initializer braces while compiling C

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoutil: Add os_get_page_size query
Jesse Natalie [Thu, 19 Nov 2020 02:15:22 +0000 (18:15 -0800)]
util: Add os_get_page_size query

No Apple/BSD implementation yet, I have no idea how to do that

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agowindows: Always set NOMINMAX to remove min/max macros
Jesse Natalie [Thu, 19 Nov 2020 02:14:41 +0000 (18:14 -0800)]
windows: Always set NOMINMAX to remove min/max macros

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoanv: Avoid a couple of warnings related to vk_error macros
Caio Marcelo de Oliveira Filho [Tue, 1 Dec 2020 17:45:35 +0000 (08:45 -0900)]
anv: Avoid a couple of warnings related to vk_error macros

When DEBUG is not defined, no error reporting is done, the error is
just returned back.  The current definition a couple of warnings in
anv_formats.c.  First when the return value is intentionally ignored

  ../src/intel/vulkan/anv_formats.c:989:48: warning: statement with no effect [-Wunused-value]
    989 |          vk_errorfi(instance, physical_device, VK_ERROR_FORMAT_NOT_SUPPORTED,
        |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/intel/vulkan/anv_private.h:486:55: note: in definition of macro ‘vk_errorfi’
    486 | #define vk_errorfi(instance, obj, error, format, ...) error
        |                                                       ^~~~~

and also when an argument is used only

  ../src/intel/vulkan/anv_formats.c:908:25: warning: unused variable ‘instance’ [-Wunused-variable]
    908 |    struct anv_instance *instance = physical_device->instance;
        |                         ^~~~~~~~
  ../src/intel/vulkan/anv_formats.c: In function ‘anv_GetPhysicalDeviceImageFormatProperties2’:
  ../src/intel/vulkan/anv_formats.c:1231:25: warning: unused variable ‘instance’ [-Wunused-variable]
   1231 |    struct anv_instance *instance = physical_device->instance;
        |                         ^~~~~~~~

to avoid both issues, use a static inline function that just returns
it's argument but can consume other input. Ignoring the return value
of a function is OK, and the extra input can be tagged as UNUSED
getting rid of both warnings.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7860>

3 years agonir/opt_sink: return early when trying to sink unused instructions
Daniel Schürmann [Wed, 2 Dec 2020 14:34:26 +0000 (15:34 +0100)]
nir/opt_sink: return early when trying to sink unused instructions

Fixes: 5f6c5e5b86f366c6fe0a0911fdc1926f1e0d1d5f ('nir: don't sink instructions into loops')

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7874>

3 years agov3dv: fix early return from failed drmGetMagic
Iago Toral Quiroga [Wed, 2 Dec 2020 06:57:32 +0000 (07:57 +0100)]
v3dv: fix early return from failed drmGetMagic

v2: Log more detail to stderr upon failure (Chema)

Fixes: b14679ab226 ('v3dv: check return value of drmGetMagic')
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7865>

3 years agofreedreno: Add missing dependency to build
Daniel Stone [Wed, 2 Dec 2020 13:10:21 +0000 (13:10 +0000)]
freedreno: Add missing dependency to build

computerator depends on ir3_parser.h, which is a generated file, but
this dependency is not expressed in the build.

Fixes: 1e8808a4a0f ("freedreno/ir3: refactor out helper to compile shader from asm")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7870>

3 years agoglx: Fix the generated error when indirect contexts are not supported
Adam Jackson [Tue, 1 Dec 2020 15:53:41 +0000 (10:53 -0500)]
glx: Fix the generated error when indirect contexts are not supported

When the server doesn't support indirect contexts it will generate a
BadValue error, since the CreateContext request's isDirect field will
have specified an unsupported value of False. We attempt to verify that
context creation succeeded by asking whether the context's XID is direct
or not after we create it. Due to the details of XCB error handling, if
the context wasn't successfully created, the GLXBadContext error from
the GLXIsDirect request will get raised first, hiding the BadValue from
the application.

To fix this, we change the behavior of __glXIsDirect based on the
`error` outparameter. If it is NULL we still raise the error generated
from the GLXIsDirect request, but if it is non-NULL we now just inform
the caller that the request failed and silently eat the error. By doing
this the BadValue (or whatever else) from the CreateContext request will
bubble up to the application as expected.

This is admittedly a bit subtle but it's the simplest way to get to the
fix here. A better solution would be to convert all of CreateContext to
XCB, but XCB doesn't have protocol for GLX_SGIX_fbconfig yet so we'd
lose glXCreateContextWithConfigSGIX.

Fixes: mesa/mesa#3907
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7859>

3 years agoglx: Simplify error handling in glXImportContextEXT
Adam Jackson [Tue, 1 Dec 2020 15:49:03 +0000 (10:49 -0500)]
glx: Simplify error handling in glXImportContextEXT

The GLXIsDirect request will throw GLXBadContext for us if it needs to,
so we can avoid synthesizing an error on the client side.

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7859>

3 years agomicrosoft/clc: increase test-timeout
Erik Faye-Lund [Wed, 2 Dec 2020 13:45:20 +0000 (14:45 +0100)]
microsoft/clc: increase test-timeout

The test "clc_compiler_test" is kinda nasty in packing too many things
into a single test, making it awkwardly long. We should really consider
splitting it up into multiple tests instead.

But right now, it's sometimes timing out on CI, which is bad, so here's
a quick band-aid to prevent this from happening.

The previous timeout of two minutes seems to not always be sufficient
under various loads, so let's add another minute just to be sure.

Here's an example of a failure with the current timeout:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/5918980#L1589

Fixes: ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7872>

3 years agoegl: fix typo in wl_drm error message
Simon Ser [Tue, 1 Dec 2020 13:21:56 +0000 (14:21 +0100)]
egl: fix typo in wl_drm error message

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7854>

3 years agoetnaviv: update fallthrough comments
Christian Gmeiner [Tue, 1 Dec 2020 11:17:13 +0000 (12:17 +0100)]
etnaviv: update fallthrough comments

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7849>

3 years agomicrosoft/clc: add missing dependency
Erik Faye-Lund [Wed, 2 Dec 2020 12:20:58 +0000 (13:20 +0100)]
microsoft/clc: add missing dependency

We include git_sha1.h in clc_compiler.c, so we should also make sure we
depend on the header being generated in time. This fixes a spurious
build error when compiling with many cores, like we do on CI.

Fixes: ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7869>

3 years agomicrosoft/clc: use files-function for source-list
Erik Faye-Lund [Wed, 2 Dec 2020 12:18:48 +0000 (13:18 +0100)]
microsoft/clc: use files-function for source-list

This makes things a bit more explicit, and is generally what we seem to
do around in the source-tree.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7869>

3 years agozink: moved vkEnumerateInstanceVersion to create_instance
Duncan Hopkins [Tue, 10 Nov 2020 15:07:07 +0000 (15:07 +0000)]
zink: moved vkEnumerateInstanceVersion to create_instance

Moved the call to vkEnumerateInstanceVersion() into the create_instance() function,
so the result can be passed into the application apiVersion.
Will stop drivers from limiting a devices supported api version.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7533>

3 years agogitlab-ci: do not clone git-repo for test-job
Erik Faye-Lund [Wed, 2 Dec 2020 10:28:31 +0000 (11:28 +0100)]
gitlab-ci: do not clone git-repo for test-job

The only thing we really need from the git-repo is the piglit_run.ps1
script, so let's upload that into our artifacts instead.

Fixes: d560addc30e ("gitlab-ci: run piglit on windows")
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7867>