platform/upstream/mesa.git
2 years agovenus: assign valid memoryTypeIndex of exportable ahb memory for image
Yiwei Zhang [Tue, 26 Oct 2021 06:59:47 +0000 (06:59 +0000)]
venus: assign valid memoryTypeIndex of exportable ahb memory for image

The current AHB spec leaves the input memoryTypeIndex undefined when
allocating exportable AHB memory backing an external image.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13537>

2 years agoamd/rgp: Use VGH clocks for RGP workaround.
Bas Nieuwenhuizen [Tue, 26 Oct 2021 23:49:23 +0000 (01:49 +0200)]
amd/rgp: Use VGH clocks for RGP workaround.

Hear that it matters for RGP. This is the most likely scenario where
we would hit this workaround, given the tooling for profiling on the
deck will set profile_peak as workaround for hangs.

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

2 years agoci/piglit-runner: Merge piglit-driver-*.txt files into driver-*.txt.
Emma Anholt [Mon, 25 Oct 2021 17:38:27 +0000 (10:38 -0700)]
ci/piglit-runner: Merge piglit-driver-*.txt files into driver-*.txt.

The test names are definitely unique (deqp has specific prefixes, piglit
uses '@' as a separator instead of '.'), so we can just have a single file
regardless of test type.  Merges the two groups of xfails together so you
can't mix up which file to edit (I certainly have), and so that we don't
need to introduce yet another set of files when we add gtest for libva.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13517>

2 years agoci/deqp-runner: Rename the deqp-drivername-*.txt files to drivername-*.txt
Emma Anholt [Mon, 25 Oct 2021 17:27:10 +0000 (10:27 -0700)]
ci/deqp-runner: Rename the deqp-drivername-*.txt files to drivername-*.txt

We have two testsuites with the same format for fails/flakes/skips files,
and test names that are definitely unique.  As I'm about to add a third
testsuite (gtest for libva-utils), so let's have just one file each for
fails/flakes/skips instead of one per type of testsuite.  This starts the
move with just the bulk rename of deqp.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13517>

2 years agoiris: destroy our mutexes a little later
Paulo Zanoni [Thu, 7 Oct 2021 20:48:39 +0000 (13:48 -0700)]
iris: destroy our mutexes a little later

While there seems to be no bug with the state things are today, I was
recently doing some debugging and put an iris_bo_wait() before a
bo_close() in iris_bufmgr_destroy(), which caused an issue since the
bo_deps_lock mutex had already been destroyed.

Since there are quite a few things we do with the bufmgr after
destroying the mutexes, I figured we should probably postpone mutex
destruction in order to be a little safer against future code
modifications like the one I just did.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13494>

2 years agodocs: update calendar for 21.3.0-rc3
Eric Engestrom [Wed, 27 Oct 2021 19:45:46 +0000 (20:45 +0100)]
docs: update calendar for 21.3.0-rc3

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

2 years agovenus: refactor private descriptor_set helpers to be private
Yiwei Zhang [Mon, 25 Oct 2021 22:34:04 +0000 (22:34 +0000)]
venus: refactor private descriptor_set helpers to be private

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13522>

2 years agoanv: Enable CCS for storage image formats
Sagar Ghuge [Mon, 16 Mar 2020 17:14:53 +0000 (10:14 -0700)]
anv: Enable CCS for storage image formats

v2: (Jason Ekstrand)
- Restructure if condition.
- Add early return.

v3: (Felix)
- Don't set aux_supported to false for storage image on XeHPG.

v4: (Nanley)
- Check image view format against fmt_list.
- Add helper anv_get_isl_format_with_usage.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3606>

2 years agoanv: Pass correct aux usage while filling out surface state
Sagar Ghuge [Tue, 28 Jan 2020 22:19:08 +0000 (14:19 -0800)]
anv: Pass correct aux usage while filling out surface state

While filling out surface state, pass correct aux usage for storage
images as we support compression on XeHPG.

v2: (Jason Ekstrand)
- Move assertion down a bit
- Use general layout aux usage

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3606>

2 years agozink: move all shader bo/sharedmem access to compiler passes
Mike Blumenkrantz [Wed, 20 Oct 2021 20:47:08 +0000 (16:47 -0400)]
zink: move all shader bo/sharedmem access to compiler passes

this moves more code to nir passes, which makes it easier to debug
and also allows deleting some much-more-difficult-to-read ntv code

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

2 years agozink: add more glsl base types to get_glsl_basetype()
Mike Blumenkrantz [Wed, 20 Oct 2021 20:52:01 +0000 (16:52 -0400)]
zink: add more glsl base types to get_glsl_basetype()

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

2 years agozink: move all 64-32bit shader store rewriting to nir pass
Mike Blumenkrantz [Wed, 20 Oct 2021 14:12:37 +0000 (10:12 -0400)]
zink: move all 64-32bit shader store rewriting to nir pass

this also enables natural 64bit stores on drivers that support it

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

