mesa.git
14 months agogallium: replace 16BIT_TEMPS cap with 16BIT_CONSTS
Rob Clark [Wed, 5 Aug 2020 17:21:46 +0000 (10:21 -0700)]
gallium: replace 16BIT_TEMPS cap with 16BIT_CONSTS

All drivers that support mediump lowering should support 16BIT_TEMPS,
but some do not also want 16b consts to be lowered.  Replace the pipe
cap in preperation to remove LowerPrecisionTemporaries.

Note: also updates reference checksums for the arm64_a630_traces job,
due to lowering more to 16b

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>

14 months agoglsl/lower_precision: split out const lowering
Rob Clark [Wed, 5 Aug 2020 16:56:52 +0000 (09:56 -0700)]
glsl/lower_precision: split out const lowering

Some hw can narrow 32b const/uniform to 16b on load.. and in particular
lowering constants to 16b would break const->uniform lowering.  Allow
them to lower temps to 16b, while skipping consts.

Initially it is set to the same value as LowerPrecisionTemporaries, to
preserve the current behavior.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>

14 months agofreedreno/ir3: lower local_index using local_id
Rob Clark [Mon, 20 Jul 2020 18:14:18 +0000 (11:14 -0700)]
freedreno/ir3: lower local_index using local_id

Somehow this works ok with the full compiler stack, but not in
ir3_cmdline.

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

14 months agofreedreno/ir3: ir3_cmdline updates
Rob Clark [Sun, 19 Jul 2020 17:31:23 +0000 (10:31 -0700)]
freedreno/ir3: ir3_cmdline updates

1) convert to getopt, and drop most variant related options since
   they aren't super-useful these days.. and easy enough to add
   back if/when needed.  (Also, none of the newer shader variant
   options where covered before.)
2) covert to dynamically allocated shader/variant, to get things
   working again after ir3_shader/_variant converted to ralloc
3) few small cleanups

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

14 months agoradeonsi: call nir_split_array_vars/shrink_vec_array_vars/opt_find_array_copies
Marek Olšák [Sat, 4 Jul 2020 02:09:44 +0000 (22:09 -0400)]
radeonsi: call nir_split_array_vars/shrink_vec_array_vars/opt_find_array_copies

Loosely based on RADV and https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5668

54793 shaders in 33659 tests
Totals:
SGPRS: 2739498 -> 2739474 (-0.00 %)
VGPRS: 1534120 -> 1534256 (0.01 %)
Spilled SGPRs: 2579 -> 2579 (0.00 %)
Spilled VGPRs: 29 -> 29 (0.00 %)
Private memory VGPRs: 2176 -> 256 (-88.24 %)
Scratch size: 2220 -> 288 (-87.03 %) dwords per thread
Code Size: 55572924 -> 55584592 (0.02 %) bytes
LDS: 92 -> 92 (0.00 %) blocks
Max Waves: 966044 -> 966021 (-0.00 %)
Wait states: 0 -> 0 (0.00 %)

