platform/upstream/mesa.git
2 years agointel/genxml: Assert that all MOCS fields are non-zero on Gfx7+
Kenneth Graunke [Tue, 19 Oct 2021 05:48:14 +0000 (22:48 -0700)]
intel/genxml: Assert that all MOCS fields are non-zero on Gfx7+

Let's try and catch performance problems before we have to do large
painful amounts of analysis to detect a missed field.

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

2 years agointel/genxml: Add an field option for nonzero="true"
Kenneth Graunke [Tue, 19 Oct 2021 05:35:33 +0000 (22:35 -0700)]
intel/genxml: Add an field option for nonzero="true"

This asserts that the value supplied is non-zero.  Useful for things
like MOCS fields on modern platforms where we really want to avoid
setting it to 0 (uncached).

mbz types cannot be flagged as nonzero.

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

2 years agoi965: Set MOCS for Bindless Surface/Sampler State base addresses
Kenneth Graunke [Wed, 27 Oct 2021 19:56:01 +0000 (12:56 -0700)]
i965: Set MOCS for Bindless Surface/Sampler State base addresses

We don't use bindless surface or sampler states today, and are unlikely
to ever implement that in i965, but we can set a MOCS value regardless
to avoid asserts in upcoming patches that assert MOCS isn't zero.

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

2 years agoi965: Port STATE_BASE_ADDRESS to genxml and fix bugs
Kenneth Graunke [Wed, 20 Oct 2021 22:59:40 +0000 (15:59 -0700)]
i965: Port STATE_BASE_ADDRESS to genxml and fix bugs

This largely copies crocus's code for this (but with Gfx9+ handling).

This version also fixes missing MOCS settings on several platforms,
which we hadn't noticed were missing.

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

2 years agoi965: Fix MOCS for BLORP buffer copies
Kenneth Graunke [Wed, 20 Oct 2021 08:08:07 +0000 (01:08 -0700)]
i965: Fix MOCS for BLORP buffer copies

We were passing a MOCS of 0, which is uncached.  Yikes.

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

2 years agoi965: Set MOCS for 3DSTATE_INDEX_BUFFER on Gfx6/7 as well.
Kenneth Graunke [Wed, 20 Oct 2021 07:25:47 +0000 (00:25 -0700)]
i965: Set MOCS for 3DSTATE_INDEX_BUFFER on Gfx6/7 as well.

For some reason we were only setting this on Gfx8+.

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

2 years agoi965: Set MOCS for 3DSTATE_SO_BUFFERS on Gfx7.x too
Kenneth Graunke [Wed, 20 Oct 2021 07:13:29 +0000 (00:13 -0700)]
i965: Set MOCS for 3DSTATE_SO_BUFFERS on Gfx7.x too

For some reason we were only setting this on Gfx8+.

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

2 years agoi965: Set MOCS on NULL stream output buffers
Kenneth Graunke [Tue, 19 Oct 2021 22:24:51 +0000 (15:24 -0700)]
i965: Set MOCS on NULL stream output buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is disabled stream output targets,  MOCS shouldn't matter, as
there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for these null stream
output buffers; we can just assume a MOCS for generic internal buffers.

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

2 years agoi965: Set MOCS for push constant buffers on Haswell and Gfx9+
Kenneth Graunke [Tue, 19 Oct 2021 22:18:09 +0000 (15:18 -0700)]
i965: Set MOCS for push constant buffers on Haswell and Gfx9+

We set MOCS on Ivybridge/Baytrail, but not Haswell, and not Skylake
and later.  We shoud set it everywhere.  While we're at it, we also
set it for null constant buffers, so that we aren't programming a 0
MOCS, to allow us to add some safeguards against that.

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

2 years agoi965: Set default MOCS for NULL depth/stencil/HiZ buffers
Kenneth Graunke [Tue, 19 Oct 2021 23:41:57 +0000 (16:41 -0700)]
i965: Set default MOCS for NULL depth/stencil/HiZ buffers

isl now uses info->mocs regardless of whether there's any actual
depth/stencil/HiZ buffers involved, so pass it a legitimate one,
rather than zero.  When we have entirely NULL surfaces, we just
default to the MOCS value for an internal buffer.

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

2 years agoi965: Use ISL for MOCS rather than open coding it everywhere
Kenneth Graunke [Tue, 19 Oct 2021 17:18:43 +0000 (10:18 -0700)]
i965: Use ISL for MOCS rather than open coding it everywhere