2 years agozink: move shared intrinsic offset adjustments to compiler passes
Mike Blumenkrantz [Wed, 20 Oct 2021 14:19:26 +0000 (10:19 -0400)]
zink: move shared intrinsic offset adjustments to compiler passes

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

2 years agozink: move ssbo store offset adjustment to compiler passes
Mike Blumenkrantz [Wed, 20 Oct 2021 14:15:19 +0000 (10:15 -0400)]
zink: move ssbo store offset adjustment to compiler passes

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

2 years agozink: move all 64-32bit shader load rewriting to nir pass
Mike Blumenkrantz [Wed, 20 Oct 2021 14:02:08 +0000 (10:02 -0400)]
zink: move all 64-32bit shader load rewriting to nir pass

this also enables natural 64bit loads on drivers that support it

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

2 years agozink: run lower_io_to_scalar before rewriting bo access
Mike Blumenkrantz [Wed, 20 Oct 2021 15:03:00 +0000 (11:03 -0400)]
zink: run lower_io_to_scalar before rewriting bo access

this is happening in ntv anyway, so move it to the compiler here

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

2 years agozink: move bo load offset adjustment to compiler passes
Mike Blumenkrantz [Tue, 21 Sep 2021 21:11:05 +0000 (17:11 -0400)]
zink: move bo load offset adjustment to compiler passes

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

2 years agozink: run optimize_nir() only once during compile
Mike Blumenkrantz [Tue, 19 Oct 2021 18:39:32 +0000 (14:39 -0400)]
zink: run optimize_nir() only once during compile

running all the optimizer passes repeatedly is stupid

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

2 years agonir/lower_io_to_scalar: add support for bo and shared io
Mike Blumenkrantz [Wed, 20 Oct 2021 15:03:44 +0000 (11:03 -0400)]
nir/lower_io_to_scalar: add support for bo and shared io

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

2 years agoci/radeonsi: Use a deqp-runner suite suite for stoney.
Emma Anholt [Thu, 21 Oct 2021 20:36:46 +0000 (13:36 -0700)]
ci/radeonsi: Use a deqp-runner suite suite for stoney.

This should make it easier to tune the runtime, and enable KHR-GL* tests
in the future.  (Not done currently because something in KHR-GL* causes
oomkiller).

This drops the redundant FDO_CI_CONCURRENT settings, since the default on
these boards is 4 anyway.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13504>

2 years agoutil: use anonymous file for memory fd creation
Thomas Wagner [Wed, 13 Oct 2021 07:24:42 +0000 (09:24 +0200)]
util: use anonymous file for memory fd creation

The original implementation in os_memory_fd.c always uses memfds.
Replace this by using the already existing os_create_anonymous_file in
order to support older systems or systems without memfd.

Fixes: 1166ee9caf3 ("gallium: add utility and interface for memory fd allocations")

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

2 years agoradv: don't use a separate cache entry for GS copy shaders
Rhys Perry [Tue, 26 Oct 2021 10:14:00 +0000 (11:14 +0100)]
radv: don't use a separate cache entry for GS copy shaders

This seems simpler and probably faster.

This also fixes a warning for these CTS tests:
dEQP-VK.pipeline.creation_feedback.graphics_tests.vertex_stage_geometry_stage_delayed_destroy_fragment_stage_delayed_destroy
dEQP-VK.pipeline.creation_feedback.graphics_tests.vertex_stage_geometry_stage_fragment_stage
because we no longer set found_in_application_cache=false for pipelines
with NGG GS.

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

2 years agoradv: fix invalid wait_dst_stage_mask type
Samuel Pitoiset [Thu, 14 Oct 2021 07:49:58 +0000 (09:49 +0200)]
radv: fix invalid wait_dst_stage_mask type

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

2 years agoglsl/nir/linker: Also remove image variables
Jason Ekstrand [Mon, 18 Oct 2021 15:21:04 +0000 (10:21 -0500)]
glsl/nir/linker: Also remove image variables

If we don't, then the array shrinker may shrink them to an array of zero
images which can cause GLSL serialization to blow up but only the next
time the GLSL shader is loaded from the disk cache.

Fixes: b8ee37472d3e ("glsl: Use nir_var_mem_image for images")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5520
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13412>

2 years agobroadcom/compiler: fix condition encoding bug
Iago Toral Quiroga [Mon, 25 Oct 2021 11:12:35 +0000 (13:12 +0200)]
broadcom/compiler: fix condition encoding bug

When both AC and MC are set, AC is encoded in bits 0..1 not 0..3.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13527>

2 years agobroadcom/compiler: rework simultaneous peripheral access checks
Iago Toral Quiroga [Tue, 26 Oct 2021 09:30:15 +0000 (11:30 +0200)]
broadcom/compiler: rework simultaneous peripheral access checks

This was not quite correct in that our checks for the allowed cases
were not checking that there were no other peripheral access other
than the ones allowed.

For example, we allowed  wrtmuc signal and TMU write other than
TMUC, and we also allowed TMU read and VPM read/write. But we
cannot allow wrtmuc with TMU write other than TMUC and at the
same time a VPM write for example, so we can't just check if we
have a combination of allowed peripherals, we still need to check
that those are the only ones in use by the combined instructions.

