platform/upstream/mesa.git
3 years agoturnip: move up LRZ invalidate in CmdClearAttachments
Jonathan Marek [Thu, 3 Dec 2020 05:03:14 +0000 (00:03 -0500)]
turnip: move up LRZ invalidate in CmdClearAttachments

There is an early return if cmd->state.predication_active is true, so do
the LRZ invalidate before that.

Fixes: 2f79e0066405 ("turnip: disable LRZ on vkCmdClearAttachments()")

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

3 years agoturnip: do not emit draw states in draw_cs outside of renderpass
Jonathan Marek [Thu, 3 Dec 2020 04:59:24 +0000 (23:59 -0500)]
turnip: do not emit draw states in draw_cs outside of renderpass

This avoids a possible issue with MSAA sysmem clears, which use a 3D clear
path which assumes draw states are disabled, and are emitted in draw_cs in
BeginRenderPass.

(checking for TU_CMD_DIRTY_DRAW_STATE also allows not emitting the draw
states if they will be re-emitted on the next draw anyway. the previous
patch makes it so TU_CMD_DIRTY_DRAW_STATE is always set outside of
renderpasses)

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

3 years agoturnip: correctly disable draw states outside of renderpasses
Jonathan Marek [Thu, 3 Dec 2020 04:49:26 +0000 (23:49 -0500)]
turnip: correctly disable draw states outside of renderpasses

* do the disable in EndRenderPass2 to fix the missing disable for sysmem
* we don't need a disable at the end of every tile, or between binning pass
  and gmem pass (the first draw in draw_cs emits all the draw states)

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

3 years agoturnip: always emit LRZ draw state in DIRTY_DRAW_STATE path
Jonathan Marek [Thu, 3 Dec 2020 04:32:13 +0000 (23:32 -0500)]
turnip: always emit LRZ draw state in DIRTY_DRAW_STATE path

The packet size is constant and assumes all states, except for the 2 input
attachment states. (this means we get an invalid packet if DIRTY_LRZ isn't
set when DIRTY_DRAW_STATE is set).

Fixes: 3c07a1499863 ("turnip: enable LRZ")

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

3 years agoturnip: do not include compute stage in pipeline_builder
Jonathan Marek [Thu, 3 Dec 2020 04:28:38 +0000 (23:28 -0500)]
turnip: do not include compute stage in pipeline_builder

This avoids emitting compute-related state in the graphics pipeline
(tu6_emit_xs_config was being called for compute stage).

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

3 years agoturnip: no linear_to_srgb for alpha channel for gmem clear value packing
Jonathan Marek [Thu, 3 Dec 2020 04:23:20 +0000 (23:23 -0500)]
turnip: no linear_to_srgb for alpha channel for gmem clear value packing

Alpha channel is always linear (oops).

Fixes: ddac5933f8f3 ("turnip: call packing functions directly for pack_gmem_clear_value")

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

3 years agogallium/u_threaded: optimize set_constant_buffer
Marek Olšák [Sun, 29 Nov 2020 06:25:01 +0000 (01:25 -0500)]
gallium/u_threaded: optimize set_constant_buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agogallium/u_threaded: don't make a local copy of pipe_draw_start_count
Marek Olšák [Sat, 28 Nov 2020 10:24:06 +0000 (05:24 -0500)]
gallium/u_threaded: don't make a local copy of pipe_draw_start_count

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agogallium/u_threaded: don't copy the indexbuf pointer if we overwrite it
Marek Olšák [Sat, 28 Nov 2020 10:22:06 +0000 (05:22 -0500)]
gallium/u_threaded: don't copy the indexbuf pointer if we overwrite it

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agogallium/u_threaded: set has_user_indices = false in the driver thread
Marek Olšák [Sat, 28 Nov 2020 10:18:38 +0000 (05:18 -0500)]
gallium/u_threaded: set has_user_indices = false in the driver thread

to remove some overhead from the main thread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agogallium/u_threaded: don't pass index bounds to the driver to decrease overhead
Marek Olšák [Sat, 28 Nov 2020 10:03:31 +0000 (05:03 -0500)]
gallium/u_threaded: don't pass index bounds to the driver to decrease overhead

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agoglthread: count batch space in units of uint64_t elements
Marek Olšák [Sat, 10 Oct 2020 09:09:53 +0000 (05:09 -0400)]
glthread: count batch space in units of uint64_t elements

This removes one x86 shr instruction from _mesa_glthread_allocate_command.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agoglthread: change sizes to unsigned or size_t where needed
Marek Olšák [Sat, 10 Oct 2020 03:05:08 +0000 (23:05 -0400)]
glthread: change sizes to unsigned or size_t where needed

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agoglthread: use uint64_t to declare the batch buffer instead of align(8)
Marek Olšák [Sat, 10 Oct 2020 02:37:28 +0000 (22:37 -0400)]
glthread: use uint64_t to declare the batch buffer instead of align(8)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agoglthread: use glthread->used instead of glthread->next_batch->used
Marek Olšák [Sat, 10 Oct 2020 02:16:29 +0000 (22:16 -0400)]
glthread: use glthread->used instead of glthread->next_batch->used

remove one pointer dereference by having "used" in glthread too

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>

3 years agozink: use shader keys for samplemask
Mike Blumenkrantz [Mon, 7 Dec 2020 18:41:03 +0000 (13:41 -0500)]
zink: use shader keys for samplemask

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7801>