Totals from affected shaders:
SGPRS: 7272 -> 7248 (-0.33 %)
VGPRS: 4848 -> 4984 (2.81 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 2176 -> 256 (-88.24 %)
Scratch size: 2188 -> 256 (-88.30 %) dwords per thread
Code Size: 336332 -> 348000 (3.47 %) bytes
LDS: 18 -> 18 (0.00 %) blocks
Max Waves: 2659 -> 2636 (-0.86 %)
Wait states: 0 -> 0 (0.00 %)

|   PERCENTAGE DELTAS    |  Shaders |    SGPRs |    VGPRs |SpillSGPR |SpillVGPR | PrivVGPR |  Scratch | CodeSize | MaxWaves |    Waits |
|------------------------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|
| 0ad                    |         6|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| alien_isolation        |      2936|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| anholt                 |        10|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| antichamber            |       180|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| batman_arkham_origins  |       589|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| bioshock-infinite      |      1769|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| borderlands2           |      3968|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| borderlands_presequel  |      1326|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| brutal-legend          |       338|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| chromeos               |        86|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| chromium               |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| civilization_beyond..  |       116|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| company_of_heroes2     |       240|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| counter_strike_glob..  |      1142|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| deadcore               |        76|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| deus_ex_mankind_div..  |      1410|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| dirt-showdown          |       533|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| dirt_rally             |       364|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| divinity               |      1052|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| dolphin                |        22|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| dota2                  |      1747|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| europa_universalis_4   |        76|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| f1-2015                |       775|    0.02 %|    0.12 %|    .     |    .     | -100.00 %| -100.00 %|    0.19 %|   -0.04 %|    .     |
| furmark-0.7.0          |         4|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| gimark-0.7.0           |        10|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| glamor                 |        16|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| glmark                 |        96|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| grid_autosport         |      1767|   -0.03 %|    0.17 %|    .     |    .     |  -85.52 %|  -84.44 %|    0.40 %|   -0.03 %|    .     |
| hitman                 |      1413|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-celshading       |         4|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-domino           |         6|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-dynamicbranching |        24|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-hdr              |        10|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-portals          |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| humus-volumetricfog..  |         6|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| left_4_dead_2          |      1762|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| legend_of_grimrock     |       100|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| life_is_strange        |      1296|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| mad_max                |       358|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| many-spheres           |         6|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| metro_2033_redux       |      2670|    .     |    0.02 %|    .     |    .     |    .     |    .     |    .     |   -0.02 %|    .     |
| nexuiz                 |        80|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| payday2                |      1362|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| pixmark-julia-fp32     |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| pixmark-julia-fp64     |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| pixmark-piano-0.7.0    |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| pixmark-volplosion-..  |         2|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| plot3d-0.7.0           |         8|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| portal                 |       474|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| reflections_subway     |        98|    .     |    .     |    .     |    .     |    .     |    .     |    0.02 %|    .     |    .     |
| rocket_league          |       494|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| saints_row_iv          |      1704|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| saints_row_the_third   |       671|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| sauerbraten            |         7|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| scifi_hallway          |        98|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| serious_sam_3_bfe      |       392|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| shadow_of_mordor       |      1410|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| shadow_warrior         |      3956|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| skia                   |      6094|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| sun_temple             |       109|    .     |    .     |    .     |    .     |    .     |    .     |    0.01 %|    .     |    .     |
| supertuxkart           |         4|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| talos_principle        |       324|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| team_fortress_2        |       808|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| tesseract              |       430|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| tessmark-0.7.0         |         6|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| thea                   |       172|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| tomb_raider            |      1448|   -0.02 %|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| total_war_warhammer    |       242|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| ubershaders            |        54|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| ue4_effects_cave       |       290|    .     |    .     |    .     |    .     |    .     |    .     |    0.02 %|    .     |    .     |
| ue4_elemental          |       561|    .     |    .     |    .     |    .     |    .     |    .     |    0.02 %|    .     |    .     |
| ue4_lightroom_inter..  |        64|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| ue4_realistic_rende..  |        86|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| unigine_heaven         |       322|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| unigine_sanctuary      |       264|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| unigine_tropics        |       210|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| unigine_valley         |       278|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| unity                  |        72|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| victor_vran            |      1262|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| warsow                 |       176|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| warzone2100            |         4|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| wasteland2             |        76|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| wavelet-volume         |         4|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| witcher2               |      1040|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| xcom_enemy_within      |      1236|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
| yofrankie              |        82|    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |    .     |
|------------------------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|
| All affected           |       157|   -0.33 %|    2.81 %|    .     |    .     |  -88.24 %|  -88.30 %|    3.47 %|   -0.86 %|    .     |
|------------------------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|
| Total                  |     54793|    .     |    .     |    .     |    .     |  -88.24 %|  -87.03 %|    0.02 %|    .     |    .     |

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

14 months agoradeonsi: reorder NIR optimizations
Marek Olšák [Sat, 4 Jul 2020 02:05:18 +0000 (22:05 -0400)]
radeonsi: reorder NIR optimizations

Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5668

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

14 months agoradeonsi: extend workaround for KHR-GL45.texture_view.view_classes on gfx9
Pierre-Eric Pelloux-Prayer [Wed, 29 Jul 2020 10:14:28 +0000 (12:14 +0200)]
radeonsi: extend workaround for KHR-GL45.texture_view.view_classes on gfx9

This is a followup of 19db1a540c248e330284a6c9733633d0695677a3.
This commit fixed KHR-GL45.texture_view.view_classes on gfx9 but the test
still failed when using AMD_DEBUG=nodma or AMD_DEBUG=nodcc,nodma.

The workaround is now used from si_resource_copy_region so it covers the
previous call site (si_texture_transfer_map) and the sctx->dma_copy
fallback code.

Fixes: 19db1a540c2 ("radeonsi: add a workaround to fix KHR-GL45.texture_view.view_classes on gfx9")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6115>

14 months agost/mesa: optimize DEPTH_STENCIL copies using fragment shader
Indrajit Kumar Das [Mon, 27 Jul 2020 13:51:42 +0000 (19:21 +0530)]
st/mesa: optimize DEPTH_STENCIL copies using fragment shader

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

14 months agofreedreno: allow fence_fd fences to be recycled
Rob Clark [Tue, 4 Aug 2020 21:24:44 +0000 (14:24 -0700)]
freedreno: allow fence_fd fences to be recycled

This allows us to avoid a no-op flush if there has been no rendering,
but we hit pctx->flush(PIPE_FLUSH_FENCE_FD).

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

14 months agoradeonsi: disable SDMA on gfx9
Marek Olšák [Mon, 4 May 2020 22:25:28 +0000 (18:25 -0400)]
radeonsi: disable SDMA on gfx9

Fixes: 9680a754895 "radeonsi/gfx9: enable SDMA buffer copying & clearing"
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4895>

14 months agoci: Add a build test for the Android platform
Kristian H. Kristensen [Tue, 28 Jul 2020 22:35:36 +0000 (15:35 -0700)]
ci: Add a build test for the Android platform

This builds the EGL loader and the freedreno, intel and amd vulkan
drivers.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoradv/android: Remove unused variable
Kristian H. Kristensen [Thu, 30 Jul 2020 22:25:09 +0000 (15:25 -0700)]
radv/android: Remove unused variable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agovulkan: Allow global symbol HMI for Android
Kristian H. Kristensen [Wed, 29 Jul 2020 19:51:49 +0000 (12:51 -0700)]
vulkan: Allow global symbol HMI for Android

Android looks for this symbol when loading HAL modules.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoanv: Add stub for anv_gem_get_tiling() for Android
Kristian H. Kristensen [Wed, 29 Jul 2020 19:51:07 +0000 (12:51 -0700)]
anv: Add stub for anv_gem_get_tiling() for Android

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoanv: Pass device to setup_gralloc0_usage for error reporting
Kristian H. Kristensen [Wed, 29 Jul 2020 18:02:07 +0000 (11:02 -0700)]
anv: Pass device to setup_gralloc0_usage for error reporting

Otherwise it doesn't compile.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: aba57b11ee8c6d ("anv: support GetSwapchainGrallocUsage2ANDROID for Android")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agomeson: Define ANDROID and ANDROID_API_LEVEL when compiling for Android
Kristian H. Kristensen [Wed, 29 Jul 2020 08:09:23 +0000 (01:09 -0700)]
meson: Define ANDROID and ANDROID_API_LEVEL when compiling for Android

Set ANDROID_API_LEVEL based on the value we already have and define
ANDROID to make sure we build code paths that are guarded by that.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoturnip: Make tu_android.c compile again
Kristian H. Kristensen [Wed, 29 Jul 2020 07:53:29 +0000 (00:53 -0700)]
turnip: Make tu_android.c compile again

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

14 months agomapi: Mark TLS symbols as optional in glapi-symbols.txt
Kristian H. Kristensen [Wed, 29 Jul 2020 07:08:46 +0000 (00:08 -0700)]
mapi: Mark TLS symbols as optional in glapi-symbols.txt

Presence of these depends on whether or not we're using ELF TLS.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoci: Include enough Android headers to let us compile test EGL
Kristian H. Kristensen [Tue, 28 Jul 2020 22:25:49 +0000 (15:25 -0700)]
ci: Include enough Android headers to let us compile test EGL

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

14 months agogallium/android: Rewrite backtrace helper for android
Kristian H. Kristensen [Wed, 29 Jul 2020 04:24:45 +0000 (21:24 -0700)]
gallium/android: Rewrite backtrace helper for android

The previous implementation kept a hashtable of a Backtrace object per
thread.  debug_backtrace_capture is supposed to store a backtrace in
the passed in debug_stack_frame array, but instead overwrote the
per-thread Backtrace object.

This new version works more like the libunwind based capture. We hash
the file and symbol names and store pointers in the debug_stack_frame
struct.  This way debug_backtrace_capture doesn't overwrite previous
captures or allocate memory that needs to be freed.

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

14 months agoutil: Add unit test for stack backtrace caputure
Kristian H. Kristensen [Wed, 29 Jul 2020 04:29:37 +0000 (21:29 -0700)]
util: Add unit test for stack backtrace caputure

First test never fails, but exercises the code and is useful for
manual inspection.  Second test exposes the android implementation
bug.

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

14 months agoutil: Move stack debug functions to src/util
Kristian H. Kristensen [Wed, 29 Jul 2020 05:02:31 +0000 (22:02 -0700)]
util: Move stack debug functions to src/util

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agogallium: Switch u_debug_stack/symbol.c to util/hash_table.h
Kristian H. Kristensen [Wed, 29 Jul 2020 05:52:46 +0000 (22:52 -0700)]
gallium: Switch u_debug_stack/symbol.c to util/hash_table.h

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

14 months agomapi/test: Change type to unsigned for offset
Kristian H. Kristensen [Wed, 29 Jul 2020 04:10:57 +0000 (21:10 -0700)]
mapi/test: Change type to unsigned for offset

Quiets this warning:

../../master/src/mapi/glapi/tests/check_table.cpp:576:20: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
   { "glColor3dv", _O(Color3dv) },
                   ^~~~~~~~~~~~

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoegl/android: Remove unused variable
Kristian H. Kristensen [Tue, 28 Jul 2020 22:38:03 +0000 (15:38 -0700)]
egl/android: Remove unused variable

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

14 months agoamd/llvm: Reorder LLVM headers
James Park [Wed, 5 Aug 2020 16:59:25 +0000 (09:59 -0700)]
amd/llvm: Reorder LLVM headers

LLVM uses __declspec(restrict) which breaks because Mesa define restrict
as __restrict. Move the LLVM headerse up to dodge the macro.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6180>

14 months agoci: Use a rootfs tarball for NFS root, instead of a ramdisk (for LAVA)
Tomeu Vizoso [Tue, 28 Jul 2020 09:42:42 +0000 (11:42 +0200)]
ci: Use a rootfs tarball for NFS root, instead of a ramdisk (for LAVA)

We anyway depend already on robust network support in the DUTs, and we
can save quite some time this way.

It will also allow us to grow further as we expand coverage.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-By: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6114>

14 months agoradv: set BYPASS_VTX_RATE_COMBINER_GFX103 on GFX 10.3
Samuel Pitoiset [Tue, 4 Aug 2020 09:17:41 +0000 (11:17 +0200)]
radv: set BYPASS_VTX_RATE_COMBINER_GFX103 on GFX 10.3

Based on RadeonSI.

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

14 months agoradv: fix sample shading on GFX 10.3
Samuel Pitoiset [Tue, 4 Aug 2020 09:17:25 +0000 (11:17 +0200)]
radv: fix sample shading on GFX 10.3

Based on RadeonSI.

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

14 months agoradv: increase minimum NGG vertex count requirement per workgroup on GFX 10.3
Samuel Pitoiset [Tue, 4 Aug 2020 08:56:51 +0000 (10:56 +0200)]
radv: increase minimum NGG vertex count requirement per workgroup on GFX 10.3

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

14 months agoradv: do not honor a user-specified pitch on GFX 10.3
Samuel Pitoiset [Tue, 4 Aug 2020 08:30:41 +0000 (10:30 +0200)]
radv: do not honor a user-specified pitch on GFX 10.3

According to RadeonSI, it breaks mipmapping.

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

14 months agonir/lower_tex: handle query lod with nir_lower_tex_packing_16 at lower_tex_packing
Alejandro Piñeiro [Fri, 10 Jul 2020 22:36:23 +0000 (00:36 +0200)]
nir/lower_tex: handle query lod with nir_lower_tex_packing_16 at lower_tex_packing

packing_16 with floats assumed 1 (shadow) or 4 components. But query
lod operations return 2.

Fixes the following test with v3dv:
dEQP-VK.ycbcr.query.lod.fragment.r8g8b8a8_unorm

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5863>

14 months agoradv/llvm: enable VK_KHR_memory_model
Rhys Perry [Thu, 30 Jul 2020 10:07:22 +0000 (11:07 +0100)]
radv/llvm: enable VK_KHR_memory_model

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

14 months agoac/nir: fix coherent global loads/stores
Rhys Perry [Thu, 30 Jul 2020 10:50:44 +0000 (11:50 +0100)]
ac/nir: fix coherent global loads/stores

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

14 months agoac/nir: consider an image load/store intrinsic's access
Rhys Perry [Thu, 30 Jul 2020 10:14:55 +0000 (11:14 +0100)]
ac/nir: consider an image load/store intrinsic's access

ACCESS_COHERENT may be set for a specific load/store in the case of
atomic loads/stores.

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

14 months agoradv/aco: enable VK_KHR_memory_model
Rhys Perry [Fri, 24 Jul 2020 16:11:45 +0000 (17:11 +0100)]
radv/aco: enable VK_KHR_memory_model

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

14 months agospirv: set ACCESS_COHERENT for ssbo/global/image atomic load/store
Rhys Perry [Fri, 24 Jul 2020 15:22:45 +0000 (16:22 +0100)]
spirv: set ACCESS_COHERENT for ssbo/global/image atomic load/store

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

14 months agonir/lower_tex: skip lower_tex_packing for the texture samples query
Iago Toral Quiroga [Tue, 4 Aug 2020 09:18:46 +0000 (11:18 +0200)]
nir/lower_tex: skip lower_tex_packing for the texture samples query

Similar to other skips for texture queries that don't actually sample
the texture and which results are not packed.

We can't use nir_tex_instr_is_query() here to skip the lowering for all
queries since that causes regressions in Piglit. Apparently, we do want
to lower some of the query results. In particularly, the LOD query.

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

14 months agofreedreno/computerator: Set SP_MODE_CONTROL to the same value as vulkan/GL
Eric Anholt [Wed, 8 Jul 2020 02:14:34 +0000 (19:14 -0700)]
freedreno/computerator: Set SP_MODE_CONTROL to the same value as vulkan/GL

This gets us consistent hcN access with our drivers, for experimenting.
We don't know what the other bit does yet, but let's not have to debug
that later.

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

14 months agofreedreno/a6xx: Document the bit for the magic 32bit-uniforms-as-16b mode.
Eric Anholt [Wed, 8 Jul 2020 02:12:14 +0000 (19:12 -0700)]
freedreno/a6xx: Document the bit for the magic 32bit-uniforms-as-16b mode.

Trying to figure out how uniforms were working, I found that computerator
had different behavior from our GL fragment shaders.  Given that 3xx had
an SP_ bit for this (thanks flto@ for the note), it was a matter of
pasting bits of SP_* setup into computerator until I got the GL behavior.
I named it the same as the a3xx register.

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

14 months agofreedreno/ir3: Fix the type of half-float indirect uniform loads.
Eric Anholt [Tue, 7 Jul 2020 23:37:11 +0000 (16:37 -0700)]
freedreno/ir3: Fix the type of half-float indirect uniform loads.

We would be making a MOV from a u32, when we should be loading from a
16-bit value.  This likely didn't bite us because we only do mediump in FS
and CS so far, and indirect uniforms are usually in a VS (and usually
highp).

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

14 months agonir: Print the constant data size associated with a shader.
Eric Anholt [Tue, 7 Jul 2020 19:48:09 +0000 (12:48 -0700)]
nir: Print the constant data size associated with a shader.

We should probably dump the constants, too, but this is useful to me for
now.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>

14 months agonir: Add a little more docs about NIR's constant_data.
Eric Anholt [Tue, 7 Jul 2020 19:25:13 +0000 (12:25 -0700)]
nir: Add a little more docs about NIR's constant_data.

I think everyone trips over "how does this relate to nir_const", and I was
curious if I could redefine the units of the constant_data_size / indirect
offsets.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>

14 months agonir/lower_amul: Use num_ubos/ssbos instead of recomputing it.
Eric Anholt [Wed, 8 Jul 2020 19:43:16 +0000 (12:43 -0700)]
nir/lower_amul: Use num_ubos/ssbos instead of recomputing it.

Now that num_ubos is correctly maintained, we can just trust it.  Fixes an
assertion failure in freedreno I triggered on
dEQP-GLES31.functional.ubo.random.all_per_block_buffers.1 for reasons I
don't really understand.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>

14 months agoturnip: Only include msm_drm in tu_drm.c
Kristian H. Kristensen [Wed, 5 Aug 2020 00:24:03 +0000 (17:24 -0700)]
turnip: Only include msm_drm in tu_drm.c

We copy the definition for struct drm_msm_gem_submit_bo and flags to
keep the bo list code working for now.

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

14 months agoturnip: Move remaining drm code to tu_drm.c
Kristian H. Kristensen [Mon, 20 Jul 2020 19:47:57 +0000 (12:47 -0700)]
turnip: Move remaining drm code to tu_drm.c

This moves the semaphore implementation and tu_QueueSubmit to
tu_drm.c, such that that's the only file including xf86drm.h and
msm_drm.h.  This way, the entire kernel interface is contained in
tu_drm.c

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

14 months agoturnip: Collapse some tu_drm wrappers
Kristian H. Kristensen [Tue, 7 Apr 2020 17:49:30 +0000 (10:49 -0700)]
turnip: Collapse some tu_drm wrappers

These are all internal to tu_drm.c, we can skip a couple of
abstraction layers now.

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

14 months agoturnip: Move tu_bo functions to tu_drm.c
Kristian H. Kristensen [Tue, 7 Apr 2020 17:33:27 +0000 (10:33 -0700)]
turnip: Move tu_bo functions to tu_drm.c

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

14 months agoturnip: Move device enumeration and feature discovery to tu_drm.c
Kristian H. Kristensen [Tue, 7 Apr 2020 17:28:49 +0000 (10:28 -0700)]
turnip: Move device enumeration and feature discovery to tu_drm.c

These steps are all drm specific.

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

14 months agoanv: fix allocation of custom border color pool
Iván Briano [Tue, 4 Aug 2020 19:59:43 +0000 (12:59 -0700)]
anv: fix allocation of custom border color pool

Turns out that respecting the order of parameters is important.

Reported-by: Michael Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: 5425968d2e46 ("anv: Implement VK_EXT_custom_border_color")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6175>

14 months agoaco: replace MADs in isel with FMA on GFX10.3
Rhys Perry [Thu, 18 Jun 2020 15:47:36 +0000 (16:47 +0100)]
aco: replace MADs in isel with FMA on GFX10.3

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

14 months agoaco: disable SMEM stores on GFX10.3
Rhys Perry [Thu, 18 Jun 2020 15:26:21 +0000 (16:26 +0100)]
aco: disable SMEM stores on GFX10.3

These are removed in GFX10.3

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

14 months agoaco: update aco_opcodes.py for GFX10.3
Rhys Perry [Thu, 18 Jun 2020 14:21:38 +0000 (15:21 +0100)]
aco: update aco_opcodes.py for GFX10.3

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

14 months agoaco: implement subgroup shader_clock on GFX10.3
Rhys Perry [Thu, 18 Jun 2020 13:45:31 +0000 (14:45 +0100)]
aco: implement subgroup shader_clock on GFX10.3

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

14 months agoaco: update vgpr_alloc_granule for GFX10.3
Rhys Perry [Thu, 18 Jun 2020 13:31:13 +0000 (14:31 +0100)]
aco: update vgpr_alloc_granule for GFX10.3

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

14 months agoaco: fix max_waves_per_simd on Polaris, VegaM and GFX10.3
Rhys Perry [Thu, 18 Jun 2020 13:30:51 +0000 (14:30 +0100)]
aco: fix max_waves_per_simd on Polaris, VegaM and GFX10.3

fossil-db (Polaris):
Totals from 20263 (14.75% of 137414) affected shaders:
SGPRs: 871407 -> 871679 (+0.03%); split: -0.00%, +0.03%
VGPRs: 513828 -> 550028 (+7.05%); split: -1.68%, +8.72%
CodeSize: 18869680 -> 18828148 (-0.22%); split: -0.23%, +0.01%
MaxWaves: 162012 -> 162030 (+0.01%); split: +0.01%, -0.00%
Instrs: 3629172 -> 3618817 (-0.29%); split: -0.30%, +0.02%
Cycles: 15682244 -> 15638244 (-0.28%); split: -0.30%, +0.02%
VMEM: 10675942 -> 10673344 (-0.02%); split: +0.18%, -0.21%
SMEM: 1209717 -> 1206088 (-0.30%); split: +0.03%, -0.33%
VClause: 81780 -> 81227 (-0.68%); split: -0.73%, +0.06%
SClause: 231724 -> 231561 (-0.07%); split: -0.07%, +0.00%
Copies: 187126 -> 180831 (-3.36%); split: -3.62%, +0.26%
Branches: 26841 -> 26837 (-0.01%); split: -0.03%, +0.01%

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

14 months agoaco: update bug workarounds for GFX10_3
Rhys Perry [Thu, 18 Jun 2020 13:23:13 +0000 (14:23 +0100)]
aco: update bug workarounds for GFX10_3

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

14 months agoaco: don't create v_mad_f32 on GFX10.3
Rhys Perry [Tue, 16 Jun 2020 16:43:01 +0000 (17:43 +0100)]
aco: don't create v_mad_f32 on GFX10.3

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

14 months agoaco: fix waitcnt insertion on GFX10.3
Rhys Perry [Tue, 16 Jun 2020 17:09:07 +0000 (18:09 +0100)]
aco: fix waitcnt insertion on GFX10.3

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

14 months agopanfrost: Implement EXT_multisampled_render_to_texture
Alyssa Rosenzweig [Tue, 21 Jul 2020 22:54:18 +0000 (18:54 -0400)]
panfrost: Implement EXT_multisampled_render_to_texture

Significantly helps WebGL performance with Chromium's OpenGL ES backend.
Also update docs/features.txt

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

14 months agopanfrost: Add MSAA mode selection field
Alyssa Rosenzweig [Tue, 21 Jul 2020 22:51:07 +0000 (18:51 -0400)]
panfrost: Add MSAA mode selection field

This field enables MSAA, either writing samples to separate surfaces, to
a single large-bpp surface, or implicitly resolved and to a single
surface.

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

14 months agodocs/features: Add GL_EXT_multisampled_render_to_texture
Alyssa Rosenzweig [Mon, 3 Aug 2020 17:19:43 +0000 (13:19 -0400)]
docs/features: Add GL_EXT_multisampled_render_to_texture

Currently only a6xx, panfrost added later in series.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6161>

14 months agoradv: print warnings for famous RADV_PERFTEST options that no longer exist
Samuel Pitoiset [Fri, 26 Jun 2020 10:12:18 +0000 (12:12 +0200)]
radv: print warnings for famous RADV_PERFTEST options that no longer exist

RADV_PERFTEST=aco no longer exists, ACO is the default compiler.
RADV_PERFTEST=llvm is deprecated, use RADV_DEBUG=llvm instead.

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

14 months agoradeon/vcn: Corrected vp9 ref associated data incase of target->codec is NULL
SureshGuttula [Sat, 13 Jun 2020 06:51:48 +0000 (12:21 +0530)]
radeon/vcn: Corrected vp9 ref associated data incase of target->codec is NULL

This patch fixes the case where less number of reference surfaces created and destoyed
on need basis. The problem comes when we are refereing old assoiciated data for newly
created target buffer with same address. Here old target buffer destroyed as that
surface is no more used as reference for next frames and when we create a new surface
for the next frame to process we will get the surfaceid and same target address
of destroyed surface.

When new surface/surface->buffer/target ,target->codec is null as we cleared when we
destroy this surface, but per ref_mapping logic, it was taking null associated data
i.e.0 as curr_ref_idx. Hence total reference mapping table goes wrong with wrong data.
Beacuse of this, we have seen corrupted vp9 decoded frames.

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5452>

14 months agospirv: Propagate explicit layout only in types that need it
Caio Marcelo de Oliveira Filho [Wed, 29 Jul 2020 19:42:08 +0000 (12:42 -0700)]
spirv: Propagate explicit layout only in types that need it

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

14 months agolima: Fix lima_screen_query_dmabuf_modifiers()
Roman Stratiienko [Sun, 26 Jul 2020 03:37:57 +0000 (06:37 +0300)]
lima: Fix lima_screen_query_dmabuf_modifiers()

Incorrect implementation has been found during code surfing.
v3d implementation used for reference.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Icenowy Zheng <icenowy@aosc.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6076>

14 months agotu: Implement VK_EXT_conditional_rendering
Connor Abbott [Mon, 20 Jul 2020 10:14:41 +0000 (12:14 +0200)]
tu: Implement VK_EXT_conditional_rendering

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

14 months agotu: Reset has_tess after renderpass
Connor Abbott [Mon, 3 Aug 2020 09:13:56 +0000 (11:13 +0200)]
tu: Reset has_tess after renderpass

Don't force sysmem for render passes after the one that uses
tessellation.

Also, move this into tu_cmd_state as that's where it belongs.

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

14 months agofreedreno: Document draw predication packets
Connor Abbott [Sat, 18 Jul 2020 17:25:01 +0000 (19:25 +0200)]
freedreno: Document draw predication packets

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

14 months agotu: Fix DST_INCOHERENT_FLUSH copy/paste error
Connor Abbott [Tue, 7 Jul 2020 15:10:44 +0000 (17:10 +0200)]
tu: Fix DST_INCOHERENT_FLUSH copy/paste error

This was meant to handle incoherent accesses by always flushing them,
but it accidentally checked for the coherent variant instead. As a
result e.g. a vkCmdClearImage() followed by a renderpass using the image
didn't get any flushes, resulting in the same sort of corruption seen
with sysmem renderpass clears. This happened to be exposed via some
tests that used multiview.

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

14 months agoturnip: implement VK_EXT_4444_formats
Jonathan Marek [Mon, 3 Aug 2020 19:52:59 +0000 (15:52 -0400)]
turnip: implement VK_EXT_4444_formats

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6164>

14 months agoutil/format: translate A4R4G4B4_UNORM and A4B4G4R4_UNORM vulkan formats
Jonathan Marek [Mon, 3 Aug 2020 19:49:42 +0000 (15:49 -0400)]
util/format: translate A4R4G4B4_UNORM and A4B4G4R4_UNORM vulkan formats

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6164>

14 months agoturnip: rework extended formats to allow more extended formats
Jonathan Marek [Mon, 3 Aug 2020 19:45:34 +0000 (15:45 -0400)]
turnip: rework extended formats to allow more extended formats

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6164>

14 months agoci: Actually upload trace artifacts to MinIO for baremetal
Tomeu Vizoso [Tue, 4 Aug 2020 09:17:59 +0000 (11:17 +0200)]
ci: Actually upload trace artifacts to MinIO for baremetal

Baremetal jobs filter the variables they get from .gitlab-ci.yml, and
TRACIE_UPLOAD_TO_MINIO and others weren't being let through.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Fixes: d4ca45eca2a5 ("ci: Upload traces' reference and actual images to MinIO")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6171>

14 months agoturnip: add support for D32_SFLOAT_S8_UINT
Jonathan Marek [Thu, 18 Jun 2020 03:11:05 +0000 (23:11 -0400)]
turnip: add support for D32_SFLOAT_S8_UINT

Add support for D32_SFLOAT_S8_UINT, which requires special handling because
it is actually two images.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5537>

14 months agoci: Remove kernel module build that slipped in
Tomeu Vizoso [Tue, 4 Aug 2020 09:00:54 +0000 (11:00 +0200)]
ci: Remove kernel module build that slipped in

Some changes unintendedly slipped into an unrelated commit before it was
merged.

This caused kernel modules to be built and installed in the ramdisk,
which caused some devices to fail to boot due to the ramdisk size limit
being surpassed.

These changes weren't in effect until a subsequent commit triggered a
rebuild of the ramdisks.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Fixes: a9560939e07a ("ci: Build-test Panfrost tools")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6167>

14 months agoci: Download traces from MinIO in baremetal runs
Tomeu Vizoso [Fri, 31 Jul 2020 06:24:13 +0000 (08:24 +0200)]
ci: Download traces from MinIO in baremetal runs

Now that we have MinIO, we can distribute traces better than by direct
downloads from git.

With a caching MinIO instance local to the DUT, total run times should
be noticeably impacted.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6136>

14 months agoci: Upload traces' reference and actual images to MinIO
Tomeu Vizoso [Fri, 31 Jul 2020 06:13:15 +0000 (08:13 +0200)]
ci: Upload traces' reference and actual images to MinIO

Now that the devices have sane dates, we can upload to MinIO.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6136>

14 months agospirv: Do more complex unwrapping in get_nir_type
Jason Ekstrand [Fri, 24 Jul 2020 15:46:20 +0000 (10:46 -0500)]
spirv: Do more complex unwrapping in get_nir_type

The OpenGL flavor of SPIR-V allows for samplers inside structs.  This
means that our simple array-of-array handling isn't sufficient and we
need something substantially more complex for generating NIR types.

Fixes: 14a12b771d0 "spirv: Rework our handling of images and samplers"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6065>

14 months agocompiler/types: Add a struct_type_is_packed wrapper
Jason Ekstrand [Fri, 24 Jul 2020 15:45:36 +0000 (10:45 -0500)]
compiler/types: Add a struct_type_is_packed wrapper

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

14 months agofreedreno: Fix "Offset of packed bitfield changed" warnings:
Eric Anholt [Mon, 3 Aug 2020 19:59:11 +0000 (12:59 -0700)]
freedreno: Fix "Offset of packed bitfield changed" warnings:

Example:

../src/freedreno/ir2/instr-a2xx.h:384:1: note: offset of packed bit-field
‘const_index’ has changed in GCC 4.4
  384 | } instr_fetch_vtx_t;

