platform/upstream/mesa.git
2 years agoutil/ra: Fix numeric overflow during bitset allocation
Kostiantyn Lazukin [Thu, 16 Dec 2021 11:23:49 +0000 (13:23 +0200)]
util/ra: Fix numeric overflow during bitset allocation

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Kostiantyn Lazukin <kostiantyn.lazukin@globallogic.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5752
Fixes: d4a4cd20d52 ("util/ra: use adjacency matrix for undirected graph")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14224>

2 years agomeson: drop a temp formatting variable
Thomas H.P. Andersen [Thu, 16 Dec 2021 22:09:55 +0000 (23:09 +0100)]
meson: drop a temp formatting variable

This was only needed in meson < 0.50

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

2 years agodocs: update the required meson version
Thomas H.P. Andersen [Thu, 16 Dec 2021 22:06:37 +0000 (23:06 +0100)]
docs: update the required meson version

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

2 years agomeson: drop a comment relating to old meson version
Thomas H.P. Andersen [Thu, 16 Dec 2021 21:58:58 +0000 (22:58 +0100)]
meson: drop a comment relating to old meson version

This comment was related to an if/else on meson version that has
already been removed in c1a290bdd57536d6afcff6a02f1512fba7328729

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

2 years agomeson: drop compatability with < 0.48
Thomas H.P. Andersen [Thu, 16 Dec 2021 21:28:42 +0000 (22:28 +0100)]
meson: drop compatability with < 0.48

Before meson 0.48 the cpu_family() would return 'ppc64le' on little
endian power8. In newer versions it returns 'ppc64' and endianness
should be checked with endian()

We now require meson >= 0.53 so we can drop the compatability with
older versions.

The old behavior was added in e430a034b9d2be626557931cd29808a3161889f1

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

2 years agointel/fs: Add a NONE scheduling mode
Jason Ekstrand [Wed, 10 Nov 2021 04:55:49 +0000 (22:55 -0600)]
intel/fs: Add a NONE scheduling mode

While our LIFO scheduling mode attempts to optimize for register
pressure, it's often hard for a scheduling algorithm to do better than
the instruction order provided by the shader author.  Shader authors
often do perfectly reasonable things like using texture results
immediately after fetching them or constructing texture coordinates
immediately before the texture op.  When we throw all the instruction
ordering information away, we loose any help the author may have given
us.  By attempting NONE before we fall back to the worst case LIFO mode.

And, yes, I tried this with NONE both before and after LIFO and doing
NONE before LIFO is substantially better, according to shader-db.

    total instructions in shared programs: 19673152 -> 19665202 (-0.04%)
    instructions in affected programs: 33669 -> 25719 (-23.61%)
    helped: 20
    HURT: 0
    helped stats (abs) min: 15 max: 4609 x̄: 397.50 x̃: 107
    helped stats (rel) min: 2.33% max: 67.50% x̄: 14.60% x̃: 9.12%
    95% mean confidence interval for instructions value: -867.61 72.61
    95% mean confidence interval for instructions %-change: -21.74% -7.46%
    Inconclusive result (value mean confidence interval includes 0).

    total cycles in shared programs: 935562500 -> 935020920 (-0.06%)
    cycles in affected programs: 18620349 -> 18078769 (-2.91%)
    helped: 104
    HURT: 48
    helped stats (abs) min: 88 max: 60986 x̄: 8031.48 x̃: 3680
    helped stats (rel) min: 0.61% max: 51.44% x̄: 14.95% x̃: 8.87%
    HURT stats (abs)   min: 10 max: 54724 x̄: 6118.62 x̃: 1530
    HURT stats (rel)   min: 0.13% max: 46.45% x̄: 10.28% x̃: 6.46%
    95% mean confidence interval for cycles value: -5724.34 -1401.71
    95% mean confidence interval for cycles %-change: -9.86% -4.10%
    Cycles are helped.

    total spills in shared programs: 12158 -> 10327 (-15.06%)
    spills in affected programs: 1831 -> 0
    helped: 20
    HURT: 0

    total fills in shared programs: 14749 -> 12635 (-14.33%)
    fills in affected programs: 2114 -> 0
    helped: 20
    HURT: 0

    LOST:   8
    GAINED: 649

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agointel/fs: Reset instruction order before re-scheduling
Jason Ekstrand [Wed, 10 Nov 2021 01:03:19 +0000 (19:03 -0600)]
intel/fs: Reset instruction order before re-scheduling

The way the current scheduler loop is implemented, each scheduling pass
starts with what the previous pass had.  This means that, if PRE screwed
everything up majorly, PRE_NON_LIFO would have to try to fix it.  It
also meant that tiny changes to one pass would affect every later pass.
Instead, reset the order of the instructions before each scheduling
pass.  This makes the passes entirely independent of each other.