3 years agozink: change a memcmp==0 to !memcmp
Mike Blumenkrantz [Mon, 7 Dec 2020 20:43:33 +0000 (15:43 -0500)]
zink: change a memcmp==0 to !memcmp

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7801>

3 years agozink: initial shader key implementation
Mike Blumenkrantz [Thu, 26 Nov 2020 17:08:46 +0000 (12:08 -0500)]
zink: initial shader key implementation

this is a squashed version of a previously-reviewed series
ref https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7193

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7801>

3 years agovulkan/device_select: Store Vulkan vendorID and deviceID as uint32_t
Witold Baryluk [Mon, 7 Dec 2020 20:45:42 +0000 (20:45 +0000)]
vulkan/device_select: Store Vulkan vendorID and deviceID as uint32_t

Vulkan uses 32-bit IDs, compared to PCI/USB 16-bit ones.

Some driver vendorIDs do exceed 0xffff, including MESA (used by lavapipe).

Without this, the value will be truncated, and device select layer
will not match expected (or any) device.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3935
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7977>

3 years agogallium/aux: Update scons build for u_tracepoints.[ch]
Rob Clark [Mon, 7 Dec 2020 17:08:10 +0000 (09:08 -0800)]
gallium/aux: Update scons build for u_tracepoints.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7974>

3 years agogallium/aux: Split u_tracepoints.[ch] generation
Rob Clark [Mon, 7 Dec 2020 17:05:29 +0000 (09:05 -0800)]
gallium/aux: Split u_tracepoints.[ch] generation

Allow for separate rules to be used to generate the .c and .h (partially
to make it easier for scons build, and partially because that is just a
better practice).

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

3 years agogallium/aux: Avoid creating queue when traces not enabled
Rob Clark [Sat, 5 Dec 2020 18:39:45 +0000 (10:39 -0800)]
gallium/aux: Avoid creating queue when traces not enabled

Avoids unnecessarily creating an extra thread when tracing is not
enabled.  Which also side-steps a chrome/ium sandbox issue with
the setscheduler call in u_queue.

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

3 years agonir: improve divergence analysis for loads with non-uniform resources
Rhys Perry [Fri, 22 May 2020 12:39:06 +0000 (13:39 +0100)]
nir: improve divergence analysis for loads with non-uniform resources

If ACCESS_NON_UNIFORM is not specified, we can assume the resource is
uniform. This requires nir_lower_non_uniform_access to remove that flag.

A few Detroit: Become Human shaders use a index sourced from a fragment
input which is expected to be uniform.

shader-db (Navi):
Totals from 8 (0.01% of 127638) affected shaders:
SGPRs: 224 -> 384 (+71.43%)
VGPRs: 208 -> 112 (-46.15%)
CodeSize: 5360 -> 5344 (-0.30%); split: -1.49%, +1.19%
Instrs: 1036 -> 1028 (-0.77%); split: -1.93%, +1.16%
VMEM: 1320 -> 608 (-53.94%)
SMEM: 384 -> 336 (-12.50%); split: +14.58%, -27.08%
VClause: 24 -> 16 (-33.33%)
SClause: 48 -> 56 (+16.67%)
PreSGPRs: 124 -> 216 (+74.19%)
PreVGPRs: 168 -> 88 (-47.62%)

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/5201>

3 years agonir/lower_non_uniform: remove non_uniform flags after lowering
Rhys Perry [Tue, 6 Oct 2020 16:08:33 +0000 (17:08 +0100)]
nir/lower_non_uniform: remove non_uniform flags after lowering

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/5201>

3 years agoiris: fix memleak for query_buffer_uploader
yshi18 [Thu, 3 Dec 2020 05:54:14 +0000 (13:54 +0800)]
iris: fix memleak for query_buffer_uploader

In the Chrome WebGL Aquarium  stress test, 20 instances of Chrome will run
Aquarium  simultaneously over 20+ hours. That causes Chrome crash.
During the stress, glBeginQueryIndexed is called frequently.

1.Each query will only use 32 bytes from query_buffer_uploader. After the offset
exceed 4096, it will alloc new buffer for query_buffer_uploader->buffer
and release the old buffer.

2.But iris_begin_query will call u_upload_alloc when the offset changed, and it
will increase the query_buffer_uploader->buffer->reference.count every time
when it called u_upload_alloc.

3.So when u_upload_release_buffer try to release the resource of
query_buffer_uploader->buffer, its reference.count is
already equal to 129. pipe_reference_described will only decrease its reference
count to 128.So it never called old_dst->screen->resource_destroy.

4.The old resouce bo will never be freeed. And chrome will called mmap every time
when it alloc new resource bo.

5. Chrome process map too many vmas in its process. Its map count exceed the
sysctl_max_map_count which is 65530 defined in kernel.

6. When iris_begin_query want to alloc new resource bo, it will meet NULL pointer
because mmap return failed. Finally chrome crashed when it access this NULL resource
bo.

The fix is decrease the reference count in iris_destroy_query.

Patch is verified by chrome webgl Aquarium test case for more than 72 hours.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Yang Shi <yang.a.shi@intel.com>
Reviewed-by: Alex Zuo <alex.zuo@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7890>

3 years agoaco: use UINT64_C on 64 bit constant arguments
Jonathan Gray [Tue, 4 Aug 2020 07:22:32 +0000 (17:22 +1000)]
aco: use UINT64_C on 64 bit constant arguments

