platform/upstream/mesa.git
3 years agopanfrost/ci: Split rules by ISA
Alyssa Rosenzweig [Fri, 21 May 2021 15:01:02 +0000 (11:01 -0400)]
panfrost/ci: Split rules by ISA

Panfrost has two compilers, one for Midgard GPUs and one for Bifrost
GPUs. The respective compilers are src/panfrost/midgard and
src/panfrost/bifrost. Changes internal to just one compiler (or
disassembler) cannot affect the other hardware, so there's no need to
run extra jobs in these cases.

Also split out common vs Gallium panfrost so we can do the right thing
for panvk builds in the imminent future.

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

3 years agopanfrost: Fix polygon list size computations
Icecream95 [Sat, 22 May 2021 19:10:19 +0000 (07:10 +1200)]
panfrost: Fix polygon list size computations

As noted in f5c293425fa ("panfrost: Correct polygon size computations"),
"We do have to be careful to add the header size to total comptued BO
size."

Fixes: ff3eada7eb4 ("panfrost: Use the generic preload and FB helpers in the gallium driver")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4660
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4737
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10943>

3 years agoradeonsi: explicitly return support for all index buffer formats
Mike Blumenkrantz [Fri, 21 May 2021 09:18:52 +0000 (05:18 -0400)]
radeonsi: explicitly return support for all index buffer formats

this should not change current behavior

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10914>

3 years agoci/lava: Add caching proxies for trace downloads
Tomeu Vizoso [Mon, 24 May 2021 08:26:41 +0000 (10:26 +0200)]
ci/lava: Add caching proxies for trace downloads

To avoid having to download the same traces again and again in each job,
use the caching proxy configured in the Collabora lab.

We can currently hardcode it like this because we don't test the same
driver in more than one lab, but when that changes we will need a more
flexible approach.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10949>

3 years agodocs: update link to #lima
Erik Faye-Lund [Fri, 21 May 2021 11:48:53 +0000 (13:48 +0200)]
docs: update link to #lima

Similar to the other channels, #lima is also moving to OFTC, so let's
update the links as appropriate.

While we're at it, fix the URI scheme to use a slash as a host/channel
separator, and drop the hash for maximum compatibility.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10917>

3 years agodocs: update location of #panfrost
Erik Faye-Lund [Fri, 21 May 2021 11:06:43 +0000 (13:06 +0200)]
docs: update location of #panfrost

Panfrost has already moved their IRC-channel to OFTC, so let's update
the docs as well.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10917>

3 years agodocs: update link to #zink
Erik Faye-Lund [Fri, 21 May 2021 10:49:20 +0000 (12:49 +0200)]
docs: update link to #zink

We have decided to follow what's happening with #dri-devel for #zink as
well, so let's update our link there as well.

While we're at it, let's switch the link to an anonymous link, because
we're not referring to it anywhere, so it doesn't need to be named.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10917>

3 years agodocs: promote #dri-devel on oftc over freenode
Erik Faye-Lund [Fri, 21 May 2021 10:38:19 +0000 (12:38 +0200)]
docs: promote #dri-devel on oftc over freenode

Due to the recent changes at Freenode and the recommendation from the
X.Org board of moving to OFTC[1], many mesa-developers have moved over
to the #dri-devel channel on OFTC by now.

So let's promote that channel rather than the Freenode channel.

While we're at it, let's correct[2] the URI to use a slash to separate
between the host and channel. And omit the # from the channel name for
maximum compatibility.

[1]: https://lists.freedesktop.org/archives/mesa-dev/2021-May/225271.html
[2]: https://en.wikipedia.org/wiki/Internet_Relay_Chat#URI_scheme

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10917>

3 years agoradv: remove small overhead of radv_pipeline_has_ngg()
Samuel Pitoiset [Thu, 20 May 2021 20:54:51 +0000 (22:54 +0200)]
radv: remove small overhead of radv_pipeline_has_ngg()

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

3 years agoradv: simplify radv_pipeline_has_gs_copy_shader()
Samuel Pitoiset [Thu, 20 May 2021 21:03:33 +0000 (23:03 +0200)]
radv: simplify radv_pipeline_has_gs_copy_shader()

The GS copy shader should only be built if GS and without NGG.

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

3 years agoradv: fix fast clearing DCC if one level can't be compressed on GFX10+
Samuel Pitoiset [Thu, 29 Apr 2021 09:51:14 +0000 (11:51 +0200)]
radv: fix fast clearing DCC if one level can't be compressed on GFX10+

Fallback to a slow clear, this could be improved by splitting the
clear into two parts (one fast and one slow) but that's complicated.

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