The ISL MOCS infrastructure didn't exist when we wrote the i965 code,
but now that it does, we ought to use it, deleting a complicated mess
that was replicated all throughout the codebase.

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

2 years agocrocus: Fix MOCS for buffer copies.
Kenneth Graunke [Thu, 21 Oct 2021 04:29:57 +0000 (21:29 -0700)]
crocus: Fix MOCS for buffer copies.

We were passing a MOCS of 0, which is uncached.  Yikes.

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

2 years agocrocus: Set MOCS for 3DSTATE_SO_BUFFERS on Gfx7.x too
Kenneth Graunke [Thu, 21 Oct 2021 04:24:39 +0000 (21:24 -0700)]
crocus: Set MOCS for 3DSTATE_SO_BUFFERS on Gfx7.x too

For some reason we were only setting this on Gfx8+.

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

2 years agocrocus: Set MOCS for push constant buffers where possible
Kenneth Graunke [Tue, 19 Oct 2021 22:42:28 +0000 (15:42 -0700)]
crocus: Set MOCS for push constant buffers where possible

We apparently were not setting MOCS for 3DSTATE_CONSTANT_XS at all.

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

2 years agocrocus: Set default MOCS for NULL depth/stencil/HiZ buffers
Kenneth Graunke [Tue, 19 Oct 2021 22:33:00 +0000 (15:33 -0700)]
crocus: Set default MOCS for NULL depth/stencil/HiZ buffers

isl now uses info->mocs regardless of whether there's any actual
depth/stencil/HiZ buffers involved, so pass it a legitimate one,
rather than zero.  When we have entirely NULL surfaces, we just
default to the MOCS value for an internal buffer.

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

2 years agocrocus: Set MOCS on NULL stream output buffers
Kenneth Graunke [Tue, 19 Oct 2021 22:30:35 +0000 (15:30 -0700)]
crocus: Set MOCS on NULL stream output buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is disabled stream output targets,  MOCS shouldn't matter, as
there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for these null stream
output buffers; we can just assume a MOCS for generic internal buffers.

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

2 years agocrocus: Set MOCS for index buffers on Gen6+
Kenneth Graunke [Wed, 20 Oct 2021 21:55:01 +0000 (14:55 -0700)]
crocus: Set MOCS for index buffers on Gen6+

For some reason we were only setting them on Gen8+.

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

2 years agocrocus: Tidy the ifdefs for emitting STATE_BASE_ADDRESS
Kenneth Graunke [Fri, 22 Oct 2021 09:31:25 +0000 (02:31 -0700)]
crocus: Tidy the ifdefs for emitting STATE_BASE_ADDRESS

This reorganizes the code so that we set fields in a tidy order:

   1. Set the base addresses

   2. Set either buffer sizes (Gfx8) or upper bound values (Gfx4-7)
      (These are logically the same thing, but expressed differently.)

   3. Set MOCS (Gfx6+)

I find this easier to follow.

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

2 years agocrocus: Set MOCS for most state base addresses on pre-Gen8
Kenneth Graunke [Wed, 20 Oct 2021 21:53:23 +0000 (14:53 -0700)]
crocus: Set MOCS for most state base addresses on pre-Gen8

We were only setting MOCS for dynamic state, surface state, instruction,
and indirect base addresses on Gen8+.  We should set them on Gen6+.

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

2 years agoanv: Set MOCS on NULL stream output buffers
Kenneth Graunke [Tue, 19 Oct 2021 16:12:54 +0000 (09:12 -0700)]
anv: Set MOCS on NULL stream output buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is disabled stream output targets,  MOCS shouldn't matter, as
there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for these null stream
output buffers; we can just assume a MOCS for generic internal buffers.

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

2 years agoanv: Set MOCS on NULL vertex buffers
Kenneth Graunke [Tue, 19 Oct 2021 06:43:04 +0000 (23:43 -0700)]
anv: Set MOCS on NULL vertex buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is 3DSTATE_VERTEX_BUFFERS where we set NullVertexBuffer.
It shouldn't matter here, as there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for null vertex buffers.
We can assume an internal buffer and request isl's vertex buffer MOCS.

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

2 years agoanv: Set MOCS in 3DSTATE_CONSTANT_XS even if there isn't a buffer.
Kenneth Graunke [Tue, 19 Oct 2021 06:39:30 +0000 (23:39 -0700)]
anv: Set MOCS in 3DSTATE_CONSTANT_XS even if there isn't a buffer.

