mesa.git
5 years agoaco: take LDS into account when calculating num_waves
Rhys Perry [Fri, 18 Oct 2019 18:06:10 +0000 (19:06 +0100)]
aco: take LDS into account when calculating num_waves

pipeline-db (Vega):
SGPRS: 344 -> 344 (0.00 %)
VGPRS: 424 -> 524 (23.58 %)
Spilled SGPRs: 84 -> 80 (-4.76 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 52812 -> 52484 (-0.62 %) bytes
LDS: 135 -> 135 (0.00 %) blocks
Max Waves: 56 -> 53 (-5.36 %)

v2: consider WGP, rework to be clearer and apply the
    "maximum 16 workgroups per CU" limit properly
v2: use "SIMD" instead of "EU"
v2: fix spiller by introducing "Program::max_waves"
v2: rename "lds_size" to "lds_limit"
v3: make max_waves actually independant of register usage
v3: fix issue where max_waves was way too high
v3: use DIV_ROUND_UP(a, b) instead of max(a / b, 1)
v3: rename "workgroups_per_cu" to "workgroups_per_cu_wgp"
v4: fix typo from "workgroups_per_cu" rename

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> (v3)
5 years agoaco: increase accuracy of SGPR limits
Rhys Perry [Fri, 13 Sep 2019 15:41:00 +0000 (16:41 +0100)]
aco: increase accuracy of SGPR limits

SGPRs are allocated in groups of 16 on GFX8/GFX9. GFX10 allocates a fixed
number of SGPRs and has 106 addressable SGPRs.

pipeline-db (Vega):
SGPRS: 5912 -> 6232 (5.41 %)
VGPRS: 1772 -> 1780 (0.45 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 88228 -> 87904 (-0.37 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 559 -> 571 (2.15 %)

piepline-db (Navi):
SGPRS: 341256 -> 363384 (6.48 %)
VGPRS: 171536 -> 170960 (-0.34 %)
Spilled SGPRs: 832 -> 581 (-30.17 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 14207332 -> 14190872 (-0.12 %) bytes
LDS: 33 -> 33 (0.00 %) blocks
Max Waves: 18072 -> 18251 (0.99 %)

v2: unconditionally count vcc as an extra sgpr on GFX10+
v3: pass SGPRs rounded to 8

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoradv: round vgprs/sgprs before calculating max_waves
Rhys Perry [Fri, 18 Oct 2019 20:13:44 +0000 (21:13 +0100)]
radv: round vgprs/sgprs before calculating max_waves

Note that ACO doesn't correctly round SGPR counts on GFX8/GFX9.

pipeline-db (ACO/Vega):
SGPRS: 11000 -> 11000 (0.00 %)
VGPRS: 3120 -> 3120 (0.00 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 164328 -> 164328 (0.00 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 1125 -> 1000 (-11.11 %)

v2: consider wave32

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agodocs: Add new Intel extension
Lionel Landwerlin [Wed, 23 Oct 2019 16:07:32 +0000 (19:07 +0300)]
docs: Add new Intel extension

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
5 years agoRevert "vc4: do not report alpha-test as supported"
Erik Faye-Lund [Wed, 23 Oct 2019 11:02:55 +0000 (13:02 +0200)]
Revert "vc4: do not report alpha-test as supported"

This reverts commit a79b93269cf340ce4d23b5b34100039bcaafc841.

Reviewed-by: Jose Maria Casanova <jmcasanova@igalia.com>
5 years agoRevert "v3d: do not report alpha-test as supported"
Erik Faye-Lund [Mon, 21 Oct 2019 08:48:11 +0000 (10:48 +0200)]
Revert "v3d: do not report alpha-test as supported"

This reverts commit 9d0523b569bb7208c6e74cafc0f3945415d94336.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jose Maria Casanova <jmcasanova@igalia.com>
5 years agoRevert "nir: drop support for using load_alpha_ref_float"
Erik Faye-Lund [Mon, 21 Oct 2019 08:48:09 +0000 (10:48 +0200)]
Revert "nir: drop support for using load_alpha_ref_float"

This reverts commit 5af272b47469398762e984e27f65fc4ecc293d28.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jose Maria Casanova <jmcasanova@igalia.com>
5 years agoRevert "nir: drop unused alpha_ref_float"
Erik Faye-Lund [Mon, 21 Oct 2019 08:48:07 +0000 (10:48 +0200)]
Revert "nir: drop unused alpha_ref_float"

This reverts commit e8095f2af0736b5937674ca319f29cc9dabb17d4.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jose Maria Casanova <jmcasanova@igalia.com>
5 years agoradv: fix a performance regression with graphics depth/stencil clears
Samuel Pitoiset [Tue, 22 Oct 2019 14:43:56 +0000 (16:43 +0200)]
radv: fix a performance regression with graphics depth/stencil clears

I recently changed the slow depth/stencil clear path to make sure
depth values are explicitly exported by the fragment shader. This
is actually only useful when VK_EXT_depth_range_unrestricted is
enabled.

While this path is correct, it introduced a performance regression
with Heroes of the Storm, Shadow of Mordor (Vulkan beta) and
probably more titles. This is because it prevents the hardware
to do some optimizations like discarding fragments.

This commit re-introduces the previous (a bit faster) slow
depth/stencil clear path and it selects the unrestricted path
only if VK_EXT_depth_range_unrestricted is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/863
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: fix vkUpdateDescriptorSets with inline uniform blocks
Samuel Pitoiset [Mon, 21 Oct 2019 11:32:05 +0000 (13:32 +0200)]
radv: fix vkUpdateDescriptorSets with inline uniform blocks

descriptorCount is the number of bytes into the descriptor, so
it shouldn't be used as an index. srcArrayElement/dstArrayElement
specify the starting byte offset within the binding to copy from/to.

This fixes new CTS tests:
dEQP-VK.binding_model.descriptor_copy.*.inline_uniform_block_*
dEQP-VK.binding_model.descriptor_copy.*.mix_3
dEQP-VK.binding_model.descriptor_copy.*.mix_array1

Fixes: 8d2654a4197 ("radv: Support VK_EXT_inline_uniform_block.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: fix 3D images
Samuel Pitoiset [Mon, 21 Oct 2019 13:11:35 +0000 (15:11 +0200)]
radv/gfx10: fix 3D images

GFX10 does act like GFX9 actually.

This fixes
dEQP-VK.glsl.texture_functions.query.texturesize.*sampler3d_*.

Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv/gfx10: re-enable fast depth/stencil clears with separate aspects
Samuel Pitoiset [Thu, 17 Oct 2019 08:19:37 +0000 (10:19 +0200)]
radv/gfx10: re-enable fast depth/stencil clears with separate aspects

It used to cause weird issues on GFX10 in the past with vkmark and
Wreckfest, and they can't be reproduced now. Shadow Of Mordor
(Vulkan beta) hits that path and it works fine.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: do not emit rbplus if attachments are undefined
Samuel Pitoiset [Mon, 21 Oct 2019 14:03:47 +0000 (16:03 +0200)]
radv: do not emit rbplus if attachments are undefined

Fixes some crashes with dEQP-VK.geometry.layered.*.secondary_cmd_buffer
on Raven and other chips that allow rbplus.

This just prevents a crash and rbplus probaby needs more work.

Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: add an assertion in radv_gfx10_compute_bin_size()
Samuel Pitoiset [Mon, 21 Oct 2019 08:40:23 +0000 (10:40 +0200)]
radv: add an assertion in radv_gfx10_compute_bin_size()

To prevent out of bounds access.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: do not create meta pipelines with 16 samples
Samuel Pitoiset [Mon, 21 Oct 2019 08:42:30 +0000 (10:42 +0200)]
radv: do not create meta pipelines with 16 samples

The driver only supports up to 8 samples, so it's useless to
create more pipelines than needed.

This fixes a conditional jump reported by Valgrind on GFX10:

==194282== Conditional jump or move depends on uninitialised value(s)
==194282==    at 0xDBF925A: radv_gfx10_compute_bin_size (radv_pipeline.c:3242)
==194282==    by 0xDBF95A6: radv_pipeline_generate_binning_state (radv_pipeline.c:3334)
==194282==    by 0xDBFC1A0: radv_pipeline_generate_pm4 (radv_pipeline.c:4440)
==194282==    by 0xDBFD15E: radv_pipeline_init (radv_pipeline.c:4764)
==194282==    by 0xDBFD23E: radv_graphics_pipeline_create (radv_pipeline.c:4788)
==194282==    by 0xDBB95A3: create_pipeline (radv_meta_clear.c:114)
==194282==    by 0xDBB9AC5: create_color_pipeline (radv_meta_clear.c:297)
==194282==    by 0xDBBCF05: radv_device_init_meta_clear_state (radv_meta_clear.c:1277)
==194282==    by 0xDB9ACD9: radv_device_init_meta (radv_meta.c:363)
==194282==    by 0xDB7FE3A: radv_CreateDevice (radv_device.c:2080

This is caused by an out of bound access of 'fmask_array' (ie. index
is 4 as for 16 samples).

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoanv: implement VK_INTEL_performance_query
Lionel Landwerlin [Thu, 7 Jun 2018 17:02:03 +0000 (18:02 +0100)]
anv: implement VK_INTEL_performance_query

v2: Introduce the appropriate pipe controls
    Properly deal with changes in metric sets (using execbuf parameter)
    Record marker at query end

v3: Fill out PerfCntr1&2

v4: Introduce vkUninitializePerformanceApiINTEL

v5: Use new execbuf extension mechanism

v6: Fix comments in genX_query.c (Rafael)
    Use PIPE_CONTROL workarounds (Rafael)
    Refactor on the last kernel series update (Lionel)

v7: Only I915_PERF_IOCTL_CONFIG when perf stream is already opened (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/perf: add mdapi writes for register perf counters
Lionel Landwerlin [Wed, 28 Nov 2018 15:10:09 +0000 (15:10 +0000)]
intel/perf: add mdapi writes for register perf counters

Those are not part of the OA reports.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/genxml: add RPSTAT register for core frequency
Lionel Landwerlin [Fri, 11 Oct 2019 12:53:16 +0000 (15:53 +0300)]
intel/genxml: add RPSTAT register for core frequency

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/genxml: add generic perf counters registers
Lionel Landwerlin [Wed, 28 Nov 2018 15:08:51 +0000 (15:08 +0000)]
intel/genxml: add generic perf counters registers

We have 2 of those we can configure to source programmable events.
Those are not part of the OA reports. Configuration happens in i915
through the metric set selected by the application. On the Mesa side
we'll just sample those and do a diff.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/perf: add support for querying kernel loaded configurations
Lionel Landwerlin [Mon, 22 Oct 2018 14:39:29 +0000 (15:39 +0100)]
intel/perf: add support for querying kernel loaded configurations

We use this as a communication mechanism between MDAPI & Anv.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agodrm-uapi: Update headers from drm-next
Lionel Landwerlin [Wed, 29 Aug 2018 12:58:23 +0000 (13:58 +0100)]
drm-uapi: Update headers from drm-next

Pull new updates from drm-next as of the following commit:

commit f1b4a9217efd61d0b84c6dc404596c8519ff6f59
Merge: 400e91347e1d f3a36d469621
Author: Dave Airlie <airlied@redhat.com>
Date:   Tue Oct 22 15:04:00 2019 +1000

    Merge tag 'du-next-20191016' of git://linuxtv.org/pinchartl/media into drm-next

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agointel/perf: move registers to their own header
Lionel Landwerlin [Fri, 11 Oct 2019 12:54:57 +0000 (15:54 +0300)]
intel/perf: move registers to their own header

Will conflict with the genxml RPSTAT register.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/perf: extract register configuration
Lionel Landwerlin [Fri, 19 Oct 2018 17:25:13 +0000 (18:25 +0100)]
intel/perf: extract register configuration

We want to query the content of register configurations from the
kernel. Let's pull this out of the query.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/perf: expose some utility functions
Lionel Landwerlin [Wed, 28 Aug 2019 12:45:00 +0000 (15:45 +0300)]
intel/perf: expose some utility functions

The Vulkan performance query extension is a bit lower level than the
GL one. Expose some of the functions to do the result accumulation
directly in the Anv driver.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agointel/perf: add mdapi maker helper
Lionel Landwerlin [Sat, 9 Jun 2018 22:20:10 +0000 (23:20 +0100)]
intel/perf: add mdapi maker helper

A simple utility to put the marker at the right location.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
5 years agost/mesa: Silence chatty debug printf
Kenneth Graunke [Wed, 23 Oct 2019 01:01:10 +0000 (18:01 -0700)]
st/mesa: Silence chatty debug printf

Other debug_printf's in this file are in if (0) blocks.

Trivial.

5 years agost/mesa: Map MESA_FORMAT_RGB_UNORM8 <-> PIPE_FORMAT_R8G8B8_UNORM
Chris Wilson [Wed, 10 Jul 2019 18:10:25 +0000 (19:10 +0100)]
st/mesa: Map MESA_FORMAT_RGB_UNORM8 <-> PIPE_FORMAT_R8G8B8_UNORM

This is useful for PBO texture upload with GL_RGB and GL_UNSIGNED_BYTE.

v2: Vasily Khoruzhick provided an update for the Lima CI expectations.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoanv: fix unwind of vkCreateDevice fail
Lionel Landwerlin [Tue, 22 Oct 2019 12:34:12 +0000 (15:34 +0300)]
anv: fix unwind of vkCreateDevice fail

We're skipping the context destruction in some cases which is the
grand scheme of thing is not that important because closing device->fd
will destroy the associated context as well.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Fixes: b30e01aef56 ("anv: fix memory leak on device destroy")
5 years agoRevert "aco: only emit waitcnt on loop continues if we there was some load or export"
Rhys Perry [Tue, 15 Oct 2019 16:27:07 +0000 (17:27 +0100)]
Revert "aco: only emit waitcnt on loop continues if we there was some load or export"

We don't properly pass on ctx.lgkm_cnt/ctx.barrier_imm/etc, so this
waitcnt was necessary for barriers and correctly waiting for SMEM before
s_dcache_wb on GFX10.

Totals from affected shaders:
SGPRS: 33200 -> 33200 (0.00 %)
VGPRS: 31376 -> 31376 (0.00 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 2431804 -> 2433956 (0.09 %) bytes
LDS: 316 -> 316 (0.00 %) blocks
Max Waves: 1609 -> 1609 (0.00 %)

This reverts commit 2c050b49b3d776f054f1265d5523cabb61f22fc3.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: add missing bld.scc()
Rhys Perry [Tue, 15 Oct 2019 16:56:54 +0000 (17:56 +0100)]
aco: add missing bld.scc()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: keep can_reorder/barrier when combining addition into SMEM
Rhys Perry [Tue, 15 Oct 2019 16:01:24 +0000 (17:01 +0100)]
aco: keep can_reorder/barrier when combining addition into SMEM

Affects 30 shaders in the pipeline-db (all youngblood).

Totals from affected shaders:
SGPRS: 2656 -> 2456 (-7.53 %)
VGPRS: 2260 -> 2260 (0.00 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 240680 -> 240944 (0.11 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 90 -> 90 (0.00 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: add a few missing checks in value numbering
Rhys Perry [Mon, 14 Oct 2019 16:19:19 +0000 (17:19 +0100)]
aco: add a few missing checks in value numbering

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: use ds_read2_b64/ds_write2_b64
Rhys Perry [Tue, 15 Oct 2019 10:31:11 +0000 (11:31 +0100)]
aco: use ds_read2_b64/ds_write2_b64

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: properly combine additions into ds_write2_b64/ds_read2_b64
Rhys Perry [Mon, 14 Oct 2019 16:17:00 +0000 (17:17 +0100)]
aco: properly combine additions into ds_write2_b64/ds_read2_b64

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: fix sparse store_lds()
Rhys Perry [Mon, 14 Oct 2019 19:25:27 +0000 (20:25 +0100)]
aco: fix sparse store_lds()

p_extract_vector's second operand is in units of the definition size, not
dwords.

v2: move extract_subvector() to right before ds_write_helper

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: create load_lds/store_lds helpers
Rhys Perry [Fri, 11 Oct 2019 11:02:49 +0000 (12:02 +0100)]
aco: create load_lds/store_lds helpers

We'll want these for GS, since VS->GS IO on Vega is done using LDS.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: fix 64-bit p_extract_vector on 32-bit p_create_vector
Rhys Perry [Mon, 14 Oct 2019 18:27:52 +0000 (19:27 +0100)]
aco: fix 64-bit p_extract_vector on 32-bit p_create_vector

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: small stage corrections
Rhys Perry [Tue, 10 Sep 2019 14:08:31 +0000 (15:08 +0100)]
aco: small stage corrections

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agost/mesa: replace pipe_shader_state with tgsi_token* in st_vp_variant
Marek Olšák [Fri, 18 Oct 2019 02:41:54 +0000 (22:41 -0400)]
st/mesa: replace pipe_shader_state with tgsi_token* in st_vp_variant

we don't need more than that

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: allow nir_lower_uniforms_to_ubo to be run repeatedly
Marek Olšák [Fri, 18 Oct 2019 23:49:44 +0000 (19:49 -0400)]
nir: allow nir_lower_uniforms_to_ubo to be run repeatedly

for st/mesa

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agofreedreno/ir3: fixup register footprint fixup
Rob Clark [Mon, 21 Oct 2019 23:33:50 +0000 (16:33 -0700)]
freedreno/ir3: fixup register footprint fixup

Small typo resulted in not converting footprint to vec4, meaning that we
could potentially ask for quite a few more registers than required

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agofreedreno/ir3: handle scalarized varying inputs
Rob Clark [Mon, 21 Oct 2019 18:15:53 +0000 (11:15 -0700)]
freedreno/ir3: handle scalarized varying inputs

If the load_interpolated_input is scalarized, we would be too
conservative about deciding the tex instruction wasn't a candidate to
pre-fetch:

vec1 32 ssa_0 = load_const (0x00000000 /* 0.000000 */)
vec2 32 ssa_1 = intrinsic load_barycentric_pixel () (0) /* interp_mode=0 */
vec1 32 ssa_2 = intrinsic load_interpolated_input (ssa_1, ssa_0) (0, 0) /* base=0 */ /* component=0 */ /* packed:v_uv,v_uv1 */
vec1 32 ssa_3 = intrinsic load_interpolated_input (ssa_1, ssa_0) (0, 1) /* base=0 */ /* component=1 */ /* packed:v_uv,v_uv1 */
vec2 32 ssa_8 = vec2 ssa_2, ssa_3
vec4 32 ssa_9 = tex ssa_8 (coord), 0 (texture), 0 (sampler)

Really we don't care that the texcoord components come from different
load_interpolated_input instructions, just that they have consecutive
varying offsets.

Reported-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoaco: refactor value numbering
Daniel Schürmann [Sat, 19 Oct 2019 14:11:13 +0000 (16:11 +0200)]
aco: refactor value numbering

Previously, we used one hashset per BB, so that we could
always initialize the current hashset from the immediate
dominator. This patch changes the behavior to a single
hashmap using the block index per instruction to resolve
dominance.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
5 years agomesa/st: assert that lowering is supported
Erik Faye-Lund [Fri, 18 Oct 2019 12:29:26 +0000 (14:29 +0200)]
mesa/st: assert that lowering is supported

Some of these lowerings aren't supported for drivers that supports
tesselation and geometry shaders. Let's add a couple of asserts to make
it obvious if these have been enabled when it's not possible.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agogitlab-ci: Enable llvmpipe in ARM build jobs
Michel Dänzer [Tue, 8 Oct 2019 17:48:41 +0000 (19:48 +0200)]
gitlab-ci: Enable llvmpipe in ARM build jobs

v2:
* Use LLVM 8 from buster-backports
v3:
* Use LLVM 7 again for armhf, llvmpipe is still broken there with LLVM 8

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: Update the meson cross file for LLVM_VERSION as well
Michel Dänzer [Fri, 11 Oct 2019 13:43:34 +0000 (15:43 +0200)]
gitlab-ci: Update the meson cross file for LLVM_VERSION as well

Cross builds don't use the llvm-config path from the native file.

5 years agogitlab-ci: Use native aarch64 runner for ARM build jobs
Michel Dänzer [Tue, 8 Oct 2019 17:46:11 +0000 (19:46 +0200)]
gitlab-ci: Use native aarch64 runner for ARM build jobs

This allows running the regression tests.

One downside is that we can't easily build the Vulkan overlay layer,
because only x86 binaries of the glslang validator are available. If
that's important, we could either use those binaries via qemu, or build
it from source.

v2:
* Add :amd64 suffix to existing debian-9/10 job names (Eric Engestrom)

Acked-by: Eric Engestrom <eric.engestrom@intel.com> # v1
5 years agogitlab-ci: Explicitly list debian-10 in needs: for .deqp-test template
Michel Dänzer [Tue, 22 Oct 2019 09:19:17 +0000 (11:19 +0200)]
gitlab-ci: Explicitly list debian-10 in needs: for .deqp-test template

Apparently needs: in a definition overwrites inherited ones. So
.deqp-test effectively didn't declare needs: for debian-10, which means
any jobs based on .deqp-test could spuriously run after the debian-10
job failed or was cancelled.

5 years agogitlab-ci: Bring ARM docker image install script in line with x86_64
Michel Dänzer [Thu, 10 Oct 2019 08:56:08 +0000 (10:56 +0200)]
gitlab-ci: Bring ARM docker image install script in line with x86_64

Use https:// URLs in the APT configuration.

Drop --no-install-recommends, the image generation template disables
installation of recommended packages in /etc/apt/apt.conf.

Run apt-get autoremove at the end, cleaning up packages which were
installed to satisfy dependencies but are no longer needed.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: Sort ARM docker image packages in alphabetical order
Michel Dänzer [Wed, 9 Oct 2019 16:48:17 +0000 (18:48 +0200)]
gitlab-ci: Sort ARM docker image packages in alphabetical order

No functional change.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradv: fix updating bound fast ds clear values with different aspects
Samuel Pitoiset [Mon, 21 Oct 2019 20:17:43 +0000 (22:17 +0200)]
radv: fix updating bound fast ds clear values with different aspects

On GFX9, the driver is able to do an optimized fast depth/stencil
clear with only one aspect (ie. clear the stencil part of a
depth/stencil image). When this happens, the driver should only
update the clear values of the given aspect.

Note that it's currently only supported on GFX9 but I have some
local patches that extend this optimized path for other gens.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1967
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agointel/compiler: Refactor disassembly of sources in 3src instruction
Sagar Ghuge [Wed, 22 May 2019 18:11:49 +0000 (11:11 -0700)]
intel/compiler: Refactor disassembly of sources in 3src instruction

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel/compiler: Don't move immediate in register
Sagar Ghuge [Tue, 21 May 2019 23:15:16 +0000 (16:15 -0700)]
intel/compiler: Don't move immediate in register

On Gen12, we support mixed mode HF/F operands, and also 3 source
instruction supports immediate value support, so keep immediate as it
is, if it fits properly in 16 bit field.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel/compiler: Set bits according to source file
Sagar Ghuge [Fri, 19 Apr 2019 20:37:17 +0000 (13:37 -0700)]
intel/compiler: Set bits according to source file

On Gen >= 12, if src0 or src2 holds immediate value, we need set
src[0/2]_is_imm bits instead of register file.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel/compiler: Add Immediate support for 3 source instruction
Sagar Ghuge [Fri, 26 Jul 2019 01:28:06 +0000 (18:28 -0700)]
intel/compiler: Add Immediate support for 3 source instruction

On Gen >= 10, Either src0 or src2 can use 16-bit immediate value, but
not both.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoci: Disable lima until its farm can get fixed.
Eric Anholt [Tue, 22 Oct 2019 02:56:01 +0000 (19:56 -0700)]
ci: Disable lima until its farm can get fixed.

It's been throwing the following error today:

"<Fault -32603: 'Internal Server Error (contact server administrator
for details): could not extend file "base/17952/18226": No space left
on device\nHINT: Check free disk space.\n'>"

Reviewed-by: Daniel Stone <daniels@collabora.com>
5 years agointel: Add missing entry for brw_nir_lower_alpha_to_coverage in Makefile
Sagar Ghuge [Mon, 21 Oct 2019 20:58:04 +0000 (13:58 -0700)]
intel: Add missing entry for brw_nir_lower_alpha_to_coverage in Makefile

Fixes: 7ecfbd4f6d4 ("nir: Add alpha_to_coverage lowering pass")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
5 years agollvmpipe: handle compute shader launch with 0 threads
Dave Airlie [Wed, 16 Oct 2019 03:33:36 +0000 (13:33 +1000)]
llvmpipe: handle compute shader launch with 0 threads

If you set LP_NUM_THREADS=0 compute shaders would hang,
just execute the workloads in sequence if we have no threads
in the pool.

Fixes: 1b24e3ba75 ("llvmpipe: add compute threadpool + mutex")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agofreedreno/ir3: Add missing ir3_nir_lower_tex_prefetch.c to Android.mk
Marijn Suijten [Sat, 19 Oct 2019 23:54:29 +0000 (01:54 +0200)]
freedreno/ir3: Add missing ir3_nir_lower_tex_prefetch.c to Android.mk

This file is created in 2a0d45ae6cf09d60c048d7854e3d082bf15e374f but
addition to android makefiles was omitted. It breaks the build with
missing references which are defined in this file.
List the file in ir3_SOURCES to make the build succeed.

Signed-off-by: Marijn Suijten <marijns95@gmail.com>
5 years agoac/llvm: fix ac_to_integer_type() for 32-bit const addr space pointers
Samuel Pitoiset [Mon, 21 Oct 2019 12:11:47 +0000 (14:11 +0200)]
ac/llvm: fix ac_to_integer_type() for 32-bit const addr space pointers

This fixes some crashes with dEQP-VK.descriptor_indexing.* when
read_first_invocation has its source from a descriptor.

Most of these tests still fail because of an LLVM bug (they work
with ACO).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoaco: run opt_algebraic in a loop
Rhys Perry [Thu, 3 Oct 2019 16:15:34 +0000 (17:15 +0100)]
aco: run opt_algebraic in a loop

Totals from affected shaders:
SGPRS: 13920 -> 13656 (-1.90 %)
VGPRS: 12972 -> 12960 (-0.09 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1005680 -> 1000648 (-0.50 %) bytes
LDS: 91 -> 91 (0.00 %) blocks
Max Waves: 688 -> 688 (0.00 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: use nir_lower_idiv_precise
Rhys Perry [Wed, 18 Sep 2019 19:45:05 +0000 (20:45 +0100)]
aco: use nir_lower_idiv_precise

v7: rename _nv50/_llvm to _fast/_precise

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agonir/lower_idiv: add new llvm-based path
Rhys Perry [Tue, 5 Feb 2019 15:56:24 +0000 (15:56 +0000)]
nir/lower_idiv: add new llvm-based path

v2: make variable names snake_case
v2: minor cleanups in emit_udiv()
v2: fix Panfrost build failure
v3: use an enum instead of a boolean flag in nir_lower_idiv()'s signature
v4: remove nir_op_urcp
v5: drop nv50 path
v5: rebase
v6: add back nv50 path
v6: add comment for nir_lower_idiv_path enum
v7: rename _nv50/_llvm to _fast/_precise
v8: fix etnaviv build failure

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agointel/compiler: Remove emit_alpha_to_coverage workaround from backend
Sagar Ghuge [Fri, 27 Sep 2019 23:28:11 +0000 (16:28 -0700)]
intel/compiler: Remove emit_alpha_to_coverage workaround from backend

Remove emit_alpha_to_coverage workaround from backend compiler and start
using ported workaround from NIR.

v2: Copy comment from brw_fs_visitor (Caio Marcelo de Oliveira Filho)

Fixes piglit test on HSW:
- arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-coverage-combinations

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
5 years agonir: Add alpha_to_coverage lowering pass
Sagar Ghuge [Fri, 27 Sep 2019 23:23:46 +0000 (16:23 -0700)]
nir: Add alpha_to_coverage lowering pass

Importing this pass from fs_visitor::emit_alpha_to_coverage_workaround()
in intel/compiler.

v2 (Caio Marcelo de Oliveira Filho):
- Track store output and sample mask instruction
- Nest math insturction for more readability
- Bail out early if no gl_SampleMask

v3: (Caio Marcelo de Oliveira Filho):
- Do math instructions after instruction block
- Restructure code
- Move pass under src/intel/compiler

v4: (Caio Marcelo de Oliveira Filho):
- Organize dither mask calculation

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
5 years agoaco: ensure that uniform booleans are computed in WQM if their uses happen in WQM
Daniel Schürmann [Wed, 16 Oct 2019 10:56:05 +0000 (12:56 +0200)]
aco: ensure that uniform booleans are computed in WQM if their uses happen in WQM

This fixes graphical corruption in SC2.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
5 years agomeson: Require meson >= 0.49.1 when using icc or icl
Dylan Baker [Fri, 18 Oct 2019 20:49:42 +0000 (13:49 -0700)]
meson: Require meson >= 0.49.1 when using icc or icl

0.49.0 can compile most of mesa with ICC or ICL, but not SWR without
additional workarounds in our meson.build files. Bumping patch version
is easier and shouldn't be a big burden anyway, especially to cover a
niche compiler. The check originally only covered ICC, but now covers
ICL as well.

Fixes: 3740ffb59c89d8d879b1e0c1aed32c389dd82a35
       ("meson: add switches for SWR with MSVC")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1937
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodocs: update calendar, add news item and link release notes for 19.1.8
Juan A. Suarez Romero [Mon, 21 Oct 2019 17:13:55 +0000 (19:13 +0200)]
docs: update calendar, add news item and link release notes for 19.1.8

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
5 years agodocs: add release notes for 19.1.8
Juan A. Suarez Romero [Mon, 21 Oct 2019 17:10:28 +0000 (19:10 +0200)]
docs: add release notes for 19.1.8

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit cc88eeb6ffc4e86d76dfdbfc601d519bc35b6c41)

5 years agodocs: add release notes for 19.1.8
Juan A. Suarez Romero [Mon, 21 Oct 2019 11:55:11 +0000 (13:55 +0200)]
docs: add release notes for 19.1.8

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 5c6d266c591208b1c27e06f61b814210fc6e095f)

5 years agoaco/gfx10: Update constant addresses in fix_branches_gfx10.
Timur Kristóf [Wed, 16 Oct 2019 13:05:56 +0000 (15:05 +0200)]
aco/gfx10: Update constant addresses in fix_branches_gfx10.

Due to a bug in GFX10 hardware, s_nop instructions must be added
if a branch is at 0x3f. We already do this, but forgot to also update
the constant addresses that come after this instruction.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco/gfx10: Fix PS exports for SPI_SHADER_32_AR.
Timur Kristóf [Tue, 15 Oct 2019 07:55:17 +0000 (09:55 +0200)]
aco/gfx10: Fix PS exports for SPI_SHADER_32_AR.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco/gfx10: Wait for pending SMEM stores before loads
Timur Kristóf [Mon, 14 Oct 2019 13:18:31 +0000 (15:18 +0200)]
aco/gfx10: Wait for pending SMEM stores before loads

Currently if you have an SMEM store followed by an SMEM load that
loads the same location as was written, it won't work because the
store isn't finished before the load is executed. This is NOT
mitigated by an s_nop instruction on GFX10.

Since we currently don't have proper alias analysis, this commit adds
a workaround which will insert an s_waitcnt lgkmcnt(0) before each
SSBO load if they follow a store. We should further refine this in
the future when we can make sure to only add the wait when we load the
same thing as has been stored.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agopanfrost: Fix the DISCARD_WHOLE_RES case in transfer_map()
Boris Brezillon [Thu, 10 Oct 2019 13:12:30 +0000 (15:12 +0200)]
panfrost: Fix the DISCARD_WHOLE_RES case in transfer_map()

The current implementation does not synchronize on BO readiness when
DISCARD_WHOLE_RES flag is set, which can lead to misbehaviours when the
resource being updated is being used by one of the pending or already
flushed batches.

Adding unconditional BO synchronization would do the trick, but we can
sometimes optimize this path by re-allocating a new BO instead of
waiting for the existing one to be ready.

Reported-by: Daniel Stone <daniels@collabora.com>
Reported-by: Heinrich Fink <heinrich.fink@daqri.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agost/mesa: only require ESSL 3.1 for geometry shaders
Iago Toral Quiroga [Fri, 18 Oct 2019 07:37:54 +0000 (09:37 +0200)]
st/mesa: only require ESSL 3.1 for geometry shaders

According to the OES_geometry_shader spec, section Dependencies:

   "OpenGL ES 3.1 and OpenGL ES Shading Language 3.10
    are required."

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoegl/android: Remove our own reference to buffers.
Lepton Wu [Tue, 17 Sep 2019 20:49:17 +0000 (13:49 -0700)]
egl/android: Remove our own reference to buffers.

We currently doesn't maintain it correctly and the buffer gets leaked if
surface is destroyed before calling swapping buffers.

From Android frameworks/native/libs/nativewindow/include/system/window.h:

  The window holds a reference to the buffer between dequeueBuffer and
  either queueBuffer or cancelBuffer, so clients only need their own
  reference if they might use the buffer after queueing or canceling it.

v2: Remove our own reference.

Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor")
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Reviewed-By: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
5 years agoradv: advertise VK_KHR_spirv_1_4
Samuel Pitoiset [Wed, 16 Oct 2019 09:41:53 +0000 (11:41 +0200)]
radv: advertise VK_KHR_spirv_1_4

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: do not dump descriptors twice in hang reports
Samuel Pitoiset [Tue, 15 Oct 2019 13:32:13 +0000 (15:32 +0200)]
radv: do not dump descriptors twice in hang reports

If a pipeline has both graphics and compute, descriptors are same.
While we are at it, use queue->device for simplicity.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: dump trace files earlier if a GPU hang is detected
Samuel Pitoiset [Tue, 15 Oct 2019 12:52:02 +0000 (14:52 +0200)]
radv: dump trace files earlier if a GPU hang is detected

To make sure a trace file is generated in case the driver crashes
during the hang report generation (which happens sometimes).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: print which ring is dumped in hang reports
Samuel Pitoiset [Tue, 15 Oct 2019 13:10:27 +0000 (15:10 +0200)]
radv: print which ring is dumped in hang reports

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: do not print useless descriptors info in hang reports
Samuel Pitoiset [Tue, 15 Oct 2019 12:49:38 +0000 (14:49 +0200)]
radv: do not print useless descriptors info in hang reports

This information has never been useful. All descriptors are
already dumped with colors etc, and it's more useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: enable VK_KHR_shader_float_controls on GFX6-GFX7
Samuel Pitoiset [Fri, 18 Oct 2019 16:04:52 +0000 (18:04 +0200)]
radv: enable VK_KHR_shader_float_controls on GFX6-GFX7

Disable 16-bit features because fp16 isn't exposed on these chips.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agopanfrost/ci: Update expectations list
Alyssa Rosenzweig [Sat, 19 Oct 2019 19:07:27 +0000 (15:07 -0400)]
panfrost/ci: Update expectations list

A bunch of blend tests fixed on T760. A single blend test regressed on
both T760/T860 but I am unable to reproduce locally so am just
documenting the regression and moving on.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Implement SIMD-aware dead code elimination
Alyssa Rosenzweig [Wed, 16 Oct 2019 17:19:49 +0000 (13:19 -0400)]
pan/midgard: Implement SIMD-aware dead code elimination

We would like to eliminate not just entire dead instructions, but also
dead components, which increases scheduler flexibility (since some
vector instructions can become scalar after eliminating dead
components). This also will allow better RA in the future.

Results are meh.

total instructions in shared programs: 3453 -> 3451 (-0.06%)
instructions in affected programs: 60 -> 58 (-3.33%)
helped: 2
HURT: 0

total bundles in shared programs: 1826 -> 1824 (-0.11%)
bundles in affected programs: 33 -> 31 (-6.06%)
helped: 2
HURT: 0

total quadwords in shared programs: 3144 -> 3144 (0.00%)
quadwords in affected programs: 0 -> 0
helped: 0
HURT: 0

total registers in shared programs: 321 -> 321 (0.00%)
registers in affected programs: 45 -> 45 (0.00%)
helped: 11
HURT: 11
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 16.67% max: 50.00% x̄: 39.70% x̃: 50.00%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for registers value: -0.45 0.45
95% mean confidence interval for registers %-change: -1.87% 62.18%
Inconclusive result (value mean confidence interval includes 0).

total threads in shared programs: 445 -> 447 (0.45%)
threads in affected programs: 2 -> 4 (100.00%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Create dependency graph bytewise
Alyssa Rosenzweig [Thu, 17 Oct 2019 20:37:11 +0000 (16:37 -0400)]
pan/midgard: Create dependency graph bytewise

This allows for vec16 dependencies in the scheduler, not that we have
any yet (thankfully).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Handle nontrivial masks in texture RA
Alyssa Rosenzweig [Wed, 16 Oct 2019 17:01:41 +0000 (13:01 -0400)]
pan/midgard: Handle nontrivial masks in texture RA

The texture instruction has a mask we need to take into account.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Implement per-byte liveness tracking
Alyssa Rosenzweig [Wed, 16 Oct 2019 16:30:13 +0000 (12:30 -0400)]
pan/midgard: Implement per-byte liveness tracking

Now that we have notion of byte masks, liveness tracking can be updated
to reflect this extra granularity without loss of correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Simplify mir_bytemask_of_read_components
Alyssa Rosenzweig [Fri, 18 Oct 2019 02:18:36 +0000 (22:18 -0400)]
pan/midgard: Simplify mir_bytemask_of_read_components

There are easy ways to iterate sources!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Report byte masks for read components
Alyssa Rosenzweig [Wed, 16 Oct 2019 16:25:32 +0000 (12:25 -0400)]
pan/midgard: Report byte masks for read components

Read component masks don't have a particular type associated, since the
type of the ALU operation may not match the type of the operands in
question. So let's generate byte masks instead, and update the rest of
the compiler to use byte masks when analyzing reads.

Preparation for mixed types.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add helpers for manipulating byte masks
Alyssa Rosenzweig [Wed, 16 Oct 2019 16:24:28 +0000 (12:24 -0400)]
pan/midgard: Add helpers for manipulating byte masks

There are essentially two formats of masks in play beginning with this
commit: masks per-channel and masks per-byte. The former make sense
within a given fixed-size instruction; the latter are
typesize-independent. It turns out you need the latter to meaningfully
manipulate instructions containing multiple sizes (which is quite
possible with ALU operations).

Similarly, we have mir_srcsize. We calculate the size of the source by
analyzing the size of the instruction itself and stepping down if there
is a half-modifier.

Finally, we have mir_round_bytemask_down, for when we want to take a
byte mask and "round it down" to a given component size, so that we can
use it as a component mask.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Implement OP_IS_STORE with table
Alyssa Rosenzweig [Sat, 19 Oct 2019 18:04:39 +0000 (14:04 -0400)]
pan/midgard: Implement OP_IS_STORE with table

..rather than open-coding.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Tableize load/store ops
Alyssa Rosenzweig [Fri, 18 Oct 2019 12:22:40 +0000 (08:22 -0400)]
pan/midgard: Tableize load/store ops

This will allow us to encode properties about the load/store ops like we
do for ALU ops. We include now properties about whether we have a store,
and if there are special cases on the load/store op. We also tag each
instruction by its natural size... this is probably not totally right,
but it's a start.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Factor out mir_get_alu_src
Alyssa Rosenzweig [Thu, 17 Oct 2019 20:37:48 +0000 (16:37 -0400)]
pan/midgard: Factor out mir_get_alu_src

This helper is used in a bunch of places ... might as well make that
common.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard/disasm: Fix printing 8-bit/16-bit masks
Alyssa Rosenzweig [Wed, 16 Oct 2019 21:34:28 +0000 (17:34 -0400)]
pan/midgard/disasm: Fix printing 8-bit/16-bit masks

The trick is realizing even with a destination override, the masks are encoded in the same mode as the
instruction itself, rather than stepping down. The override means that
the smaller type is used, but the mask is parsed as if it were the
higher type. Overriding down is down by printed by blinding doing this. Overriding up can be thought of as printing in the upper size, but shifting the alphabet to use the upper half, i.e. shifting xyzw to become abcd.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Identify 64-bit atomic opcodes
Alyssa Rosenzweig [Fri, 18 Oct 2019 12:18:52 +0000 (08:18 -0400)]
pan/midgard: Identify 64-bit atomic opcodes

They are symmetric to their 32-bit counterparts, just shifted.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Debug mir_insert_instruction_after_scheduled
Alyssa Rosenzweig [Wed, 16 Oct 2019 16:18:51 +0000 (12:18 -0400)]
pan/midgard: Debug mir_insert_instruction_after_scheduled

Add some comments explaining what's going on in a more natural flow in
order to solve the actual bug.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 2d914ebe818 ("pan/midgard: Fix memory corruption in register spilling")
5 years agoetnaviv: keep track of buffer valid ranges for PIPE_BUFFER
Christian Gmeiner [Fri, 6 Sep 2019 13:13:51 +0000 (15:13 +0200)]
etnaviv: keep track of buffer valid ranges for PIPE_BUFFER

This allows a write to proceed to an uninitialized part of a buffer
even when the GPU is using the previously-initialized portions.

Such a situation can be triggered with the following API usage example:

  glBufferSubData(..., offset, size, data1);
  glDrawArrays(...);
  // append new vertex data
  glBufferSubData(..., offset+size, size, data2);
  glDrawArrays(...);

Same is done for freedreno, nouveau and radeon.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: store updated usage in pipe_transfer object
Christian Gmeiner [Fri, 6 Sep 2019 19:21:26 +0000 (21:21 +0200)]
etnaviv: store updated usage in pipe_transfer object

Store the changed usage in the newly created transfer object.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: fix code style
Christian Gmeiner [Sun, 20 Oct 2019 06:02:11 +0000 (08:02 +0200)]
etnaviv: fix code style

Fixes: 1194afdfe35 ("etnaviv: rework the stream flush to always go through the context flush")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoanv: fix memory leak on device destroy
Lionel Landwerlin [Fri, 18 Oct 2019 12:28:30 +0000 (15:28 +0300)]
anv: fix memory leak on device destroy

v2: handle vma destruction if vkCreateDevice fails (Jordan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1959
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>