platform/upstream/mesa.git
3 years agonir/builder: Add a name format arg to nir_builder_init_simple_shader().
Eric Anholt [Mon, 26 Oct 2020 18:37:25 +0000 (11:37 -0700)]
nir/builder: Add a name format arg to nir_builder_init_simple_shader().

This cleans up a bunch of gross sprintfs and keeps the caller from needing
to remember to ralloc_strdup.  I added a couple of '"%s", name ? name :
""' to radv where I didn't fully trace through whether a non-null name was
being passed in.

I also took the liberty of adding a basic name to a few shaders (pan_blit,
unit tests)

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

3 years agonir/builder: Drop the mem_ctx arg from nir_builder_init_simple_shader().
Eric Anholt [Mon, 26 Oct 2020 18:28:33 +0000 (11:28 -0700)]
nir/builder: Drop the mem_ctx arg from nir_builder_init_simple_shader().

This looks a lot more simple now!

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

3 years agointel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().
Eric Anholt [Mon, 26 Oct 2020 18:25:08 +0000 (11:25 -0700)]
intel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().

These two consumers were the only ones out of the ~65 calls to
init_simple_shader, so there's a pretty clear consensus on how to allocate
simple shaders.  I suspect that actually these would be just fine with
b.shader being the mem_ctx, but that would take a bit more rework.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>

3 years agonir/tests: Simplify the mem_ctx setup in our unit tests.
Eric Anholt [Mon, 26 Oct 2020 18:22:49 +0000 (11:22 -0700)]
nir/tests: Simplify the mem_ctx setup in our unit tests.

These all make a simple shader and free it at the end, that can be our
mem_ctx.

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

3 years agonir/builder_tests: Drop unused lin_ctx.
Eric Anholt [Mon, 26 Oct 2020 18:20:30 +0000 (11:20 -0700)]
nir/builder_tests: Drop unused lin_ctx.

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

3 years agonir_builder: Return a new builder from nir_builder_init_simple_shader().
Eric Anholt [Mon, 26 Oct 2020 17:44:53 +0000 (10:44 -0700)]
nir_builder: Return a new builder from nir_builder_init_simple_shader().

It's a little inline function, so we can just RAII it for better
ergonomics.

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

3 years agonir/algebraic: optimize bitfield_select(a, iand(a, b), c)
Samuel Pitoiset [Tue, 10 Nov 2020 13:10:35 +0000 (14:10 +0100)]
nir/algebraic: optimize bitfield_select(a, iand(a, b), c)

fossils-db (Vega10):
Totals from 242 (0.17% of 139517) affected shaders:
CodeSize: 853752 -> 852752 (-0.12%)
Instrs: 165944 -> 165694 (-0.15%)
Cycles: 855720 -> 854528 (-0.14%)
VMEM: 83772 -> 83668 (-0.12%); split: +0.13%, -0.25%
SMEM: 12360 -> 12316 (-0.36%)
SClause: 8222 -> 8238 (+0.19%)

Only helps Control.

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

3 years agogallium: Add format modifier plane count query
James Jones [Mon, 3 Feb 2020 21:17:01 +0000 (13:17 -0800)]
gallium: Add format modifier plane count query

Rather than hard-code a list of all the format
modifiers supported by any gallium driver and the
number of aux planes they require in the dri state
tracker, add a screen proc that queries the number
of planes required for a given modifier+format
pair.

Since the only format modifiers that require
auxiliary planes currently are the iris driver's
I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, and
I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS, the absence
of the screen proc implies zero aux planes for all
of the screen's supported modifiers.  Hence, when
a driver does not expose the proc, derive the
number of planes directly from the format.

Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>

3 years agogallium: Add pipe_screen::is_dmabuf_modifier_supported
James Jones [Thu, 6 Aug 2020 23:13:07 +0000 (16:13 -0700)]
gallium: Add pipe_screen::is_dmabuf_modifier_supported

Add a "do you support this modifier?" query to all
drivers which support format modifiers. This will
be used in a subsequent change to fully
encapsulate modifier validation and auxiliary plane
count calculation logic behind the driver
abstraction, which will in turn simplify the
addition of device-class-specific format modifiers
in the nouveau driver.

Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>

3 years agomesa: Undefine ALIGN macro before it is used as a function name. Issues on MacOS.
Duncan Hopkins [Wed, 26 Aug 2020 16:39:56 +0000 (17:39 +0100)]
mesa: Undefine ALIGN macro before it is used as a function name. Issues on MacOS.

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

3 years agov3dv: VK_KHR_display extension support
Steven Houston [Wed, 4 Nov 2020 17:45:10 +0000 (17:45 +0000)]
v3dv: VK_KHR_display extension support

When VK_KHR_display is enabled it needs to open the primary
node on the vc4/vc5 display device, so pass it to
physical_device_init().
Extension functions call through to the wsi_common_display.c
implementations.

v2: Follow Mesa conventions for comments and char *
    Refer to vc4 display device in comments.