Shader-db results on Ice Lake:

    total instructions in shared programs: 19670486 -> 19670648 (<.01%)
    instructions in affected programs: 25317 -> 25479 (0.64%)
    helped: 2
    HURT: 7
    helped stats (abs) min: 4 max: 4 x̄: 4.00 x̃: 4
    helped stats (rel) min: 0.07% max: 0.07% x̄: 0.07% x̃: 0.07%
    HURT stats (abs)   min: 8 max: 70 x̄: 24.29 x̃: 12
    HURT stats (rel)   min: 0.41% max: 4.95% x̄: 1.47% x̃: 0.87%
    95% mean confidence interval for instructions value: -1.28 37.28
    95% mean confidence interval for instructions %-change: -0.04% 2.30%
    Inconclusive result (value mean confidence interval includes 0).

    total cycles in shared programs: 935535948 -> 935490243 (<.01%)
    cycles in affected programs: 421994824 -> 421949119 (-0.01%)
    helped: 1269
    HURT: 879
    helped stats (abs) min: 1 max: 12008 x̄: 259.38 x̃: 52
    helped stats (rel) min: <.01% max: 28.02% x̄: 1.12% x̃: 0.14%
    HURT stats (abs)   min: 1 max: 29931 x̄: 322.46 x̃: 20
    HURT stats (rel)   min: <.01% max: 32.17% x̄: 1.74% x̃: 0.22%
    95% mean confidence interval for cycles value: -71.37 28.81
    95% mean confidence interval for cycles %-change: -0.11% 0.21%
    Inconclusive result (value mean confidence interval includes 0).

    total spills in shared programs: 12403 -> 12430 (0.22%)
    spills in affected programs: 1355 -> 1382 (1.99%)
    helped: 2
    HURT: 7

    total fills in shared programs: 15128 -> 15182 (0.36%)
    fills in affected programs: 3294 -> 3348 (1.64%)
    helped: 2
    HURT: 7

    LOST:   21
    GAINED: 28

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agoRevert "intel/fs: Do cmod prop again after scheduling"
Jason Ekstrand [Wed, 10 Nov 2021 02:17:42 +0000 (20:17 -0600)]
Revert "intel/fs: Do cmod prop again after scheduling"

This reverts commit ba2fa1ceaf4ccb905e1d841b45f88505449db44e.  Doing
optimizations after scheduling but before RA means doing them in the
middle of the scheduling loop which introduces additional dependencies
between one scheduling iteration and the next.  That won't work if we
want to make the scheduling modes independent, at least not unless we
have some way of fully cloning the IR.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agointel/eu: Don't double-loop as often in brw_set_uip_jip
Jason Ekstrand [Tue, 9 Nov 2021 22:09:23 +0000 (16:09 -0600)]
intel/eu: Don't double-loop as often in brw_set_uip_jip

brw_find_next_block_end() scans through the instructions to find the end
of the block.  We were calling it for every instruction in the program
which is, if you have a single basic block, makes the whole mess a nice
clean O(n^2) when it really doesn't need to be.  Instead, only call
brw_find_next_block_end() as-needed.  This brings it back to O(n) like
it should have been.

This cuts the runtime of the following Vulkan CTS on my SKL box by 5%
from 1:51 to 1:45:  dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agointel/fs: Use OPT() for split_virtual_grfs
Jason Ekstrand [Tue, 9 Nov 2021 20:38:48 +0000 (14:38 -0600)]
intel/fs: Use OPT() for split_virtual_grfs

Now that we're being conservative in the pass, it's easy to tell when it
makes progress and we can put it in the OPT() macro.  This way, we get
nice INTEL_DEBUG=optimizer dumps for it.  While we're here, fix the
header comment which is massively out-of-date.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agointel/fs: Be more conservative in split_virtual_grfs
Jason Ekstrand [Tue, 9 Nov 2021 20:37:57 +0000 (14:37 -0600)]
intel/fs: Be more conservative in split_virtual_grfs

Instead of modifying every single instruction, keep track of which VGRFs
are actually split in a bit-set, and only modify the instructions that
actually touch split regs.

This cuts the runtime of the following Vulkan CTS on my SKL box by 45%
from 3:21 to 1:51:  dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13734>

2 years agospirv: Use the incorporated names
Caio Oliveira [Wed, 15 Sep 2021 20:20:53 +0000 (13:20 -0700)]
spirv: Use the incorporated names

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14209>

2 years agospirv: Identify non-temporal image operand added in SPIR-V 1.6
Caio Oliveira [Mon, 20 Sep 2021 18:10:10 +0000 (11:10 -0700)]
spirv: Identify non-temporal image operand added in SPIR-V 1.6

Map it to the existing ACCESS_STREAM_CACHE_POLICY access mode.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14209>

2 years agonir: Handle volatile semantics for loading HelperInvocation builtin
Caio Oliveira [Wed, 15 Sep 2021 22:38:23 +0000 (15:38 -0700)]
nir: Handle volatile semantics for loading HelperInvocation builtin

SPV_EXT_demote_to_helper_invocation added OpDemoteToHelperInvocation
operation to turn an invocation into a helper invocation, but the
value of HelperInvocation (a builtin from Input storage class)
couldn't be modified dynamically without breaking compatibility.

For the extension the operation OpIsHelperInvocation was added to get
the dynamic value.

For SPIR-V 1.6, the demote operation was promoted, but now to get the
dynamic value the shader must issue a load to HelperInvocation with
Volatile memory access semantics.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14209>

2 years agospirv: Update headers and metadata to SPIR-V 1.6, revision 1
Caio Oliveira [Wed, 25 Aug 2021 19:25:58 +0000 (12:25 -0700)]
spirv: Update headers and metadata to SPIR-V 1.6, revision 1

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14209>

2 years agodocs: update calendar and link releases notes for 21.3.2
Eric Engestrom [Fri, 17 Dec 2021 22:32:41 +0000 (22:32 +0000)]
docs: update calendar and link releases notes for 21.3.2

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

2 years agodocs: add release notes for 21.3.2
Eric Engestrom [Fri, 17 Dec 2021 22:31:13 +0000 (22:31 +0000)]
docs: add release notes for 21.3.2

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

2 years agoci/windows: Remove line numbers of SPIR-V errors in spirv2dxil tests
Caio Oliveira [Fri, 17 Dec 2021 19:20:10 +0000 (11:20 -0800)]
ci/windows: Remove line numbers of SPIR-V errors in spirv2dxil tests

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