3 years agoci: Update to a new kernel fixing a bug in the panfrost driver
Boris Brezillon [Fri, 21 May 2021 09:48:03 +0000 (11:48 +0200)]
ci: Update to a new kernel fixing a bug in the panfrost driver

Should fix #4818.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10915>

3 years agoradv/ci: Test on Stoney on CI
Tomeu Vizoso [Tue, 18 May 2021 06:02:51 +0000 (08:02 +0200)]
radv/ci: Test on Stoney on CI

Run part of the VK CTS in 3 devices with Stoney Ridge graphics.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10853>

3 years agoci/iris: Switch GLK back to manual testing.
Emma Anholt [Fri, 21 May 2021 17:07:07 +0000 (10:07 -0700)]
ci/iris: Switch GLK back to manual testing.

The glk boards are particularly slow, and we've had the lab get backed up,
causing many spurious failures in the last day due to #4819.  Just disable
this board by default for now until that can get sorted out.

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

3 years agoradv: set RADEON_FLAG_GTT_WC flag for prime memory
Yogesh Mohanmarimuthu [Wed, 21 Apr 2021 15:18:23 +0000 (20:48 +0530)]
radv: set RADEON_FLAG_GTT_WC flag for prime memory

With display on iGPU and render on dGPU, VRR is not working. To fix
this set RADEON_FLAG_GTT_WC flag when allocating memory for prime. This
allows kernel function amdgpu_display_user_framebuffer_create() to
allocate GTT memory with USWC flag making the buffer scanout for iGPU.
This helps the ddx amdgpu_present_check_flip() function to return
true. Now, xserver will flip the framebuffer instead of blit. Due
to this VRR feature will work where iGPU supports USWC flag.

v2: modify commit message with use case (Michel Dänzer)
v3: allow GTT_WC flag only if VRAM_DOMAIN and NO_CPU_ACCESS (Bas Nieuwenhuizen)
v4: add check for wsi_info is NULL
v5: use wsi_info pointer to check for prime alloc (Bas Nieuwenhuizen)
v6: set _GTT_WC flag when wsi_info pointer is not NULL (Bas Nieuwenhuizen)

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10657>

3 years agointel/fs: make sure shuffle is lowered to supported types
Lionel Landwerlin [Thu, 20 May 2021 20:30:19 +0000 (23:30 +0300)]
intel/fs: make sure shuffle is lowered to supported types

On XeHP there are restrictions on types of source and destinations
with float types. As shuffle is implemented using MOV we need to make
sure we lower it to supported types.

This fixes tests like :

    dEQP-VK.subgroups.arithmetic.framebuffer.subgroupexclusivemax_vec4_vertex
    dEQP-VK.subgroups.arithmetic.framebuffer.subgroupexclusivemul_f16vec3_vertex

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10902>

3 years agoaux/trace: dump 'wait' param for get_query_result
Mike Blumenkrantz [Mon, 17 May 2021 18:17:49 +0000 (14:17 -0400)]
aux/trace: dump 'wait' param for get_query_result

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

3 years agoaux/trace: add a pipe_context::clear_buffer hook
Mike Blumenkrantz [Mon, 17 May 2021 18:02:29 +0000 (14:02 -0400)]
aux/trace: add a pipe_context::clear_buffer hook

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

3 years agoaux/trace: fix query handling with tc
Mike Blumenkrantz [Mon, 17 May 2021 18:01:49 +0000 (14:01 -0400)]
aux/trace: fix query handling with tc

trace needs to follow the tc rules for queries a little in order to avoid
crashing and provide drivers with the same behavior they expect

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

3 years agoaux/trace: fix set_inlinable_constants hook
Mike Blumenkrantz [Mon, 10 May 2021 20:13:01 +0000 (16:13 -0400)]
aux/trace: fix set_inlinable_constants hook

need to dump the arg, not just the array

Fixes: 8926c4a313e ("aux/trace: add a set_inlinable_constants hook")

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

3 years agoaux/trace: hook tc methods
Mike Blumenkrantz [Fri, 7 May 2021 20:47:56 +0000 (16:47 -0400)]
aux/trace: hook tc methods

these need to have the context/screen unwrapped in order to not crash
while tracing

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

3 years agoaux/trace: stop dumping transfer data for threaded contexts
Mike Blumenkrantz [Fri, 7 May 2021 19:04:09 +0000 (15:04 -0400)]
aux/trace: stop dumping transfer data for threaded contexts

this is only useful for unit testing (and is it really useful even then?),
and does nothing but explode trace dumps and demolish performance otherwise

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

3 years agoaux/trace: trace transfer ops
Mike Blumenkrantz [Fri, 7 May 2021 19:03:46 +0000 (15:03 -0400)]
aux/trace: trace transfer ops

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