v3: Added Copyright © 2020 Raspberry Pi
v4: Test device has primary node when using simulator.
v5: Assert that we have a primary device. Fix trailing blank space.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3692
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7515>

3 years agollvmpipe: just use draw_regions in draw/line setup.
Dave Airlie [Mon, 9 Nov 2020 06:49:44 +0000 (16:49 +1000)]
llvmpipe: just use draw_regions in draw/line setup.

This fixes:
dEQP-VK.draw.scissor*

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>

3 years agolavapipe: disable SNORM blending for now
Dave Airlie [Thu, 5 Nov 2020 03:18:57 +0000 (13:18 +1000)]
lavapipe: disable SNORM blending for now

dEQP-VK.pipeline.blend.dual_source.format.r16g16b16a16_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.format.r16g16b16a16_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail
dEQP-VK.pipeline.blend.format.r8g8b8a8_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail

All fail due to the 1 - mdc or 1 - mca alpha channel in the last quadrant.

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>

3 years agolavapipe: enable alpha to one.
Dave Airlie [Tue, 3 Nov 2020 22:59:53 +0000 (08:59 +1000)]
lavapipe: enable alpha to one.

CTS seems fine with this.

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>

3 years agou_blitter: port radv 3D blit coords logic.
Dave Airlie [Mon, 9 Nov 2020 01:06:27 +0000 (11:06 +1000)]
u_blitter: port radv 3D blit coords logic.

The current code fails a lot of VK CTS tests, this fixes them all:
dEQP-VK*blit_image*3d*

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>

3 years agogallium: handle empty cbuf slots in framebuffer samples helper
Dave Airlie [Wed, 4 Nov 2020 19:42:34 +0000 (05:42 +1000)]
gallium: handle empty cbuf slots in framebuffer samples helper

If we have cbufs but they are all empty, default
to returning the fb->samples.

Fixes:
dEQP-VK.pipeline.multisample.mixed_count.1_4_unused
on lavapipe

v2:
drop unneeded chunk (Roland)

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>

3 years agozink: only add MESA WSI structs for specific devices
Iago Toral Quiroga [Fri, 6 Nov 2020 08:20:42 +0000 (09:20 +0100)]
zink: only add MESA WSI structs for specific devices

Some drivers will drop warnings about seeing these structs in the
pNext chain and not handling them. This change makes it so we
only include the structs with Vulkan drivers that are known to
require them for proper behavior (v3dv only for now) to avoid the
warnings.

It should be noted that here we are only supressing the messages
from Zink. Since the Mesa Vulkan WSI code will include these structs,
when native Vulkan Mesa drivers are used without Zink they might
still dump these messages.

Requested by Mike Blumenkrantz.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7523>

3 years agonir/validate: Size the set of blocks to avoid rehashing.
Eric Anholt [Tue, 20 Oct 2020 21:32:28 +0000 (14:32 -0700)]
nir/validate: Size the set of blocks to avoid rehashing.

We can use num_blocks (if it's been initialized by some pass indexing
blocks) to pre-size our table, which helps on validating shaders with many
blocks which would otherwise reallocate the set several times.

No statistically significant performance difference on softpipe
KHR-GL33.texture_swizzle.functional runtime (n=15).  A previous, similar
variant of this patch cut .3% of instructions in softpipe shader-db ./run
shaders/closed/steam/borderlands-2/35* (an arbitrary set of shaders that
completed in reasonable amount of time) according to callgrind.

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

3 years agoutil/set: Fix the _mesa_set_clear function to not leave tombstones.
Eric Anholt [Tue, 20 Oct 2020 21:37:10 +0000 (14:37 -0700)]
util/set: Fix the _mesa_set_clear function to not leave tombstones.

This implementation was broken and should have just been the same as the
hash_table_clear() one, which I copied over here.  It was setting all
formerly-present entries to deleted, yet also setting deleted_entries to
0.  This meant that all new searches or additions after clearing would
have to reprobe the whole table until a rehash happened, and that rehash
would be delayed because we violated the deleted_entries invariant.

No statistically significant performance difference on softpipe
KHR-GL33.texture_swizzle.functional runtime (n=18)

Fixes: 5c075b085585 ("util/set: add a set_clear function")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>

3 years agoutil/hash_table: Clean up the _mesa_hash_table_clear() implementation.
Eric Anholt [Tue, 20 Oct 2020 22:04:27 +0000 (15:04 -0700)]
util/hash_table: Clean up the _mesa_hash_table_clear() implementation.

Use the entry_is_present() helper to clarify what's going on with
deletion, and then we can remove the special continue for NULL since we're
just writing NULL anyway (which the CPU cache will elide for us).

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

3 years agoutil/hash_table: Handle NULL ht in _mesa_hash_table_clear().
Eric Anholt [Tue, 20 Oct 2020 22:01:15 +0000 (15:01 -0700)]
util/hash_table: Handle NULL ht in _mesa_hash_table_clear().