2 years agoaco: remove SMEM constant/addition combining out of the loop
Rhys Perry [Tue, 14 Dec 2021 19:51:50 +0000 (19:51 +0000)]
aco: remove SMEM constant/addition combining out of the loop

There's no reason for this optimization to be in this loop.

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

2 years agoaco: skip &-4 before SMEM
Rhys Perry [Thu, 11 Nov 2021 10:54:56 +0000 (10:54 +0000)]
aco: skip &-4 before SMEM

The hardware ignores the low 2 bits. I'm not sure if they are ignored
before or after the address is calculated, but this optimization should be
cautious enough.

fossil-db (Sienna Cichlid):
Totals from 259 (0.19% of 134572) affected shaders:
SpillSGPRs: 1381 -> 1382 (+0.07%)
SpillVGPRs: 1783 -> 1782 (-0.06%); split: -0.67%, +0.62%
CodeSize: 1598612 -> 1596084 (-0.16%); split: -0.30%, +0.14%
Scratch: 180224 -> 179200 (-0.57%); split: -1.14%, +0.57%
Instrs: 284885 -> 284268 (-0.22%); split: -0.34%, +0.12%
Latency: 6585634 -> 6603388 (+0.27%); split: -0.48%, +0.75%
InvThroughput: 2638983 -> 2648474 (+0.36%); split: -0.58%, +0.94%
VClause: 6797 -> 6820 (+0.34%); split: -0.15%, +0.49%
SClause: 6569 -> 6574 (+0.08%); split: -1.11%, +1.19%
Copies: 50561 -> 50586 (+0.05%); split: -0.61%, +0.66%
Branches: 10058 -> 10062 (+0.04%); split: -0.01%, +0.05%

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

2 years agoaco: disallow SMEM offsets that are not multiples of 4
Rhys Perry [Tue, 30 Nov 2021 15:45:12 +0000 (15:45 +0000)]
aco: disallow SMEM offsets that are not multiples of 4

These can't be encoded on GFX6/7, and combining these additions causes
CTS failures on GFX10.3.

I think the low 2 MSBs are ignored before the addition, not after, so
load(a + 3, 0) becomes load(a, 3), which is the same as load(a, 0).

No fossil-db changes.

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

2 years agoradv: Add safety check for RGP traces on VanGogh.
Bas Nieuwenhuizen [Tue, 9 Nov 2021 23:53:14 +0000 (00:53 +0100)]
radv: Add safety check for RGP traces on VanGogh.

To avoid accidental hangs.

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

2 years agocrocus: Clamp VS point sizes to the HW limits as required.
Emma Anholt [Thu, 16 Dec 2021 20:26:53 +0000 (12:26 -0800)]
crocus: Clamp VS point sizes to the HW limits as required.

Fixes piglit vs-point-size-zero.

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

2 years agoci/crocus: Add support for manual CI runs on my G41.
Emma Anholt [Tue, 23 Nov 2021 19:25:41 +0000 (11:25 -0800)]
ci/crocus: Add support for manual CI runs on my G41.

Uses a shared runner at my house so we have an easy way to minimally test
crocus.

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

2 years agonir/opt_access: infer CAN_REORDER for global access
Rhys Perry [Thu, 2 Dec 2021 10:34:44 +0000 (10:34 +0000)]
nir/opt_access: infer CAN_REORDER for global access

fossil-db (Sienna Cichlid):
Totals from 352 (0.26% of 134621) affected shaders:
VGPRs: 17240 -> 17272 (+0.19%)
CodeSize: 1753640 -> 1755744 (+0.12%); split: -0.04%, +0.16%
Instrs: 323190 -> 323801 (+0.19%); split: -0.03%, +0.22%
Latency: 3241205 -> 3241293 (+0.00%); split: -0.10%, +0.10%
InvThroughput: 568927 -> 568067 (-0.15%); split: -0.16%, +0.00%
SClause: 12109 -> 10444 (-13.75%); split: -13.76%, +0.01%
Copies: 27802 -> 27717 (-0.31%); split: -0.56%, +0.26%
PreSGPRs: 14699 -> 14690 (-0.06%)
PreVGPRs: 15793 -> 15799 (+0.04%)

fossil-db (Polaris10):
Totals from 348 (0.26% of 135668) affected shaders:
SGPRs: 21446 -> 21574 (+0.60%); split: -0.15%, +0.75%
VGPRs: 17004 -> 16996 (-0.05%); split: -0.09%, +0.05%
CodeSize: 1782796 -> 1783060 (+0.01%); split: -0.03%, +0.05%
Instrs: 337828 -> 337921 (+0.03%); split: -0.03%, +0.06%
Latency: 3726328 -> 3726721 (+0.01%); split: -0.09%, +0.10%
InvThroughput: 1307917 -> 1299841 (-0.62%); split: -0.62%, +0.00%
VClause: 4327 -> 4337 (+0.23%); split: -0.09%, +0.32%
SClause: 12178 -> 10529 (-13.54%); split: -13.55%, +0.01%
Copies: 40227 -> 40244 (+0.04%); split: -0.19%, +0.24%
PreSGPRs: 14946 -> 14937 (-0.06%)
PreVGPRs: 15637 -> 15643 (+0.04%)

fossil-db (Pitcairn):
Totals from 351 (0.26% of 135668) affected shaders:
SGPRs: 20382 -> 20619 (+1.16%); split: -0.79%, +1.95%
CodeSize: 1789732 -> 1789836 (+0.01%); split: -0.04%, +0.04%
MaxWaves: 1947 -> 1949 (+0.10%)
Instrs: 352274 -> 352318 (+0.01%); split: -0.04%, +0.06%
Latency: 4057829 -> 4058226 (+0.01%); split: -0.08%, +0.09%
InvThroughput: 1332245 -> 1317578 (-1.10%); split: -1.11%, +0.01%
VClause: 8581 -> 8583 (+0.02%); split: -0.13%, +0.15%
SClause: 12187 -> 10552 (-13.42%); split: -13.43%, +0.02%
Copies: 44906 -> 44915 (+0.02%); split: -0.24%, +0.26%
PreSGPRs: 16571 -> 16562 (-0.05%)

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