This avoids MOCS != 0 assertions in later patches.  iris also does this,
and we do it for the 3DSTATE_CONSTANT_ALL packet path as well.  It's a
bit pointless, but it should hopefully be harmless also.

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

2 years agoanv: Set MOCS for 3DSTATE_CONSTANT_XS on Gfx7.x as well
Kenneth Graunke [Tue, 19 Oct 2021 20:44:10 +0000 (13:44 -0700)]
anv: Set MOCS for 3DSTATE_CONSTANT_XS on Gfx7.x as well

We were only setting this on Gfx9+.  It's MBZ on Gfx8, but it exists
on Gfx7.x and doesn't have those restrictions there; we should set it.

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

2 years agoanv: Set default MOCS for NULL depth/stencil/HiZ buffers
Kenneth Graunke [Tue, 19 Oct 2021 21:12:32 +0000 (14:12 -0700)]
anv: Set default MOCS for NULL depth/stencil/HiZ buffers

isl now uses info->mocs regardless of whether there's any actual
depth/stencil/HiZ buffers involved, so pass it a legitimate one,
rather than zero.  When we have entirely NULL surfaces, we just
default to isl's MOCS value for an internal depth buffer.

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

2 years agoiris: Fix MOCS for buffer copies
Kenneth Graunke [Wed, 20 Oct 2021 06:13:47 +0000 (23:13 -0700)]
iris: Fix MOCS for buffer copies

We were passing a MOCS of 0, which is uncached.  Yikes.

Fixes: c5b22441f1c ("iris: Fix buffer -> buffer copy_region")

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

2 years agoiris: Set MOCS on NULL stream output buffers
Kenneth Graunke [Tue, 19 Oct 2021 12:20:00 +0000 (05:20 -0700)]
iris: Set MOCS on NULL stream output buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is disabled stream output targets,  MOCS shouldn't matter, as
there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for these null stream
output buffers; we can just assume a MOCS for generic internal buffers.

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

2 years agoiris: Set MOCS on NULL vertex buffers
Kenneth Graunke [Tue, 19 Oct 2021 12:22:45 +0000 (05:22 -0700)]
iris: Set MOCS on NULL vertex buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is 3DSTATE_VERTEX_BUFFERS where we set NullVertexBuffer.
It shouldn't matter here, as there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for null vertex buffers.
We can assume an internal buffer and request isl's vertex buffer MOCS.

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

2 years agoiris: Set MOCS on 3DSTATE_CONSTANT_ALL packets that disable all buffers
Kenneth Graunke [Tue, 19 Oct 2021 12:31:55 +0000 (05:31 -0700)]
iris: Set MOCS on 3DSTATE_CONSTANT_ALL packets that disable all buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we missed
setting a non-zero MOCS was in 3DSTATE_CONSTANT_ALL packets which fully
disable all constant buffers.  (If any constant buffer was present, we
would set an actual MOCS value.)

MOCS really shouldn't matter here, as there are no actual constant
buffers to be cached.  That said, it should be harmless to do so, and
we can just assume a generic MOCS for internal buffers.

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

2 years agoiris: Set MOCS on 3DSTATE_CONSTANT_XS on Gfx9+
Kenneth Graunke [Wed, 13 May 2020 22:08:33 +0000 (15:08 -0700)]
iris: Set MOCS on 3DSTATE_CONSTANT_XS on Gfx9+

We were leaving this blank due to a Broadwell restriction, causing our
constant buffers to be uncached.  We later fixed this for Gfx12+, but
left Gfx9-11 without a fix.  We should specify one.

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

2 years agoiris: Set default MOCS for NULL depth/stencil/HiZ buffers
Kenneth Graunke [Tue, 19 Oct 2021 12:27:04 +0000 (05:27 -0700)]
iris: Set default MOCS for NULL depth/stencil/HiZ buffers

isl now uses info->mocs regardless of whether there's any actual
depth/stencil/HiZ buffers involved, so pass it a legitimate one,
rather than zero.  When we have entirely NULL surfaces, we just
default to isl's MOCS value for an internal depth buffer.

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

2 years agoiris: Set Bindless Sampler State MOCS
Kenneth Graunke [Tue, 19 Oct 2021 05:56:48 +0000 (22:56 -0700)]
iris: Set Bindless Sampler State MOCS