This is the one useful bit of _mesa_set_clear() that wasn't in
_mesa_hash_table_clear().

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

3 years agoclover: add support for opencl C features
Dave Airlie [Tue, 10 Nov 2020 05:08:46 +0000 (15:08 +1000)]
clover: add support for opencl C features

This adds support to the compiler and api for this CL 3.0 feature.

fixes CTS compiler features_macro

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

3 years agoclover/spirv: avoid strings for version handling
Pierre Moreau [Tue, 10 Nov 2020 01:44:45 +0000 (11:44 +1000)]
clover/spirv: avoid strings for version handling

This is extracted from Pierre's WIP versioning patch.

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

3 years agoclover/llvm: don't use strings for version handling.
Pierre Moreau [Tue, 10 Nov 2020 01:39:08 +0000 (11:39 +1000)]
clover/llvm: don't use strings for version handling.

This is extracted from Pierre's WIP versioning patch.

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

3 years agoclover: add platform supported extensions with version
Dave Airlie [Wed, 7 Oct 2020 03:35:13 +0000 (13:35 +1000)]
clover: add platform supported extensions with version

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

3 years agoclover: add support for versioned device extensions
Dave Airlie [Wed, 7 Oct 2020 03:42:26 +0000 (13:42 +1000)]
clover: add support for versioned device extensions

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

3 years agoclover: report device CLC versions for 3.0
Dave Airlie [Mon, 2 Nov 2020 05:54:11 +0000 (15:54 +1000)]
clover: report device CLC versions for 3.0

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

3 years agoclover: add CL_PLATFORM_NUMERIC_VERSION support
Dave Airlie [Fri, 6 Nov 2020 06:37:19 +0000 (16:37 +1000)]
clover: add CL_PLATFORM_NUMERIC_VERSION support

This is part of CL 3.0

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

3 years agoclover/platform: move versioning to core object.
Dave Airlie [Tue, 10 Nov 2020 00:07:44 +0000 (10:07 +1000)]
clover/platform: move versioning to core object.

This reads the env var once at constructor time and stores it
in the platform object.

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

3 years agoclover: add CL 3.0 CL_DEVICE_NUMERIC_VERSION support
Dave Airlie [Fri, 6 Nov 2020 00:52:18 +0000 (10:52 +1000)]
clover: add CL 3.0 CL_DEVICE_NUMERIC_VERSION support

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

3 years agoclover/device: store version in device at constructor.
Dave Airlie [Tue, 10 Nov 2020 00:03:47 +0000 (10:03 +1000)]
clover/device: store version in device at constructor.

This reads the env vars once and stores the value, and converts
to strings when needed

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

3 years agoutil: add a env getter for versions
Dave Airlie [Mon, 9 Nov 2020 23:56:21 +0000 (09:56 +1000)]
util: add a env getter for versions

This lets us parse a standard major.minor version.

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

3 years agoclover: rename platform/device apis using strings
Pierre Moreau [Mon, 9 Nov 2020 23:44:14 +0000 (09:44 +1000)]
clover: rename platform/device apis using strings

Just add as_string to these to faciliate the non-string ones.

(extracted by airlied from pmoreau patch).

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

3 years agoclover/queue: Flush automatically if applications do not flush themselves
Karol Herbst [Wed, 4 Nov 2020 22:05:51 +0000 (23:05 +0100)]
clover/queue: Flush automatically if applications do not flush themselves

With the image_read_write OpenCL CTS we can get a stack overflow handling
all the events as the application itself never flushes.

We need to address this in two ways:
1. flush the queue once an abritary amoung of events piled up.
2. Drop event deps once they get a fence assigned.

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

3 years agomesa/bufferobj: Fix valgrind complaints
Rob Clark [Mon, 9 Nov 2020 21:58:42 +0000 (13:58 -0800)]
mesa/bufferobj: Fix valgrind complaints

==328537== Mutex reinitialization: mutex 0x1281afb0, recursion count 0, owner 0.
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x117DA107: mtx_init (threads_posix.h:207)
==328537==    by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537==    by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281afb0 was first observed at:
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x117DA107: mtx_init (threads_posix.h:207)
==328537==    by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537==    by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)

Signed-off-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/7517>

3 years agomesa/fbo: Fix valgrind complaints
Rob Clark [Mon, 9 Nov 2020 21:55:14 +0000 (13:55 -0800)]
mesa/fbo: Fix valgrind complaints

Just statically initialize the dummy/incomplete framebuffer/renderbuffer
to avoid re-intializing their mutex.

==328537== Mutex reinitialization: mutex 0x1281bd28, recursion count 0, owner 0.
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x118F9727: mtx_init (threads_posix.h:207)
==328537==    by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537==    by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281bd28 was first observed at:
==328537==    at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537==    by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537==    by 0x118F9727: mtx_init (threads_posix.h:207)
==328537==    by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537==    by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537==    by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537==    by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537==    by 0x1173C323: st_create_context (st_context.c:1019)
==328537==    by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537==    by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537==    by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537==    by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537==    by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)