2 years agonir/algebraic: optimize more 64-bit imul with constant source
Rhys Perry [Tue, 9 Mar 2021 16:51:25 +0000 (16:51 +0000)]
nir/algebraic: optimize more 64-bit imul with constant source

Two 64-bit shifts and an addition are usually faster than the several
multiplications nir_lower_int64 creates.

No fossil-db changes.

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

2 years agonir/opt_load_store_vectorize: improve ssbo/global alias analysis
Rhys Perry [Tue, 9 Mar 2021 16:11:12 +0000 (16:11 +0000)]
nir/opt_load_store_vectorize: improve ssbo/global alias analysis

If either the global access or the ssbo access is restrict, they shouldn't
alias.

No fossil-db changes.

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

2 years agoradv: fix dynamic rendering global scissor
Samuel Pitoiset [Mon, 13 Dec 2021 09:21:38 +0000 (10:21 +0100)]
radv: fix dynamic rendering global scissor

Make sure to clamp the global scissor to the render area.

This fixes dEQP-VK.draw.dynamic_rendering.*oversized.

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

2 years agoanv/pipeline: Get rid of sample_shading_enable
Jason Ekstrand [Tue, 14 Dec 2021 18:17:53 +0000 (12:17 -0600)]
anv/pipeline: Get rid of sample_shading_enable

Putting it in the pipeline is a bit of a lie.  We no longer need it for
nir_lower_wpos_center. The only other user is pipeline_has_coarse_pixel
and that is used to build the shader key which we construct before we've
processed any NIR so we don't have accurate information at that time
anyway.  Instead, look at ms_info->sampleShadingEnable directly in
pipeline_has_coarse_pixel and trust the back-end to deal with disabling
coarse when we need per-sample dispatch.

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

2 years agoanv,nir: Use sample_pos_or_center in lower_wpos_center
Jason Ekstrand [Thu, 2 Dec 2021 20:41:41 +0000 (14:41 -0600)]
anv,nir: Use sample_pos_or_center in lower_wpos_center

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

2 years agointel/fs: Implement the sample_pos_or_center system value
Jason Ekstrand [Thu, 2 Dec 2021 20:16:02 +0000 (14:16 -0600)]
intel/fs: Implement the sample_pos_or_center system value

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

2 years agointel/fs: Rework emit_samplepos_setup()
Jason Ekstrand [Thu, 2 Dec 2021 20:25:12 +0000 (14:25 -0600)]
intel/fs: Rework emit_samplepos_setup()

This rolls compute_sample_position into emit_samplepos_setup, its only
caller, by using a loop instead of calling it twice.  We also
early-return for the !persample_dispatch case instead of doing it as
part of the sample calculation.  This means that we don't call
fetch_payload_reg() to get sample_pos_reg unless we're actually going to
use it so the function is safe to call even if we haven't set up
sample_pos_reg.  This will be important for the next commit.

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

2 years agointel/fs: Return fs_reg directly from builtin setup helpers
Jason Ekstrand [Mon, 22 Nov 2021 19:42:59 +0000 (13:42 -0600)]
intel/fs: Return fs_reg directly from builtin setup helpers

There's no good reason why we're allocating them on the heap and
returning a pointer.  Return the fs_reg directly.

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

2 years agonir: Add a new sample_pos_or_center system value
Jason Ekstrand [Thu, 2 Dec 2021 20:11:21 +0000 (14:11 -0600)]
nir: Add a new sample_pos_or_center system value

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

2 years agoradeonsi/nir: Check for VARYING_SLOT_PRIMITIVE_ID not SYSTEM_VALUE
Jason Ekstrand [Fri, 17 Dec 2021 05:20:31 +0000 (23:20 -0600)]
radeonsi/nir: Check for VARYING_SLOT_PRIMITIVE_ID not SYSTEM_VALUE

This function is called on load/store_input/output.  It makes no sense
for it to get a SYSTEM_VALUE enum.  This only doesn't explode because
SYSTEM_VALUE_PRIMITIVE_ID happens to be below VARYING_SLOT_VAR0 so it
doesn't interact with any actual varyings.  The next commit is going to
add another system value which will push SYSTEM_VALUE_PRIMITIVE_ID up by
one so it will equal VARYING_SLOT_VAR0 and then the first FS input will
always get smashed to flat which isn't what we want.

Fixes: b59bb9c07ae4 ("radeonsi: force flat for PrimID early in si_nir_scan_shader")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14198>

2 years agoglthread: only log glthread destroy reason when it's not NULL
Pierre-Eric Pelloux-Prayer [Thu, 16 Dec 2021 11:09:16 +0000 (12:09 +0100)]
glthread: only log glthread destroy reason when it's not NULL

Fixes: 670759a208d ("glthread: inline _mesa_glthread_restore_dispatch and merge disable & destroy")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14226>

2 years agoradeonsi: don't use perp. end caps when line smoothing is on
Pierre-Eric Pelloux-Prayer [Thu, 16 Dec 2021 11:06:52 +0000 (12:06 +0100)]
radeonsi: don't use perp. end caps when line smoothing is on

The line smoothing algorithm causes the diagonal line to be visible.

See: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13700#note_1187405

Fixes: 45717780082 ("radeonsi: set PERPENDICULAR_ENDCAP_ENA for wide AA lines")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14226>