avoids errors seen when building on OpenBSD/amd64

../src/amd/compiler/aco_instruction_selection.cpp:1677:62: error: ambiguous conversion for functional-style cast from 'unsigned long' to 'aco::Operand'
            bld.vop3(aco_opcode::v_mul_f64, Definition(dst), Operand(0x3FF0000000000000lu), tmp);
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
glibc uses unsigned long for uint64_t on LP64 archs and unsigned long long for
uint64_t on ILP32 archs.  On OpenBSD unsigned long long is used for uint64_t
on all archs.

The Operand constructors are uint8_t uint16_t uint32_t uint64_t
use UINT64_C so lu or llu suffix will be used as needed.

Fixes: df645fa369d ("aco: implement VK_KHR_shader_float_controls")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7944>

3 years agomesa/st: lower 64 bit ops to scalar before lowering to soft-float
Gert Wollny [Sun, 25 Oct 2020 18:28:22 +0000 (19:28 +0100)]
mesa/st: lower 64 bit ops to scalar before lowering to soft-float

The fp64 emulation is not prepared for vectorized 64 bit code, so
if the driver doesn't ask for lowering to scalar by itself, do it before
lowering to soft-fb, and run a vectorizazion pass afterwards.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7961>

3 years agoradv: disable alphaToOne feature
Samuel Pitoiset [Mon, 7 Dec 2020 11:38:46 +0000 (12:38 +0100)]
radv: disable alphaToOne feature

The feature was exposed but completely ignored by the driver. Other
AMD drivers don't expose it as well, probably because it's complicated
to implement alpha-to-coverage properly. Let's disable it.

Cc: mesa-stable.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7966>

3 years agodriconf: add allow_incorrect_primitive_id option
Pierre-Eric Pelloux-Prayer [Wed, 4 Nov 2020 09:19:18 +0000 (10:19 +0100)]
driconf: add allow_incorrect_primitive_id option

And enable it for SPECviewperf.

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

3 years agovbo/dlist: only use merged primitives when it's ok to do so
Pierre-Eric Pelloux-Prayer [Tue, 20 Oct 2020 08:57:04 +0000 (10:57 +0200)]
vbo/dlist: only use merged primitives when it's ok to do so

Merging primitives generates incorrect gl_PrimitiveID[In] values.
So make merged primitives construction non-destructive and fallback
to drawing with original primitives if a program reads gl_PrimitiveId.

This commit adds _mesa_update_primitive_id_is_unused modeled after
_mesa_update_allow_draw_out_of_order to update ctx->_PrimitiveIDIsUnused
each time shaders are updated.

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

3 years agovbo/dlist: avoid splitting draw commands in multiple draws
Pierre-Eric Pelloux-Prayer [Tue, 20 Oct 2020 08:57:04 +0000 (10:57 +0200)]
vbo/dlist: avoid splitting draw commands in multiple draws

For (Multi)DrawArrays and (Multi)DrawElements commands, the storage size
needed are known early so we can make sure that the prim_store/vertex_store
will be big enough to store the whole command.

This reduces the amount of drawcalls in snx03 tests. For instance in test10:

      | Num draw calls |     GPU-load    |
------|----------------|-----------------|
      | Before | After |  Before | After |
------|--------|-------|---------|-------|
test10|  35k   |   8k  |   58%   |  80%  |

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

3 years agovbo/dlist: refactor prim_store/vertex_store allocations
Pierre-Eric Pelloux-Prayer [Tue, 20 Oct 2020 08:38:37 +0000 (10:38 +0200)]
vbo/dlist: refactor prim_store/vertex_store allocations

This will be used in the next commit.

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

3 years agomesa: optimize _mesa_program_resource_location
Pierre-Eric Pelloux-Prayer [Wed, 7 Oct 2020 15:31:51 +0000 (17:31 +0200)]
mesa: optimize _mesa_program_resource_location

- xxhash is faster than sha1.
- remove superfluous calls to strlen

Using SPECviewperf13 snx-03 first subtest and "perf -e cycles -g", perf report says:

 Before  | After  | Function
---------|--------|---------------
  47.39% | 47.36% | _mesa_CallList
   5.00% |  3.03% | _mesa_program_resource_location

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7078>

3 years agoutil/hash_table: add _mesa_hash_data_with_seed function
Pierre-Eric Pelloux-Prayer [Thu, 8 Oct 2020 14:49:01 +0000 (16:49 +0200)]
util/hash_table: add _mesa_hash_data_with_seed function

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7078>

3 years agovbo/dlist: implement primitive merging
Pierre-Eric Pelloux-Prayer [Thu, 8 Oct 2020 12:49:29 +0000 (14:49 +0200)]
vbo/dlist: implement primitive merging

Merge consecutive primitives using the same mode while constructing the index buffer.

This improves performance a lot (x3 - x10) SPECviewperf13 snx-03 test by reducing the
number of draw calls per frame.
Here are some numbers for 4 of the tests:

      | Num draw calls |     GPU-load    |
------|----------------|-----------------|
      | Before | After |  Before | After |
------|--------|-------|---------|-------|
test1 |  390k  |  16k  |   68%   |  90%  |
test2 |  370k  |  16k  |   40%   |  90%  |
test3 |  1.2M  |  35k  |   38%   |  78%  |
test10|  3.5M  |  35k  |   36%   |  58%  |

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