Signed-off-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/7517>

3 years agoutil/threaded_context: use driver's ubo alignment for constant buffer uploads
Mike Blumenkrantz [Fri, 6 Nov 2020 15:48:46 +0000 (10:48 -0500)]
util/threaded_context: use driver's ubo alignment for constant buffer uploads

this is another case where the hardcoded value was specific to radeon drivers

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

3 years agofreedreno: Protect gmem_cache ralloc allocations
Rob Clark [Mon, 9 Nov 2020 22:11:09 +0000 (14:11 -0800)]
freedreno: Protect gmem_cache ralloc allocations

Since the ralloc context for cache_key allocation is shared between all
the contexts hanging off a screen, we need to allocate the key under the
screen->lock.

Fixes: 91f9bb99c5e ("freedreno: add gmem state cache")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>

3 years agofreedreno/drm: Rework APPEND() macro
Rob Clark [Tue, 3 Nov 2020 18:18:33 +0000 (10:18 -0800)]
freedreno/drm: Rework APPEND() macro

In particular I wanted the nr_foo increment to be after assignment..
mostly just to track down a potential race.  (This wasn't it, but I
like this color for the bikeshed better.)

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

3 years agofreedreno/batch: Cleanup submit immediately after flush
Rob Clark [Thu, 29 Oct 2020 22:28:11 +0000 (15:28 -0700)]
freedreno/batch: Cleanup submit immediately after flush

No reason to keep these around if the batch is not immediately unref'd.

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

3 years agofreedreno/drm: Drop growable submit_bos table
Rob Clark [Thu, 29 Oct 2020 22:23:21 +0000 (15:23 -0700)]
freedreno/drm: Drop growable submit_bos table

Since we are not tracking reloc flags per submit, we can just construct
this table at flush time, rather than using a second growable table that
is in sync with msm_submit->bos.

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

3 years agofreedreno: Add submit lock
Rob Clark [Wed, 28 Oct 2020 17:47:07 +0000 (10:47 -0700)]
freedreno: Add submit lock

Add a lock to synchronize batch flush (which can be triggered from a
different ctx) with cmdstream emit.

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

3 years agofreedreno: Make fd_context_batch() return a reference
Rob Clark [Wed, 28 Oct 2020 16:51:15 +0000 (09:51 -0700)]
freedreno: Make fd_context_batch() return a reference

This protects better against another context triggering a batch flush
and unref while the first context is doing resource tracking.

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

3 years agofreedreno/batch: Move fd_batch_get_prologue()
Rob Clark [Wed, 28 Oct 2020 16:15:45 +0000 (09:15 -0700)]
freedreno/batch: Move fd_batch_get_prologue()

To keep fd_batch_flush() and it's internal helper batch_flush()
together.  Also update an obsolete comment.

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

3 years agofreedreno/drm: Make ring refcnt atomic again
Rob Clark [Sat, 24 Oct 2020 19:20:57 +0000 (12:20 -0700)]
freedreno/drm: Make ring refcnt atomic again

In general, rings are not shared across contexts/threads.  But this
can happen with texture stateobjs, which can be invalidated by other
contexts.

And while we're here, lets convert the rest of freedreno/drm to
u_atomic

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

3 years agofreedreno: Use ctx seqno in batch cache key
Rob Clark [Sat, 24 Oct 2020 19:09:12 +0000 (12:09 -0700)]
freedreno: Use ctx seqno in batch cache key

It is smaller than a pointer, and doesn't run into problems of context
destroy/create cycle ending up with the same address.

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

3 years agofreedreno/a6xx: Texture cache locking
Rob Clark [Fri, 23 Oct 2020 21:56:09 +0000 (14:56 -0700)]
freedreno/a6xx: Texture cache locking

Originally the tex cache was never touched from other contexts, but
rebind_resource() changed that.  Add some locking to protect tex cache
against multi-threaded access.

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

3 years agofreedreno: batch-cache locking
Rob Clark [Fri, 23 Oct 2020 19:46:47 +0000 (12:46 -0700)]
freedreno: batch-cache locking

Move the locking slightly to protect hashtable lookups as well.

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

3 years agofreedreno: Fix spurious flush
Rob Clark [Thu, 22 Oct 2020 21:43:35 +0000 (14:43 -0700)]
freedreno: Fix spurious flush

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

3 years agofreedreno: Convert to mesa_log*()
Rob Clark [Sun, 8 Nov 2020 19:14:22 +0000 (11:14 -0800)]
freedreno: Convert to mesa_log*()

debug_printf() isn't terribly great in multi-threaded situations.. but
since we now have a simple util/log.h, which even plays nicely with
logcat on android, lets use that instead.

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

3 years agofreedreno: debug cleanup
Rob Clark [Thu, 22 Oct 2020 21:43:10 +0000 (14:43 -0700)]
freedreno: debug cleanup

