platform/upstream/mesa.git
3 years agozink: disable some builtin-gl-sample-mask sample shading tests on ci
Mike Blumenkrantz [Tue, 23 Feb 2021 15:28:10 +0000 (10:28 -0500)]
zink: disable some builtin-gl-sample-mask sample shading tests on ci

these are super flaky

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

3 years agomesa: update vao _EnabledWithMapMode in copy_array_object
Pierre-Eric Pelloux-Prayer [Mon, 22 Feb 2021 20:05:57 +0000 (21:05 +0100)]
mesa: update vao _EnabledWithMapMode in copy_array_object

Otherwise it can be out of sync.

Fixes: 306f1ef417a ("mesa: precompute _mesa_get_vao_vp_inputs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4331
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9199>

3 years agoanv: Fix wait_count missing increment
Lionel Landwerlin [Mon, 22 Feb 2021 16:41:24 +0000 (18:41 +0200)]
anv: Fix wait_count missing increment

If we don't wait on anything, I bet it makes the QueuePresent faster,
but also completely wrong...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 02f94c33066eff ("anv: don't wait for completion of work on vkQueuePresent()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4276
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9211>

3 years agoac/rgp: define EM_AMDGPU if missing for compatibility
Jan Beich [Sat, 20 Feb 2021 13:27:02 +0000 (13:27 +0000)]
ac/rgp: define EM_AMDGPU if missing for compatibility

EM_AMDGPU isn't defined on DragonFly, FreeBSD, OpenBSD, so use the
same workaround as ac_rtld.c.

src/amd/common/ac_rgp_elf_object_pack.c:382:24: error: use of undeclared identifier 'EM_AMDGPU'
   elf_hdr.e_machine = EM_AMDGPU;
                       ^

Fixes: 110bb2c77dd3 ("ac/rgp: add helper function to write rgp elf oject")
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9169>

3 years agoac: prefer system EM_AMDGPU definition
Jan Beich [Mon, 22 Feb 2021 10:41:56 +0000 (10:41 +0000)]
ac: prefer system EM_AMDGPU definition

May improve compatibility with systems where EM_AMDGPU value is
different from Linux.

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

3 years agoetnaviv: use nir_lower_uniforms_to_ubo(..)
Christian Gmeiner [Thu, 17 Dec 2020 11:39:14 +0000 (12:39 +0100)]
etnaviv: use nir_lower_uniforms_to_ubo(..)

This removes our local copy and fixes the following nir validation problem:
  error: nir_intrinsic_range(instr) != 0 (../src/compiler/nir/nir_validate.c:646)

No piglit or deqp regression seen.

shader-db results for GC3000:

instructions helped:   shaders/deqp_gles2/23470.shader_test VERT:        328 -> 316 (-3.66%)
instructions helped:   shaders/deqp_gles2/23473.shader_test FRAG:        328 -> 316 (-3.66%)
instructions helped:   shaders/glamor/88.shader_test FRAG:               472 -> 452 (-4.24%)
instructions helped:   shaders/chromeos/36.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/24.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/18.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/45.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/deqp_gles2/23494.shader_test VERT:        176 -> 164 (-6.82%)
instructions helped:   shaders/deqp_gles2/23497.shader_test FRAG:        176 -> 164 (-6.82%)
instructions helped:   shaders/glamor/82.shader_test FRAG:               280 -> 260 (-7.14%)
instructions helped:   shaders/chromeos/21.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/chromeos/15.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/tesseract/268.shader_test VERT:           152 -> 136 (-10.53%)
instructions helped:   shaders/tesseract/270.shader_test VERT:           184 -> 164 (-10.87%)
instructions helped:   shaders/tesseract/272.shader_test VERT:           216 -> 192 (-11.11%)
instructions helped:   shaders/tesseract/266.shader_test VERT:           88 -> 76 (-13.64%)
instructions helped:   shaders/deqp_gles2/23488.shader_test VERT:        112 -> 96 (-14.29%)
instructions helped:   shaders/deqp_gles2/23491.shader_test FRAG:        112 -> 96 (-14.29%)
instructions helped:   shaders/chromeos/102.shader_test VERT:            168 -> 144 (-14.29%)
instructions helped:   shaders/deqp_gles2/23449.shader_test FRAG:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23446.shader_test VERT:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23461.shader_test FRAG:        124 -> 100 (-19.35%)
instructions helped:   shaders/deqp_gles2/23458.shader_test VERT:        124 -> 100 (-19.35%)
instructions helped:   shaders/chromeos/39.shader_test VERT:             124 -> 100 (-19.35%)

temps helped:   shaders/chromeos/102.shader_test VERT:            6 -> 5 (-16.67%)
temps helped:   shaders/deqp_gles2/23470.shader_test VERT:        5 -> 4 (-20.00%)
temps helped:   shaders/deqp_gles2/23473.shader_test FRAG:        5 -> 4 (-20.00%)

temps HURT:   shaders/tesseract/272.shader_test VERT:           6 -> 7 (16.67%)

immediates helped:   shaders/deqp_gles2/23470.shader_test VERT:        24 -> 20 (-16.67%)
immediates helped:   shaders/deqp_gles2/23473.shader_test FRAG:        24 -> 20 (-16.67%)
immediates helped:   shaders/chromeos/102.shader_test VERT:            8 -> 4 (-50.00%)
immediates helped:   shaders/chromeos/39.shader_test VERT:             8 -> 4 (-50.00%)

immediates HURT:   shaders/glamor/88.shader_test FRAG:               32 -> 36 (12.50%)
immediates HURT:   shaders/deqp_gles2/23494.shader_test VERT:        4 -> 8 (100.00%)
immediates HURT:   shaders/deqp_gles2/23497.shader_test FRAG:        4 -> 8 (100.00%)

total instructions in shared programs: 1123728 -> 1123392 (-0.03%)
instructions in affected programs: 3644 -> 3308 (-9.22%)
helped: 24
HURT: 0
helped stats (abs) min: 4 max: 24 x̄: 14.00 x̃: 12
helped stats (rel) min: 3.66% max: 19.35% x̄: 10.74% x̃: 8.83%
95% mean confidence interval for instructions value: -17.11 -10.89
95% mean confidence interval for instructions %-change: -13.03% -8.45%
Instructions are helped.

total temps in shared programs: 86978 -> 86976 (<.01%)
temps in affected programs: 22 -> 20 (-9.09%)
helped: 3
HURT: 1
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 16.67% max: 20.00% x̄: 18.89% x̃: 20.00%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67%
95% mean confidence interval for temps value: -2.09 1.09
95% mean confidence interval for temps %-change: -38.40% 18.40%
Inconclusive result (value mean confidence interval includes 0).

total immediates in shared programs: 141464 -> 141460 (<.01%)
immediates in affected programs: 104 -> 100 (-3.85%)
helped: 4
HURT: 3
helped stats (abs) min: 4 max: 4 x̄: 4.00 x̃: 4
helped stats (rel) min: 16.67% max: 50.00% x̄: 33.33% x̃: 33.33%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 12.50% max: 100.00% x̄: 70.83% x̃: 100.00%
95% mean confidence interval for immediates value: -4.53 3.38
95% mean confidence interval for immediates %-change: -48.17% 70.79%
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>

3 years agoetnaviv: nir: add ubo lowering pass
Christian Gmeiner [Thu, 24 Dec 2020 12:11:26 +0000 (13:11 +0100)]
etnaviv: nir: add ubo lowering pass

Adds a pass to lower the load_ubo intrinsics for block 0 back
to load_uniform intrinsic.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>

3 years agoaco: don't rematerialize exec
Daniel Schürmann [Tue, 23 Feb 2021 14:07:43 +0000 (15:07 +0100)]
aco: don't rematerialize exec

Since exec is not considered a temporary anymore,
we accidentally allowed to rematerialize it.

Fixes: a56ddca4e80a6ef7bb0c44edb4e5b6169510aaca ('aco: make all exec accesses non-temporaries')
Closes: #4327

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

3 years agovc4: let st lower rect tex
Christian Gmeiner [Sat, 6 Feb 2021 20:14:49 +0000 (21:14 +0100)]
vc4: let st lower rect tex

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoetnaviv: let st lower rect tex
Christian Gmeiner [Sat, 6 Feb 2021 20:12:35 +0000 (21:12 +0100)]
etnaviv: let st lower rect tex

Before this change we used a dummy load_uniform to represent texcoord
scale. That dummy load was converted to a load_const where we are using
the upper 32 bits to store the uniform content type and that breaks nir's
validation. With the new nir_intrinsic_load_texture_scaling we know the
uniform type and do not need to go from load_ubo->load_const (with type
information).

shader-db for GC3000:

instructions helped:   shaders/tesseract/491.shader_test FRAG:           260 -> 248 (-4.62%)
instructions helped:   shaders/tesseract/494.shader_test FRAG:           256 -> 244 (-4.69%)
instructions helped:   shaders/tesseract/238.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/241.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/127.shader_test FRAG:           80 -> 76 (-5.00%)
instructions helped:   shaders/tesseract/130.shader_test FRAG:           156 -> 148 (-5.13%)
instructions helped:   shaders/tesseract/226.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/229.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/217.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/214.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/205.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/202.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/169.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/166.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/118.shader_test FRAG:           32 -> 28 (-12.50%)
instructions helped:   shaders/tesseract/181.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/178.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/121.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/193.shader_test FRAG:           84 -> 72 (-14.29%)
instructions helped:   shaders/tesseract/190.shader_test FRAG:           84 -> 72 (-14.29%)

temps HURT:   shaders/tesseract/494.shader_test FRAG:           6 -> 7 (16.67%)
temps HURT:   shaders/tesseract/491.shader_test FRAG:           6 -> 7 (16.67%)

total instructions in shared programs: 1122112 -> 1121920 (-0.02%)
instructions in affected programs: 2676 -> 2484 (-7.17%)
helped: 20
HURT: 0
helped stats (abs) min: 4 max: 12 x̄: 9.60 x̃: 12
helped stats (rel) min: 4.62% max: 14.29% x̄: 8.92% x̃: 8.50%
95% mean confidence interval for instructions value: -11.14 -8.06
95% mean confidence interval for instructions %-change: -10.65% -7.18%
Instructions are helped.

total temps in shared programs: 86942 -> 86944 (<.01%)
temps in affected programs: 12 -> 14 (16.67%)
helped: 0
HURT: 2

total immediates in shared programs: 141216 -> 141216 (0.00%)
immediates in affected programs: 0 -> 0
helped: 0
HURT: 0

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoetnaviv: nir: support nir_intrinsic_load_texture_rect_scaling
Christian Gmeiner [Sat, 6 Feb 2021 20:09:19 +0000 (21:09 +0100)]
etnaviv: nir: support nir_intrinsic_load_texture_rect_scaling

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agottn: lower rectangle textures if not supported
Christian Gmeiner [Fri, 19 Feb 2021 08:52:31 +0000 (09:52 +0100)]
ttn: lower rectangle textures if not supported

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agogallium/st: lower rectangle textures if not supported
Christian Gmeiner [Mon, 1 Feb 2021 10:48:02 +0000 (11:48 +0100)]
gallium/st: lower rectangle textures if not supported

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agogallium: add PIPE_CAP_TEXRECT
Christian Gmeiner [Mon, 1 Feb 2021 10:44:45 +0000 (11:44 +0100)]
gallium: add PIPE_CAP_TEXRECT

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir/lower_tex: wider usage of nir_tex_instr_src_index(..)
Christian Gmeiner [Thu, 11 Feb 2021 12:13:42 +0000 (13:13 +0100)]
nir/lower_tex: wider usage of nir_tex_instr_src_index(..)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir/lower_tex: 'txs free' tex_rect lowering
Christian Gmeiner [Mon, 1 Feb 2021 10:13:19 +0000 (11:13 +0100)]
nir/lower_tex: 'txs free' tex_rect lowering

GPUs without native txs support (and without an emulation in sw)
can use this new lowering. Also it saves us from doing int/float
conversions.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir: add has_txs flag
Christian Gmeiner [Mon, 1 Feb 2021 10:05:48 +0000 (11:05 +0100)]
nir: add has_txs flag

Some nir lowerings might need to know if txs is supported by
the backend.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir: add load_texture_rect_scaling
Christian Gmeiner [Fri, 13 Nov 2020 09:35:38 +0000 (10:35 +0100)]
nir: add load_texture_rect_scaling

Will be used in a different form of lower_rect tex lowering.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoradv: add support for instruction timing with RGP
Samuel Pitoiset [Thu, 18 Feb 2021 10:23:19 +0000 (11:23 +0100)]
radv: add support for instruction timing with RGP

This is probably the most useful feature with SQTT/RGP.

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

3 years agoradv: add support for exporting pipelines with RGP
Samuel Pitoiset [Tue, 16 Feb 2021 13:09:20 +0000 (14:09 +0100)]
radv: add support for exporting pipelines with RGP

This is still experimental and only enabled with
RADV_THREAD_TRACE_PIPELINE to avoid breaking existing support.

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

3 years agoradv: store a pointer to the code in radv_shader_variant
Samuel Pitoiset [Tue, 16 Feb 2021 13:08:34 +0000 (14:08 +0100)]
radv: store a pointer to the code in radv_shader_variant

This will be used by SQTT to dump the disassembly.

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

3 years agoradv: Enable displayable DCC.
Bas Nieuwenhuizen [Mon, 26 Oct 2020 22:48:44 +0000 (23:48 +0100)]
radv: Enable displayable DCC.

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

3 years agoradv: Use ac_surface DCC settings for shareable images.
Bas Nieuwenhuizen [Mon, 26 Oct 2020 22:39:36 +0000 (23:39 +0100)]
radv: Use ac_surface DCC settings for shareable images.

On GFX10 the settings for displayable DCC are different than those
for normal texturing.

This is technically a slight pessimization as ac_surface does not
know about textures that don't have to be sampled. However, for color
surfaces this is a very unlikely situation as presumably even MSAA
images have to be resolved (potentially using texture HW).

So in practice this should be equal for everything except displayable DCC.

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

3 years agoradv: Add DCC info to the metadata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 09:57:06 +0000 (11:57 +0200)]
radv: Add DCC info to the metadata.

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

3 years agoradv: Implement displayable DCC retiling.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 09:54:36 +0000 (11:54 +0200)]
radv: Implement displayable DCC retiling.