3 years agoaux/trace: more effectively unwrap pipe_context params from screen functions
Mike Blumenkrantz [Thu, 6 May 2021 21:06:09 +0000 (17:06 -0400)]
aux/trace: more effectively unwrap pipe_context params from screen functions

when using tc, these are the threaded context, not the trace context

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

3 years agoaux/trace: add pipe_context::set_debug_callback hook
Mike Blumenkrantz [Thu, 6 May 2021 20:04:00 +0000 (16:04 -0400)]
aux/trace: add pipe_context::set_debug_callback hook

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

3 years agoci: update some radv trace checksums
Andres Gomez [Wed, 5 May 2021 09:03:22 +0000 (12:03 +0300)]
ci: update some radv trace checksums

After a7c0cf500b3 ("radv: Enable DCC for image stores on GFX10.")
some checksums for the radv driver remained to be updated.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agoci: update some radv trace checksums
Andres Gomez [Wed, 5 May 2021 07:18:10 +0000 (10:18 +0300)]
ci: update some radv trace checksums

After 524848707b4 ("radv: don't set sx_blend_opt_epsilon for V_028C70_COLOR_10_11_11")
some checksums for the radv driver remained to be updated.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agoci: make sure we only read the first line from install/VERSION
Andres Gomez [Wed, 5 May 2021 07:10:44 +0000 (10:10 +0300)]
ci: make sure we only read the first line from install/VERSION

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agoci: remove results directory content only with piglit runners
Andres Gomez [Tue, 4 May 2021 19:10:54 +0000 (22:10 +0300)]
ci: remove results directory content only with piglit runners

Removing the directory itself can be problematic with certain runner
strategies (B2C).

v2:
  - Better deleting pattern matching since the previously used one was
    problematic and not pointed out by /bin/sh, as noticed by Emma.

v3:
  - Check that the results directory exists before attempting to
    delete its content.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agoci: allow starting xorg for piglit run
Andres Gomez [Mon, 3 May 2021 19:11:17 +0000 (22:11 +0300)]
ci: allow starting xorg for piglit run

And enable it in the radv's Raven traces job.

v2:
  - Adapt to changes in the start-x.sh script.

v3:
  - Not deleting any more the non-existent by now
    ".gitlab-ci/common/start-x.sh" script (Martin).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agoci: add xorg to the x86_test-vk container
Andres Gomez [Thu, 22 Apr 2021 22:51:56 +0000 (01:51 +0300)]
ci: add xorg to the x86_test-vk container

Only the AMD video drivers for xorg are added since there are no other
expected users by now.

v2:
  - Remove the start/stop logic from the x.sh script. We don't care
    about stopping since that's already managed by gitlab-ci (Emma).

v3:
  - Remove mistakenly added ".gitlab-ci/common/start-x.sh"
    script (Martin).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

3 years agointel/compiler: balanced tileY/linear friendly LID order for CS
Felix DeGrood [Wed, 19 May 2021 16:50:45 +0000 (09:50 -0700)]
intel/compiler: balanced tileY/linear friendly LID order for CS

Fixes perf regression introduced from tileY LID order for CS
shaders that access both textures and buffers. Walks LIDs in
X-major fashion, but with blocks of height 4. This maps LIDs per
HW thread for SIMD8/16/32 as (2x4/4x4/8x4), which is always good
for tileY resources and usually good for linear resources.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10733>

3 years agointel/compiler: tileY friendly LID order for CS
Felix DeGrood [Wed, 19 May 2021 18:51:20 +0000 (11:51 -0700)]
intel/compiler: tileY friendly LID order for CS

Computer shaders that access tileY resources (textures) benefit
from Y-locality accesses. Easiest way to implement this is walk
local ids in Y-major fashion, instead of X-major fashion. Y-major
local ids will reduce partial writes and increase cache locality
for tileY accesses since tileY resources cachelines progress in
Y direction.

Improves performance on TGL:
  Borderlands3.dxvk-g2  +1.5%

Y-major can introduce a performance drop on CS that use mixture
of buffers and images. This should be fixed in next commit.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10733>

3 years agointel/compile: refactor DERIVATIVE_GROUP logic
Felix DeGrood [Wed, 19 May 2021 18:48:09 +0000 (11:48 -0700)]
intel/compile: refactor DERIVATIVE_GROUP logic

Minor changes to logic to make following changes easier.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10733>

3 years agointel/compiler: Use switch for DERIVATIVE_GROUP logic
Felix DeGrood [Wed, 19 May 2021 16:32:16 +0000 (09:32 -0700)]
intel/compiler: Use switch for DERIVATIVE_GROUP logic

Switch statement is more readable.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10733>