It's apparently due to bitfields that would cross the width of their type.
Just expand the types of the affected fields so that the compiler quiets
down.

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

14 months agoturnip: delete tu_clear_sysmem_attachments_2d
Jonathan Marek [Mon, 6 Jul 2020 15:33:32 +0000 (11:33 -0400)]
turnip: delete tu_clear_sysmem_attachments_2d

2D path is using the same hardware as the 3D path, with the advantage of
separate register state, but here it requires WFI and extra cache flushing
and invalidating, so it should be better to just use the 3D path. There are
also some cases where the 3D path would be much faster, since it can clear
multiple attachments at once.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5775>

14 months agoturnip: fix sysmem CmdClearAttachments 3D fallback breaking GMEM path flush
Jonathan Marek [Wed, 8 Jul 2020 11:46:09 +0000 (07:46 -0400)]
turnip: fix sysmem CmdClearAttachments 3D fallback breaking GMEM path flush

It was clearing the flush bits, which are used by both GMEM/SYSMEM paths,
but emitting the flushes inside the cond_exec, where they would only run
for the sysmem path.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5775>

14 months agonir/deref: Don't try to compare derefs containing casts
Jason Ekstrand [Sat, 25 Jul 2020 01:27:37 +0000 (20:27 -0500)]
nir/deref: Don't try to compare derefs containing casts