Straightforward implementation using the retile map from radeonsi.

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

3 years agoradv: Implement initialization of displayable DCC.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 01:32:19 +0000 (03:32 +0200)]
radv: Implement initialization of displayable DCC.

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

3 years agoamd/common: Add retile map size helper.
Bas Nieuwenhuizen [Fri, 19 Feb 2021 02:58:28 +0000 (03:58 +0100)]
amd/common: Add retile map size helper.

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

3 years agoradv: Use shared code for setting opaque metadata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 01:18:25 +0000 (03:18 +0200)]
radv: Use shared code for setting opaque metadata.

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

3 years agoradv: Handle UMD metadata on import.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 00:20:41 +0000 (02:20 +0200)]
radv: Handle UMD metadata on import.

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

3 years agoamd/common: constify ac_surface_set_umd_metata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 00:20:18 +0000 (02:20 +0200)]
amd/common: constify ac_surface_set_umd_metata.

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

3 years agoaco/lower_phis: fix all_preds_uniform with continue_or_break
Rhys Perry [Mon, 22 Feb 2021 15:05:32 +0000 (15:05 +0000)]
aco/lower_phis: fix all_preds_uniform with continue_or_break

Found in a Death Stranding shader with loop unrolling disabled.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 9a089baff1a ("aco: optimize boolean phis with uniform selections")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9193>