3 years agovbo/dlist: convert LINE_STRIPS to LINES
Pierre-Eric Pelloux-Prayer [Thu, 8 Oct 2020 12:48:25 +0000 (14:48 +0200)]
vbo/dlist: convert LINE_STRIPS to LINES

Less primitive modes allows for better primitive merging.

Lines are always used (instead of picking dynamically lines or line
strips for instance) because:
- they don't need primitive restarts to be merged
- they perform better (at least on radeonsi) - SPECviewperf13 snx subtests
  with lines (like 4 or 10) are 1.5x-2x faster.

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

3 years agovbo/dlist: create an index buffer in compile_vertex_list
Pierre-Eric Pelloux-Prayer [Thu, 8 Oct 2020 12:43:57 +0000 (14:43 +0200)]
vbo/dlist: create an index buffer in compile_vertex_list

This will be useful to implement other optimizations.

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

3 years agodlist: do not call _mesa_lookup_list twice
Pierre-Eric Pelloux-Prayer [Tue, 6 Oct 2020 09:58:29 +0000 (11:58 +0200)]
dlist: do not call _mesa_lookup_list twice

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7078>

3 years agoandroid: radv: add libcutils shared dependency
Mauro Rossi [Sat, 5 Dec 2020 01:58:32 +0000 (02:58 +0100)]
android: radv: add libcutils shared dependency

Fixes the following building error:

    FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/vulkan.android-x86_intermediates/LINKED/vulkan.android-x86.so
    ...
    ld.lld: error: undefined symbol: property_get
    >>> referenced by os_misc.c:193 (external/mesa/src/util/os_misc.c:193)
    >>>               os_misc.o:(os_get_option) in archive out/target/product/x86_64/obj/STATIC_LIBRARIES/libmesa_util_intermediates/libmesa_util.a

Fixes: eeecc21d ("util: Add property_get() fallback for android")
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7861>