Another example is that even if we allow a TMU write (other than TMUC)
with a wrtmuc signal, the resulting instruction must still have just
one TMU write other than TMUC, but we were allowing the merge if one
instruction signaled wrtmuc and the other wrote to tmu other than tmuc
without testing if the combined result would have 2 tmu writes.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13527>

2 years agogbm: add GBM_FORMAT_GR1616 and RG1616
Manuel Stoeckl [Sat, 23 Oct 2021 03:24:24 +0000 (23:24 -0400)]
gbm: add GBM_FORMAT_GR1616 and RG1616

Only GR1616 has a corresponding DRI format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13501>

2 years agogbm: add missing R16 case in gbm_bo_get_bpp
Manuel Stoeckl [Tue, 26 Oct 2021 01:30:35 +0000 (21:30 -0400)]
gbm: add missing R16 case in gbm_bo_get_bpp

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13523>

2 years agoradv: Add bufferDeviceAddressMultiDevice support.
Bas Nieuwenhuizen [Fri, 22 Oct 2021 13:29:55 +0000 (15:29 +0200)]
radv: Add bufferDeviceAddressMultiDevice support.

We don't support multiple devices so this is a nop. However, Baldurs Gate 3 enables
this and with the new more complete checks this causes device creation to fail.

Fixes: 2e5718c9574 ("vulkan: provide common functions to check device features")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5509
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13482>

2 years agoglthread: add a trivial thread-safe way to skip display list execution
Marek Olšák [Sat, 23 Oct 2021 22:26:30 +0000 (18:26 -0400)]
glthread: add a trivial thread-safe way to skip display list execution

There are apps that never put state changes into display lists.

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

2 years agoglthread: add an option to make glCheckFramebufferStatus a no-op
Marek Olšák [Mon, 18 Oct 2021 12:16:23 +0000 (08:16 -0400)]
glthread: add an option to make glCheckFramebufferStatus a no-op

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

2 years agoglthread: don't sync for glIsEnabled with a few enums
Marek Olšák [Mon, 18 Oct 2021 03:10:31 +0000 (23:10 -0400)]
glthread: don't sync for glIsEnabled with a few enums

viewperf benefits

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

2 years agoglthread: don't execute display lists if they have no effect
Marek Olšák [Fri, 22 Oct 2021 20:59:17 +0000 (16:59 -0400)]
glthread: don't execute display lists if they have no effect

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

2 years agonir/lower_samplers_as_deref: rewrite more image intrinsics
Mike Blumenkrantz [Fri, 22 Oct 2021 18:04:45 +0000 (14:04 -0400)]
nir/lower_samplers_as_deref: rewrite more image intrinsics

"I think we want to lower them."

-Jason "And I do know how the pass works" Ekstrand

fixes #5540

cc: mesa-stable

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

2 years agozink: more accurately update samplemask for fs shader keys
Mike Blumenkrantz [Tue, 26 Oct 2021 18:03:56 +0000 (14:03 -0400)]
zink: more accurately update samplemask for fs shader keys

the fs samplemask needs to be updated on framebuffer rebind and on
fs bind to ensure that the key gets updated in time for the pipeline
change

fixes #5559

cc: mesa-stable

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

2 years agozink: fix gl_SampleMaskIn spirv generation
Mike Blumenkrantz [Fri, 22 Oct 2021 17:47:16 +0000 (13:47 -0400)]
zink: fix gl_SampleMaskIn spirv generation

the uint[1] -> uint dance is only relevant on the first load, so move
the variable type shuffling inside the create block to avoid breaking successive
loads

fixes #5543

cc: mesa-stable

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

2 years agoradv: fence->user_ptr and ctx->fence_map are now totally unused.
Dave Airlie [Tue, 26 Oct 2021 02:36:20 +0000 (12:36 +1000)]
radv: fence->user_ptr and ctx->fence_map are now totally unused.

Garbage collect them.

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

2 years agomesa: Require MRT support for GL3/ES3
Alyssa Rosenzweig [Wed, 20 Oct 2021 12:36:22 +0000 (08:36 -0400)]
mesa: Require MRT support for GL3/ES3

OpenGL 3.0 requires the driver can draw to 8 simultaneous render
targets. Similarly, OpenGL ES 3.0 requires the driver can draw to 4
simultaneous render targets. Fix the version computation logic to take
this into account.

On Mali T720, we support ~all features of OpenGL ES 3.1 except we only
support a single render target. Mali T720 should advertise OpenGL 2.1
and OpenGL ES 2.0 only. With the previous logic, it incorrectly
advertised OpenGL ES 3.1.

v2: Lie about the minimum for GL 3.0 to make freedreno a3xx happy. Add
Emma's reviewed-by.

v3: Update the Mali T720 CI expectations. There are tests that pass on
GLES3 but not GLES2. Unclear if these are dEQP bugs or Mesa bugs, lima
hits the same issues. Add them to the known fails