3 years agoiris: Check data alignment for copy_mem_mem
Robert Tarasov [Fri, 21 May 2021 02:48:16 +0000 (19:48 -0700)]
iris: Check data alignment for copy_mem_mem

Check both source and destination offsets are aligned to 4. This
patch fixes dEQP-GLES{2|3}.functional.buffer.write.random.* tests
failures on guest side while trying to copy small (<16b) buffers
via glBufferSubData() with offset which isn't aligned to 4.

Fixes: 9b1b9714 ("iris: Use MI_COPY_MEM_MEM for tiny resource_copy_region calls.")
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com
Reviewed-by: Marcin Ślusarz marcin.slusarz@intel.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10910>

3 years agoaux/vbuf: prevent uint underflow and assert if no vbs are dirty
Mike Blumenkrantz [Fri, 21 May 2021 14:08:01 +0000 (10:08 -0400)]
aux/vbuf: prevent uint underflow and assert if no vbs are dirty

if this mask is 0, there is nothing to do here

Fixes: e73bf3b805d ("gallium: add start_slot parameter to set_vertex_buffers")

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

3 years agopps: fix a missing include in Intel pps driver
Chia-I Wu [Fri, 21 May 2021 19:52:28 +0000 (12:52 -0700)]
pps: fix a missing include in Intel pps driver

In file included from ../src/intel/ds/intel_pps_perf.cc:8:
../src/intel/ds/intel_pps_perf.h:34:78: error: ‘string’ in namespace ‘std’ does not name a type

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10934>

3 years agoir3: Only use per-wave pvtmem layout for compute
Connor Abbott [Thu, 20 May 2021 16:30:12 +0000 (18:30 +0200)]
ir3: Only use per-wave pvtmem layout for compute

The blob seems to do this since a630, and it fixes
spec@glsl-1.30@execution@fs-large-local-array on a650.

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

3 years agoir3: Call nir_lower_wrmask() again after lowering scratch
Connor Abbott [Thu, 20 May 2021 16:26:55 +0000 (18:26 +0200)]
ir3: Call nir_lower_wrmask() again after lowering scratch

I forgot that after rebasing on large_consts support that this is now
called after the first time nir_lower_wrmask is called and can generate
partial writemasks that need to be lowered. While we're here, also call
the main optimization loop if things are lowered to scratch because it
generates address arithmetic that may need to be cleaned up.

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

3 years agopanfrost/ci: Disable G72 jobs for now
Alyssa Rosenzweig [Fri, 21 May 2021 17:54:30 +0000 (13:54 -0400)]
panfrost/ci: Disable G72 jobs for now

There's a bug in ATEST (and LD_TILE?) handling affecting v6, manifesting
as gpu sched timeouts in dmesg and ultimately as random dEQP flakes.
Until this can be sorted out and the G72 jobs are proven to be stable,
we can't have them in the critical merge path.

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

3 years agopanfrost/ci: Disable GLES2 jobs when we run GLES3
Alyssa Rosenzweig [Fri, 21 May 2021 14:45:49 +0000 (10:45 -0400)]
panfrost/ci: Disable GLES2 jobs when we run GLES3

I've been meaning to make this change for a while, but I've been holding
out in case dEQP-GLES2 on T860/Bifrost catches a driver issue missed by
dEQP-GLES3 and also missed by T720's dEQP-GLES2 job. Given that hasn't
happened (indeed, dEQP-GLES3 is an effective super set of dEQP-GLES2),
let's save the cycles and skip the redundant jobs.

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

3 years agolima: implement alpha test
Vasily Khoruzhick [Wed, 19 May 2021 05:26:57 +0000 (22:26 -0700)]
lima: implement alpha test

As [1] suggests, 3 lower bits in rsw->multi_sample is alpha test
compare func and bits 16-23 are reference value - uint8,
0.0 is 0, 0.5 is 0x80, 1.0 is 0xff.

Just as on Panfrost, enabled alpha test needs early-Z and pixel kill
to be disabled.

[1] http://web.archive.org/web/20171026123213/http://limadriver.org/Render_State/

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10879>

3 years agoac: ac_gpu_info::has_vgt_flush_ngg_legacy_bug
Samuel Pitoiset [Fri, 21 May 2021 06:50:24 +0000 (08:50 +0200)]
ac: ac_gpu_info::has_vgt_flush_ngg_legacy_bug

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

3 years agopanfrost: Rename G52 product ID 0x7402 as G52r1
Ezequiel Garcia [Fri, 21 May 2021 13:08:20 +0000 (10:08 -0300)]
panfrost: Rename G52 product ID 0x7402 as G52r1

As pointed out by Robin Murphy, the new product ID belongs
to IP revision "G52r1".

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10921>

3 years agogallium: remove structure u_resource
Marek Olšák [Wed, 5 May 2021 20:21:56 +0000 (16:21 -0400)]
gallium: remove structure u_resource

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