Fix an extra \n and remove a useless trace (I guess after 7yrs it is no
longer actually TODO)

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

3 years agofreedreno/drm: Convert to simple_mtx
Rob Clark [Sat, 7 Nov 2020 19:50:18 +0000 (11:50 -0800)]
freedreno/drm: Convert to simple_mtx

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

3 years agofreedreno: Drop fd_context_lock() and friends
Rob Clark [Tue, 27 Oct 2020 23:44:38 +0000 (16:44 -0700)]
freedreno: Drop fd_context_lock() and friends

These were actually just wrappers for the screen->lock, left over from
moving things around a long time ago.  Lets drop them to make things
more explicit (that we are locking the screen, not the context).

Involves a bit of shuffling things around to untangle header deps, but
no functional change.

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

3 years agost/mesa: fix use-after-free when updating shader info in st_link_nir
Marek Olšák [Mon, 9 Nov 2020 21:20:13 +0000 (16:20 -0500)]
st/mesa: fix use-after-free when updating shader info in st_link_nir

Fixes: 549ae5f8 "st/mesa: make sure prog->info is up to date for NIR (v2)"

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3756
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3685

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

3 years agod3d12: avoid searching twice for bos
Erik Faye-Lund [Mon, 9 Nov 2020 20:31:59 +0000 (21:31 +0100)]
d3d12: avoid searching twice for bos

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agod3d12: ensure all compoents of clip-distances are written
Erik Faye-Lund [Thu, 5 Nov 2020 17:46:15 +0000 (18:46 +0100)]
d3d12: ensure all compoents of clip-distances are written

This fixes a regression that happened after rebasing on master, where we
end up not writing all components of the clip-distance array, which the
DXIL validation code in the D3D12 runtime treats as an error.

To ensure we don't end up overwriting a previous wrire, enable
nir_shader_compiler_options::lower_all_io_to_temps as well.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agod3d12: introduce d3d12 gallium driver
Erik Faye-Lund [Sun, 26 May 2019 08:43:12 +0000 (10:43 +0200)]
d3d12: introduce d3d12 gallium driver

This driver will allow running OpenGL and OpenCL on top of Gallium
for any hardware supporting Microsoft's Direct3D 12 on Windows 10.

This is the combination of a lot of commits from our development branch,
containing code from several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agomicrosoft: add resource state manager utility code
BillKristiansen [Wed, 27 May 2020 15:23:16 +0000 (17:23 +0200)]
microsoft: add resource state manager utility code

The code originates from this repository:
https://github.com/microsoft/D3D12TranslationLayer

It will be used in the next commit.

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

3 years agomicrosoft/compiler: translate nir to dxil
Erik Faye-Lund [Wed, 4 Sep 2019 09:51:29 +0000 (11:51 +0200)]
microsoft/compiler: translate nir to dxil

Here's the code to emit DXIL code from NIR. It's big and bulky as-is,
and it needs to be split up a bit.

This is the combination of a lot of commits from our development branch,
containing code by several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agomicrosoft/compiler: add dxil-util code
Erik Faye-Lund [Wed, 4 Sep 2019 09:51:29 +0000 (11:51 +0200)]
microsoft/compiler: add dxil-util code

This is support-code to emit the DirectX Intermediate Language, which is
a dialect of LLVM 3.7 bitcode. Because modern versions of LLVM doesn't
support emitting bitcode for older versions, and we can't rely on an old
LLVM version because we need the OpenCL support from Clang later on, we
instead implement our own LLVM bitcode encoder as part of this work.

See the official DXIL documentation for more details on DXIL:
https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst

The reason this comes as a separate library, is because we're also using
this code as the basis for an OpenCL C compiler, which will follow as a
separate merge-request later.

This is the combination of more than 230 commits from our development
branch, including the work from several authors.

Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agocompiler: add SYSTEM_BIT_FRONT_FACE
Erik Faye-Lund [Tue, 3 Nov 2020 09:40:23 +0000 (10:40 +0100)]
compiler: add SYSTEM_BIT_FRONT_FACE

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

3 years agogallium: Wrap some header files into "extern C"
Louis-Francis Ratté-Boulianne [Wed, 22 Jul 2020 20:25:38 +0000 (16:25 -0400)]
gallium: Wrap some header files into "extern C"

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agonir/print: print GS extra info
Gert Wollny [Wed, 17 Jun 2020 08:54:44 +0000 (10:54 +0200)]
nir/print: print GS extra info

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agoutil/format_zs: Add C++ include handling
Gert Wollny [Wed, 10 Jun 2020 12:34:32 +0000 (14:34 +0200)]
util/format_zs: Add C++ include handling

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