Note to mesa-stable maintainers: this downgrades the OpenGL version
advertised on Mali T720. As such, this patch should apply to the
unreleased 21.3 (Eric) but should NOT be backported to any released Mesa
versions (21.2 or older should NOT have this patch). This is a bit of a
compromise; Emma agreed with this plan on IRC.

Reported-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v2]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> [v2]
Cc: 21.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13455>

2 years agomicrosoft/compiler: Use memcpy instead of a union to write dxil_features
Michael Tang [Fri, 22 Oct 2021 23:03:11 +0000 (16:03 -0700)]
microsoft/compiler: Use memcpy instead of a union to write dxil_features

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13496>

2 years agonir/lower_blend: Use correct clamp for SNORM
Alyssa Rosenzweig [Sat, 23 Oct 2021 01:12:59 +0000 (21:12 -0400)]
nir/lower_blend: Use correct clamp for SNORM

nir_lower_blend was written against the OpenGL ES 3.2 specification,
which does not support blending SNORM render targets. The ES spec
says that non-floating point buffers get clamped to [0, 1] before
blending. The story is not so simple: SNORM buffers are blendable in
OpenGL and must clamped to [-1, 1] rather than [0, 1]. Handle this case.

NIR does have the fsat_signed_mali instruction to clamp to [-1, 1], but
it is only implemented in Panfrost, and this pass is in common code.
Open code it instead. Panfrost optimizes the open coded version, so this
is good enough.

Fixes SNORM subtests of Piglit arb_texture_view-rendering-formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13499>

2 years agopanvk: Pass through alpha_zero_nop/one_store flags
Alyssa Rosenzweig [Sun, 24 Oct 2021 23:15:26 +0000 (19:15 -0400)]
panvk: Pass through alpha_zero_nop/one_store flags

When constructing the Internal Blend Descriptor for fixed-function
blending, set the alpha_zero_nop/one_store flags based on the given
equation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13508>

2 years agopanfrost: Pass through alpha_zero_nop/one_store
Alyssa Rosenzweig [Sun, 24 Oct 2021 23:14:42 +0000 (19:14 -0400)]
panfrost: Pass through alpha_zero_nop/one_store

Compute whether these flags can be set when constructing the blend CSO
and pass them in the appropriate place in the Internal Blend Descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13508>

2 years agopanfrost: Test alpha_zero_nop/one_store predicates
Alyssa Rosenzweig [Sun, 24 Oct 2021 23:13:16 +0000 (19:13 -0400)]
panfrost: Test alpha_zero_nop/one_store predicates

For each blend mode in our blending unit tests, add whether we can set
the alpha_zero_nop and alpha_one_store flags and check against the
predicates.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13508>

2 years agopanfrost: Add alpha_zero_nop/one_store predicate
Alyssa Rosenzweig [Sun, 24 Oct 2021 23:05:46 +0000 (19:05 -0400)]
panfrost: Add alpha_zero_nop/one_store predicate

Some Mali GPUs can avoid storing to the tilebuffer if src alpha = 0, and
can replace blending with a store if src alpha = 1. This saves power in
the common case of alpha blending. Add predicates to check if these
optimizations are valid for a given blend equation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13508>

2 years agopanfrost: Rename depth bias fields
Alyssa Rosenzweig [Sun, 24 Oct 2021 23:33:37 +0000 (19:33 -0400)]
panfrost: Rename depth bias fields

Make it clear that the distinction is the facingness of the primitives
the depth bias applies to.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13509>

2 years agoiris: Drop hint if primitive id is required or not
Sagar Ghuge [Thu, 21 Oct 2021 19:54:01 +0000 (12:54 -0700)]
iris: Drop hint if primitive id is required or not

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13474>

2 years agoanv: Drop hint if primitive id is required or not
Sagar Ghuge [Thu, 21 Oct 2021 19:48:47 +0000 (12:48 -0700)]
anv: Drop hint if primitive id is required or not

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13474>

2 years agointel/compiler: Track primitive id in domain/evaluation shader
Sagar Ghuge [Fri, 22 Oct 2021 16:51:42 +0000 (09:51 -0700)]
intel/compiler: Track primitive id in domain/evaluation shader

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggeted-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13474>

2 years agointel/genxml: Add new Primitive ID Not Required bit field to 3DSTATE_DS
Sagar Ghuge [Thu, 21 Oct 2021 19:45:08 +0000 (12:45 -0700)]
intel/genxml: Add new Primitive ID Not Required bit field to 3DSTATE_DS

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13474>

2 years agozink: don't add dynamic vertex pipeline states if no attribs are used
Mike Blumenkrantz [Mon, 25 Oct 2021 18:11:50 +0000 (14:11 -0400)]
zink: don't add dynamic vertex pipeline states if no attribs are used

adding the states requires that vertex attribs be bound, but it's illegal
to bind 0 attribs

cc: mesa-stable

fixes #5558

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

2 years agointel/compiler: Don't use SIMD larger than needed for workgroup
Caio Marcelo de Oliveira Filho [Fri, 8 Oct 2021 03:18:39 +0000 (20:18 -0700)]
intel/compiler: Don't use SIMD larger than needed for workgroup