3 years agogallium: remove empty structure u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 20:14:34 +0000 (16:14 -0400)]
gallium: remove empty structure u_resource_vtbl

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

3 years agogallium: remove u_resource_vtbl::transfer_(un)map
Marek Olšák [Wed, 5 May 2021 20:06:28 +0000 (16:06 -0400)]
gallium: remove u_resource_vtbl::transfer_(un)map

This removes the call indirection.

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

3 years agogallium: split transfer_(un)map into buffer_(un)map and texture_(un)map
Marek Olšák [Wed, 5 May 2021 19:27:46 +0000 (15:27 -0400)]
gallium: split transfer_(un)map into buffer_(un)map and texture_(un)map

The u_resource_vtbl indirection is going to be removed.

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

3 years agogallium: remove u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:25:20 +0000 (14:25 -0400)]
gallium: remove u_resource_vtbl::resource_destroy

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

3 years agor600: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
r600: stop using u_resource_vtbl::resource_destroy

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

3 years agosvga: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
svga: stop using u_resource_vtbl::resource_destroy

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

3 years agovirgl: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
virgl: stop using u_resource_vtbl::resource_destroy

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

3 years agoi915g: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 18:07:18 +0000 (14:07 -0400)]
i915g: stop using u_resource_vtbl::resource_destroy

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

3 years agonouveau: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:39:20 +0000 (13:39 -0400)]
nouveau: stop using u_resource_vtbl::resource_destroy

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

3 years agor300: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:27:53 +0000 (13:27 -0400)]
r300: stop using u_resource_vtbl::resource_destroy

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

3 years agoradeonsi: stop using u_resource_vtbl::resource_destroy
Marek Olšák [Wed, 5 May 2021 17:11:27 +0000 (13:11 -0400)]
radeonsi: stop using u_resource_vtbl::resource_destroy

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

3 years agogallium: remove transfer_flush_region from u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 16:55:29 +0000 (12:55 -0400)]
gallium: remove transfer_flush_region from u_resource_vtbl

It's only used by buffers and only zink uses it privately for textures too.
This is part of removing u_resource_vtbl.

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

3 years agogallium: remove resource_get_handle from u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 15:37:30 +0000 (11:37 -0400)]
gallium: remove resource_get_handle from u_resource_vtbl

This is the initial step towards removing u_resource_vtbl.

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

3 years agogallium: remove unused u_default_transfer_unmap
Marek Olšák [Wed, 5 May 2021 16:14:04 +0000 (12:14 -0400)]
gallium: remove unused u_default_transfer_unmap

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

3 years agozink: don't set u_resource_vtbl
Marek Olšák [Wed, 5 May 2021 17:15:45 +0000 (13:15 -0400)]
zink: don't set u_resource_vtbl

nothing uses it

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

3 years agoci: more freedreno flakes
Mike Blumenkrantz [Fri, 21 May 2021 12:01:19 +0000 (08:01 -0400)]
ci: more freedreno flakes

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

3 years agofreedreno: Implement TC resource_busy
Rob Clark [Thu, 15 Apr 2021 20:22:23 +0000 (13:22 -0700)]
freedreno: Implement TC resource_busy

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

3 years agofreedreno: Rename internal resource_busy
Rob Clark [Thu, 15 Apr 2021 20:16:30 +0000 (13:16 -0700)]
freedreno: Rename internal resource_busy

So I can re-use the name fd_resource_busy.

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

3 years agovc4: initialize array
Juan A. Suarez Romero [Fri, 21 May 2021 10:36:23 +0000 (12:36 +0200)]
vc4: initialize array

This fixes a (rather false) error about accessing an array that it is
uninitialized.