3 years agobroadcom/compiler: skip unnecessary unifa writes
Iago Toral Quiroga [Thu, 18 Feb 2021 07:32:13 +0000 (08:32 +0100)]
broadcom/compiler: skip unnecessary unifa writes

If a new UBO load happens to read exactly at the offset right after the
previous UBO load (something that is fairly common, for example when
reading a matrix), we can skip the unifa write (with its 3 delay slots)
and just continue to call ldunifa to continue reading consecutive addresses.

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

3 years agobroadcom/compiler: add a constant alu optimization pass
Iago Toral Quiroga [Wed, 17 Feb 2021 10:17:25 +0000 (11:17 +0100)]
broadcom/compiler: add a constant alu optimization pass

Currently this is useful to clean up after DCEing leading ldunifa
instructions, but it can be expanded to handle more cases which
may allow to simplify the compiler code in places where we have
been trying to optimize manually for similar cases.

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

3 years agobroadcom/compiler: remove unused leading ldunifa
Iago Toral Quiroga [Tue, 16 Feb 2021 11:08:05 +0000 (12:08 +0100)]
broadcom/compiler: remove unused leading ldunifa

This requires that we go back to the unifa write and update the address
to jump over the unused leading component.

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

3 years agobroadcom/compiler: allow dead code elimination of unused trailing ldunifa
Iago Toral Quiroga [Tue, 16 Feb 2021 10:04:44 +0000 (11:04 +0100)]
broadcom/compiler: allow dead code elimination of unused trailing ldunifa