One day, we may want copy_prop_vars or other passes to be able to see
through certain types of casts such as when someone casts a uint64_t to
a uvec2.  However, for now we should just avoid casts all together.

Fixes: d8e3edb784d3a "nir/deref: Support casts and ptr_as_array in..."
Tested-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6072>

14 months agonir: Remove the old nir_opt_shrink_load.
Eric Anholt [Thu, 23 Jul 2020 05:10:39 +0000 (22:10 -0700)]
nir: Remove the old nir_opt_shrink_load.

The old pass only handled intrinsic load_constant, while the new
nir_opt_shrink_vectors handles ALU ops, nir load_consts, along with all
the load intrinsics.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>

14 months agoamd: Swap from nir_opt_shrink_load() to nir_opt_shrink_vectors().
Eric Anholt [Thu, 23 Jul 2020 05:00:57 +0000 (22:00 -0700)]
amd: Swap from nir_opt_shrink_load() to nir_opt_shrink_vectors().

This should do much more trimming than shrink_load, and is a win on i965's
vec4 and nir-to-tgsi.  For scalar backends like this that don't need ALU
shrinking, it still gets more load intrinsics covered.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>

14 months agoi965: Enable vector shrinking in the vec4 backend.
Eric Anholt [Thu, 23 Jul 2020 04:35:07 +0000 (21:35 -0700)]
i965: Enable vector shrinking in the vec4 backend.