We don't use bindless sampler states today, but when we do, we'll want
them to have proper MOCS values.  This also avoids asserts in upcoming
patches which enforce that MOCS isn't zero.

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

2 years agoiris: Drop unnecessary parenthesis
Kenneth Graunke [Tue, 19 Oct 2021 05:55:34 +0000 (22:55 -0700)]
iris: Drop unnecessary parenthesis

Trivial.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13480>

2 years agoblorp: Use a non-zero MOCS for disabled constant buffers
Kenneth Graunke [Tue, 19 Oct 2021 06:32:46 +0000 (23:32 -0700)]
blorp: Use a non-zero MOCS for disabled constant buffers

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is disabled constant buffers, where MOCS shouldn't matter, as
there's no actual buffer to be cached.

That said, it should be harmless to set MOCS for these null constant
buffers; we can just assume a generic MOCS for internal buffers.

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

2 years agoblorp: Fill in MOCS for null depth/stencil/HiZ buffers.
Kenneth Graunke [Tue, 19 Oct 2021 12:31:06 +0000 (05:31 -0700)]
blorp: Fill in MOCS for null depth/stencil/HiZ buffers.

isl now uses info->mocs regardless of whether there's any actual
depth/stencil/HiZ buffers involved, so pass it a legitimate one,
rather than zero.  We just assume a generic internal MOCS when we
have entirely NULL surfaces.

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

2 years agoblorp: Fill in MOCS even for SURFTYPE_NULL surfaces.
Kenneth Graunke [Tue, 19 Oct 2021 23:34:42 +0000 (16:34 -0700)]
blorp: Fill in MOCS even for SURFTYPE_NULL surfaces.

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is SURFTYPE_NULL surfaces, where MOCS really shouldn't matter,
as there's no actual surface to be cached.

That said, it should be harmless to set MOCS for these null surfaces;
we can just assume a generic MOCS for internal buffers.

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

2 years agoisl: Fill in MOCS for NULL depth, stencil, and HiZ buffers.
Kenneth Graunke [Tue, 19 Oct 2021 21:16:38 +0000 (14:16 -0700)]
isl: Fill in MOCS for NULL depth, stencil, and HiZ buffers.

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is SURFTYPE_NULL depth, stencil, and HiZ buffers, where MOCS
really shouldn't matter, as there's no actual surface to be cached.

That said, it should be harmless to set MOCS for these null surfaces.
We now set the one provided in info->mocs regardless of whether any
buffers actually exist or not.

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

2 years agoisl: Fill in MOCS even for SURFTYPE_NULL surfaces.
Kenneth Graunke [Tue, 19 Oct 2021 20:54:29 +0000 (13:54 -0700)]
isl: Fill in MOCS even for SURFTYPE_NULL surfaces.

We'd like to add safeguards against accidental use of MOCS 0 (uncached),
which can have large performance implications.  One case where we use
MOCS of 0 is SURFTYPE_NULL surfaces, where MOCS really shouldn't matter,
as there's no actual surface to be cached.

That said, it should be harmless to set MOCS for these null surfaces;
we can just assume a generic MOCS for internal buffers.

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

2 years agointel/genxml: Change 3DSTATE_CONSTANT_XS::MOCS to be MBZ on Gfx8.
Kenneth Graunke [Tue, 19 Oct 2021 17:05:47 +0000 (10:05 -0700)]
intel/genxml: Change 3DSTATE_CONSTANT_XS::MOCS to be MBZ on Gfx8.

The Broadwell PRM says: "Constant Buffer Object Control State must
always be programmed to zero."

This patch changes the MOCS field in gen8.xml to be "mbz" type, so that
it's impossible to set it to a non-zero value.

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

2 years agointel/genxml: Drop "Hierarchical Depth Buffer MOCS" field
Kenneth Graunke [Tue, 19 Oct 2021 06:06:25 +0000 (23:06 -0700)]
intel/genxml: Drop "Hierarchical Depth Buffer MOCS" field

This is redundant with the existing "MOCS" field.  We don't need both.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13480>

2 years agointel/genxml: Add an "mbz" data type
Kenneth Graunke [Tue, 26 Oct 2021 21:46:21 +0000 (14:46 -0700)]
intel/genxml: Add an "mbz" data type