Unless we are combining multiple workgroups in the same HW thread,
there's no advantage of using SIMD16 when SIMD8 already fits the
entire workgroup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13249>

2 years agointel/compiler: Use SIMD selection helpers for variable workgroup size
Caio Marcelo de Oliveira Filho [Mon, 11 Oct 2021 14:49:40 +0000 (07:49 -0700)]
intel/compiler: Use SIMD selection helpers for variable workgroup size

Variable workgroup size works by compiling as much SIMD variants as
possible and then selecting the right one during dispatch (when the
actual workgroup size is passed to us).

Instead of replicating the logic in a separate function, reuse the
same logic for regular SIMD selection.  And move function for that
together with the remaining simd selection functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13249>

2 years agointel/compiler: Use SIMD selection helpers for CS
Caio Marcelo de Oliveira Filho [Thu, 7 Oct 2021 07:23:07 +0000 (00:23 -0700)]
intel/compiler: Use SIMD selection helpers for CS

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13249>

2 years agointel/compiler: Add helpers to select SIMD for compute shaders
Caio Marcelo de Oliveira Filho [Thu, 7 Oct 2021 05:37:42 +0000 (22:37 -0700)]
intel/compiler: Add helpers to select SIMD for compute shaders

Clean up the logic and move it to functions that work with prog_data
attributes to select the right SIMD.  This shouldn't change any
behavior compared to the original.

Having it extracted will allow reuse by Task/Mesh and make it easier
to write tests.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13249>

2 years agozink: stop exporting PIPE_SHADER_CAP_FP16_DERIVATIVES
Mike Blumenkrantz [Tue, 26 Oct 2021 15:05:31 +0000 (11:05 -0400)]
zink: stop exporting PIPE_SHADER_CAP_FP16_DERIVATIVES

spirv doesn't support this

fixes #5561

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13530>

2 years agomicrosoft/spirv_to_dxil: turn sysvals into input varyings
Michael Tang [Fri, 8 Oct 2021 21:19:04 +0000 (14:19 -0700)]
microsoft/spirv_to_dxil: turn sysvals into input varyings

Fixes: b47090c5b33 ("spirv: Always declare FragCoord as a sysval")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13276>

2 years agoanv: fix push constant lowering with bindless shaders
Lionel Landwerlin [Tue, 26 Oct 2021 11:27:18 +0000 (14:27 +0300)]
anv: fix push constant lowering with bindless shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9fa1cdfe7ffd ("intel/rt: Implement push constants as global memory reads")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13529>

2 years agozink: add notes about binding points which aren't counted in util funcs
Mike Blumenkrantz [Fri, 22 Oct 2021 18:35:53 +0000 (14:35 -0400)]
zink: add notes about binding points which aren't counted in util funcs

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

2 years agozink: don't check rebind count outside of buffer/image rebind function
Mike Blumenkrantz [Fri, 22 Oct 2021 18:33:29 +0000 (14:33 -0400)]
zink: don't check rebind count outside of buffer/image rebind function

zink_resource_has_binds() only checks descriptor binds, and this doesn't
include streamout or fb bindings, so call these functions from the specific
rebind points to ensure those cases are also checked

fixes #5541

cc: mesa-stable

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

2 years agozink: only reset zink_resource::so_valid on buffer rebind
Mike Blumenkrantz [Fri, 22 Oct 2021 18:32:40 +0000 (14:32 -0400)]
zink: only reset zink_resource::so_valid on buffer rebind

otherwise this is going to randomly modify some image properties

cc: mesa-stable

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

2 years agozink: don't break early when applying fb clears
Mike Blumenkrantz [Fri, 22 Oct 2021 18:24:48 +0000 (14:24 -0400)]
zink: don't break early when applying fb clears

a resource can be bound to multiple fb attachments, each with
its own clear, so ensure that all of these are applied

fixes #5542

cc: mesa-stable

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

2 years agozink: detect prim type more accurately for tess/gs lines
Mike Blumenkrantz [Fri, 22 Oct 2021 17:24:40 +0000 (13:24 -0400)]
zink: detect prim type more accurately for tess/gs lines

u_reduced_prim() can't determine the output primitive when vs isn't the
last vertex stage, so store this from the appropriate shader info and use
it when it's available

fixes #5547

cc: mesa-stable

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

2 years agozink: split out descriptor pool sizing into separate struct
Mike Blumenkrantz [Mon, 18 Oct 2021 16:05:51 +0000 (12:05 -0400)]
zink: split out descriptor pool sizing into separate struct

this migrates existing uses of zink_descriptor_layout_key to use
zink_descriptor_pool_key instead, which ends up being more helpful overall
since it puts all the pool-related data into a single struct

this also has a(n incredibly small) benefit of removing VkDescriptorPoolSize[6]
from every program data struct and deduplicating it into the descriptor
pool key set

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

2 years agozink: reduce hashed region of zink_descriptor_layout_key
Mike Blumenkrantz [Mon, 18 Oct 2021 15:48:33 +0000 (11:48 -0400)]
zink: reduce hashed region of zink_descriptor_layout_key