This manages to make some extra vec operations that would turn into movs
go away.

brw shader-db:
total instructions in shared programs: 3895037 -> 3893221 (-0.05%)
total cycles in shared programs: 113832759 -> 113792154 (-0.04%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>

14 months agonir: Add a pass to cut the trailing ends of vectors.
Eric Anholt [Wed, 22 Jul 2020 23:57:22 +0000 (16:57 -0700)]
nir: Add a pass to cut the trailing ends of vectors.

Ideally we'd also handle unused middles of vectors and reswizzle ALU-only
uses of it so we could write fewer channels, but that's future work/

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>

14 months agoturnip: workaround for a630 d24_unorm_s8_uint fails
Jonathan Marek [Thu, 11 Jun 2020 21:57:54 +0000 (17:57 -0400)]
turnip: workaround for a630 d24_unorm_s8_uint fails

A630 doesn't have the HW format we use to sample stencil, so it needs a
workaround. It also has a bug around the AS_R8G8B8A8 format, which doesn't
work when UBWC is disabled, so use 8_8_8_8_UNORM instead when UBWC is
disabled (using AS_R8G8B8A8 or 8_8_8_8_UNORM should only matter with UBWC)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5438>

14 months agoetnaviv: fix nir validation problem
Christian Gmeiner [Thu, 30 Jul 2020 19:25:12 +0000 (21:25 +0200)]
etnaviv: fix nir validation problem

Fixes the following validation problem:
  error: nir_intrinsic_align_offset(instr) < nir_intrinsic_align_mul(instr)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6127>

14 months agofreedreno/decode: move dependencies up a level
Rob Clark [Sun, 2 Aug 2020 19:17:28 +0000 (12:17 -0700)]
freedreno/decode: move dependencies up a level

This is mainly for the benefit of automated syncing of changes from mesa
back to envytools, where the same subdir meson.build's are used, but the
toplevel meson.build is different.  In the envytools case, we want these
depenendencies to be required.

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

14 months agofreedreno/registers: install gzip'd register database
Rob Clark [Sun, 2 Aug 2020 18:55:43 +0000 (11:55 -0700)]
freedreno/registers: install gzip'd register database

The decode tools aren't too useful to install without the xml.  But
since libxml2 can read compressed xml, we'll gzip them for installation.

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

14 months agofreedreno/registers: split header build into subdirs
Rob Clark [Sun, 2 Aug 2020 18:35:48 +0000 (11:35 -0700)]
freedreno/registers: split header build into subdirs

Instead of building the adreno/foo.xml headers from the toplevel, split
out a subdir().  This fits better with how meson likes things to be
structured.  But it does require fixing a bit about how gen_header.py
resolves imports, ie. it cannot assume the src file is at the root of
the $RNN_PATH.

This is needed for the next patch, to add support for installing the
register database for use with installed tools.

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

14 months agofreedreno/registers: add .gitignore
Rob Clark [Sun, 2 Aug 2020 17:20:38 +0000 (10:20 -0700)]
freedreno/registers: add .gitignore

Testing headergen2 will create .xml.h in the same location as the .xml.
But we don't want this to get accidentially committed.

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

14 months agofreedreno/rnn: rework RNN_DEF_PATH construction
Rob Clark [Sun, 2 Aug 2020 17:16:47 +0000 (10:16 -0700)]
freedreno/rnn: rework RNN_DEF_PATH construction

No need for rnn_path.h, just construct the whole thing in meson and pass
via c_args.  Also move where the path is constructed up one level.  This
will be needed for syncing back to envytools, where the path will be
different.

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

14 months agofreedreno/rnn: also look for .xml.gz
Rob Clark [Sun, 2 Aug 2020 17:00:02 +0000 (10:00 -0700)]
freedreno/rnn: also look for .xml.gz

libxml2 can load gzip compressed files, so lets look for these too.
This will be useful for installing the register database so that an
installed cffdump/crashdec can use them.  But it isn't too useful
to be able to edit the installed register database, so we can gzip
them to use less disk space.

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

14 months agoradv: Implement VK_EXT_4444_formats
Joshua Ashton [Wed, 15 Jul 2020 10:21:23 +0000 (11:21 +0100)]
radv: Implement VK_EXT_4444_formats

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6160>

14 months agoanv: Implement VK_EXT_4444_formats
Jason Ekstrand [Tue, 14 Jul 2020 22:59:49 +0000 (17:59 -0500)]
anv: Implement VK_EXT_4444_formats

We only support the ARGB format, not the ABGR one.  Fortunately, the
ARGB is the one required by D3D11.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6158>

14 months agovulkan: Update Vulkan XML and headers to 1.2.149
Jason Ekstrand [Mon, 3 Aug 2020 14:40:54 +0000 (09:40 -0500)]
vulkan: Update Vulkan XML and headers to 1.2.149

Reviewed-by Joshua Ashton <joshua@froggi.es>

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6158>

14 months agou_prim_restart: add inline function for getting restart index based on index size
Mike Blumenkrantz [Fri, 31 Jul 2020 15:08:04 +0000 (11:08 -0400)]
u_prim_restart: add inline function for getting restart index based on index size

handy to have this available for drivers to reuse

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