There are some fields which Must Be Zero, and we don't want to allow
setting them from the template struct, but we do want them in the XML
to allow them to be decoded properly, and for documentation purposes.

This adds a new "mbz" type, much like "mbo", except it doesn't set
anything in the struct.  We also update the decoder to handle it.

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

2 years agointel/genxml: Fix Indirect Object Access Upper Bound on Gfx4
Kenneth Graunke [Fri, 22 Oct 2021 09:33:04 +0000 (02:33 -0700)]
intel/genxml: Fix Indirect Object Access Upper Bound on Gfx4

We had this field mislabeled as "Instruction Access Upper Bound", but
instruction state base address doesn't exist until Gfx5.  This is
supposed to be the upper bound for indirect object base address,
matching the G45 copy.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13480>

2 years agodrirc: enable do_dce_before_clip_cull_analysis for ANSA
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 16:24:25 +0000 (18:24 +0200)]
drirc: enable do_dce_before_clip_cull_analysis for ANSA

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

2 years agoglsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checks
Pierre-Eric Pelloux-Prayer [Thu, 16 Sep 2021 11:11:30 +0000 (13:11 +0200)]
glsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checks

The GLSL spec says it's an error if a shader statically writes to these
2 variables.

Until this commit, Mesa refused to link a shader if it had an unused
function writing to one of these variables while another (used) function
wrote to the other.

This commit adds an option to perform dead function elimination after
the intra-stage linking step but before performing these checks.

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

2 years agodocs: update calendar and link releases notes for 21.2.5
Dylan Baker [Thu, 28 Oct 2021 17:44:08 +0000 (10:44 -0700)]
docs: update calendar and link releases notes for 21.2.5

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

2 years agodocs: add sha256 sums for 21.2.5
Dylan Baker [Thu, 28 Oct 2021 17:42:02 +0000 (10:42 -0700)]
docs: add sha256 sums for 21.2.5

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

2 years agodocs: add release notes for 21.2.5
Dylan Baker [Thu, 28 Oct 2021 16:48:04 +0000 (09:48 -0700)]
docs: add release notes for 21.2.5

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

2 years agor300: improve precission of linear interpolation
Filip Gawin [Wed, 27 Oct 2021 16:45:00 +0000 (18:45 +0200)]
r300: improve precission of linear interpolation

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

2 years agoir3/ra: Check register file upper bound when updating preferred_reg
Danylo Piliaiev [Wed, 27 Oct 2021 10:40:51 +0000 (13:40 +0300)]
ir3/ra: Check register file upper bound when updating preferred_reg

Otherwise we could get invalid reg in get_reg()

Would fix many dEQP-VK.ssbo.phys.layout.*

Fixes: 0ffcb19b9d9fbe902224542047c389a661fbf816 "ir3: Rewrite register allocation"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13546>

2 years agoradeon/vce: Limiting max supported refernce frames to 1 for h264 encoding
shanshengwang [Tue, 26 Oct 2021 09:50:24 +0000 (17:50 +0800)]
radeon/vce: Limiting max supported refernce frames to 1  for h264 encoding

VCE currently restricted  max_supported reference frames to 1

Signed-off-by: shanshengwang <shansheng.wang@amd.com>
Suggested-by: Suresh Guttula <suresh.guttula@amd.com>
Acked-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13543>

2 years agoac/nir: remove bogus assertion about the position for culling
Samuel Pitoiset [Thu, 21 Oct 2021 16:00:22 +0000 (18:00 +0200)]
ac/nir: remove bogus assertion about the position for culling

It's undefined to not export a position but some applications rely
on that. The position is always initialized to 0,0,0,1 everywhere else
if not exported.

Fixes KHR-GL46.shader_image_load_store.multiple-uniforms with Zink.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13470>

2 years agointel/pps: reuse timestamp_frequency from intel_device_info
Lionel Landwerlin [Thu, 28 Oct 2021 08:13:39 +0000 (11:13 +0300)]
intel/pps: reuse timestamp_frequency from intel_device_info

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agointel/pps: provide accurate min sampling period
Lionel Landwerlin [Thu, 28 Oct 2021 08:13:00 +0000 (11:13 +0300)]
intel/pps: provide accurate min sampling period

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agointel/dev: printout timestamp period
Lionel Landwerlin [Thu, 28 Oct 2021 08:12:16 +0000 (11:12 +0300)]
intel/dev: printout timestamp period

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agodocs: put a list of commands to setup perfetto
Lionel Landwerlin [Wed, 27 Oct 2021 21:15:33 +0000 (00:15 +0300)]
docs: put a list of commands to setup perfetto

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agopps: add an intel config file
Lionel Landwerlin [Wed, 27 Oct 2021 21:09:14 +0000 (00:09 +0300)]
pps: add an intel config file