only the first 3 members of VkDescriptorSetLayoutBinding are useful here

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

2 years agozink: eliminate a hole in zink_descriptor_layout_key
Mike Blumenkrantz [Mon, 18 Oct 2021 15:33:38 +0000 (11:33 -0400)]
zink: eliminate a hole in zink_descriptor_layout_key

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

2 years agozink: rename zink_descriptor_layout_key::num_descriptors -> num_bindings
Mike Blumenkrantz [Mon, 18 Oct 2021 15:24:13 +0000 (11:24 -0400)]
zink: rename zink_descriptor_layout_key::num_descriptors -> num_bindings

this was always misnamed and thus misleading

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

2 years agod3d10umd: Update for set_sampler_views take_ownership parameter.
Jose Fonseca [Mon, 25 Oct 2021 09:58:25 +0000 (10:58 +0100)]
d3d10umd: Update for set_sampler_views take_ownership parameter.

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

2 years agod3d10umd: Fix MSVC build.
Jose Fonseca [Mon, 19 Jul 2021 13:39:45 +0000 (14:39 +0100)]
d3d10umd: Fix MSVC build.

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

2 years agod3d10umd: Update for transfer interface changes.
Jose Fonseca [Mon, 19 Jul 2021 13:35:48 +0000 (14:35 +0100)]
d3d10umd: Update for transfer interface changes.

Update for eb74f977693221eb1419f4827f549d48251f22da.

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

2 years agod3d10umd: Rename Dxgi.h to DxgiFns.h.
Jose Fonseca [Mon, 19 Jul 2021 13:34:06 +0000 (14:34 +0100)]
d3d10umd: Rename Dxgi.h to DxgiFns.h.

To avoid clashing with the WinSDK's dxgi.h header, which we'll need later.

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

2 years agovulkan/wsi/wayland: don't expose surface formats not fully supported
Lionel Landwerlin [Wed, 20 Oct 2021 08:08:34 +0000 (11:08 +0300)]
vulkan/wsi/wayland: don't expose surface formats not fully supported

Depending on whether an application creates a swapchain with
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR or not, we might use 2
different formats with the compositor.

This change makes sure that we support all the underlying formats
before exposing the corresponding VkFormat to the application.

v2: Don't forget get_formats2() (Ivan)