If a ldunifa is the last in a sequence and is not used, we can safely
eliminate it.

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

3 years agobroadcom/compiler: fix ldunif optimization
Iago Toral Quiroga [Fri, 19 Feb 2021 10:08:36 +0000 (11:08 +0100)]
broadcom/compiler: fix ldunif optimization

When we look back for a previous uniform definition we want to
start looking from the current position of the cursor, not the
end of the current block. The latter only works when translating
from NIR, since in that case both always match, but any optimization
pass may rewrite code and emit uniforms at any place in the middle of
the program.

Also, ntq_store_dest expects result to be written by the last instruction
to handle the case where it is stored to a NIR register. That won't be
the case if the result comes from an optimized uniform, so in that case
we need to insert a MOV, like we do in non-uniform control flow.

v2: fix ntq_store_dest for optimized uniforms.

Fixes: 14af7b3085 ('broadcom/compiler: don't emit redundant ldunif')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agovulkan: Use typed outarray API
James Park [Wed, 3 Feb 2021 18:29:26 +0000 (10:29 -0800)]
vulkan: Use typed outarray API

MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agomeson/llvm: add native for gallium swrast
Dave Airlie [Mon, 22 Feb 2021 01:08:45 +0000 (11:08 +1000)]
meson/llvm: add native for gallium swrast

If we are building llvmpipe and lavapipe we want native in this
list.

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

3 years agolavapipe: fix icd generation for windows
Dave Airlie [Mon, 22 Feb 2021 02:01:59 +0000 (18:01 -0800)]
lavapipe: fix icd generation for windows

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

3 years agolavapipe: add dll definition file instead of using PUBLIC
Dave Airlie [Mon, 22 Feb 2021 01:27:20 +0000 (17:27 -0800)]
lavapipe: add dll definition file instead of using PUBLIC

This avoids conflicts with the definitions in vk_icd.h

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

3 years agolavapipe: fix msvc initialiser
Dave Airlie [Mon, 22 Feb 2021 01:14:05 +0000 (11:14 +1000)]
lavapipe: fix msvc initialiser

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

3 years agolavapipe: use the common icd generator
Dave Airlie [Tue, 16 Feb 2021 03:56:54 +0000 (13:56 +1000)]
lavapipe: use the common icd generator

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

3 years agozink: update ci results
Mike Blumenkrantz [Tue, 23 Feb 2021 03:50:52 +0000 (22:50 -0500)]
zink: update ci results

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

3 years agozink: handle PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in transfer_map for buffers
Mike Blumenkrantz [Sun, 6 Sep 2020 15:57:06 +0000 (11:57 -0400)]
zink: handle PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in transfer_map for buffers

when discarding the whole resource on an unused resource, we can deinit the buffer
range here

in the future, ideally we should be doing something like creating a new vk buffer/image
entirely here and demoting the existing one to a queue that destroys/caches it when
the batch finishes in order to avoid fencing

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

3 years agozink: change some transfer_map cases of waiting on cs batch to flushing cs
Mike Blumenkrantz [Sun, 6 Sep 2020 15:08:33 +0000 (11:08 -0400)]
zink: change some transfer_map cases of waiting on cs batch to flushing cs

we don't actually have to stall here, we just have to make sure the cs batch
is submitted before the subsequent buffer copy command goes into a gfx
batch in order to preserve the ordering

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

3 years agozink: only wait on last write-batch for resources during transfer_map
Mike Blumenkrantz [Fri, 4 Sep 2020 16:08:18 +0000 (12:08 -0400)]
zink: only wait on last write-batch for resources during transfer_map

if we need to sync a resource for read-only mapping, we only need to wait on
the fence that was last flagged as having writes to the resource, not batches
that may have reads, as reads don't affect memory coherency

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

3 years agozink: beef up zink_transfer_flush_region
Mike Blumenkrantz [Fri, 4 Sep 2020 13:41:30 +0000 (09:41 -0400)]
zink: beef up zink_transfer_flush_region

this now takes over from previous call sites in zink_transfer_unmap

we add a flush here if we had pending usage to ensure that the resource
gets properly synced

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

3 years agozink: simplify barrier usage
Mike Blumenkrantz [Tue, 15 Sep 2020 22:26:39 +0000 (18:26 -0400)]
zink: simplify barrier usage

this simplifies the barrier helper callsites as we no longer need
to check whether a barrier is needed beforehand in order to avoid potentially
ending a renderpass too early

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

3 years agozink: only reset pipeline hash conditionally when updating fb state
Mike Blumenkrantz [Fri, 18 Sep 2020 15:46:55 +0000 (11:46 -0400)]
zink: only reset pipeline hash conditionally when updating fb state

if we aren't changing anything here then we don't need to update the pipeline

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

3 years agozink: move gfx pipeline creation closer to the bind point
Mike Blumenkrantz [Wed, 16 Sep 2020 18:49:12 +0000 (14:49 -0400)]
zink: move gfx pipeline creation closer to the bind point

ensure that the renderpass has already been started by this point so
we have a valid object

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

3 years agozink/ci: disable arb_timer_query tests
Dave Airlie [Tue, 23 Feb 2021 00:33:24 +0000 (10:33 +1000)]
zink/ci: disable arb_timer_query tests

These are going to be flaky in CI so don't bother

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

3 years agozink: rename 'has_draw' flag on batches and set it when the batch is used
Mike Blumenkrantz [Tue, 29 Sep 2020 19:05:28 +0000 (15:05 -0400)]
zink: rename 'has_draw' flag on batches and set it when the batch is used

this lets us add some tracking later for handling no-op fencing

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

3 years agozink: destroy renderpass objects on context destroy
Mike Blumenkrantz [Sun, 21 Feb 2021 17:07:56 +0000 (12:07 -0500)]
zink: destroy renderpass objects on context destroy

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

3 years agozink/ci: update results for GL 3.3 testing enables
Dave Airlie [Mon, 22 Feb 2021 23:38:55 +0000 (09:38 +1000)]
zink/ci: update results for GL 3.3 testing enables

There are some new crashes/fails but I don't think the lavapipe
change is at fault for those.

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

3 years agolavapipe: add calibrated timestamp support
Dave Airlie [Mon, 8 Feb 2021 00:58:39 +0000 (10:58 +1000)]
lavapipe: add calibrated timestamp support

This is a bit of a lie, but it's enough to get zink support
for timer queries to work.

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

3 years agoci: Move the piglit expectations lists to the per-driver CI dirs.
Eric Anholt [Fri, 19 Feb 2021 17:45:29 +0000 (09:45 -0800)]
ci: Move the piglit expectations lists to the per-driver CI dirs.

Now changing piglit expectations won't retest everyone else's drivers.

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

3 years agoci: Move the dEQP and traces expectations to the per-driver CI dirs.
Eric Anholt [Fri, 19 Feb 2021 17:31:38 +0000 (09:31 -0800)]
ci: Move the dEQP and traces expectations to the per-driver CI dirs.

This means less custom test-source-dep stuff for these drivers, though it
means that touching the CI expects files will cause a bit more retesting:

- broadcom drivers retest as a group (but Igalia requested that
  organization of CI files)
- radv+radeonsi retest as a group
- lvp+llvmpipe retest as a group

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

3 years agonir/range_analysis: Handle vectors better in ssa_def_bits_used
Ian Romanick [Thu, 18 Feb 2021 03:40:07 +0000 (19:40 -0800)]
nir/range_analysis: Handle vectors better in ssa_def_bits_used

If a query is made of a vector ssa_def (possibly from an intermediate
result), return all_bits.  If a constant source is a vector, swizzle
the correct component.

Unit tests were added for the constant vector cases.  I don't see a
great way to make unit tests for the other cases.

v2: Add a FINIHSME comment about u16vec2 hardware.

Fixes: 96303a59eae ("nir: Add some range analysis for used bits")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9123>

3 years agonir/range-analysis: C++ linkage
Ian Romanick [Thu, 13 Feb 2020 03:07:35 +0000 (19:07 -0800)]
nir/range-analysis: C++ linkage

Fixes: 96303a59eae ("nir: Add some range analysis for used bits")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9123>

3 years agozink/ci: update results now that we are testing zink/lavapipe
Dave Airlie [Mon, 22 Feb 2021 06:24:07 +0000 (16:24 +1000)]
zink/ci: update results now that we are testing zink/lavapipe

Once the extension fix is merged the CI results change appreciably.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9185>

3 years agozink: use extensioned draw indirect functions.
Dave Airlie [Mon, 22 Feb 2021 05:50:06 +0000 (15:50 +1000)]
zink: use extensioned draw indirect functions.

The code was using the core versions, but for vulkan 1.0 at
least the extension versions are what is required to be asked for.

This fixes zink loading on lavapipe, and blows up the CI.

v2: Use LOCAL device extension variant (zmike)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9185>

3 years agoanv: don't wait for completion of work on vkQueuePresent()
Lionel Landwerlin [Mon, 22 Feb 2021 16:41:24 +0000 (18:41 +0200)]
anv: don't wait for completion of work on vkQueuePresent()

Another mistake which is that we don't use the right wait API.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 829699ba632b2b ("anv: implement shareable timeline semaphores")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4276
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9188>

3 years agoanv: reset binary syncobj to be signaled before submission
Lionel Landwerlin [Mon, 22 Feb 2021 11:57:37 +0000 (13:57 +0200)]
anv: reset binary syncobj to be signaled before submission

Before we introduced the submission thread in 829699ba632b2b, once we
returned from vkQueueSubmit, all signaled syncobj would have a
i915_request/dma-fence waiting to be signaled by some work that would
submitted to HW by i915.

After this submission thread that is no longer the case. We added a
few checks in places like vkQueuePresentKHR() to wait for the binary
semaphores to materialize before we would hand things over to the WSI
code.

Unfortunately 829699ba632b2b forgot to reset the signaled binary
semaphore.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 829699ba632b2b ("anv: implement shareable timeline semaphores")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4276
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9188>

3 years agoAdjust dylib compatibility versions to match what was set by mesa-18.3's autotools...
Jeremy Huddleston Sequoia [Sat, 30 Jan 2021 21:10:12 +0000 (13:10 -0800)]
Adjust dylib compatibility versions to match what was set by mesa-18.3's autotools-based builds

Cc: 20.3 21.0 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4113
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8796>

3 years agoglx: proposed fix for setSwapInterval
Dave Airlie [Mon, 22 Feb 2021 05:57:01 +0000 (15:57 +1000)]
glx: proposed fix for setSwapInterval

When mesa gets a DRI2 1.1 connection (as experienced with
vmwware DDX) we don't get a pointer for this.

Don't explode just keep going.

Fixes: 60ebeb4608a8 ("glx: Implement GLX_EXT_swap_control for DRI2 and DRI3")
Reviewed-by: Adam Jackson <ajaX@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9184>

3 years agor600/sfn: Base instr lowering class on nir_lower_instruction code
Gert Wollny [Sat, 20 Feb 2021 09:58:36 +0000 (10:58 +0100)]
r600/sfn: Base instr lowering class on nir_lower_instruction code

Now that the lowering pass has been update there is no need to
duplicate the code to scan the shader.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>

3 years agor600/sfn: remove duplicate barriers
Gert Wollny [Mon, 8 Feb 2021 16:32:00 +0000 (17:32 +0100)]
r600/sfn: remove duplicate barriers

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>

3 years agor600/sfn: Fix indirect_file flag for IMAGES
Gert Wollny [Mon, 8 Feb 2021 08:37:28 +0000 (09:37 +0100)]
r600/sfn: Fix indirect_file flag for IMAGES

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>

3 years agor600/sfn: Handle memory_barrier_atomic_counters
Gert Wollny [Fri, 5 Feb 2021 16:11:52 +0000 (17:11 +0100)]
r600/sfn: Handle memory_barrier_atomic_counters

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>

3 years agoandroid: util/fossilize_db: add missing sources to Makefile.sources
Mauro Rossi [Sun, 21 Feb 2021 21:16:13 +0000 (22:16 +0100)]
android: util/fossilize_db: add missing sources to Makefile.sources

Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/i915_dri_intermediates/LINKED/i915_dri.so
ld.lld: error: undefined symbol: foz_read_entry
>>> referenced by disk_cache_os.c:945 (external/mesa/src/util/disk_cache_os.c:945)
ld.lld: error: undefined symbol: foz_write_entry
>>> referenced by disk_cache_os.c:951 (external/mesa/src/util/disk_cache_os.c:951)

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/vulkan.anv_intermediates/LINKED/vulkan.anv.so
FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
ld.lld: error: undefined symbol: foz_destroy
>>> referenced by disk_cache.c:237 (external/mesa/src/util/disk_cache.c:237)
ld.lld: error: undefined symbol: foz_read_entry
>>> referenced by disk_cache_os.c:945 (external/mesa/src/util/disk_cache_os.c:945)
ld.lld: error: undefined symbol: foz_write_entry
>>> referenced by disk_cache_os.c:951 (external/mesa/src/util/disk_cache_os.c:951)

Fixes: eca6bb9540d8 ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Marijn Suijten <marijns95@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9178>

3 years agoci/a5xx: Increase our dEQP GLES3 fraction by 4x.
Eric Anholt [Thu, 18 Feb 2021 20:28:27 +0000 (12:28 -0800)]
ci/a5xx: Increase our dEQP GLES3 fraction by 4x.

Now that we've got SMP, we can get a lot more of this test suite covered
in our 10-minute job window.

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

3 years agoci/a5xx: Update the piglit expectations.
Eric Anholt [Thu, 18 Feb 2021 20:25:27 +0000 (12:25 -0800)]
ci/a5xx: Update the piglit expectations.

Now with -j4 in place, we can actually complete a manual piglit job in
less than an hour! (barely)

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

3 years agoci/bare-metal: Use an upstream kernel for db820c.
Eric Anholt [Fri, 5 Feb 2021 00:42:51 +0000 (16:42 -0800)]
ci/bare-metal: Use an upstream kernel for db820c.

On top of the last kernel tree I added a couple of DT changes for db820c
from the qcom landing tree necessary for bringing up the GPU, and a fix to
my OOB cleanups fro cheza.  I also enabled the CPU clock driver for db820c
so we can turn on SMP and not leave jobs stranded on a 19Mhz CPU or whatever.

This causes us to need a bit of updating of our TF expectations since the
order of jobs changes a bit.

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

3 years agoci/freedreno: Remove stray BM_DTB definition.
Eric Anholt [Fri, 5 Feb 2021 00:41:43 +0000 (16:41 -0800)]
ci/freedreno: Remove stray BM_DTB definition.

It's unused -- cheza uses an image with kernel+dtb glued together, and
this var does nothing (which is good, given that it was pointing to
db820c.

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

3 years agoci/freedreno: Fix a5xx piglit runs.
Eric Anholt [Fri, 5 Feb 2021 00:06:44 +0000 (16:06 -0800)]
ci/freedreno: Fix a5xx piglit runs.

I missed this regression in the "start using Xorg" branch since the piglit
runs are manual.  I made the piglit runs accidentally require a core
context, which a5xx can't do (it's only GL 3.1).

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

3 years agopan/bi: Do copyprop in linear-time
Alyssa Rosenzweig [Thu, 18 Feb 2021 21:21:43 +0000 (16:21 -0500)]
pan/bi: Do copyprop in linear-time

Per discussion with Daniel Schürmann on IRC about the joys of SSA form
and why you don't actually need use-def chains. Indeed, I didn't. No
shader-db changes, time difference in shader-db is neglible since the
win from this is particularly for large shaders.

Total runtime of
dEQP-GLES31.functional.ssbo.layout.single_struct_array.single_buffer.std430_instance_array
reduced from 1.04s to 0.77s (25%)

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

3 years agopan/bi: Remove unused definitions
Alyssa Rosenzweig [Fri, 19 Feb 2021 15:45:57 +0000 (10:45 -0500)]
pan/bi: Remove unused definitions

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

3 years agopan/bi: Adapt builder to dest count
Alyssa Rosenzweig [Thu, 18 Feb 2021 19:58:50 +0000 (14:58 -0500)]
pan/bi: Adapt builder to dest count

If there are no destinations, don't produce a _to version, and let the
bare version return the bi_instr.

If there are multiple destinations, take each in the _to version and
don't produce a bare version.

Both cares are probably what you wanted anyway.

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

3 years agopan/bi: Annotate instructions by destination count
Alyssa Rosenzweig [Thu, 18 Feb 2021 19:15:02 +0000 (14:15 -0500)]
pan/bi: Annotate instructions by destination count

Allows for better builders.

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

3 years agopan/bi: Allow spilling with multiple destinations
Alyssa Rosenzweig [Fri, 19 Feb 2021 13:56:17 +0000 (08:56 -0500)]
pan/bi: Allow spilling with multiple destinations

Now that we fixed this.

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

3 years agopan/bi: Make bi_writemask take a destination
Alyssa Rosenzweig [Thu, 18 Feb 2021 21:56:16 +0000 (16:56 -0500)]
pan/bi: Make bi_writemask take a destination

Assuming it's only the first destination breaks assumptions across the
compiler. Add a destination source and fix up the many corresponding
issues. Nothing to backport as far as I understand since multidest
instruction are new.

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

3 years agopan/bi: Mark DISCARD as having side effects
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:28:52 +0000 (09:28 -0500)]
pan/bi: Mark DISCARD as having side effects

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