3 years agomesa/math: Fix address of array always returning true
Marijn Suijten [Tue, 1 Dec 2020 18:19:29 +0000 (19:19 +0100)]
mesa/math: Fix address of array always returning true

    external/mesa3d/src/mesa/math/m_matrix.c:1403:13: error: address of array 'mat->inv' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
       if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) {
           ~~~~~^~~ ~~

Fixes: 3175b63a0df ("mesa: don't allocate matrices with malloc")
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7861>

3 years agoandroid: util: Add libcutils to Android.mk shared libs
Marijn Suijten [Tue, 1 Dec 2020 18:13:14 +0000 (19:13 +0100)]
android: util: Add libcutils to Android.mk shared libs

Otherwise:

    external/mesa3d/src/util/os_misc.c:59:12: fatal error: 'cutils/properties.h' file not found
    #  include <cutils/properties.h>
               ^~~~~~~~~~~~~~~~~~~~~

And:

    ld.lld: error: undefined symbol: property_get
    >>> referenced by os_misc.c:193 (external/mesa3d/src/util/os_misc.c:193)
    >>>               os_misc.o:(os_get_option) in archive out/target/product/discovery/obj/STATIC_LIBRARIES/libmesa_util_intermediates/libmesa_util.a

Fixes: eeecc21d935 ("util: Add property_get() fallback for android")
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7861>

3 years agozink: Cap PIPE_SHADER_CAP_MAX_CONST_BUFFERS to 32
Witold Baryluk [Mon, 7 Dec 2020 20:30:32 +0000 (20:30 +0000)]
zink: Cap PIPE_SHADER_CAP_MAX_CONST_BUFFERS to 32

PIPE_MAX_CONSTANT_BUFFERS is 32, however many Vulkan implementations
has maxPerStageDescriptorUniformBuffers that exceeds it, for example:

radv 8388606,
anv 64
nvidia 1048580 for RTX 2000 and up.

and, together with the current zink logic, the returned value
will exceed the maximum allowed value for the cap.

This causes cso_destroy_context to pass big values back to zink
(via zink_set_constant_buffer), resulting in access beyond end of
allocated buffer for all UBOs.

Cap the cap to PIPE_MAX_CONSTANT_BUFFERS (32), not INT_MAX.

Add an assert to verify future drivers.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: daaf5f1d186 ("gallium: Fix leak of currently bound UBOs at CSO context destruction.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7976>

3 years agogallium: fix the PIPE_SHADER_CAP_SUPPORTED_IRS value for all drivers
Marek Olšák [Sat, 28 Nov 2020 07:25:49 +0000 (02:25 -0500)]
gallium: fix the PIPE_SHADER_CAP_SUPPORTED_IRS value for all drivers

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

3 years agost/mesa: remove less useful debug options in hot paths
Marek Olšák [Tue, 24 Nov 2020 05:11:48 +0000 (00:11 -0500)]
st/mesa: remove less useful debug options in hot paths

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

3 years agost/mesa: don't generate TGSI for the draw VS because it now supports NIR too
Marek Olšák [Sat, 28 Nov 2020 07:41:46 +0000 (02:41 -0500)]
st/mesa: don't generate TGSI for the draw VS because it now supports NIR too

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

3 years agodraw: add NIR support to draw_create_vertex_shader
Marek Olšák [Sat, 28 Nov 2020 07:38:16 +0000 (02:38 -0500)]
draw: add NIR support to draw_create_vertex_shader

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

3 years agozink: fix channel ordering in format-mapping
Erik Faye-Lund [Mon, 7 Dec 2020 11:27:23 +0000 (12:27 +0100)]
zink: fix channel ordering in format-mapping

This looks like a typo. Packed vulkan formats should always map to the
inverse order of the corresponding gallium notation. Besides, it makes
no sense that unsigned and signed formats have different ordering.

Fixes: cdfb1d925f3 ("zink: add last few format maps for ARB_vertex_type_2_10_10_10_rev")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7964>

3 years agor600/sfn: Add support for shader_clock
Gert Wollny [Mon, 7 Dec 2020 12:01:35 +0000 (13:01 +0100)]
r600/sfn: Add support for shader_clock

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7973>

3 years agor600/sfn: Fix dest-swizzle for GS vertex loads
Gert Wollny [Sat, 28 Nov 2020 15:36:04 +0000 (16:36 +0100)]
r600/sfn: Fix dest-swizzle for GS vertex loads

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7962>

3 years agogallium: Fix VAAPI postproc blit
Thong Thai [Mon, 7 Dec 2020 15:05:57 +0000 (10:05 -0500)]
gallium: Fix VAAPI postproc blit

Fixes the VAAPI postproc issue mentioned in this comment
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6736#note_626808)
without changing the height of the underlying resource when doing the
blit.

This commit removes the 0.5 pixel center offset from the compute blit - VAAPI postproc is the only function that uses this compute blit.

Fixes: 49465babdb3 ("frontends/va/postproc: Use the actual image height when blitting")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7970>

3 years agonir/lower_non_uniform: Better handle non-derefs
Jason Ekstrand [Thu, 12 Nov 2020 23:32:41 +0000 (17:32 -0600)]
nir/lower_non_uniform: Better handle non-derefs

In particular, if we have an index or bindless handle we were passing
the original handle which, technically, is uniform within the context of
the if.  However, we can save the back-end compiler some effort if we
pass it the result of the read_first_invocation().

(Rebased by Kenneth Graunke and Rhys Perry.)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7592>

3 years agonir/lower_non_uniform: Refactor for better code organization
Jason Ekstrand [Thu, 12 Nov 2020 22:39:45 +0000 (16:39 -0600)]
nir/lower_non_uniform: Refactor for better code organization

In theory, I don't think this is a functional change.  We should
generate the same code before and after.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7592>

3 years agonir/lower_non_uniform: Use nir_read_first_invocation helper.
Kenneth Graunke [Wed, 2 Dec 2020 19:00:15 +0000 (11:00 -0800)]
nir/lower_non_uniform: Use nir_read_first_invocation helper.

We now have a general helper for this, and don't need to roll our own.

Suggested by Rhys Perry in the review for MR !7592.

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

3 years agogallium: do not reset buffers for unsupported stages
Erik Faye-Lund [Mon, 7 Dec 2020 16:42:43 +0000 (17:42 +0100)]
gallium: do not reset buffers for unsupported stages

There's no good reason why drivers that doesn't grok geometry,
tesselation or compute shaders needs to deal with them.

This fixes a crash on a lot of Piglit tests for Zink.

Fixes: daaf5f1d186 ("gallium: Fix leak of currently bound UBOs at CSO context destruction.")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7971>

3 years agollvmpipe: work around mingw compiler optimization bug
Michel Zou [Thu, 3 Dec 2020 21:18:55 +0000 (22:18 +0100)]
llvmpipe: work around mingw compiler optimization bug

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

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/7914>

3 years agoradv: fix clearing FMASK for layered MSAA images on GFX9+
Samuel Pitoiset [Fri, 4 Dec 2020 16:41:37 +0000 (17:41 +0100)]
radv: fix clearing FMASK for layered MSAA images on GFX9+

If we always clear the whole FMASK buffer, layers can be corrupted.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3710
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/7924>

3 years agoac/surface: initialize the FMASK slice size for GFX9+
Samuel Pitoiset [Fri, 4 Dec 2020 16:40:55 +0000 (17:40 +0100)]
ac/surface: initialize the FMASK slice size for GFX9+

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7924>

3 years agoradv: advertise VK_EXT_sample_locations on GFX10+
Samuel Pitoiset [Tue, 1 Dec 2020 10:13:51 +0000 (11:13 +0100)]
radv: advertise VK_EXT_sample_locations on GFX10+

Only MSAA2x and MSAA4X sample locations can be used.

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/7850>

3 years agoradv: enable using MSAA2x and MSAA4x sample locations on GFX10+
Samuel Pitoiset [Tue, 1 Dec 2020 11:33:05 +0000 (12:33 +0100)]
radv: enable using MSAA2x and MSAA4x sample locations on GFX10+

These failures are really weird but MSAA2x and MSAA4x work fine.

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/7850>

3 years agoradv: Implement VK_VALVE_mutable_descriptor_type.
Hans-Kristian Arntzen [Mon, 7 Dec 2020 12:41:26 +0000 (13:41 +0100)]
radv: Implement VK_VALVE_mutable_descriptor_type.

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

3 years agovulkan: Update to 1.2.164.
Hans-Kristian Arntzen [Mon, 7 Dec 2020 12:40:47 +0000 (13:40 +0100)]
vulkan: Update to 1.2.164.

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

3 years agoandroid: freedreno/ir3: use python3 in gen rules
Mauro Rossi [Sun, 6 Dec 2020 20:09:13 +0000 (21:09 +0100)]
android: freedreno/ir3: use python3 in gen rules

Completes freedreno gen rules migration to python3 as per meson.build
With this change all freedreno gen rules use $(MESA_PYTHON3)

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

3 years agoandroid: freedreno: Remove fd_log()
Mauro Rossi [Sat, 5 Dec 2020 15:40:12 +0000 (16:40 +0100)]
android: freedreno: Remove fd_log()

Fixes the following building error:

FAILED: ninja: 'external/mesa/src/gallium/drivers/freedreno/freedreno_log.c',
needed by 'out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_pipe_freedreno_intermediates/freedreno_log.o',
missing and no known rule to make it

Fixes: 03e7c93b828a ("freedreno: Remove fd_log()")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7942>

3 years agoandroid: freedreno: Add GPU tracepoints
Mauro Rossi [Sat, 5 Dec 2020 19:58:47 +0000 (20:58 +0100)]
android: freedreno: Add GPU tracepoints

Changelog:
- add freedreno_tracepoints.c.{c,h} gen rules for Android $(MESA_PYTHON3)
- update Makefile.sources with the required generated sources

Fixes the following building errors:

external/mesa/src/gallium/drivers/freedreno/freedreno_gmem.c:35:10:
fatal error: 'u_tracepoints.h' file not found
         ^~~~~~~~~~~~~~~~~
1 error generated.

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: __trace_end_clear_restore
>>> referenced by freedreno_tracepoints.h:38 (out/target/product/x86_64/obj/STATIC_LIBRARIES/libmesa_pipe_freedreno_intermediates/
freedreno_tracepoints.h:38)
...
ld.lld: error: undefined symbol: __trace_start_vsc_overflow_test
>>> referenced by freedreno_tracepoints.h:272 (out/target/product/x86_64/obj/STATIC_LIBRARIES/libmesa_pipe_freedreno_intermediates
/freedreno_tracepoints.h:272)
ld.lld: error: too many errors emitted, stopping now

Fixes: a02dcb970fff ("freedreno: Add GPU tracepoints")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7942>

3 years agoandroid: gallium/aux: Add GPU tracepoint mechanism
Mauro Rossi [Sat, 5 Dec 2020 15:40:12 +0000 (16:40 +0100)]
android: gallium/aux: Add GPU tracepoint mechanism

Android rules to build u_trace sources and u_tracepoints generated sources

Changelog:
- add util/u_tracepoints.{c,h} gen rules for Android using $(MESA_PYTHON3)
- update Makefile.sources with the required sources and generated sources

Fixes: 3471af9c6cfa ("gallium/aux: Add GPU tracepoint mechanism")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7942>

3 years agoandroid: gallium/aux: update old generated sources rules
Mauro Rossi [Sat, 5 Dec 2020 15:40:12 +0000 (16:40 +0100)]
android: gallium/aux: update old generated sources rules

This is in preparation for additional generated sources rules for Android
which will require ad hoc rules, so it is necessary to replace old ones

NOTE: pre-existing gen rules based on $(transform-generated-source) macro
are both obsolete and use of '%' pattern rule is incompatible with ad hoc
python commands for different targets

Changelog:
- remove util/u_format_srgb.c target
- replace obsolete indices/{u_indices,unfilled}_gen.c 'common' gen rules
  with 'per target' gen rules using $(MESA_PYTHON3) as per meson gen rules

Fixes: 3471af9c6cfa ("gallium/aux: Add GPU tracepoint mechanism")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7942>

3 years agoci: update the list of expected failures for RADV/FIJI
Samuel Pitoiset [Mon, 7 Dec 2020 08:59:25 +0000 (09:59 +0100)]
ci: update the list of expected failures for RADV/FIJI

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

3 years agoradv: fix using FS sample shading if the linker optimized inputs away
Samuel Pitoiset [Thu, 3 Dec 2020 09:10:22 +0000 (10:10 +0100)]
radv: fix using FS sample shading if the linker optimized inputs away

During NIR linking, constant varyings might be moved to the next
stage and the sample qualifier removed.

shader_info::uses_sample_shading remembers if the sample qualifier
was used before optimizations.

No fossils-db changes on Sienna Cichlid.

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/7892>

3 years agolavapipe: fix logic-op support
Erik Faye-Lund [Fri, 4 Dec 2020 21:06:35 +0000 (22:06 +0100)]
lavapipe: fix logic-op support

Lavapipe exposes support for the logicOp feature, but doesn't actually
respect the state. This is easy to fix, so let's plumb it through.

This fixes spec@!opengl 1.0@gl-1.0-logicop When running with Zink on
Lavapipe.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7932>

3 years agozink. Fixing vkGetPhysicalDeviceProperties2 and vkGetPhysicalDeviceFeatures2 for...
Duncan Hopkins [Mon, 7 Dec 2020 08:25:13 +0000 (08:25 +0000)]
zink. Fixing vkGetPhysicalDeviceProperties2 and vkGetPhysicalDeviceFeatures2 for Vk 1.1 and VK_KHR_get_physical_device_properties2.

MoltenVK does not export the vkGetPhysical*2() functionns, even in Vulkan 1.2.154.0 where the instance version moves from 1.0 to 1.1.
If the extension is present and used the KHR versions of the functions can be used.
From the spec the vkGetPhysicalDevice*2() functions should be avaiable from Vk 1.1 loaders and devices. Which implies MoltenVK might be misbehaving.
This change allows the extension to be used, if present, before the Vk 1.1 version check.

Fixes: 752f6d80 ("zink: setup version dependent VkPhysicalDeviceVulkan*Features and VkPhysicalDeviceVulkan*Properties.")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7960>

3 years agoradv: use 32-bit predication for skipping FCE on GFX10.3+
Samuel Pitoiset [Thu, 3 Dec 2020 11:51:35 +0000 (12:51 +0100)]
radv: use 32-bit predication for skipping FCE on GFX10.3+

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/7897>

3 years agoradv: set the predication boolean as 32-bit if necessary
Samuel Pitoiset [Thu, 3 Dec 2020 11:42:12 +0000 (12:42 +0100)]
radv: set the predication boolean as 32-bit if necessary

CTS is missing tests.

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/7897>

3 years agoradv: fix exporting multiviews with NGG
Samuel Pitoiset [Fri, 27 Nov 2020 14:29:34 +0000 (15:29 +0100)]
radv: fix exporting multiviews with NGG

If a subpass uses multiview but the fragment shader doesn't load it
we still have to export it.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7815>

3 years agoradv: mark GFX10.3 as a non-conformant Vulkan implementation
Samuel Pitoiset [Fri, 4 Dec 2020 08:29:43 +0000 (09:29 +0100)]
radv: mark GFX10.3 as a non-conformant Vulkan implementation

In theory, GFX10.3 is not considered to be a conformant Vulkan
implementation because we didn't submit a conformance submission
package.

Cc: mesa-stable
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/7913>

3 years agoradeonsi: fix regression on gpus using the radeon winsys.
Dave Airlie [Sun, 6 Dec 2020 23:47:35 +0000 (09:47 +1000)]
radeonsi: fix regression on gpus using the radeon winsys.

For GPUs using the radeon kernel driver, num_se was never
getting initialised.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3939
Fixes: f2977a162af4 ("ac: fix min/max_good_num_cu_per_sa on gfx10.3 with disabled SEs")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7954>

3 years agoradeonsi/gfx10: added support for gfx10 conditional rendering
Indrajit Kumar Das [Tue, 10 Nov 2020 09:59:45 +0000 (15:29 +0530)]
radeonsi/gfx10: added support for gfx10 conditional rendering

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

3 years agor300,r600,radeonsi: inline struct radeon_cmdbuf to remove dereferences
Marek Olšák [Sun, 29 Nov 2020 09:09:02 +0000 (04:09 -0500)]
r300,r600,radeonsi: inline struct radeon_cmdbuf to remove dereferences

It's straightforward except that the amdgpu winsys had to be cleaned up
to allow this.

radeon_cmdbuf is inlined and optionally the winsys can save the pointer
to it. radeon_cmdbuf::priv points to the winsys cs structure.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7907>

3 years agopanfrost: Only set varyings and varying_buffers when varying_count > 0
Boris Brezillon [Sun, 22 Nov 2020 10:35:29 +0000 (11:35 +0100)]
panfrost: Only set varyings and varying_buffers when varying_count > 0

This removes the "warn: No Varying records" printed by pandecode.

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/7921>

3 years agopanfrost: Fix draw descriptor definition
Boris Brezillon [Wed, 2 Dec 2020 10:18:14 +0000 (11:18 +0100)]
panfrost: Fix draw descriptor definition

Move the 2 words padding out of the draw descriptor to fix Midgard tiler
job decoding.

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/7921>

3 years agopanfrost: Fix texture payload decoding
Boris Brezillon [Wed, 2 Dec 2020 10:10:04 +0000 (11:10 +0100)]
panfrost: Fix texture payload decoding

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/7921>

3 years agoisl: Fix android build
Lionel Landwerlin [Sat, 5 Dec 2020 10:52:56 +0000 (12:52 +0200)]
isl: Fix android build

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Mauro Rossi <issor.oruam@gmail.com>
Fixes: f08d8c849e0df3 ("intel/isl: Build gen 12.5")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3931
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7938>

3 years agoci: Run sanity job automatically for forked branches as well
Michel Dänzer [Thu, 3 Dec 2020 17:45:15 +0000 (18:45 +0100)]
ci: Run sanity job automatically for forked branches as well

This should make running the CI for forked branches less painful again.

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

3 years agoci: Manual test jobs don't need the Git tree
Michel Dänzer [Thu, 3 Dec 2020 17:59:25 +0000 (18:59 +0100)]
ci: Manual test jobs don't need the Git tree

If they do need something, it should be passed via artifacts from a
build job.

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

3 years agoci: sanity job doesn't need the Git tree
Michel Dänzer [Thu, 3 Dec 2020 17:58:09 +0000 (18:58 +0100)]
ci: sanity job doesn't need the Git tree

This should fix the sanity job taking >= 1 minute in some cases.

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

3 years agoci: Drop x86_build_old image
Michel Dänzer [Thu, 3 Dec 2020 17:11:00 +0000 (18:11 +0100)]
ci: Drop x86_build_old image

Currently not used for anything.

v2:
* Drop build script as well (Eric Anholt)

Fixes: a3543adc2628 "clover: set LLVM min version to 8.0.1"
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7902>

3 years agoci: Append $MESA_TEMPLATES_COMMIT to image tags
Michel Dänzer [Thu, 3 Dec 2020 16:54:05 +0000 (17:54 +0100)]
ci: Append $MESA_TEMPLATES_COMMIT to image tags

This ensures all images get rebuilt when we update to a newer
ci-templates commit.

v2:
* Append to WINDOWS(_UPSTREAM)_IMAGE instead of WINDOWS_TAG. The latter
  failed, apparently variables are not expanded recursively on the
  Windows runners.
* Use separate MESA_IMAGE_TAG/MESA_BASE_IMAGE variables instead of
  appending to each FDO_DISTRIBUTION_TAG/FDO_BASE_IMAGE separately for
  Linux jobs, to prevent accidentally dropping the suffix.

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

3 years agoci: Define global variable MESA_TEMPLATES_COMMIT for ci-templates commit
Michel Dänzer [Thu, 3 Dec 2020 16:30:56 +0000 (17:30 +0100)]
ci: Define global variable MESA_TEMPLATES_COMMIT for ci-templates commit

No functional change.

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

3 years agoci: Run git gc before creating Git cache tarball
Michel Dänzer [Fri, 4 Dec 2020 13:55:54 +0000 (14:55 +0100)]
ci: Run git gc before creating Git cache tarball

Since the job which creates the cache tarball starts from the previous
cache, the cache kept accumulating cruft and growing bigger.

This cuts the size of the tarball in half (from almost 600M to under
300M), which can translate to significant time savings when downloading
it on some runners.

v2:
* Use git gc --aggressive (Eric Anholt)

Reviewed-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7920>

3 years agomeson: Fix Clang microsoft-enum-value detection.
Vinson Lee [Wed, 11 Nov 2020 02:17:57 +0000 (18:17 -0800)]
meson: Fix Clang microsoft-enum-value detection.

Fixes: 3aee462781a ("meson: add windows compiler checks and libraries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7543>

3 years agogallium/osmesa: Return cleanly for OSMesaGetDepthBuffer() with no depth.
Eric Anholt [Thu, 3 Dec 2020 01:03:33 +0000 (17:03 -0800)]
gallium/osmesa: Return cleanly for OSMesaGetDepthBuffer() with no depth.

This makes our behavior match classic.

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

3 years agogallium/osmesa: Fix leak of the ST manager/api on library unload.
Eric Anholt [Wed, 2 Dec 2020 23:20:13 +0000 (15:20 -0800)]
gallium/osmesa: Fix leak of the ST manager/api on library unload.

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

3 years agogallium/osmesa: Fix data race on setting up the ST API.
Eric Anholt [Wed, 2 Dec 2020 23:10:51 +0000 (15:10 -0800)]
gallium/osmesa: Fix data race on setting up the ST API.

We're going to need it anyway, put it in the same call_once as the ST
manager.

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

3 years agogallium/osmesa: Remove the broken buffer-reuse scheme.
Eric Anholt [Wed, 2 Dec 2020 22:48:34 +0000 (14:48 -0800)]
gallium/osmesa: Remove the broken buffer-reuse scheme.

Besides leaking and a lack of thread-safety, it would also incorrectly
share front buffers if multiple contexts happened to use the same
size/format, as demonstrated by the new unit test.

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

3 years agogallium/osmesa: Fix flushing and Y-flipping of the depth buffer.
Eric Anholt [Wed, 11 Nov 2020 00:51:36 +0000 (16:51 -0800)]
gallium/osmesa: Fix flushing and Y-flipping of the depth buffer.

We were returning a pointer to use-after-free the depth buffer, not
updating it in after future rendering, and also not y flipping it.  A
little refactor to mostly reuse the color buffer's path makes it easy to
do it all right.

Adds a unit test to check for these bugs.

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

3 years agozink: assert all index values in ntv OpAccessChain constructor
Mike Blumenkrantz [Fri, 4 Dec 2020 19:05:11 +0000 (14:05 -0500)]
zink: assert all index values in ntv OpAccessChain constructor

this is super annoying

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7933>

3 years agoxmlconfig: Warn if parsing the engine/app versions fails.
Eric Anholt [Fri, 2 Oct 2020 23:58:09 +0000 (16:58 -0700)]
xmlconfig: Warn if parsing the engine/app versions fails.

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

3 years agoxmlconfig: Add unit tests for recent bugs in the driconf rewrite.
Eric Anholt [Wed, 7 Oct 2020 16:59:43 +0000 (09:59 -0700)]
xmlconfig: Add unit tests for recent bugs in the driconf rewrite.

This covers:
7fb4ab9ec122 ("driconf: Restore the ability to override driconf with the environment.")
2b977adff805 ("xmlconfig: fix scandir_filter")

and touches a bit more of drirc logic while I'm here.

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

3 years agodocs: update calendar and link releases notes for 20.2.4
Dylan Baker [Fri, 4 Dec 2020 20:57:16 +0000 (12:57 -0800)]
docs: update calendar and link releases notes for 20.2.4

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

3 years agorelnotes: Add sha256sums for 20.2.4
Dylan Baker [Fri, 4 Dec 2020 20:53:31 +0000 (12:53 -0800)]
relnotes: Add sha256sums for 20.2.4

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

3 years agodocs: add release notes for 20.2.4
Dylan Baker [Fri, 4 Dec 2020 20:10:59 +0000 (12:10 -0800)]
docs: add release notes for 20.2.4

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