It was useful to set a colleague up on perfetto.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agopps: remove counter_ids fields
Lionel Landwerlin [Wed, 27 Oct 2021 21:08:19 +0000 (00:08 +0300)]
pps: remove counter_ids fields

Those appear not to be recognized anymore by perfetto.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

2 years agointel/dev/test: Assert (verx10 / 10) == ver
Jordan Justen [Tue, 26 Oct 2021 07:54:58 +0000 (00:54 -0700)]
intel/dev/test: Assert (verx10 / 10) == ver

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13568>

2 years agoaco: use std::vector and IDSet in RA validator
Rhys Perry [Wed, 27 Oct 2021 08:34:44 +0000 (09:34 +0100)]
aco: use std::vector and IDSet in RA validator

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

2 years agobroadcom/compiler: padding fixes to QPU assembly dumps
Iago Toral Quiroga [Wed, 27 Oct 2021 10:24:09 +0000 (12:24 +0200)]
broadcom/compiler: padding fixes to QPU assembly dumps

When there are dst/src modifiers it is pretty common that instructions
take too much space and lead to alignment issues that make code a lot
harder to read, so align the MUL and SIG columns a bit wider to avoid
this:

Before:

0x380021828003faa8 fmax  rf2, rf42.abs, rf40.abs; nop
0x3800f186c503f0f0 fcmp.pushc  -, rf3, rf48; nop
0x380c038b85b83282 fmax  rf11, rf10, rf2; mov.ifa  rf14, rf46
0x3800219ab503f359 and  rf26, rf13, rf25; nop
0x3820f186c503f2f0 fcmp.pushc  -, rf11, rf48; nop           ; thrsw
0x382c013fb5b8368e and  rf63, rf26, rf14; mov.ifa  rf4, rf46; thrsw
0x38002185b503ffc4 and  rf5, rf63, rf4  ; nop
0x38002186b503f141 and  rf6, rf5, rf1   ; nop
0x382031873503f186 vfpack  tlb, rf6, rf6; nop               ; thrsw
0x380031873503f18f vfpack  tlb, rf6, rf15; nop
0x38003186bb03f000 nop                  ; nop

After:

0x380021828003faa8 fmax rf2, rf42.abs, rf40.abs  ; nop
0x3800f186c503f0f0 fcmp.pushc -, rf3, rf48       ; nop
0x380c038b85b83282 fmax rf11, rf10, rf2          ; mov.ifa rf14, rf46
0x3800219ab503f359 and rf26, rf13, rf25          ; nop
0x3820f186c503f2f0 fcmp.pushc -, rf11, rf48      ; nop                         ; thrsw
0x382c013fb5b8368e and rf63, rf26, rf14          ; mov.ifa rf4, rf46           ; thrsw
0x38002185b503ffc4 and rf5, rf63, rf4            ; nop
0x38002186b503f141 and rf6, rf5, rf1             ; nop
0x382031873503f186 vfpack tlb, rf6, rf6          ; nop                         ; thrsw
0x380031873503f18f vfpack tlb, rf6, rf15         ; nop
0x38003186bb03f000 nop                           ; nop

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

2 years agozink: always use explicit lod for texture() when legal in non-fragment stages
Mike Blumenkrantz [Wed, 27 Oct 2021 21:37:30 +0000 (17:37 -0400)]
zink: always use explicit lod for texture() when legal in non-fragment stages

implicit lod is something else entirely

fixes #5566

cc: mesa-stable

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

2 years agozink: set aspectMask for renderpass2 VkAttachmentReference2 structs
Mike Blumenkrantz [Wed, 27 Oct 2021 20:32:55 +0000 (16:32 -0400)]
zink: set aspectMask for renderpass2 VkAttachmentReference2 structs

this is otherwise just garbage

fixes #5569

cc: mesa-stable

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

2 years agozink: use align64 for allocation sizes
Mike Blumenkrantz [Wed, 27 Oct 2021 20:37:03 +0000 (16:37 -0400)]
zink: use align64 for allocation sizes

avoid 32bit sint overflows