3 years agopan/bi: Mark branches as having side effects
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:17:48 +0000 (09:17 -0500)]
pan/bi: Mark branches as having side effects

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

3 years agopan/bi: Inline `bytemask of read components`
Alyssa Rosenzweig [Thu, 18 Feb 2021 21:26:02 +0000 (16:26 -0500)]
pan/bi: Inline `bytemask of read components`

Only used in one place (and should never be used elsewhere -- even this
use is questionable). By inlining we avoid O(N^2) behaviour on the
number of sources in liveness updates.

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

3 years agopan/bi: Reduce liveness calculations in DCE
Alyssa Rosenzweig [Thu, 18 Feb 2021 21:11:38 +0000 (16:11 -0500)]
pan/bi: Reduce liveness calculations in DCE

Forward port of fc06b8b7 ("pan/mdg: Optimize liveness computation in
DCE")

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

3 years agopan/bi: Use nir_opt_sink/move for constants
Alyssa Rosenzweig [Thu, 18 Feb 2021 20:56:43 +0000 (15:56 -0500)]
pan/bi: Use nir_opt_sink/move for constants

Fixes excessive (and failing) spilling in dEQP-GLES31.functional.ssbo.layout.*

shader-db results are a toss up (I suspect we'd see better results if we
tracked register pressure directly):

total instructions in shared programs: 161377 -> 161377 (0.00%)

total nops in shared programs: 121159 -> 121203 (0.04%)
nops in affected programs: 1839 -> 1883 (2.39%)
Nops are HURT.

total clauses in shared programs: 31604 -> 31606 (<.01%)
clauses in affected programs: 38 -> 40 (5.26%)
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 130847 -> 130845 (<.01%)
quadwords in affected programs: 1246 -> 1244 (-0.16%)
Inconclusive result (value mean confidence interval includes 0).

total loops in shared programs: 18 -> 18 (0.00%)
total spills in shared programs: 705 -> 705 (0.00%)
total fills in shared programs: 1645 -> 1645 (0.00%)

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

3 years agopanfrost: Don't advertise OES_copy_image
Alyssa Rosenzweig [Fri, 19 Feb 2021 20:58:16 +0000 (15:58 -0500)]
panfrost: Don't advertise OES_copy_image

We don't support it yet.

Fixes: 61d3ae6e0bd ("panfrost: Initial stub for Panfrost driver")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>

3 years agopanfrost: Fix typo in midgard.xml
Alyssa Rosenzweig [Fri, 19 Feb 2021 19:45:39 +0000 (14:45 -0500)]
panfrost: Fix typo in midgard.xml

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

3 years agopanfrost: Reinterpret format for reload blits
Alyssa Rosenzweig [Fri, 19 Feb 2021 19:08:42 +0000 (14:08 -0500)]
panfrost: Reinterpret format for reload blits

Fixes dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.r32ui_rgb10_a2.texture2d_to_texture2d

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

3 years agopanfrost: Fix UNORM 16 rendering
Alyssa Rosenzweig [Fri, 19 Feb 2021 18:38:57 +0000 (13:38 -0500)]
panfrost: Fix UNORM 16 rendering

fp16 loses precision.

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

3 years agopanfrost: Hide MSAA 8x/16x support
Alyssa Rosenzweig [Fri, 19 Feb 2021 17:44:50 +0000 (12:44 -0500)]
panfrost: Hide MSAA 8x/16x support

dEQP-GLES31.functional.texture.multisample.samples_16.sample_position is
failing on Bifrost, and we already weren't advertising on Midgard. Until
someone gets spare cycles to debug all the problems, keep it hidden
behind a debug flag to avoid introducing bugs.

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

3 years agopanfrost: Raise TEXTURE_BUFFER_OFFSET_ALIGNMENT
Alyssa Rosenzweig [Fri, 19 Feb 2021 16:51:16 +0000 (11:51 -0500)]
panfrost: Raise TEXTURE_BUFFER_OFFSET_ALIGNMENT

The blob advertises 64 for this, so let's use the same value. Small
alignments are observed to raise an IMPRECISE_FAULT at least on Bifrost.
As a bonus this forces cache line alignment which will help perf. Fixes

dEQP-GLES31.functional.texture.texture_buffer.render.as_vertex_texture.offset_1_alignments

Fixes: 5f7bafa316f ("panfrost: Enable ARB_texture_buffer_object")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>

3 years agopanfrost: Fix NULL deref in pan_sfbd
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:58:33 +0000 (09:58 -0500)]
panfrost: Fix NULL deref in pan_sfbd