2 years agoaco: fix check_vop3_operands() for f16vec2 ffma fneg combine
Rhys Perry [Thu, 16 Dec 2021 15:47:53 +0000 (15:47 +0000)]
aco: fix check_vop3_operands() for f16vec2 ffma fneg combine

For v_pk_fma_f16, we should consider all three operands, not the first
two.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 15a375b4c86 ("radv,aco: don't lower some ffma instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14229>

2 years agonir/print: print const value near each use of const ssa variable
Marcin Ślusarz [Fri, 19 Nov 2021 14:47:56 +0000 (15:47 +0100)]
nir/print: print const value near each use of const ssa variable

Without/with NIR_DEBUG=print,print_const:

-vec4 32 ssa_60 = fadd ssa_59, ssa_58
+vec4 32 ssa_60 = fadd ssa_59 /*(0xbf800000, 0x3e800000, 0x00000000, 0x3f800000) = (-1.000000, 0.250000, 0.000000, 1.000000)*/, ssa_58

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

2 years agonir/print: group hex and float vectors together
Marcin Ślusarz [Fri, 19 Nov 2021 14:35:37 +0000 (15:35 +0100)]
nir/print: group hex and float vectors together

Vectors are much easier to follow in this format, because developer cares
either about hex or float values, never both.

Before/after:

-vec4 32 ssa_222 = load_const (0x00000000 /* 0.000000 */, 0x00000000 /* 0.000000 */, 0x3f800000 /* 1.000000 */, 0x3f800000 /* 1.000000 */)
+vec4 32 ssa_222 = load_const (0x00000000, 0x00000000, 0x3f800000, 0x3f800000) = (0.000000, 0.000000, 1.000000, 1.000000)

-vec1 32 ssa_174 = load_const (0xbf800000 /* -1.000000 */)
+vec1 32 ssa_174 = load_const (0xbf800000 = -1.000000)

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

2 years agonir/print: move print_load_const_instr up
Marcin Ślusarz [Fri, 19 Nov 2021 14:28:49 +0000 (15:28 +0100)]
nir/print: move print_load_const_instr up

... to avoid forward declarations in future commit

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

2 years agobroadcom/ci: restructure expected results
Juan A. Suarez Romero [Tue, 30 Nov 2021 09:03:29 +0000 (10:03 +0100)]
broadcom/ci: restructure expected results

Sort/rename the files so expected tests are classified by device.

No need to split the tests by driver (e.g., V3D vs V3DV).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13983>

2 years agoradv/amdgpu: Only wait on queue_syncobj when needed.
Bas Nieuwenhuizen [Thu, 16 Dec 2021 00:01:27 +0000 (01:01 +0100)]
radv/amdgpu: Only wait on queue_syncobj when needed.

If signalled on the same queue it is totally useless, so only wait
if we have a syncobj that is explicitly being waited on, which can
be from potentially another queue/ctx. (Ideally we'd check but there
is no way to do so currently. Might revisit when we integrate the
common sync framework)

Fixes: 7675d066caa ("radv/amdgpu: Add support for submitting 0 commandbuffers.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14214>

2 years agoanv: Drop anv_sync_create_for_bo
Jason Ekstrand [Thu, 16 Dec 2021 20:27:50 +0000 (14:27 -0600)]
anv: Drop anv_sync_create_for_bo

The older helper is unused so we can roll it all into
anv_create_sync_for_memory.

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

2 years agoanv,wsi: simplify WSI synchronization
Lionel Landwerlin [Wed, 15 Dec 2021 09:52:44 +0000 (11:52 +0200)]
anv,wsi: simplify WSI synchronization

Rather than using 2 vfuncs, use one since we've unified the
synchronization framework in the runtime with a single vk_sync object.

v2 (Jason Ekstrand):
 - create_sync_for_memory is now in vk_device

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agoanv: Implement vk_device::create_sync_for_memory
Jason Ekstrand [Thu, 16 Dec 2021 20:14:19 +0000 (14:14 -0600)]
anv: Implement vk_device::create_sync_for_memory

Fixes: 36ea90a3619f ("anv: Convert to the common sync and submit framework")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agovulkan/queue: Handle WSI memory signal information
Jason Ekstrand [Thu, 16 Dec 2021 16:29:03 +0000 (10:29 -0600)]
vulkan/queue: Handle WSI memory signal information

We handle it by asking the driver to create a vk_sync that wraps a
VkDeviceMemory object and gets passed as one of the signal ops.

Fixes: 9bffd81f1cb7 ("vulkan: Add common implementations of vkQueueSubmit and vkQueueWaitIdle")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agovulkan: fix missing handling of WSI memory signal
Lionel Landwerlin [Wed, 15 Dec 2021 09:08:17 +0000 (11:08 +0200)]
vulkan: fix missing handling of WSI memory signal

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b996fa8efaa4 ("anv: implement VK_KHR_synchronization2")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5744
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>

2 years agointel/stub: Implement shell versions of DRM_I915_GEM_GET_TILING and DRM_I915_SEM_GET_...
Ian Romanick [Thu, 16 Dec 2021 01:53:04 +0000 (17:53 -0800)]
intel/stub: Implement shell versions of DRM_I915_GEM_GET_TILING and DRM_I915_SEM_GET_TILING

This is necessary to use intel_stub_gpu with Crocus.

v2: Remove unused i915_bo::swizzle_mode. Noticed by Emma.

Fixes: 953a4ca6fec ("intel: Add has_bit6_swizzle to devinfo")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14218>

2 years agointel/stub: Silence "initialized field overwritten" warning
Ian Romanick [Thu, 9 Dec 2021 20:06:39 +0000 (12:06 -0800)]
intel/stub: Silence "initialized field overwritten" warning

src/intel/tools/intel_noop_drm_shim.c:459:36: warning: initialized field overwritten [-Woverride-init]
  459 |    [DRM_I915_GEM_EXECBUFFER2_WR] = i915_ioctl_noop,
      |                                    ^~~~~~~~~~~~~~~

Fixes: 0f4f1d70bfe ("intel: add stub_gpu tool")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14218>

2 years agoci/freedreno: Add known flakes from the last month.
Emma Anholt [Thu, 16 Dec 2021 22:14:09 +0000 (14:14 -0800)]
ci/freedreno: Add known flakes from the last month.

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

2 years agoglx: Fix GLX_NV_float_buffer fbconfig handling
Adam Jackson [Wed, 16 Jun 2021 18:01:04 +0000 (14:01 -0400)]
glx: Fix GLX_NV_float_buffer fbconfig handling

Since we didn't record this attribute from the server, we wouldn't
account for it in glXChooseFBConfig, and glXGetFBConfigAttrib wouldn't
know about it.

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

2 years agovenus: add some trace points
Chia-I Wu [Mon, 17 May 2021 17:25:52 +0000 (10:25 -0700)]
venus: add some trace points

Add trace points for

 - vn_AcquireNextImage2KHR and vn_QueuePresentKHR
 - vn_AcquireImageANDROID and vn_QueueSignalReleaseImageANDROID
 - vn_BeginCommandBuffer and vn_EndCommandBuffer
 - vn_*Wait*
 - vn_Queue*
 - vn_instance_wait_roundtrip
 - shmem allocations and cache miss/skip

v2: fix cache miss/skip trace points (Ryan)

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

2 years agomeson: correctly detect linker arguments
Michel Zou [Thu, 25 Nov 2021 20:51:07 +0000 (21:51 +0100)]
meson: correctly detect linker arguments

Fixes: 22673a98 ("meson: Check arguments before adding")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13961>

2 years agor300: Remove unused RC_OPCODE_DPH
Emma Anholt [Wed, 8 Dec 2021 20:30:20 +0000 (12:30 -0800)]
r300: Remove unused RC_OPCODE_DPH

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_SFL
Emma Anholt [Wed, 8 Dec 2021 20:28:43 +0000 (12:28 -0800)]
r300: Remove unused RC_OPCODE_SFL

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_CLAMP.
Emma Anholt [Wed, 8 Dec 2021 20:24:13 +0000 (12:24 -0800)]
r300: Remove unused RC_OPCODE_CLAMP.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_SWZ.
Emma Anholt [Wed, 8 Dec 2021 20:21:11 +0000 (12:21 -0800)]
r300: Remove unused RC_OPCODE_SWZ.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_XPD.
Emma Anholt [Wed, 8 Dec 2021 20:19:56 +0000 (12:19 -0800)]
r300: Remove unused RC_OPCODE_XPD.

Nothing generates it in the backend.

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

2 years agor300: Remove unused RC_OPCODE_ABS.
Emma Anholt [Wed, 8 Dec 2021 20:17:43 +0000 (12:17 -0800)]
r300: Remove unused RC_OPCODE_ABS.

Nothing generates it in the backend.

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

2 years agor300: Remove support for SCS.
Emma Anholt [Wed, 8 Dec 2021 19:51:30 +0000 (11:51 -0800)]
r300: Remove support for SCS.

Nothing generates this meta-op in the backend, so we don't need it.

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

2 years agor300: Remove some dead compiler code.
Emma Anholt [Wed, 8 Dec 2021 19:45:22 +0000 (11:45 -0800)]
r300: Remove some dead compiler code.

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

2 years agonir/print: compact printing of intrinsic indices
Marcin Ślusarz [Tue, 19 Oct 2021 09:27:40 +0000 (11:27 +0200)]
nir/print: compact printing of intrinsic indices

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

2 years agonir/print: expand printing of io semantics.gs_streams
Marcin Ślusarz [Mon, 18 Oct 2021 13:40:13 +0000 (15:40 +0200)]
nir/print: expand printing of io semantics.gs_streams

gs_streams can be set for at least 2 other intrinsics.

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

2 years agonir/print: simplify printing of IO semantics
Marcin Ślusarz [Mon, 18 Oct 2021 13:29:23 +0000 (15:29 +0200)]
nir/print: simplify printing of IO semantics

Some of the tested flags are set for other intrinsics and they are
printed only when set, so there's no point in checking exact intrinsic
name or shader stage.

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

2 years agointel/compiler: Use uppercase enum values in brw_ir_performance.cpp
Kenneth Graunke [Thu, 4 Jun 2020 01:06:45 +0000 (18:06 -0700)]
intel/compiler: Use uppercase enum values in brw_ir_performance.cpp

This is by far the more common style in Mesa.  It also gives a cue that
e.g. num_dependency_ids is a fixed definition rather than some kind of
local variable maintaining a count.

While hre, we also rename the enums to have full prefixes to prepare for
a future where we use them in multiple files for future backend work.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14182>

2 years agointel/vec4: Inline emit_texture and move helpers to brw_vec4_nir.cpp
Kenneth Graunke [Tue, 14 Dec 2021 00:52:57 +0000 (16:52 -0800)]
intel/vec4: Inline emit_texture and move helpers to brw_vec4_nir.cpp

emit_texture() only has one caller, nir_emit_texture().  We may as well
inline that.  Move the associated helper functions for emitting sampler
messages there as well, to keep associated code nearby.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5183
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14191>

2 years agointel/vec4: Use nir_texop in emit_texture instead of translating
Kenneth Graunke [Tue, 14 Dec 2021 00:46:23 +0000 (16:46 -0800)]
intel/vec4: Use nir_texop in emit_texture instead of translating

We eliminated the GLSL IR -> vec4 backend ages ago, so the only caller
uses a nir_texop enum.  Drop a layer of translating.

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

2 years agointel/vec4: Use ir_texture_opcode less in emit_texture()
Kenneth Graunke [Tue, 14 Dec 2021 00:35:46 +0000 (16:35 -0800)]
intel/vec4: Use ir_texture_opcode less in emit_texture()

This replaces a bunch of uses of the GLSL IR ir_texture_opcode enum with
the backend opcode, in preparation for removing it altogether.

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

2 years agoradv,aco: do not disable anisotropy filtering for non-mipmap images
Samuel Pitoiset [Mon, 13 Dec 2021 10:13:40 +0000 (11:13 +0100)]
radv,aco: do not disable anisotropy filtering for non-mipmap images

This fixes
dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_*.mag_linear_min_linear.

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

2 years agoac/nir: add an option to disable anisotropic filtering for single level images
Samuel Pitoiset [Mon, 13 Dec 2021 16:39:01 +0000 (17:39 +0100)]
ac/nir: add an option to disable anisotropic filtering for single level images

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

2 years agoglx: fix querying GLX_FBCONFIG_ID for Window
Pierre-Eric Pelloux-Prayer [Mon, 13 Dec 2021 14:07:13 +0000 (15:07 +0100)]
glx: fix querying GLX_FBCONFIG_ID for Window

This commit fixes apps using the following sequence:
1. XCreateWindow(dpy) -> win
2. glXCreateContextAttribsARB(dpy, ...) -> ctx
3. glXMakeCurrent(dpy, win, ctx)
4. glXQueryDrawable(dpy, win, GLX_FBCONFIG_ID, ...)

glXQueryDrawable returned 0 (while correctly returning a valid
GLXFCONFIG_ID for other types of drawables).

This commit adds the same dance as driInferDrawableConfig to get
the GLX visual from the Window, and then the GLXFBCONFIG_ID of
this visual.

This fixes:
* piglit: glx-query-drawable --attr=GLX_FBCONFIG_ID --type=WINDOW
* Maya which uses the config ID from step 4 as an input to
glXChooseFBConfig.

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

2 years agodri: Remove unused driGetRendererString
Adam Jackson [Thu, 9 Dec 2021 20:53:27 +0000 (15:53 -0500)]
dri: Remove unused driGetRendererString

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agodri: Remove unused driUpdateFramebufferSize
Adam Jackson [Thu, 9 Dec 2021 20:52:07 +0000 (15:52 -0500)]
dri: Remove unused driUpdateFramebufferSize

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agodri: Remove unused driContextSetFlags
Adam Jackson [Thu, 9 Dec 2021 20:51:30 +0000 (15:51 -0500)]
dri: Remove unused driContextSetFlags

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agomesa: Remove unused _mesa_initialize_visual
Adam Jackson [Thu, 9 Dec 2021 20:20:58 +0000 (15:20 -0500)]
mesa: Remove unused _mesa_initialize_visual

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>

2 years agoanv, iris: Implement Wa_14014890652 for DG2
Sagar Ghuge [Fri, 10 Sep 2021 22:17:54 +0000 (15:17 -0700)]
anv, iris: Implement Wa_14014890652 for DG2

Workaround is to set:

3DSTATE_VFG::GranularityThresholdDisable = 1
3DSTATE_VFG::DistributionGranularity = BATCH
3DSTATE_VF::GeometryDistributionEnable = 1

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>

2 years agoanv, iris: Add Wa_22011440098 for DG2
Anuj Phogat [Wed, 12 May 2021 17:42:41 +0000 (10:42 -0700)]
anv, iris: Add Wa_22011440098 for DG2

Rework:
 * Jordan: Set MOCS after
   7b78b2fcac6 ("intel/genxml: Assert that all MOCS fields are non-zero on Gfx7+")

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>

2 years agoanv, iris: Add Wa_16011773973 for DG2
Anuj Phogat [Tue, 4 May 2021 00:39:28 +0000 (17:39 -0700)]
anv, iris: Add Wa_16011773973 for DG2

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>

2 years agoRevert "nir: disable a NIR test due to undebuggable & locally unreproducible CI failures"
Caio Oliveira [Wed, 15 Dec 2021 09:31:53 +0000 (01:31 -0800)]
Revert "nir: disable a NIR test due to undebuggable & locally unreproducible CI failures"

This reverts commit 6eb3fe2d4fa2c42d7ee1e20b390b3117a8980eaf.  The root cause was
a bug in Meson when using the new gtest protocol and a test failed before producing
the XML file expected by it.  This was fixed in later versions of Meson, so
we've bumped the required meson version to use that feature.  The failure should
now be properly identified, so re-enabling the NIR test.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>

2 years agomeson: Bump version required for gtest protocol
Caio Oliveira [Wed, 15 Dec 2021 09:30:36 +0000 (01:30 -0800)]
meson: Bump version required for gtest protocol

The feature was added in 0.55 but there was a bug when tests
crashed (and no XML file was generated) that was only fixed in 0.59.2.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>

2 years agonir: Initialize nir_register::divergent
Caio Oliveira [Wed, 15 Dec 2021 08:47:36 +0000 (00:47 -0800)]
nir: Initialize nir_register::divergent

Fixes: c7fc44f9ebb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14205>

2 years agonir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.
Emma Anholt [Tue, 14 Dec 2021 23:51:13 +0000 (15:51 -0800)]
nir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.

This flag is used by the nv50, r600, and svga backends for instruction
exactness.  It was easier to plumb it in as an override in tgsi_ureg than
to make all of ALU instruction emit do it.

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

2 years agomesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional
Ian Romanick [Wed, 15 Dec 2021 01:19:01 +0000 (17:19 -0800)]
mesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional
Ian Romanick [Wed, 15 Dec 2021 01:18:37 +0000 (17:18 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional
Ian Romanick [Wed, 15 Dec 2021 01:10:43 +0000 (17:10 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional

v2: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, and GL_ONE_MINUS_SRC_ALPHA
should always be supported now. Noticed by Marek.

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional
Ian Romanick [Wed, 15 Dec 2021 01:06:49 +0000 (17:06 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional

Cheatsheet:

_mesa_has_ARB_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGL_COMPAT and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).

_mesa_has_OES_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGLES and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGLES).

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

2 years agomesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional
Ian Romanick [Wed, 15 Dec 2021 00:43:32 +0000 (16:43 -0800)]
mesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional

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

2 years agointel/fs: Use HF as destination type for F32TOF16 in fquantize2f16
Ian Romanick [Thu, 9 Dec 2021 23:25:20 +0000 (15:25 -0800)]
intel/fs: Use HF as destination type for F32TOF16 in fquantize2f16

Having an integer destination type instead of a float destination type
confuses the SWSB code.  This causes problems on some Intel GPUs.  Fix
this by using the correct type in the destination of the F32TOF16
opcode.

Gfx7 doesn't have the HF type, so continue to emit W on that platform.
The assertions in brw_F32TO16 (brw_eu_emit.c) are updated to reflect
this.  In scalar mode, UD is never emitted as a destination type for
this opcode, so remove it from the allowed types in the assertion.

I also condidered doing something like de55fd358fa ("intel/fs/xehp:
Teach SWSB pass about the exec pipeline of
FS_OPCODE_PACK_HALF_2x16_SPLIT."), but Curro recommended that just using
the correct types is a better fix.  I agree.

v2: Add missing changes to fs_generator::generate_pack_half_2x16_split.
I'm not sure how I (and the Intel CI) missed that the first time. :(

v3: Fix copy-and-paste issue in the v2 fix. Noticed by Tapani.

Reviewed-by: Francisco Jerez <currojerez@riseup.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14181>

2 years agovenus: cache shmems
Chia-I Wu [Fri, 10 Dec 2021 23:38:05 +0000 (15:38 -0800)]
venus: cache shmems

Shmems are allocated internally and are only for CPU access.  They can
be easily cached.

Venus have 4 sources of shmem allocations

 - the ring buffer
 - the reply stream
 - the indirection submission upload cs
 - one cs for each vn_command_buffer

The first one is allocated only once.  The other three reallocate
occasionally.  The frequencies depend on the workloads.

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

2 years agovenus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer
Chia-I Wu [Wed, 8 Dec 2021 23:55:12 +0000 (15:55 -0800)]
venus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer

It suballocates from a shmem pool owned by vn_instance.  The goals are
to speed up shmem allocations for VkCommandBuffer and to reduce the
number of BOs.  Both are crucial when shmems are HOST3D BOs, because
they require roundtrips to the renderer to allocate and they take up KVM
memslots.

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

2 years agovenus: add vn_cs_encoder_storage_type
Chia-I Wu [Wed, 8 Dec 2021 23:24:04 +0000 (15:24 -0800)]
venus: add vn_cs_encoder_storage_type

It generalizes cs->indirect.

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

2 years agovenus: use vn_renderer_shmem_pool for reply shmems
Chia-I Wu [Fri, 10 Dec 2021 01:08:15 +0000 (17:08 -0800)]
venus: use vn_renderer_shmem_pool for reply shmems

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

2 years agovenus: add vn_renderer_shmem_pool
Chia-I Wu [Wed, 8 Dec 2021 23:32:19 +0000 (15:32 -0800)]
venus: add vn_renderer_shmem_pool

It provides shmem suballocations.  It is designed to be used with
short-lived shmems.  A long-lived shmem can hold on to some large
allocation while only using a likely small region of the large
allocation.

v2: cleanups suggested by Yiwei

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

2 years agovenus: add vn_renderer_util.[ch]
Chia-I Wu [Thu, 9 Dec 2021 22:12:01 +0000 (14:12 -0800)]
venus: add vn_renderer_util.[ch]

Move helpers built on top of vn_renderer.h to the new files.

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

2 years agomesa: inline mesa_initialize_buffer_object.
Dave Airlie [Thu, 9 Dec 2021 04:23:56 +0000 (14:23 +1000)]
mesa: inline mesa_initialize_buffer_object.

This has no other users now.

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

2 years agomesa/st: remove st_cb_bufferobjects*
Dave Airlie [Thu, 9 Dec 2021 04:05:58 +0000 (14:05 +1000)]
mesa/st: remove st_cb_bufferobjects*

this has all been merged into mesa now

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

2 years agomesa/bufferobj: move invalidate buffer to optional feature
Dave Airlie [Thu, 9 Dec 2021 03:57:08 +0000 (13:57 +1000)]
mesa/bufferobj: move invalidate buffer to optional feature

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

2 years agomesa/st: rename access flag to transfer flag function
Dave Airlie [Thu, 9 Dec 2021 03:55:32 +0000 (13:55 +1000)]
mesa/st: rename access flag to transfer flag function

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

2 years agobufferobj: cleanup subdata copies
Dave Airlie [Thu, 9 Dec 2021 03:41:42 +0000 (13:41 +1000)]
bufferobj: cleanup subdata copies

This moves the common dst min/max invalidation and renames
to be a bit more consistent

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