v3: Replace formats with availability boolean (Simon)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 151b65b21190 ("vulkan/wsi/wayland: generalize modifier handling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5522
Reviewed-by: Ivan Briano <ivan.briano@intel.com> (v2)
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13453>

2 years agopanfrost: support PIPE_RESOURCE_PARAM_NPLANES query
Derek Foreman [Mon, 25 Oct 2021 20:58:13 +0000 (15:58 -0500)]
panfrost: support PIPE_RESOURCE_PARAM_NPLANES query

While panfrost doesn't support multi-planar formats directly, we might
still import multi-planar BOs through GBM (for example, when doing direct
scanout in weston).

We can support PIPE_RESOURCE_PARAM_NPLANES by simply counting the
planes we have.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13039>

2 years agopanfrost: Support planar formats for scanout
Derek Foreman [Mon, 25 Oct 2021 20:53:21 +0000 (15:53 -0500)]
panfrost: Support planar formats for scanout

While panfrost doesn't directly support planar formats, we can get here
from GBM. This happens, for example, when weston is trying to use a BO
for direct scanout.

Walk the list of planes to find the right one.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13039>

2 years agoradv: lower the viewport index to zero when the VGT stage doesn't export it
Samuel Pitoiset [Wed, 6 Oct 2021 09:53:47 +0000 (11:53 +0200)]
radv: lower the viewport index to zero when the VGT stage doesn't export it

This is allowed and the fragment shader should read zero.

No fossils db changes.

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

2 years agomeson: build freedreno tools when other parts of freedreno not enabled
Ilia Mirkin [Mon, 25 Oct 2021 00:06:20 +0000 (20:06 -0400)]
meson: build freedreno tools when other parts of freedreno not enabled

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13510>

2 years agofreedreno: support lua54
Ilia Mirkin [Mon, 25 Oct 2021 00:05:40 +0000 (20:05 -0400)]
freedreno: support lua54

This is the default version in gentoo, and it apparently uses the lua54
variant rather than lua.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13510>

2 years agofreedreno/drm: Move suballoc_bo to device
Rob Clark [Mon, 25 Oct 2021 22:59:23 +0000 (15:59 -0700)]
freedreno/drm: Move suballoc_bo to device

Having it in msm_pipe isn't saving any locking.  But it does mean that
cleanup_fences() can drop the last pipe reference, which in turn drops
the last suballoc_bo reference, which can cause recursion back into the
bo cache.

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

2 years agofreedreno/drm: Add some asserts
Rob Clark [Mon, 25 Oct 2021 17:13:25 +0000 (10:13 -0700)]
freedreno/drm: Add some asserts

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

2 years agomesa: add a no_error path to _mesa_handle_bind_buffer_gen
Marek Olšák [Wed, 20 Oct 2021 02:45:47 +0000 (22:45 -0400)]
mesa: add a no_error path to _mesa_handle_bind_buffer_gen

It only helps when it's inlined, which is true for glBindBuffer.

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

2 years agomesa: remove redundant flagging USAGE_ARRAY_BUFFER
Marek Olšák [Mon, 25 Oct 2021 00:39:11 +0000 (20:39 -0400)]
mesa: remove redundant flagging USAGE_ARRAY_BUFFER

We do that in gl*Pointer, glBindVertexBuffer, etc.

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

2 years agomesa: move setting USAGE_PIXEL_PACK_BUFFER out of BindBuffer to reduce overhead
Marek Olšák [Wed, 20 Oct 2021 03:48:51 +0000 (23:48 -0400)]
mesa: move setting USAGE_PIXEL_PACK_BUFFER out of BindBuffer to reduce overhead

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

2 years agomesa: remove USAGE_ELEMENT_ARRAY_BUFFER because it's unused and adding overhead
Marek Olšák [Wed, 20 Oct 2021 03:30:07 +0000 (23:30 -0400)]
mesa: remove USAGE_ELEMENT_ARRAY_BUFFER because it's unused and adding overhead

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

2 years agovulkan: Fix entrypoint generation when compiling for x86 with MSVC
Boris Brezillon [Mon, 25 Oct 2021 16:37:21 +0000 (18:37 +0200)]
vulkan: Fix entrypoint generation when compiling for x86 with MSVC

When compiling for x86 with MSVC, Vulkan API entry points follow the
__stdcall convention (VKAPI_CALL maps to __stdcall), which uses the
following name mangling:

   _<function_name>@<arguments_size>

Fix the vk_entrypoint_stub()/alternatename definitions accordingly.

Fixes: 6d44b21d4fd ("vulkan: Fix weak symbol emulation when compiling with MSVC")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13516>

2 years agonir/serialize: Make more space for intrinsic_op allowing 1024 ops
Danylo Piliaiev [Wed, 20 Oct 2021 14:36:27 +0000 (17:36 +0300)]
nir/serialize: Make more space for intrinsic_op allowing 1024 ops

We are close to the limit of 512 intrinsics, make more space to
be able to support up to 1024 intrinsics.

Take one bit from packed_const_indices, they shouldn't suffer in
a common case.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13456>

2 years agoaco: only load streamout buffers if streamout is enabled
Samuel Pitoiset [Mon, 25 Oct 2021 11:58:20 +0000 (13:58 +0200)]
aco: only load streamout buffers if streamout is enabled

The streamout_config SGPR is used to determine if streamout is enabled.

This fixes a GPU hang with various transform feedback tests:
 - dEQP-GLES3.functional.transform_feedback.*
 - KHR-GL46.transform_feedback.api_errors_test
 - KHR-GL46.draw_indirect.basic-draw*-xfbPaused
 - KHR-GL46.geometry_shader.api.draw_calls_while_tf_is_paused

Cc: 21.3 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/13514>

2 years agoradv: report error messages when the driver can't be initialized
Samuel Pitoiset [Wed, 13 Oct 2021 16:53:13 +0000 (18:53 +0200)]
radv: report error messages when the driver can't be initialized

Not only with RADV_DEBUG=startup.

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

2 years agoradv: fix build errors with Android
Samuel Pitoiset [Wed, 20 Oct 2021 07:23:26 +0000 (09:23 +0200)]
radv: fix build errors with Android

Fixes: 49c3a88fadd ("radv: implement VK_KHR_format_feature_flags2")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5518
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/13450>

2 years agoradv: remove old RADV_TRACE_FILE warning
Samuel Pitoiset [Wed, 20 Oct 2021 07:49:27 +0000 (09:49 +0200)]
radv: remove old RADV_TRACE_FILE warning

It has been replaced by RADV_DEBUG=hang a year ago.

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

2 years agopanfrost: Remove duplicated #if
Alyssa Rosenzweig [Tue, 5 Oct 2021 22:52:13 +0000 (18:52 -0400)]
panfrost: Remove duplicated #if

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13208>

2 years agopanfrost: Remove ancient TODO
Alyssa Rosenzweig [Tue, 5 Oct 2021 20:17:02 +0000 (16:17 -0400)]
panfrost: Remove ancient TODO

This was implemented ages ago.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13208>

2 years agopanfrost: Enable AFBC on v7
Alyssa Rosenzweig [Tue, 5 Oct 2021 20:18:22 +0000 (16:18 -0400)]
panfrost: Enable AFBC on v7

The bugs blocking this have been resolved, so flip on AFBC again and get
moar fps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13205>

2 years agopanfrost: Decompress for incompatible AFBC formats
Alyssa Rosenzweig [Sat, 16 Oct 2021 23:44:53 +0000 (19:44 -0400)]
panfrost: Decompress for incompatible AFBC formats

AFBC is keyed to the format. Depending on the hardware, we'll get an
Invalid Data Fault or a GPU timeout if we attempt to sample from an
AFBC-compressed RGBA8 texture as R32F (for example).

Fixes Piglit ./bin/arb_texture_view-rendering-formats_gles3 with AFBC.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13205>

2 years agopanfrost: Add internal afbc_formats
Alyssa Rosenzweig [Sat, 16 Oct 2021 23:45:27 +0000 (19:45 -0400)]
panfrost: Add internal afbc_formats

We need to know the internal (physical) formats used for AFBC of a given
logical format, in order to check format compatibility and determine if
we need to decompress AFBC for conformance.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13205>

2 years agopanfrost: Workaround ISSUE_TSIX_2033
Alyssa Rosenzweig [Tue, 5 Oct 2021 23:20:03 +0000 (19:20 -0400)]
panfrost: Workaround ISSUE_TSIX_2033

According to mali_kbase, all Bifrost and Valhall GPUs are affected by
issue TSIX_2033. This hardware bug breaks the INTERSECT frame shader
mode when forcing clean_tile_writes. What does that mean?

The hardware considers a tile "clean" if it has been cleared but not
drawn to. Setting clean_tile_write forces the hardware to write back
such "clean" tiles to main memory.

Bifrost hardware supports frame shaders, which insert a rectangle into
every tile according to a configured rule. Frame shaders are used in
Panfrost to implement tile reloads (i.e. LOAD_OP_LOAD). Two modes are
relevant to the current discussion: ALWAYS, which always inserts a frame
shader, and INTERSECT, which tries to only insert where there is
geometry. Normally, we use INTERSECT for tile reloads as it is more
efficient than ALWAYS-- it allows us to skip reloads of tiles that are
discarded and never written back to memory.

From a software perspective, Panfrost's current logic is correct: if we
clear, we set clean_tile_writes, else we use an INTERSECT frame shader.
There is no software interaction between the two.

Unfortunately, there is a hardware interaction. The hardware forces
clean_tile_writes in certain circumstances when AFBC is used.
Ordinarily, this is a hardware implementation detail and invisible to
software. Unfortunately, this implicit clean tile write is enough to
trigger the hardware bug when using INTERSECT. As such, we need to
detect this case and use ALWAYS instead of INTERSECT for correct
results.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13205>

2 years agopanfrost: Fix gl_FragColor lowering
Alyssa Rosenzweig [Sat, 16 Oct 2021 20:14:00 +0000 (16:14 -0400)]
panfrost: Fix gl_FragColor lowering

The gl_FragColor lowering in the fragment shader depends on the number
of render targets, which can change every set_framebuffer_state.
set_framebuffer_state thus needs to force a rebind of the fragment
shader.

Fixes a regression in Piglit fbo-drawbuffers-none gl_FragColor -auto
-fbo from enabling AFBC on Mali G52.

Fixes: 28ac4d1e005 ("panfrost: Call nir_lower_fragcolor based on key")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13498>

2 years agopanfrost: Remove unused MIDGARD_NO_AFBC quirk
Alyssa Rosenzweig [Tue, 5 Oct 2021 20:09:27 +0000 (16:09 -0400)]
panfrost: Remove unused MIDGARD_NO_AFBC quirk

This is not Midgard-specific and is handled outside of the quirks
infrastructure now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13497>

2 years agopanfrost,panvk: Use dev->has_afbc instead of quirks
Alyssa Rosenzweig [Tue, 5 Oct 2021 20:05:56 +0000 (16:05 -0400)]
panfrost,panvk: Use dev->has_afbc instead of quirks

This uses the new property for AFBC we've added. The AFBC quirk is
applied only to v4, and we only set dev->has_afbc on v5+ so this is not
a regression. It now respects the hardware-specific AFBC disable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13497>

2 years agopanfrost: Detect implementations support AFBC
Alyssa Rosenzweig [Tue, 5 Oct 2021 20:01:00 +0000 (16:01 -0400)]
panfrost: Detect implementations support AFBC

AFBC is an optional feature on Bifrost. If it is missing, a bit will be
set in the poorly named AFBC_FEATURES register. Check this so we can act
appropriately.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13497>

2 years agoturnip: Drop the assertion about the temporary bit in sync fd imports.
Emma Anholt [Thu, 21 Oct 2021 20:06:38 +0000 (13:06 -0700)]
turnip: Drop the assertion about the temporary bit in sync fd imports.

Khronos's conclusion was that you only need the bit when you want
temporary and there's a choice between temporary and permanent.

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

2 years agogallium/u_blitter: Read MSAA z/s from sampler's .x instead of .y or .z.
Emma Anholt [Tue, 19 Oct 2021 22:36:09 +0000 (15:36 -0700)]
gallium/u_blitter: Read MSAA z/s from sampler's .x instead of .y or .z.

u_format defines depth formats as having depth in .x, mesa/st samples for
depth or stencil in .x (not making use of any other channels).
util_make_fs_blit_zs() looks for depth or stencil in .x.  The MSAA path
was the exception looking for it in .z or .y, which was causing drivers to
need to splat their values out to the other channels.  This should be
better on hardware that can emit shorter messages for sampling just the
first channels.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13446>