Fixes: 7bc39c8418e ("vc4: Add a dump-the-surface-contents routine.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4816
Cc: mesa-stable
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10918>

3 years agopanfrost: Add PAN_MESA_DEBUG=dirty option
Alyssa Rosenzweig [Wed, 19 May 2021 19:07:38 +0000 (15:07 -0400)]
panfrost: Add PAN_MESA_DEBUG=dirty option

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

3 years agopanfrost: Dirty track fragment images
Alyssa Rosenzweig [Wed, 19 May 2021 18:40:08 +0000 (14:40 -0400)]
panfrost: Dirty track fragment images

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

3 years agopanfrost: Dirty track viewport descriptor
Alyssa Rosenzweig [Wed, 19 May 2021 18:17:48 +0000 (14:17 -0400)]
panfrost: Dirty track viewport descriptor

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

3 years agopanfrost: Dirty track textures/samplers
Alyssa Rosenzweig [Wed, 19 May 2021 18:04:23 +0000 (14:04 -0400)]
panfrost: Dirty track textures/samplers

draws/second on drawoverhead test 4 is improved by 160% (not a typo)

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

3 years agopanfrost: Dirty track RSDs
Alyssa Rosenzweig [Wed, 19 May 2021 17:27:38 +0000 (13:27 -0400)]
panfrost: Dirty track RSDs

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

3 years agopanfrost: Dirty all state when batch is set
Alyssa Rosenzweig [Wed, 19 May 2021 18:27:08 +0000 (14:27 -0400)]
panfrost: Dirty all state when batch is set

State uploads are bound to the batch, so if the batch changes, we
invalidate all state. Theoretically this isn't totally optimal but in
practice it should be good enough.

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

3 years agopanfrost: Add the usual clean/dirty helpers
Alyssa Rosenzweig [Wed, 19 May 2021 17:26:45 +0000 (13:26 -0400)]
panfrost: Add the usual clean/dirty helpers

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

3 years agopanfrost: Define dirty tracking flags
Alyssa Rosenzweig [Tue, 18 May 2021 23:25:38 +0000 (19:25 -0400)]
panfrost: Define dirty tracking flags

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

3 years agofrontends/va/picture:Fix wrong reallocation even surface is protected
SureshGuttula [Mon, 17 May 2021 08:52:48 +0000 (14:22 +0530)]
frontends/va/picture:Fix wrong reallocation even surface is protected

This patch will avoid reallocation,if surface is already protected.
Fixing the comparision logic of boolean value(true \ flase) with
PIPE_BIND_PROTECTED.

Fixes: 81be8b3c2f2 ("va/picture: make sure destination buffer is protected if needed")

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10916>

3 years agoutil/prim_restart: fix util_translate_prim_restart_ib
Mike Blumenkrantz [Tue, 18 May 2021 23:55:01 +0000 (19:55 -0400)]
util/prim_restart: fix util_translate_prim_restart_ib

this was broken for the indirect case if the indirect draw count or
firstIndex was nonzero and also would rewrite the index buffer onto the
wrong offset of the dst buffer

Fixes: 0c85d6c523f ("gallium/util: factor out primitive-restart rewriting logic")
Fixes: 330d0607ed6 ("gallium: remove pipe_index_buffer and set_index_buffer")

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

3 years agodri: don't call modifier interfaces when modifiers_count is 0
Lucas Stach [Thu, 20 May 2021 16:07:12 +0000 (18:07 +0200)]
dri: don't call modifier interfaces when modifiers_count is 0

The wayland EGL platform sets the modifier count to 0 in some cases
to signal that modifiers should not be used, even if a list of modifiers
is present. The loader_dri_create_image helper didn't handle this case
properly and called the modifierful driver interface with a 0 modifier
count, leading to the obvious outcome of the driver being unable to
allocate an image.

Fixes: cb9ae4273d68 ("dri: add loader_dri_create_image helper")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10903>

3 years agonir/lower_io_to_vector: fix per vertex io handling for arrays
Timothy Arceri [Fri, 14 May 2021 05:31:16 +0000 (15:31 +1000)]
nir/lower_io_to_vector: fix per vertex io handling for arrays

The pass was processing the per vertex index from the wrong end
of the array deref chain.

Fixes: bcd14756eec8 ("nir/lower_io_to_vector: add flat mode")

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

3 years agoiris: Silence warnings about implicit enum type conversions
Ian Romanick [Mon, 12 Apr 2021 19:04:31 +0000 (12:04 -0700)]
iris: Silence warnings about implicit enum type conversions

src/gallium/drivers/iris/iris_state.c: In function ‘iris_create_blend_state’:
src/gallium/drivers/iris/iris_state.c:1284:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1284 |          be.SourceBlendFactor           = src_rgb;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1285:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1285 |          be.SourceAlphaBlendFactor      = src_alpha;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1286:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1286 |          be.DestinationBlendFactor      = dst_rgb;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1287:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1287 |          be.DestinationAlphaBlendFactor = dst_alpha;
      |                                         ^
src/gallium/drivers/iris/iris_state.c:1308:28: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1308 |       pb.SourceBlendFactor =
      |                            ^
src/gallium/drivers/iris/iris_state.c:1310:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1310 |       pb.SourceAlphaBlendFactor =
      |                                 ^
src/gallium/drivers/iris/iris_state.c:1312:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1312 |       pb.DestinationBlendFactor =
      |                                 ^
src/gallium/drivers/iris/iris_state.c:1314:38: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
 1314 |       pb.DestinationAlphaBlendFactor =
      |                                      ^

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

3 years agoiris: Return correct enum names from fmt_swizzle
Ian Romanick [Mon, 12 Apr 2021 18:45:51 +0000 (11:45 -0700)]
iris: Return correct enum names from fmt_swizzle

SCS_ONE and ISL_CHANNEL_SELECT_ONE (and SCS_ZERO and
ISL_CHANNEL_SELECT_ZERO) have the same values, so this doesn't matter in
practice.  However, some compiler warning options will cause warnings to
be generated.

src/gallium/drivers/iris/iris_state.c: In function ‘fmt_swizzle’:
src/gallium/drivers/iris/iris_state.c:2177:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2177 |    case PIPE_SWIZZLE_1: return SCS_ONE;
      |                                ^~~~~~~
src/gallium/drivers/iris/iris_state.c:2178:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2178 |    case PIPE_SWIZZLE_0: return SCS_ZERO;
      |                                ^~~~~~~~

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

3 years agogallium/dri: Allow use of R8G8_R8B8 for YUYV and G8R8_B8R8 for UYVY
Ian Romanick [Sat, 13 Mar 2021 07:03:49 +0000 (23:03 -0800)]
gallium/dri: Allow use of R8G8_R8B8 for YUYV and G8R8_B8R8 for UYVY

v2: Add missing FALLTHROUGH. Caught by CI.

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

3 years agonir/lower_tex: Add support for lowering YUYV formats
Ian Romanick [Sat, 13 Mar 2021 07:07:09 +0000 (23:07 -0800)]
nir/lower_tex: Add support for lowering YUYV formats

v2: Rebase on bc438c91d9b ("nir/lower_tex: ignore texture_index if
tex_instr has deref src")

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

3 years agomesa: Add R8G8_R8B8 and G8R8_B8R8 formats
Ian Romanick [Sat, 13 Mar 2021 07:01:15 +0000 (23:01 -0800)]
mesa: Add R8G8_R8B8 and G8R8_B8R8 formats

These aren't real formats.  They cannot be used with
RenderbufferObjects, Textures, or anything else visible through the GL
API.  The only purpose is to support YUYV textures imported through
EGL_image_external.  There is hardware that can sample from this
subsampled format, but the hardware does not do the colorspace
conversion automatically.

v2: Treat these formats as compressed.  This is a lie, but it seems to
be a less egregious lie than what I was doing before.  It also passes
'ninja test'.

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

3 years agointel/isl: Add mappings for PIPE_FORMAT_R8G8_R8B8_UNORM and PIPE_FORMAT_G8R8_B8R8_UNORM
Ian Romanick [Sat, 13 Mar 2021 02:31:39 +0000 (18:31 -0800)]
intel/isl: Add mappings for PIPE_FORMAT_R8G8_R8B8_UNORM and PIPE_FORMAT_G8R8_B8R8_UNORM

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

3 years agogallium/dri: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:45:58 +0000 (12:45 -0800)]
gallium/dri: Add Y21x formats

v2: Add all the Y21x tests to the A530 expected fail list.  All of the
YUV image import tests fail on this platform, and nobody has been able
to investigate why.

v3: Update the comment describing the zeroed bits in Y212.  Suggested by
Emma.

v4: Add all Y21x test to the rpi3 expected fail list.

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

3 years agoegl/dri2: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:41:10 +0000 (12:41 -0800)]
egl/dri2: Add Y21x formats

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