The last of the nr_cbufs audit changes.

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

3 years agopanfrost: Fix NULL derefs in pan_cmdstream.c
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:57:26 +0000 (09:57 -0500)]
panfrost: Fix NULL derefs in pan_cmdstream.c

Auditing nr_cbufs. Note we have to augment the blending logic a bit to
use the same 'no blend' case for missing RTs as we do for depth-only
passes.

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

3 years agopanfrost: Fix NULL deref in pan_mfbd.c
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:45:30 +0000 (09:45 -0500)]
panfrost: Fix NULL deref in pan_mfbd.c

Auditing all uses of nr_cbufs

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

3 years agopanfrost: Remove redundant NULL check
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:41:15 +0000 (09:41 -0500)]
panfrost: Remove redundant NULL check

Already checked in the callee, no need to check in the caller.

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

3 years agopanfrost: Fix NULL dereference adding cbuf to batch
Alyssa Rosenzweig [Fri, 19 Feb 2021 14:39:07 +0000 (09:39 -0500)]
panfrost: Fix NULL dereference adding cbuf to batch

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

3 years agopanfrost: Fix infinite loop spilling
Alyssa Rosenzweig [Fri, 19 Feb 2021 13:58:02 +0000 (08:58 -0500)]
panfrost: Fix infinite loop spilling

At least this way failed RA will crash (by having no spill node to pick)
instead? Seen in
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.21 on
Bifrost.

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

3 years agopan/bi: Fix elimination of repeated branches
Alyssa Rosenzweig [Thu, 18 Feb 2021 18:54:30 +0000 (13:54 -0500)]
pan/bi: Fix elimination of repeated branches

How many times can I break such a small pass?

Fixes: a805d999c0e ("pan/bi: Fix jumps to terminal block again")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9137>

3 years agopan/bi: Optimize out redundant jumps to #0x0
Alyssa Rosenzweig [Thu, 18 Feb 2021 18:53:33 +0000 (13:53 -0500)]
pan/bi: Optimize out redundant jumps to #0x0

If it's the last instruction, that's silly.

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