fixes #5568

cc: mesa-stable

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

2 years agozink: cache bo SpvId array types
Mike Blumenkrantz [Wed, 27 Oct 2021 21:13:35 +0000 (17:13 -0400)]
zink: cache bo SpvId array types

this cuts down on a truckload of useless new validation spam

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

2 years agovenus: implement vn_buffer_cache_entries_create
Yiwei Zhang [Mon, 18 Oct 2021 06:49:30 +0000 (06:49 +0000)]
venus: implement vn_buffer_cache_entries_create

1. advertise high hit rate cache combinations, and we should limit the
   caches to those only require device memory pool alloc
2. use size = 1 to ask for buffer memory requirements so that we do a
   sanity check on our assumption of returned size and alignment. For
   implementations don't meet our assumption, continue without cache.

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

2 years agovenus: implement vn_buffer_cache_get_memory_requirements
Yiwei Zhang [Mon, 18 Oct 2021 23:36:11 +0000 (23:36 +0000)]
venus: implement vn_buffer_cache_get_memory_requirements

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

2 years agovenus: implement vn_buffer_get_max_buffer_size
Yiwei Zhang [Mon, 18 Oct 2021 18:03:11 +0000 (18:03 +0000)]
venus: implement vn_buffer_get_max_buffer_size

This change estimates the max_buffer_size with quick sort. Try to
avoid some traffic upon device creation time, but not worth adding a
buffer simple create api to avoid the extra requirement query traffic
since this is temporary.

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

2 years agovenus: add buffer cache init and usage flows
Yiwei Zhang [Fri, 15 Oct 2021 18:37:23 +0000 (18:37 +0000)]
venus: add buffer cache init and usage flows

1. struct vn_buffer_cache_entry for buffer memory requirements
2. struct vn_buffer_cache for all buffer related cached info
3. implement vn_buffer_cache_init
4. implement vn_buffer_cache_fini
5. empty vn_buffer_get_max_buffer_size
6. empty vn_buffer_cache_entries_create
7. implement vn_buffer_cache_entries_destroy
8. empty vn_buffer_cache_get_memory_requirements

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

2 years agovenus: add struct vn_image_memory_requirements
Yiwei Zhang [Thu, 21 Oct 2021 06:06:10 +0000 (06:06 +0000)]
venus: add struct vn_image_memory_requirements

This aligns with vn_buffer_memory_requirements and can potentially
simplify future image memory requirements cache init.

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

2 years agovenus: add struct vn_buffer_memory_requirements
Yiwei Zhang [Thu, 21 Oct 2021 05:56:30 +0000 (05:56 +0000)]
venus: add struct vn_buffer_memory_requirements

This will simplify later buffer cache api.

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

2 years agovenus: refactor the ahb buffer mem_type_bits query api
Yiwei Zhang [Mon, 18 Oct 2021 21:22:57 +0000 (21:22 +0000)]
venus: refactor the ahb buffer mem_type_bits query api

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

2 years agovenus: refactor to add vn_buffer_init
Yiwei Zhang [Mon, 18 Oct 2021 20:17:04 +0000 (20:17 +0000)]
venus: refactor to add vn_buffer_init

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

2 years agovenus: refactor to add vn_device_init
Yiwei Zhang [Sat, 16 Oct 2021 22:57:16 +0000 (22:57 +0000)]
venus: refactor to add vn_device_init

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

2 years agovenus: release queues on device creation failure
Yiwei Zhang [Fri, 15 Oct 2021 20:02:18 +0000 (20:02 +0000)]
venus: release queues on device creation failure

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

2 years agozink: add better handling for CUBE_COMPATIBLE bit
Mike Blumenkrantz [Fri, 6 Aug 2021 20:20:45 +0000 (16:20 -0400)]
zink: add better handling for CUBE_COMPATIBLE bit

this check was illegal because the usage bits weren't yet populated,
so add another check after usage bits are determined to figure out if
CUBE_COMPATIBLE can be applied

additionally, checking sample counts was never needed since the spec
prohibits CUBE_COMPATIBLE use with multisampling

zink DEBUG: ERR: 'Validation Error: [ VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x991b3105 | vkGetPhysicalDeviceImageFormatProperties: value of usage must not be 0. The Vulkan spec states: usage must not be 0 (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask)'

Fixes: 71494c4874c ("zink: only mark resources as cube-compatible if supported")

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

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>