3 years agoutil/format: Add Y21x formats
Ian Romanick [Fri, 12 Mar 2021 20:40:05 +0000 (12:40 -0800)]
util/format: Add Y21x formats

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

3 years agogallium/dri: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:55:08 +0000 (20:55 -0800)]
gallium/dri: Add Y41x formats

v2: Don't leak __DRI_IMAGE_FOURCC_RGBA16161616 to applications.

v3: Fix typo in __DRI_IMAGE_FOURCC_RGBA16161616 table entry.

v4: Add the Y412 and Y416 tests to the A530 expected fail list.  Many
YUV image import tests fail on this platform, and nobody has been able
to investigate why.

v5: Update the comment describing the zeroed bits in Y412.  Suggested by
Emma.

v6: Add all Y41x test to the rpi3 expected fail list.

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

3 years agoegl/dri2: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:54:30 +0000 (20:54 -0800)]
egl/dri2: Add Y41x formats

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

3 years agoutil/format: Add Y41x formats
Ian Romanick [Thu, 11 Mar 2021 04:53:46 +0000 (20:53 -0800)]
util/format: Add Y41x formats

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

3 years agonir/lower_tex: Add support for lowering Y41x formats
Ian Romanick [Thu, 11 Mar 2021 03:49:05 +0000 (19:49 -0800)]
nir/lower_tex: Add support for lowering Y41x formats

These are similar to AYUV, but the channel ordering is different... in
such a way that there's no RGBA format that will make the channels line
up right.