3 years agogallium/util: Wrap suballoc.h into extern C
Louis-Francis Ratté-Boulianne [Wed, 4 Mar 2020 16:13:39 +0000 (11:13 -0500)]
gallium/util: Wrap suballoc.h into extern C

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agoutil/slab: allow usage from c++ code
Erik Faye-Lund [Sun, 26 May 2019 08:42:10 +0000 (10:42 +0200)]
util/slab: allow usage from c++ code

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agogallium/nir: Wrap tgsi_to_nir header in extern C
Louis-Francis Ratté-Boulianne [Tue, 10 Mar 2020 18:07:41 +0000 (14:07 -0400)]
gallium/nir: Wrap tgsi_to_nir header in extern C

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>

3 years agosoftpipe: correct signature of get_compiler_options
Erik Faye-Lund [Tue, 10 Nov 2020 08:38:45 +0000 (09:38 +0100)]
softpipe: correct signature of get_compiler_options

This gets rid of a harmless but annoying compiler warning on MSVC.

Fixes: 73bafb5ee38 ("gallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7524>

3 years agopanfrost: Fix ->reads_frag_coord assignment
Boris Brezillon [Tue, 10 Nov 2020 10:01:50 +0000 (11:01 +0100)]
panfrost: Fix ->reads_frag_coord assignment

Let's assign ->reads_frag_coord only once to handle the sysval case
(used on Bifrost) correctly.

Fixes: f1de952b695b ("panfrost: Use shader_info harder")
Cc: 20.3 <mesa-stable>
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/7527>

3 years agopanfrost: Fix Bifrost blend descriptor emission
Boris Brezillon [Tue, 10 Nov 2020 08:57:24 +0000 (09:57 +0100)]
panfrost: Fix Bifrost blend descriptor emission

Format conversion only works if the num_comps field is set to 4,
probably because the tile buffer always store those 4 components
internally.

Fixes: edd98aac3f16 ("panfrost: Add support for native wallpapering on Bifrost")
Fixes: 8389976b7c09 ("panfrost: XML-ify the blend descriptors")
Cc: 20.3 <mesa-stable>
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/7527>

3 years agopan/bi: Model writemasks correctly
Alyssa Rosenzweig [Mon, 9 Nov 2020 18:44:07 +0000 (13:44 -0500)]
pan/bi: Model writemasks correctly

We don't handle partial write masks in the backend yet, so for now we
can't pretend we do, else we'll have RA bugs. Fixes

dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha

Fixes: b2c6cf2b6db1 ("pan/bi: Eliminate writemasks in the IR")
Cc: 20.3 <mesa-stable>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>

3 years agointel/dump_gpu: add support for MMAP_OFFSET ioctl
Lionel Landwerlin [Tue, 10 Nov 2020 13:03:23 +0000 (15:03 +0200)]
intel/dump_gpu: add support for MMAP_OFFSET ioctl

Our driver started using this method to mmap the BOs and we need to
hook it to track the dirtiness of the BO.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7528>

3 years agopanfrost: Fix AFBC blits of resources with faked RGTC
Icecream95 [Mon, 2 Nov 2020 07:32:18 +0000 (20:32 +1300)]
panfrost: Fix AFBC blits of resources with faked RGTC

Because u_transfer_helper changes resources back from the real format
to the emulated format after creation, we need to fix the format enum
for resources with fake compression when doing blits to/from AFBC.

Fixes: acb8dcfebdd ("panfrost: Choose AFBC when available")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7400>

3 years agozink: setup version dependent VkPhysicalDeviceVulkan*Features and VkPhysicalDeviceVul...
Duncan Hopkins [Sun, 8 Nov 2020 12:11:12 +0000 (12:11 +0000)]
zink: setup version dependent VkPhysicalDeviceVulkan*Features and VkPhysicalDeviceVulkan*Properties.

Adds template support to zink_device_info.py for setting up the VkPhysicalDeviceVulkan* version Features and Properties structures.
When the next Vulkan version with newer structure is released a single like should only need to be added.
Note, the 11 structures where not added until Vk 1.2, so that is not a typo.
This code does not stop the use of clonflicting extensions or other VkPhysicalDevice*Features structures with VkPhysicalDeviceVulkan*Features structures when calling vkCreateDevice()

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7496>

3 years agorbug: Handle non-TGSI shaders
Icecream95 [Sun, 8 Nov 2020 10:52:23 +0000 (23:52 +1300)]
rbug: Handle non-TGSI shaders

NIR shaders aren't yet transferred over the wire, but at least they
don't cause a crash.

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

3 years agorbug: Forward get_compiler_options to pipe driver
Icecream95 [Sun, 8 Nov 2020 10:50:59 +0000 (23:50 +1300)]
rbug: Forward get_compiler_options to pipe driver

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

3 years agoaco: fix combining add/sub to b2i if a new dest needs to be allocated
Samuel Pitoiset [Mon, 9 Nov 2020 18:42:22 +0000 (19:42 +0100)]
aco: fix combining add/sub to b2i if a new dest needs to be allocated

The uses vector needs to be expanded to avoid out of bounds access
and to make sure the number of uses is initialized to 0.

This fixes combining more v_and(a, v_subbrev_co_u32).

fossilds-db (Vega10):
Totals from 4574 (3.28% of 139517) affected shaders:
SGPRs: 291625 -> 292217 (+0.20%); split: -0.01%, +0.21%
VGPRs: 276368 -> 276188 (-0.07%); split: -0.07%, +0.01%
SpillSGPRs: 455 -> 533 (+17.14%)
SpillVGPRs: 76 -> 78 (+2.63%)
CodeSize: 23327500 -> 23304152 (-0.10%); split: -0.17%, +0.07%
MaxWaves: 22044 -> 22066 (+0.10%)
Instrs: 4583064 -> 4576301 (-0.15%); split: -0.15%, +0.01%
Cycles: 47925276 -> 47871968 (-0.11%); split: -0.13%, +0.01%
VMEM: 1599363 -> 1597473 (-0.12%); split: +0.08%, -0.19%
SMEM: 331461 -> 331126 (-0.10%); split: +0.08%, -0.18%
VClause: 80639 -> 80696 (+0.07%); split: -0.02%, +0.09%
SClause: 155992 -> 155993 (+0.00%); split: -0.02%, +0.02%
Copies: 333482 -> 333318 (-0.05%); split: -0.12%, +0.07%
Branches: 70967 -> 70968 (+0.00%)
PreSGPRs: 187078 -> 187711 (+0.34%); split: -0.01%, +0.35%
PreVGPRs: 244918 -> 244785 (-0.05%)

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

3 years agoturnip: Remove pipeline NULL check.
Vinson Lee [Tue, 10 Nov 2020 02:02:21 +0000 (18:02 -0800)]
turnip: Remove pipeline NULL check.

pipeline cannot be NULL since pipeline->layout->num_sets was just
checked.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking pipeline suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7521>

3 years agoswr: Initialize FetchJit member mpFetchInfo in constructor.
Vinson Lee [Thu, 29 Oct 2020 02:36:08 +0000 (19:36 -0700)]
swr: Initialize FetchJit member mpFetchInfo in constructor.

Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member mpFetchInfo is not
initialized in this constructor nor in any functions that it
calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7359>

3 years agoReset new features for 21.0 development cycle
Dylan Baker [Tue, 10 Nov 2020 00:21:18 +0000 (16:21 -0800)]
Reset new features for 21.0 development cycle

3 years agoBump version for 21.0 devel
Dylan Baker [Tue, 10 Nov 2020 00:19:50 +0000 (16:19 -0800)]
Bump version for 21.0 devel

3 years agointel: Pointer to SCISSOR_RECT array should be 64B aligned
Anuj Phogat [Thu, 5 Nov 2020 18:33:44 +0000 (10:33 -0800)]
intel: Pointer to SCISSOR_RECT array should be 64B aligned

v2: Apply the workaround to all gen hardawre

Ref: GEN:BUG:1409725701
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7463>

3 years agobroadcom/compiler: Allow spills of temporaries from TMU reads
Arcady Goldmints-Orlov [Mon, 26 Oct 2020 04:03:04 +0000 (00:03 -0400)]
broadcom/compiler: Allow spills of temporaries from TMU reads

Since spills and fills use the TMU, special care has to be taken to
avoid putting one between a TMU setup instruction and the corresponding
reads or writes. This change adds logic to move fills up and move spills
down to avoid interrupting such sequences.

This allows compiling 6 more programs from shader-db. Other stats:

total spills in shared programs: 446 -> 446 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 606 -> 610 (0.66%)
fills in affected programs: 38 -> 42 (10.53%)
helped: 0
HURT: 2

total instructions in shared programs: 19330 -> 19363 (0.17%)
instructions in affected programs: 3299 -> 3332 (1.00%)
helped: 0
HURT: 5

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6606>

3 years agonir/algebraic: optimize bitfield_select(a, b, 0) to iand(a, b)
Samuel Pitoiset [Fri, 6 Nov 2020 15:43:41 +0000 (16:43 +0100)]
nir/algebraic: optimize bitfield_select(a, b, 0) to iand(a, b)

(src0 & src1) | (~src0 & src2) to (src0 & src1).

fossils-db (Polaris10):
Totals from 873 (0.63% of 138014) affected shaders:
SGPRs: 33781 -> 33733 (-0.14%)
VGPRs: 37704 -> 37520 (-0.49%); split: -0.51%, +0.02%
CodeSize: 3861460 -> 3853424 (-0.21%); split: -0.21%, +0.00%
MaxWaves: 5306 -> 5305 (-0.02%)
Instrs: 743798 -> 743486 (-0.04%); split: -0.04%, +0.00%
Cycles: 10962244 -> 10960936 (-0.01%); split: -0.01%, +0.00%
VMEM: 128309 -> 128350 (+0.03%); split: +0.33%, -0.30%
SMEM: 44797 -> 44113 (-1.53%); split: +0.02%, -1.54%
Copies: 71875 -> 71674 (-0.28%); split: -0.31%, +0.03%
PreSGPRs: 23484 -> 23479 (-0.02%)
PreVGPRs: 34582 -> 34529 (-0.15%)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7479>

3 years agopan/bi: Add support for load_instance_id
Boris Brezillon [Mon, 9 Nov 2020 08:20:07 +0000 (09:20 +0100)]
pan/bi: Add support for load_instance_id

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

3 years agopan/bi: Add support for load_vertex_id
Boris Brezillon [Fri, 6 Nov 2020 13:08:33 +0000 (14:08 +0100)]
pan/bi: Add support for load_vertex_id

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

3 years agopanfrost: Allow linear ZS resources on Bifrost
Boris Brezillon [Fri, 6 Nov 2020 11:50:41 +0000 (12:50 +0100)]
panfrost: Allow linear ZS resources on Bifrost

Linear Z/S buffers should be handled correctly now.

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

3 years agopan/bi: Add support for ushr
Boris Brezillon [Fri, 6 Nov 2020 11:01:26 +0000 (12:01 +0100)]
pan/bi: Add support for ushr

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

3 years agopan/bi: Add support for ishr
Boris Brezillon [Fri, 6 Nov 2020 10:51:48 +0000 (11:51 +0100)]
pan/bi: Add support for ishr

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

3 years agopan/bi: Fix ARSHIFT definitions
Boris Brezillon [Fri, 6 Nov 2020 10:50:43 +0000 (11:50 +0100)]
pan/bi: Fix ARSHIFT definitions

src1 exists, and must be set to ZERO. If we don't add this source,
lane2 refers to src2 which does not exists.

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

3 years agopan/bi: Move bitwise op packing out of bi_pack_fma()
Boris Brezillon [Fri, 6 Nov 2020 10:18:15 +0000 (11:18 +0100)]
pan/bi: Move bitwise op packing out of bi_pack_fma()

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

3 years agopan/bi: Get rid of bi_emit_ld_uniform()
Boris Brezillon [Fri, 6 Nov 2020 08:57:26 +0000 (09:57 +0100)]
pan/bi: Get rid of bi_emit_ld_uniform()

Now that we lower uniforms to UBO we can get rid of bi_emit_ld_uniform().

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

3 years agopan/bi: Lower uniforms to UBO
Boris Brezillon [Fri, 6 Nov 2020 08:56:09 +0000 (09:56 +0100)]
pan/bi: Lower uniforms to UBO

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

3 years agopan/bi: Add support for load_ubo
Boris Brezillon [Fri, 6 Nov 2020 08:55:02 +0000 (09:55 +0100)]
pan/bi: Add support for load_ubo

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

3 years agopan/bi: Fix swizzle handling in bi_copy_src()
Boris Brezillon [Thu, 5 Nov 2020 14:13:28 +0000 (15:13 +0100)]
pan/bi: Fix swizzle handling in bi_copy_src()

The number of src swizzle to initialize depends on the number of source
properties (size and number of components) not the destination ones.

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

3 years agopan/bi: Support centroid and sample interpolations
Boris Brezillon [Thu, 5 Nov 2020 11:11:54 +0000 (12:11 +0100)]
pan/bi: Support centroid and sample interpolations

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

3 years agopan/bi: Extract LD_VAR sample field from ins->load_vary.interp_mode
Boris Brezillon [Thu, 5 Nov 2020 11:10:42 +0000 (12:10 +0100)]
pan/bi: Extract LD_VAR sample field from ins->load_vary.interp_mode

So we can extend bi_emit_ld_vary() to support centroid and sample modes.

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

3 years agopanfrost: Expose GLES3 features on Bifrost when PAN_MESA_DEBUG=deqp
Boris Brezillon [Wed, 4 Nov 2020 17:48:04 +0000 (18:48 +0100)]
panfrost: Expose GLES3 features on Bifrost when PAN_MESA_DEBUG=deqp

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

3 years agopanfrost: Force late pixel kill when depth/stencil is written from the FS
Boris Brezillon [Mon, 9 Nov 2020 09:10:10 +0000 (10:10 +0100)]
panfrost: Force late pixel kill when depth/stencil is written from the FS

If we don't do that, pixels might be killed early thus preventing the
fragment shader from being called and updating the depth/stencil value.

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

3 years agoradeon/vcn : Corrected dpb_size calculation for VP9_2
SureshGuttula [Fri, 6 Nov 2020 18:05:28 +0000 (23:35 +0530)]
radeon/vcn : Corrected dpb_size calculation for VP9_2

Currently dpb_size for VP9 profile0 and profile2 is same eventhough
for profile2 dpb_size is  multiplied by extra 3/2 and we are
seeing VM_L2_PROTECTION_FAULT error and ring vcn_dec timeout because
of less dpb_size for VP9_2.

This patch will correct dpb_size for VP9_2 and fixes the issue.

Signed-off-by: SureshGuttula <suresh.guttula@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7480>