v2: Rebase on bc438c91d9b ("nir/lower_tex: ignore texture_index if
tex_instr has deref src")

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

3 years agomesa/st: Always call st_nir_lower_tex_src_plane if samplers were lowered
Ian Romanick [Fri, 14 May 2021 23:30:16 +0000 (16:30 -0700)]
mesa/st: Always call st_nir_lower_tex_src_plane if samplers were lowered

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

3 years agoegl/dri2: Rely on drm-uapi for DRM_FORMAT defines
Ian Romanick [Thu, 11 Mar 2021 04:46:50 +0000 (20:46 -0800)]
egl/dri2: Rely on drm-uapi for DRM_FORMAT defines

All of these formats, and ones that will be added later in this series,
are in the copy of drm_fourcc.h in drm-uapi.

Suggested-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agodri: Fix typo before __DRI_IMAGE_COMPONENTS defines
Ian Romanick [Tue, 2 Mar 2021 00:21:10 +0000 (16:21 -0800)]
dri: Fix typo before __DRI_IMAGE_COMPONENTS defines

s/are may be/might be/

Also add a missing comma.

v2: Also s/its/it's/.  Suggested by Nanley.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agoutil/format: Delete trailing whitespace
Ian Romanick [Mon, 1 Mar 2021 23:39:00 +0000 (15:39 -0800)]
util/format: Delete trailing whitespace

The angry red marks in Emacs were annoying me.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>

3 years agoiris: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8
Kenneth Graunke [Thu, 20 May 2021 20:04:15 +0000 (13:04 -0700)]
iris: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8

According to isl_gfx7.c:264, the display engine does not support Y
tiled buffers prior to Skylake.  But we exposed I915_FORMAT_MOD_Y_TILED
even when querying for a list of modifiers with PIPE_BIND_SCANOUT set,
which we can't support.  That led to crashes later when we tried to
create such an image, and isl rightly denied it.

Fixes crashes in wflinfo since c03e79d7831f, but the bug exists before
that and it's probably worth a stable backport even without that patch.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4815
Fixes: c03e79d7831 ("loader/dri: hook up createImageWithModifiers2")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10907>

3 years agoi965: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8-
Kenneth Graunke [Thu, 20 May 2021 20:04:15 +0000 (13:04 -0700)]
i965: Don't advertise Y-tiled modifiers for scanout buffers on Gfx8-

According to isl_gfx7.c:264, the display engine does not support Y
tiled buffers prior to Skylake.  But we exposed I915_FORMAT_MOD_Y_TILED
even when querying for a list of modifiers with __DRI_IMAGE_USE_SCANOUT
set, which we can't support.  That led to crashes later when we tried
to create such an image, and isl rightly denied it.

This duplicates a bit of code from ISL, but the isl_gfx6_filter_tiling
function that we ought to use to filter things relies on surf_info,
which we don't have at this stage.  This is probably good enough.

Fixes crashes in wflinfo since c03e79d7831f, but the bug exists before
that and it's probably worth a stable backport even without that patch.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4815
Fixes: c03e79d7831 ("loader/dri: hook up createImageWithModifiers2")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10907>

3 years agoci: Add test which occasionally times out to lavapipe-vk skips
Andres Gomez [Thu, 20 May 2021 07:47:17 +0000 (10:47 +0300)]
ci: Add test which occasionally times out to lavapipe-vk skips

E.g:
  - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/9881541
  - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/9916369

Signed-off-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10893>

3 years agoisl: Work around NVIDIA and AMD display pitch requirements
Kenneth Graunke [Thu, 20 May 2021 09:03:07 +0000 (02:03 -0700)]
isl: Work around NVIDIA and AMD display pitch requirements

In the case where we're rendering on the Intel GPU, but displaying
on an AMD and NVIDIA GPU, we need to follow their pitch requirements
for our linear scanout buffers.

Based on a patch by Lionel Landwerlin.

Closes: #4706
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10895>

3 years agoi915g: Fix undefined results for TGSI_OPCODE_KILL
Emma Anholt [Tue, 18 May 2021 19:27:34 +0000 (12:27 -0700)]
i915g: Fix undefined results for TGSI_OPCODE_KILL

The swizzle() requires a proper ureg with the 0/1 swizzle fields filled
in, or our ONE swizzles end up reading .x instead.  This meant that we
were killing based on the incoming value of R0.

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

3 years agoi915g: Fix writing of undefined depth value if not writing any outputs.
Emma Anholt [Tue, 18 May 2021 19:19:45 +0000 (12:19 -0700)]
i915g: Fix writing of undefined depth value if not writing any outputs.

This was showing up as flakes in CI on tests that didn't write any outputs
but did check the depth result.

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