OSDN Git Service

android-x86/external-mesa.git
4 years agoradeonsi: release saved resources in si_compute_copy_image
Pierre-Eric Pelloux-Prayer [Thu, 9 Jan 2020 13:41:48 +0000 (14:41 +0100)]
radeonsi: release saved resources in si_compute_copy_image

Fixes: 1b25d340b79 ("radeonsi: use compute for resource_copy_region when possible")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 1acf714d579114ff591c00989b2e6a97de8830b8)

4 years agoradeonsi: release saved resources in si_compute_clear_render_target
Pierre-Eric Pelloux-Prayer [Thu, 9 Jan 2020 13:40:44 +0000 (14:40 +0100)]
radeonsi: release saved resources in si_compute_clear_render_target

Fixes: 984fd735152 ("radeonsi: use compute for clear_render_target when possible")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit e1e87466ae7d46c564fdd3154003ae3cddf3147b)

4 years agoradeonsi: release saved resources in si_compute_expand_fmask
Pierre-Eric Pelloux-Prayer [Thu, 9 Jan 2020 13:39:24 +0000 (14:39 +0100)]
radeonsi: release saved resources in si_compute_expand_fmask

Fixes: 095a58204d9 ("radeonsi: expand FMASK before MSAA image stores are used")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 6c019e28caf2124b13d2ea5d87e936bf43d8b4fd)

4 years agoradeonsi: release saved resources in si_retile_dcc
Pierre-Eric Pelloux-Prayer [Thu, 9 Jan 2020 13:32:11 +0000 (14:32 +0100)]
radeonsi: release saved resources in si_retile_dcc

Fixes: 1f21396431a ("radeonsi: add support for displayable DCC for multi-RB chips")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2330
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 9211cbe07a0ffb0abdaf3da68f7aa3ee00a430d7)

4 years agoanv: Flag descriptors dirty when gl_NumWorkgroups is used
Jason Ekstrand [Wed, 8 Jan 2020 20:47:11 +0000 (14:47 -0600)]
anv: Flag descriptors dirty when gl_NumWorkgroups is used

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
(cherry picked from commit ae72d1238c758404df045a82c36803dbccd93b31)

4 years agoanv: fix intel perf queries availability writes
Lionel Landwerlin [Wed, 18 Dec 2019 07:16:44 +0000 (09:16 +0200)]
anv: fix intel perf queries availability writes

The availability is not written at the location changed in
ee6fbb95a74d...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ee6fbb95a74d ("anv: Properly handle host query reset of performance queries")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 60e0db3bfb05660fb3d2c868838635d667f8966a)

4 years agomesa: Prevent _MaxLevel from being less than zero
Thong Thai [Tue, 7 Jan 2020 21:38:25 +0000 (16:38 -0500)]
mesa: Prevent _MaxLevel from being less than zero

When decoding using VDPAU, the _MaxLevel value becomes -1 due to
NumLevels being equal to 0 at a certain point, and decoding fails
due to an assertion later on.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3a4f8c8158df304af08681edbbfdfd40e43a6829)

4 years agoac/gpu_info: always use distributed tessellation on gfx10
Marek Olšák [Tue, 31 Dec 2019 02:27:02 +0000 (21:27 -0500)]
ac/gpu_info: always use distributed tessellation on gfx10

This might fix a hang on Navi14.

Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit 186335d17d69c4a6b0ad69b82fe0744e4910645e)

4 years agodocs: add SHA256 sums for 19.3.2
Dylan Baker [Thu, 9 Jan 2020 18:30:32 +0000 (10:30 -0800)]
docs: add SHA256 sums for 19.3.2

4 years agoVERSION: bump for 19.3.2
Dylan Baker [Thu, 9 Jan 2020 18:11:04 +0000 (10:11 -0800)]
VERSION: bump for 19.3.2

4 years agodocs: Add release notes for 19.3.2
Dylan Baker [Thu, 9 Jan 2020 18:10:46 +0000 (10:10 -0800)]
docs: Add release notes for 19.3.2

4 years agoanv: don't close invalid syncfd semaphore
Lionel Landwerlin [Mon, 6 Jan 2020 14:38:19 +0000 (16:38 +0200)]
anv: don't close invalid syncfd semaphore

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 4578d4ae524ad433933e077bce6a0b85643e3f25)

4 years agoradeonsi: check ctx->sdma_cs before using it
Pierre-Eric Pelloux-Prayer [Tue, 7 Jan 2020 14:57:10 +0000 (15:57 +0100)]
radeonsi: check ctx->sdma_cs before using it

e5167a9276de1f383888714b41d3a9be2b9c1da9 disabled SDMA for gfx8.
This caused 3 piglit arb_sparse_buffer tests (basic, buffer-data
and commit) to crash on GFX8.

Reported-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: e5167a9276d ("radeonsi: disable SDMA on gfx8 to fix corruption on RX 580")
(cherry picked from commit 5f8daae4d829c9f734d2f41058990809d2dba349)
Conflicts resolved by Dylan Baker

Conflicts:
src/gallium/drivers/radeonsi/si_buffer.c

4 years agomain: allow external textures for BindImageTexture
Yevhenii Kolesnikov [Thu, 2 Jan 2020 13:06:48 +0000 (15:06 +0200)]
main: allow external textures for BindImageTexture

From issue 10 of the OES_EGL_image_external_essl3:

  A limited set of use-cases is enabled by making glBindImageTexture
  accept external textures. Shaders can access such external textures
  using the existing <image2D> sampler type.

Fixes: 02a6d901eee ("mesa: add OES_EGL_image_external_essl3 support")

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ed43dd62acc045e71d73dc28b74b6a9a9d52286f)

4 years agointel/nir: Add a memory barrier before barrier()
Jason Ekstrand [Tue, 7 Jan 2020 19:20:10 +0000 (13:20 -0600)]
intel/nir: Add a memory barrier before barrier()

Our barrier instruction does not implicitly do a memory fence but the
GLSL barrier() intrinsic is supposed to.  The easiest back-portable
solution is to just add the NIR barriers.  We'll sort this out more
properly in later commits.

Cc: mesa-stable@lists.freedesktop.org
Closes: #2138
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
(cherry picked from commit 803fad43c3f9a89f0d8409bd33280b5457b104c7)

4 years agoradv: Emit a BATCH_BREAK when changing pixel shaders or CB_TARGET_MASK.
Bas Nieuwenhuizen [Sun, 5 Jan 2020 14:03:51 +0000 (15:03 +0100)]
radv: Emit a BATCH_BREAK when changing pixel shaders or CB_TARGET_MASK.

Fixes a hang on Raven with Resident Evil 2.

I did not find anything more restricted to fix it:

- Setting persistent_states_per_bin to 1 fixes it too,
  but likely does an internal break on any descriptor set changes
  too.
- Only breaking the batch when cb_target_mask changes does not fix
  it (and looking at AMDVLK comments, I suspect the code in radeonsi
  should really be doing a FLUSH_DFSM).
- Always doing a FLUSH_DFSM on shader switch helps, but that is more
  often than this and I don't think we should be doing that when DFSM
  is disabled.
- Also emitting the existing break on framebuffer change when DFSM is
  disabled does not fix the issue.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2315
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 7cc0702bbb955010600fcb2685edb4ba703561a8)

4 years agoradeonsi: disable SDMA on gfx8 to fix corruption on RX 580
Marek Olšák [Thu, 2 Jan 2020 22:29:01 +0000 (17:29 -0500)]
radeonsi: disable SDMA on gfx8 to fix corruption on RX 580

Closes: #1399
Closes: #1889

Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
(cherry picked from commit e5167a9276de1f383888714b41d3a9be2b9c1da9)

Conflicts:
src/gallium/drivers/radeonsi/si_pipe.c

4 years agocherry-ignore: update for 19.3.2
Dylan Baker [Tue, 7 Jan 2020 17:11:21 +0000 (09:11 -0800)]
cherry-ignore: update for 19.3.2

4 years agoglsl/nir: do not change an element index to have correct block name
Andrii Simiklit [Wed, 17 Jul 2019 12:05:49 +0000 (15:05 +0300)]
glsl/nir: do not change an element index to have correct block name

When SSBO array is used with packed layout, both IR tree
and as a result, NIR tree will be incorrect.
In fact, the SSBO dereference indices won't
match the array size in some cases like the following:

"layout(packed, binding=1) buffer SSBO { vec4 a; } ssbo[3];
 out vec4 color;
 void main() {
   color = ssbo[2].a;
 }"

After linking the IR and then NIR will have an SSBO array
definition with size 1 but dereference still will have index 2
and linked_shader->Program->sh.ShaderStorageBlocks
will contain just SSBO with name "SSBO[2]"

So this line should be removed at least as a workaround for now
to avoid error like:
Failed to find the block by name "SSBO[0]"

Fixes: 810dde2a "glsl/nir: Add a pass to lower UBO and SSBO access"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
(cherry picked from commit be6d51e1e3a2b2165cd21fbdda2527d10f4ce9ff)

4 years agoglsl: fix a binding points assignment for ssbo/ubo arrays
Andrii Simiklit [Tue, 5 Mar 2019 15:58:53 +0000 (17:58 +0200)]
glsl: fix a binding points assignment for ssbo/ubo arrays

This is needed to be in agreement with spec requirements:
https://github.com/KhronosGroup/OpenGL-API/issues/46

Piers Daniell:
   "We discussed this in the OpenGL/ES working group meeting
    and agreed that eliminating unused elements from the interface
    block array is not desirable. There is no statement in the spec
    that this takes place and it would be highly implementation
    dependent if it happens. If the application has an "interface"
    in the shader they need to match up with the API it would be
    quite confusing to have the binding point get compacted.
    So the answer is no, the binding points aren't affected by
    unused elements in the interface block array."

v2: - 'original_dim_size' field moved above to keep
      the struct packed better on 64-bit
    - added a comment for 'total_num_array_elements' field
    - fixed a binding point calculations for SSBOs array of arrays
          ( Ian Romanick <ian.d.romanick@intel.com> )
    - fixed binding point calculations for non-packed SSBOs
v3:
    - rename 'total_num_array_elements' to 'aoa_size'
          ( Jason Ekstrand <jason@jlekstrand.net> )
    - rename 'boffset' to 'binding_stride'
          ( Alejandro Piñeiro <apinheiro@igalia.com> )

Fixes: 8cf1333b "glsl: link uniform block arrays of arrays"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109532
Reported-By: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Fritz Koenig <frkoenig@google.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
(cherry picked from commit 4beb0a23088e68693e94599ef36eb41cbcd59289)

4 years agoglsl: fix an incorrect max_array_access after optimization of ssbo/ubo
Andrii Simiklit [Tue, 5 Mar 2019 15:38:20 +0000 (17:38 +0200)]
glsl: fix an incorrect max_array_access after optimization of ssbo/ubo

This is needed to fix these tests:
piglit.spec.arb_shader_storage_buffer_object.compiler.unused-array-element_frag
piglit.spec.arb_shader_storage_buffer_object.compiler.unused-array-element_comp

Fixes: 8cf1333b "glsl: link uniform block arrays of arrays"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109532
Reported-By: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Fritz Koenig <frkoenig@google.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
(cherry picked from commit a3c9a2881e242b9ac588d6dcb158e805fefe352d)

4 years agoradv: Only use the gfx mipmap level offset/pitch for linear textures.
Bas Nieuwenhuizen [Fri, 3 Jan 2020 10:25:31 +0000 (11:25 +0100)]
radv: Only use the gfx mipmap level offset/pitch for linear textures.

The tiled-case is non-sensical for non-base mips, but Vulkan requires
that this function handles it but at the same time does not require
returning anything useful. So we can basically return anything.

Correct tiled pitch and offset are still required for our own WSI and
in the future getting the layouts of images with DRM format modifiers.
Both don't have to deal with images with more than 1 level though.

Fixes: 824bd0830e8 "radv: return the correct pitch for linear mipmaps on GFX10"
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2301
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2304
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 17741a0a05722245314e8ce9a3d5191feb63d9bd)

4 years agoradv: return the correct pitch for linear mipmaps on GFX10
Samuel Pitoiset [Mon, 30 Dec 2019 12:47:30 +0000 (13:47 +0100)]
radv: return the correct pitch for linear mipmaps on GFX10

On GFX9, the pitch of a level is always the pitch of the entire image
but not on GFX10.

This fixes graphics glithes with Halo - The Master Chief Collection.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2188
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 824bd0830e811a7b6347bbd5c30e0a76bc7daf60)

4 years agospirv: Fix glsl type assert in spir2nir.
Bas Nieuwenhuizen [Wed, 1 Jan 2020 13:56:26 +0000 (14:56 +0100)]
spirv: Fix glsl type assert in spir2nir.

Fixes: 624789e3708 "compiler/glsl: handle case where we have multiple users for types"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 96c9483ccf5bc9116f7b754a0ccbc09097275083)

Conflicts:
src/compiler/spirv/spirv2nir.c

4 years agor600: Fix maximum line width
Gert Wollny [Sat, 28 Dec 2019 14:35:13 +0000 (15:35 +0100)]
r600: Fix maximum line width

There are only 13 bits available to store the line width, hence
it can't be larger than 8191

v2: Add Fixes tag

v3: - Unify value since for all r600 archs (Konstantin Kharlamov)
    - Correct the value the line width value is emitted as a 12.4
      fixed point value of 1/2 line width on r600-r700 and as
      8 * line width on Evergreen and newer.

Fixes: 06bfb2d28f7adca7edc6be9c210a7a3583023652
    r600: fork and import gallium/radeon

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Konstantin Kharlamov <hi-angel@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3286>
(cherry picked from commit e8559ae4484c3240c81c0cbf49caf5be338f8395)

4 years agoanv: Ignore some CreateInfo structs when rasterization is disabled
Caio Marcelo de Oliveira Filho [Fri, 3 Jan 2020 21:23:32 +0000 (13:23 -0800)]
anv: Ignore some CreateInfo structs when rasterization is disabled

According to the description of VkGraphicsPipelineCreateInfo(),
pViewportState, pMultisampleState, pDepthStencilState and
pColorBlendState must be ignored when rasterization is not enabled.

This avoids potentially invalid pointers being dereferenced when
rasterization is disabled.  Tested with `demos_x64 VK_Parameter_Zoo`
from Renderdoc repository.

v2: Don't store the `raster_enabled` as part of anv_pipeline, just
    query it from the create info.  This avoids storing a state that's
    only used during pipeline creation. (Jason)

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2258
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v1]
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 75a19186b2aad7e588f04e1c554cdfd315dd848a)

4 years agonir: Add clone/hash/serialize support for non-uniform tex instructions.
Bas Nieuwenhuizen [Wed, 1 Jan 2020 13:42:58 +0000 (14:42 +0100)]
nir: Add clone/hash/serialize support for non-uniform tex instructions.

These were missed when the fields got added. Added it everywhere where
texture_index got used and it made sense.

Found this in "The Surge 2", where the inliner does not copy the fields,
resulting in corruption and hangs.

Fixes: 3bd54576415 "nir: Add a lowering pass for non-uniform resource access"
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1203
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3246>
(cherry picked from commit 69bdc1c5fccbd9c0ef5354675b069ffb1383769e)

4 years agoaco: Fix uniform i2i64.
Timur Kristóf [Tue, 31 Dec 2019 12:39:56 +0000 (13:39 +0100)]
aco: Fix uniform i2i64.

Fixes 240 failing test cases in dEQP-VK.spirv_assembly which
were failing due to a bad s_ashr_i32 instruction. This commit
fixes the instruction format along with the definitions of the
instruction.

Fixes: 11f43caaeca166c96ae49dbd506b6f58dd4a13fb
Cc: 19.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit 11e62a9734c631fa38f1e7b415f5b98f6a28589f)

4 years agowinsys/radeon: initialize pte_fragment_size
Marek Olšák [Fri, 27 Dec 2019 23:02:33 +0000 (18:02 -0500)]
winsys/radeon: initialize pte_fragment_size

Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Closes: #2179

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 84b82f8cd1c9d0a03e68af3a68fb0b009be70780)

4 years agometa: Cleanup function for DrawTex
Yevhenii Kolesnikov [Fri, 19 Jul 2019 12:10:25 +0000 (15:10 +0300)]
meta: Cleanup function for DrawTex

Buffer object was never freed, causing memory leaks.

Fixes: 76cfe2bc443 ("meta: Don't pollute the buffer object namespace in _mesa_meta_DrawTex")
CC: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1390>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1390>
(cherry picked from commit b318bc2072d42a58b491dac3aa6118012d92e5bb)

4 years agoamd/common: Handle alignment of 96-bit formats.
Bas Nieuwenhuizen [Mon, 23 Dec 2019 01:02:20 +0000 (02:02 +0100)]
amd/common: Handle alignment of 96-bit formats.

addrlib doesn't quite do it right, so do it ourselves.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2162
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 88f567b5ce3c692dbee60ba58df3af7c614e4333)

4 years agomesa: avoid returning a value in a void function
Eric Engestrom [Fri, 27 Dec 2019 21:50:24 +0000 (21:50 +0000)]
mesa: avoid returning a value in a void function

Fixes: 1d1722e91070d7c37687 ("mesa: add EXT_dsa NamedProgram functions")
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit a6873a8df2393777975ae3043a395d79e495b365)

4 years agonine: fix empty-body-issues
Eric Engestrom [Thu, 31 Oct 2019 01:26:05 +0000 (01:26 +0000)]
nine: fix empty-body-issues

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 8d43e2b2ded0fe3c82d4 ("meson: add -Werror=empty-body to disallow `if(x);`")
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
(cherry picked from commit ff3a2576a45e012b1cd8fbf73b9967083d6fce0e)

4 years agoamd: fix empty-body issues
Eric Engestrom [Mon, 28 Oct 2019 23:47:48 +0000 (23:47 +0000)]
amd: fix empty-body issues

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 8d43e2b2ded0fe3c82d4 ("meson: add -Werror=empty-body to disallow `if(x);`")
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
(cherry picked from commit 51569e525afc5e7173f12b0a3f1ba0e92425407f)

4 years agoutil/format: remove left-over util_format_description_table declaration
Eric Engestrom [Thu, 7 Nov 2019 17:29:00 +0000 (17:29 +0000)]
util/format: remove left-over util_format_description_table declaration

Fixes: 3c45c4bc44310c1af4f0 ("util: Cope with the fact that formats in u_format.csv are not ordered.")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit cc7a64f101be0939c17231257701230859dee90d)

4 years agoradv: Expose all sample counts for integer formats as well.
Bas Nieuwenhuizen [Tue, 24 Dec 2019 13:44:03 +0000 (14:44 +0100)]
radv: Expose all sample counts for integer formats as well.

Things work the same between float and integer.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2261
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit a435f002c40f5adc99d37e65cf6b8bd478dc8e71)

4 years agoanv: Properly advertise sampledImageIntegerSampleCounts
Jason Ekstrand [Tue, 24 Dec 2019 04:19:29 +0000 (22:19 -0600)]
anv: Properly advertise sampledImageIntegerSampleCounts

We support the same set of samples for integer color formats as for
non-integer.  We've been advertising it wrong since before the initial
Vulkan 1.0 release. :-(

Fixes: d68974530371 "vk/0.210.0: Rework device features and limits"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit ac70442ce1f061a42649f7c88c6a8d278fb73fb5)

4 years agoradeon/vcn2: enable rate control for hevc encoding
Pierre-Eric Pelloux-Prayer [Tue, 17 Dec 2019 09:41:39 +0000 (10:41 +0100)]
radeon/vcn2: enable rate control for hevc encoding

Based on b0626c1f306 ("radeon/vcn: enable rate control for hevc encoding").

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2225
Fixes: 587b9c5dae6 ("radeon/vcn: implement vcn 2.0 encode")
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3134>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3134>
(cherry picked from commit 9c2a3b4e7566108ad336c253e3cd0fcb2629ae6d)

4 years agoetnaviv: update resource status after flushing
Christian Gmeiner [Fri, 29 Nov 2019 08:44:43 +0000 (09:44 +0100)]
etnaviv: update resource status after flushing

Currently piglit spec@arb_occlusion_query@occlusion_query_conform
spins for ever as the resource status is never reset. See
etna_hw_get_query_result(..) for more details.

Fixes: 1456aa61cc5 ("etnaviv: Rework resource status tracking")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Marek Vasut <marex@denx.de>
(cherry picked from commit 6e75f2172b5cc9298dee6f17e55bed60ce0c15fb)

4 years agoradv/gfx10: fix the out-of-bounds check for vertex descriptors
Samuel Pitoiset [Wed, 18 Dec 2019 12:29:39 +0000 (13:29 +0100)]
radv/gfx10: fix the out-of-bounds check for vertex descriptors

When stride is 0, it should check against the offset not the index.

This fixes black character models with Beat Saber and missing snow
with Dragon Quest.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2233
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1975
Cc: <mesa-stable@lists.freedesktop.org>
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/3147>
(cherry picked from commit f3cccd05d9f6e9d05c18d1a3a5f9eb863e4f264b)

4 years agoloader: fix close on uninitialized file descriptor value
Lionel Landwerlin [Wed, 18 Dec 2019 15:48:26 +0000 (17:48 +0200)]
loader: fix close on uninitialized file descriptor value

Using a drm syscall layer faking a kernel driver :

  ==581460== Conditional jump or move depends on uninitialised value(s)
  ==581460==    by 0x48A4C2B: close (drm-hooks.cpp:185)
  ==581460==    by 0x5A815F1: dri3_alloc_render_buffer (loader_dri3_helper.c:1469)
  ==581460==    by 0x5A82050: dri3_get_buffer (loader_dri3_helper.c:1827)
  ==581460==    by 0x5A82662: loader_dri3_get_buffers (loader_dri3_helper.c:2028)
  ==581460==    by 0x6C78109: intel_update_image_buffers (brw_context.c:1870)
  ==581460==    by 0x6C77805: intel_update_renderbuffers (brw_context.c:1499)
  ==581460==    by 0x6C7789D: intel_prepare_render (brw_context.c:1520)
  ==581460==    by 0x6C773D4: intelMakeCurrent (brw_context.c:1341)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 069fdd5f9fac ("egl/x11: Support DRI3 v1.1")
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3152>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3152>
(cherry picked from commit fc2552b6445a1295c18acf8798411da85bbc5387)

4 years agoradv: Limit workgroup size to 1024.
Bas Nieuwenhuizen [Wed, 18 Dec 2019 09:21:40 +0000 (10:21 +0100)]
radv: Limit workgroup size to 1024.

Fixes a hang with geekbench.

The existence of RX 580 and NAVI10 results shows that the generations
before and after this do not have the issue. (They show up on the
website). So this is likely a GFX9 only issue.

This is not something weird like LDS size since none of the shaders
seem to use LDS.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3145>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3145>
(cherry picked from commit a9a3108be774aea620fa4fc726c33100d9a49add)

4 years agointel/vec4: Fix lowering of multiplication by 16-bit constant
Caio Marcelo de Oliveira Filho [Mon, 16 Dec 2019 22:43:53 +0000 (14:43 -0800)]
intel/vec4: Fix lowering of multiplication by 16-bit constant

Existing code was ignoring whether the type of the immediate source
was signed or not.  If the source was signed, it would ignore small
negative values but it also would wrongly accept values between
INT16_MAX and UINT16_MAX, causing the atual value to later be
reinterpreted as a negative number (under 16-bits).

Fixes tests/shaders/glsl-mul-const.shader_test in Piglit for older
platforms that don't support MUL with 32x32 types and use vec4.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 766fdeccf943d090694d4fbeebbe470904481d32)

4 years agointel/fs: Fix lowering of dword multiplication by 16-bit constant
Caio Marcelo de Oliveira Filho [Mon, 16 Dec 2019 21:37:41 +0000 (13:37 -0800)]
intel/fs: Fix lowering of dword multiplication by 16-bit constant

Existing code was ignoring whether the type of the immediate source
was signed or not.  If the source was signed, it would ignore small
negative values but it also would wrongly accept values between
INT16_MAX and UINT16_MAX, causing the atual value to later be
reinterpreted as a negative number (under 16-bits).

Fixes tests/shaders/glsl-mul-const.shader_test in Piglit for platforms
that don't support MUL with 32x32 types, including ICL and TGL.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2186
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 2137be22fa2c75eda462456f2b7778684d0631fc)

4 years agointel/fs: Lower 64-bit MOVs after lower_load_payload()
Caio Marcelo de Oliveira Filho [Thu, 12 Dec 2019 21:25:33 +0000 (13:25 -0800)]
intel/fs: Lower 64-bit MOVs after lower_load_payload()

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit c06ba8358958279cfad6cdf2a52d9824a818f0b8)

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3130>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3130>

4 years agodcos: add releanse notes for 19.3.1
Dylan Baker [Wed, 18 Dec 2019 18:56:33 +0000 (10:56 -0800)]
dcos: add releanse notes for 19.3.1

4 years agoVERSION: bump version for 19.3.1
Dylan Baker [Wed, 18 Dec 2019 18:34:24 +0000 (10:34 -0800)]
VERSION: bump version for 19.3.1

4 years agodocs: remove new_features.txt from stable branch
Dylan Baker [Wed, 18 Dec 2019 18:33:20 +0000 (10:33 -0800)]
docs: remove new_features.txt from stable branch

Now that the .0 is done, we shouldn't have any more new features added
to the branch

4 years agomesa: avoid triggering assert in implementation
Lionel Landwerlin [Mon, 16 Dec 2019 15:58:41 +0000 (17:58 +0200)]
mesa: avoid triggering assert in implementation

When tearing down a GL context with an active performance query, the
implementation can be confused by a query marked active when it's
being deleted.

This shouldn't happen in the implementation because the context will
already be idle.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2235
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115>
(cherry picked from commit 2c8742ed858c6446c93bddec117abf467a393c35)

4 years agoi965: expose MESA_FORMAT_B8G8R8X8_SRGB visual
Tapani Pälli [Fri, 15 Nov 2019 07:18:10 +0000 (09:18 +0200)]
i965: expose MESA_FORMAT_B8G8R8X8_SRGB visual

Patch adds BGRX sRGB visuals, required format translation information
to the __DRI_IMAGE_FOURCC_SXRGB8888 format and makes all BGRX visuals
sRGB capable just like is done with BGRA.

squashed patches from Yevhenii Kolesnikov:
  dri: Add __DRI_IMAGE_FOURCC_SXRGB8888 conversion
  i965: force visuals without alpha bits to use sRGB

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1501
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
(cherry picked from commit 75caae2268f5c70b1f3005df8618876341ac14fd)

4 years agodri: add __DRI_IMAGE_FORMAT_SXRGB8
Tapani Pälli [Fri, 15 Nov 2019 07:12:15 +0000 (09:12 +0200)]
dri: add __DRI_IMAGE_FORMAT_SXRGB8

Add format definition and required plumbing to create images.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
(cherry picked from commit 8b6b5ce6691c80f3254964b746499d5ca75b59b1)

4 years agovirgl: Increase the shader transfer buffer by doubling the size
Gert Wollny [Mon, 16 Dec 2019 20:48:09 +0000 (21:48 +0100)]
virgl: Increase the shader transfer buffer by doubling the size

With only linearly increasing the size of the shader transfer buffer
the transfer of very large shaders may fail, so with each attempt double
the size of the buffer.

CTS:
  dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.48
  for VTK-GL-CTS b5dcfb9c5 and newer

virglrenderer bug:
  https://gitlab.freedesktop.org/virgl/virglrenderer/issues/150

Fixes: a8987b88ff1db4ac00720a9b56c4bc3aeb666537
    virgl: add driver for virtio-gpu 3D (v2)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3121>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3121>
(cherry picked from commit cffa7bb99084eb9e5988c2be4427f6b188cc7bbe)

4 years agoanv: Export filter_minmax support only when it's really supported
Iván Briano [Fri, 13 Dec 2019 00:07:19 +0000 (16:07 -0800)]
anv: Export filter_minmax support only when it's really supported

Fixes: bea4d4c78c3 ("anv: add VK_EXT_sampler_filter_minmax support")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3071>
(cherry picked from commit 0fd93b95898f8048ced8aa9f8db5472d4309b9e0)

4 years agoamd/common: Always use addrlib for HTILE tc-compat.
Bas Nieuwenhuizen [Thu, 12 Dec 2019 11:10:58 +0000 (12:10 +0100)]
amd/common: Always use addrlib for HTILE tc-compat.

Even without depth+stencil addrlib can (correctly!) decide to
disable tc compatible HTILE.

One example is 8x sampling with 32-bit depth on Stoney. The row size
on Stoney is 1024, while the tile size is 2048, which results in
tile splits which are not supported with tc-compat.

On Stoney, this fixes
dEQP-VK.glsl.builtin_var.fragdepth.*_list_d32_sfloat_multisample_8

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3054>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3054>
(cherry picked from commit b53856aca31b1a1fde8cd87a6978934cd6ae94b1)

4 years agoamd/common: Fix tcCompatible degradation on Stoney.
Bas Nieuwenhuizen [Wed, 11 Dec 2019 15:04:58 +0000 (16:04 +0100)]
amd/common: Fix tcCompatible degradation on Stoney.

addrlib sometimes returns smaller sizes for tcCompat as it does
not seem to take into account the depth+stencil matching config
gymnastics with tcCompat.

This fixes
dEQP-VK.pipeline.render_to_image.core.2d_array.huge.height.r8g8b8a8_unorm_d32_sfloat_s8_uint

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3054>
(cherry picked from commit e197fb1c2fccf4719630d91a7c7f76308d88132b)

4 years agoradv: fix radv secure compile feature breaks compilation on armhf EABI and aarch64
Luis Mendes [Sat, 9 Nov 2019 23:21:05 +0000 (23:21 +0000)]
radv: fix radv secure compile feature breaks compilation on armhf EABI and aarch64

__NR_select is not defined the same way across architectures, sometimes is
not even defined, like in armhf EABI and aarch64.

Signed-off-by: Luis Mendes <luis.p.mendes@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2042
(cherry picked from commit 0cb5c96a83e3da2986fc8219b10671a7caea9ee5)

4 years agoanv: fix fence underlying primitive checks
Lionel Landwerlin [Wed, 11 Dec 2019 23:58:01 +0000 (01:58 +0200)]
anv: fix fence underlying primitive checks

We appear to have got lucky that the only type of temporary fence
payload we could have was a syncobj and that would only happen when
the type of the permanent payload was also a syncobj.

This code was broken if that assumption changed and it did in commit
f9a3d9738b12.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
(cherry picked from commit 52bc235f2adcae8a3f40c74b15c9aad9e2b5c5b9)

4 years agoiris: Default to X-tiling for scanout buffers without modifiers
Kenneth Graunke [Wed, 11 Dec 2019 17:49:38 +0000 (09:49 -0800)]
iris: Default to X-tiling for scanout buffers without modifiers

Neither Mutter nor KWin's wayland compositors appear to use modifiers.
In the non-modifier case, iris was still trying to use Y-tiling for
scan-out surfaces, leading to this error:

(gnome-shell:7247): mutter-WARNING **: 09:23:47.787: meta_drm_buffer_gbm_new failed: drmModeAddFB failed: Invalid argument

We now fall back to the historical X-tiling for scanout buffers, which
ought to work everyone, at lower performance.  To regain that, we need
to ensure modifiers are actually supported in environments people use.

Fixes: fbf31247710 ("iris: Rework tiling/modifiers handling")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit dcb4230e5e51c1f2ff84c436134c231996af85e9)

4 years agocherry-ignore: update for the 19.3.1 cycle
Dylan Baker [Thu, 12 Dec 2019 18:22:03 +0000 (10:22 -0800)]
cherry-ignore: update for the 19.3.1 cycle

4 years agodocs/19.3.0: Add SHA256 sums
Dylan Baker [Thu, 12 Dec 2019 19:55:00 +0000 (11:55 -0800)]
docs/19.3.0: Add SHA256 sums

4 years agoVERSION: bump for 19.3.0 final
Dylan Baker [Thu, 12 Dec 2019 19:21:58 +0000 (11:21 -0800)]
VERSION: bump for 19.3.0 final

4 years agodocs: add release notes for 19.3.0
Dylan Baker [Thu, 12 Dec 2019 19:21:43 +0000 (11:21 -0800)]
docs: add release notes for 19.3.0

4 years agoRevert "egl: move #include of local headers out of Khronos headers"
Dylan Baker [Thu, 12 Dec 2019 17:24:42 +0000 (09:24 -0800)]
Revert "egl: move #include of local headers out of Khronos headers"

This reverts commit 87efb9f3a4f366372bc873dee741a2c2f272e5c9.

This is breaking the QT build, so it needs to go until these symbols can
make their way to upstream khronos

4 years agoRevert "egl: avoid local modifications for eglext.h Khronos standard header file"
Dylan Baker [Thu, 12 Dec 2019 17:23:54 +0000 (09:23 -0800)]
Revert "egl: avoid local modifications for eglext.h Khronos standard header file"

This reverts commit 2a497735ec75cfc5edaff378613e3b145b3bb22d.

This patch is built on the previous patch, which needs to be reverted.

4 years agoanv: fix incorrect VMA alignment for CCS main surfaces
Lionel Landwerlin [Tue, 10 Dec 2019 11:49:49 +0000 (03:49 -0800)]
anv: fix incorrect VMA alignment for CCS main surfaces

Maybe finer way of dealing with this requirement would be to increase
the number of pdevice->memory.types[] to add a category for special
alignment cases.

Meanwhile this fixes the problem of CCS surface alignment and it's
probably not going to cause issues given the size of our address
space.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6af8a4acc4a4 ("anv: Add aux-map translation for gen12+")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 5fdea9f40182002899fc941bfb8c3f36ed5366a1)

4 years agoac/nir: fix out-of-bound access when loading constants from global
Samuel Pitoiset [Tue, 10 Dec 2019 16:46:26 +0000 (17:46 +0100)]
ac/nir: fix out-of-bound access when loading constants from global

Global load/store instructions can't know if the offset is
out-of-bound because they don't use descriptors (no range).

Fix this by clamping the offset for arrays that are indexed
with a non-constant offset that's greater or equal to the array
size.

This fixes VM faults and GPU hangs with Dead Rising 4.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2148
Fixes: 71a67942003 ("ac/nir: Enable nir_opt_large_constants")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit a0f1a5fa051786c16de6f0062771051f8565daec)

4 years agoradeonsi: use gfx9.surf_offset to compute texture offset
Pierre-Eric Pelloux-Prayer [Fri, 6 Dec 2019 20:35:38 +0000 (21:35 +0100)]
radeonsi: use gfx9.surf_offset to compute texture offset

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2177
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ff0f10866699a22216fd1a4af6cdb89c2fea10e1)

4 years agoandroid: radeonsi: fix build after vl refactoring (v2)
Mauro Rossi [Sat, 16 Nov 2019 17:39:31 +0000 (18:39 +0100)]
android: radeonsi: fix build after vl refactoring (v2)

vl functions moved from radeonsi to gallium/auxiliary/vl have left
android build of radeonsi in broken state.

libmesa_galliumvl static is need to build readeonsi,
gallium_dri building rules are reworked to avoid multiple symbols
and libmesa_galliumvl static dependency is needed in radeonsi.

Here is the changelog:
- android: gallium/auxiliary: add libmesa_galliumvl static
- android: gallium_dri: move libmesa_gallium to static to prevent multiple symbols
- android: radeonsi: fix build after vl refactoring

Fixes the following building error:

external/mesa/src/gallium/drivers/radeonsi/si_uvd.c:47:
error: undefined reference to 'vl_video_buffer_create_as_resource'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes: 86e60bc ("radeonsi: remove si_vid_join_surfaces and use combined planar allocations")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 96aef08dc6f4ea4a79cdf995d867d08e8f838b2a)
Conflicts Resolved by Dylan Baker

Conflicts:
src/gallium/targets/dri/Android.mk

Panfrost is not enabled for android in 19.3, and the series is a bit
bigger than I'd like to pull into the stable branch for a .0 release

4 years agoanv: Don't leak when set_tiling fails
Jason Ekstrand [Mon, 2 Dec 2019 19:51:59 +0000 (13:51 -0600)]
anv: Don't leak when set_tiling fails

Fixes: a44744e01d73 "anv: Require a dedicated allocation for..."
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 0a36fafa95175efbad1a61b36706e535929afd2b)
Conflicts resolved by Dylan Baker

Conflicts:
src/intel/vulkan/anv_device.c

4 years agoiris: Fix import of multi-planar surfaces with modifiers
Nanley Chery [Fri, 15 Nov 2019 17:17:23 +0000 (09:17 -0800)]
iris: Fix import of multi-planar surfaces with modifiers

Multi-planar surfaces are allowed to have modifiers. Don't require
DRM_FORMAT_MOD_INVALID in order to create a surface for each plane
defined by the format.

Fixes: 246eebba4a8 ("iris: Export and import surfaces with modifiers that have aux data")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 21376cffb37018160ad3eef38b5a640ba1675a4f)

4 years agoiris: try to set the specified tiling when importing a dmabuf
James Xiong [Thu, 4 Apr 2019 15:27:33 +0000 (08:27 -0700)]
iris: try to set the specified tiling when importing a dmabuf

When importing a dmabuf with a specified tiling, the dmabuf user
should always try to set the tiling mode because: 1) the exporter
can set tiling AFTER exporting/importing. 2) a dmabuf could be
exported from a kernel driver other than i915, in this case the
dmabuf user and exporter need to set tiling separately.

This patch fixes a problem when running vkmark under weston with
iris on ICL, it crashed to console with the following assert. i965
doesn't have this problem as it always tries to set the specified
tiling mode.

weston: ../src/gallium/drivers/iris/iris_resource.c:990: iris_resource_from_handle: Assertion `res->bo->tiling_mode == isl_tiling_to_i915_tiling(res->surf.tiling)' failed.

Signed-off-by: James Xiong <james.xiong@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
(cherry picked from commit b6d45e7f748e9ff7e198391f5ce5d1253101fedb)

4 years agogallium: Store the image format in winsys_handle
Nanley Chery [Fri, 15 Nov 2019 22:10:38 +0000 (14:10 -0800)]
gallium: Store the image format in winsys_handle

This format will be used to properly handle planar images with modifiers
in iris.

Fixes: 246eebba4a8 ("iris: Export and import surfaces with modifiers that have aux data")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 51ee8fff9b5e803592a2fd34730fdcfdfba469cb)

4 years agoradv: Fix RGBX Android<->Vulkan format correspondence.
Bas Nieuwenhuizen [Tue, 10 Dec 2019 15:53:56 +0000 (16:53 +0100)]
radv: Fix RGBX Android<->Vulkan format correspondence.

This is correct per the Vulkan spec format equivalence table.

Fixes: f36b52740a0 "radv/android: Add android hardware buffer queries."
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2e44bfc14f5c2e44ed820257615c2008955bc5bf)

4 years agomeson/broadcom: libbroadcom_cle also needs zlib
Dylan Baker [Tue, 10 Dec 2019 19:15:37 +0000 (11:15 -0800)]
meson/broadcom: libbroadcom_cle also needs zlib

Fixes: 1ae8018a6af81eec4832a57d9d0346aa3dd98d28
       ("meson: Add support for the vc4 driver.")
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d0eebda99088d15199aa0ae2c2d62ab6939568ce)

4 years agomeson/broadcom: libbroadcom_cle needs expat headers
Dylan Baker [Tue, 10 Dec 2019 18:19:04 +0000 (10:19 -0800)]
meson/broadcom: libbroadcom_cle needs expat headers

Fixes: 1ae8018a6af81eec4832a57d9d0346aa3dd98d28
       ("meson: Add support for the vc4 driver.")
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 85a9698ac3a032aa8e2e71ff804b489749a754ec)

4 years agoanv: fix missing gen12 handling
Lionel Landwerlin [Tue, 10 Dec 2019 11:49:16 +0000 (03:49 -0800)]
anv: fix missing gen12 handling

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 181be14d4303 ("anv: Build for gen12")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit dcfe1903c3f501429851d0278ba78742e907355b)

4 years agoradeonsi: fix multi plane buffers creation
Pierre-Eric Pelloux-Prayer [Mon, 9 Dec 2019 08:48:37 +0000 (09:48 +0100)]
radeonsi: fix multi plane buffers creation

When using 3 planes, the sequence produces this chain:
  plane0 -> plane2
This commit fixes this to produce:
  plane0 -> plane1 -> plane2

Fixes: 86e60bc2659 ("radeonsi: remove si_vid_join_surfaces and use combined planar allocations")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2193
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit e3e91cebcd9307654eb3535e2f6521103ec8b997)

4 years agogallium/util: Support POLYGON in u_stream_outputs_for_vertices
Alyssa Rosenzweig [Fri, 6 Dec 2019 21:45:57 +0000 (16:45 -0500)]
gallium/util: Support POLYGON in u_stream_outputs_for_vertices

u_decomposed_prims_for_vertices cannot support POLYGON, but POLYGON is
trivial to support as a special case directly (since we have the number
of vertices directly).

Fixes aborts in Panfrost in apps using GL_POLYGON.

Fixes: e881aa8c12c ("gallium/util: Add u_stream_outputs_for_vertices helper")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Revewied-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a37822f5f740c55cd6f848adfd6c3d567ae4fd79)

4 years agoanv: Re-emit all compute state on pipeline switch
Jason Ekstrand [Sat, 7 Dec 2019 00:26:59 +0000 (18:26 -0600)]
anv: Re-emit all compute state on pipeline switch

It's a very odd case to hit in the real world.  However, there are some
CTS tests which switch back and forth between dispatch and clear without
changing the pipeline.

Fixes: bc612536eb2f "anv: Emit a dummy MEDIA_VFE_STATE before switching..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
(cherry picked from commit 0f60aa4037dfb6aa86d5b9524fe649f13b2b8825)

4 years agofreedreno: reorder format check
Fritz Koenig [Thu, 5 Dec 2019 00:16:43 +0000 (16:16 -0800)]
freedreno: reorder format check

With the addition of the planar formats helper, the
planar formats no longer have a valid block.bits field.
Calling util_format_get_blocksize therefore asserts.

Reorder the check to see if the format is supported
before doing the query to get the blocksize.

Fixes: 20f132e5eff2d ("gallium/util: add planar format layouts and helpers")

Signed-off-by: Fritz Koenig <frkoenig@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
(cherry picked from commit c496d442844183968f7c4903c8ed549aa990d15f)

4 years agogallium/dri2: Fix creation of multi-planar modifier images
Nanley Chery [Thu, 14 Nov 2019 21:59:58 +0000 (13:59 -0800)]
gallium/dri2: Fix creation of multi-planar modifier images

The commit noted below assumed and enforced that DRM_MOD_INVALID was the
only valid modifier for multi-planar imported images. Due to that, it
required that modifier on multi-planar images to:

   1. Allow multiple planes.
   2. Perform YUV format lowering and extent adjustments.
   3. Use buffer_index to correctly map the given planes.

Fix these issues by removing or updating the code built on that
assumption.

Fixes: 2066966c106 ("gallium/dri2: Support creating multi-planar modifier images")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d5c857837aae205c0e1fddee30300b4419e2bb3f)

4 years agoglsl/nir: iterate the system values list when adding varyings
Timothy Arceri [Thu, 5 Dec 2019 04:01:14 +0000 (15:01 +1100)]
glsl/nir: iterate the system values list when adding varyings

Iterate the system values list when adding varyings to the program
resource list in the NIR linker. This is needed to avoid CTS
regressions when using the NIR to build the GLSL resource list in
an upcoming series. Presumably it also fixes a bug with the current
ARB_gl_spirv support.

Fixes: ffdb44d3a0a2 ("nir/linker: Add inputs/outputs to the program resource list")

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
(cherry picked from commit 1abca2b3c84a42ab64c466bc209db42c41bba5e3)

4 years agointel/compiler: Fix 'comparison is always true' warning
Ian Romanick [Tue, 19 Nov 2019 03:16:23 +0000 (19:16 -0800)]
intel/compiler: Fix 'comparison is always true' warning

Without looking at the assembly or something, I'm not sure what the
compiler does here.  The brw_reg_type enum is marked packed, so I'm
guess that it gets represented as a uint8_t.  That's the only reason I
could think that comparing with -1 would be always true.

This patch adds the same cast that exists in brw_hw_type_to_reg_type.
It might be better to add a #define outside the enum for
BRW_REGISTER_TYPE_INVALID as (enum brw_reg_type)-1.

src/intel/compiler/brw_eu_compact.c: In function ‘has_immediate’:
src/intel/compiler/brw_eu_compact.c:1515:20: warning: comparison is always true due to limited range of data type [-Wtype-limits]
 1515 |       return *type != -1;
      |                    ^~
src/intel/compiler/brw_eu_compact.c:1518:20: warning: comparison is always true due to limited range of data type [-Wtype-limits]
 1518 |       return *type != -1;
      |                    ^~

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
CID: 1455194
Fixes: 12d3b11908e ("intel/compiler: Add instruction compaction support on Gen12")
Cc: @mattst88
(cherry picked from commit 668635abd26dda458f9293f99dd39f56431a4d61)

4 years agonir/lower_clip: Fix incorrect driver loc for clipdist outputs
Rob Clark [Wed, 4 Dec 2019 00:28:26 +0000 (16:28 -0800)]
nir/lower_clip: Fix incorrect driver loc for clipdist outputs

Somehow adjusting maxloc based on existing outputs got lost, resulting
in the clipdist varying clobbering the position varying.  Causing a
shader that had no position output in freedreno/ir3, which triggers GPU
hangs in neverball.

Fixes: d0f746b6458 ("nir: Save nir_variable pointers in nir_lower_clip_vs rather than locs.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
(cherry picked from commit 372ed42d222a274abe712b62f4b037cbeb6fddb5)

4 years agocherry-ignore: update for 19.3-rc7
Dylan Baker [Wed, 4 Dec 2019 21:01:02 +0000 (13:01 -0800)]
cherry-ignore: update for 19.3-rc7

4 years agointel/perf: fix improper pointer access
Lionel Landwerlin [Tue, 3 Dec 2019 14:35:45 +0000 (16:35 +0200)]
intel/perf: fix improper pointer access

This expression was unused by the macro, probably why it didn't
register in the compilation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ddacd3d43b203e7c66ec366820e2a230b7e3aa67)

4 years agointel/perf: simplify the processing of OA reports
Lionel Landwerlin [Tue, 3 Dec 2019 14:33:25 +0000 (16:33 +0200)]
intel/perf: simplify the processing of OA reports

This is a more accurate description of what happens in processing the
OA reports.

Previously we only had a somewhat difficult to parse state machine
tracking the context ID.

What we really only need to do to decide if the delta between 2
reports (r0 & r1) should be accumulated in the query result is :

   * whether the r0 is tagged with the context ID relevant to us

   * if r0 is not tagged with our context ID and r1 is: does r0 have a
     invalid context id? If not then we're in a case where i915 has
     resubmitted the same context for execution through the execlist
     submission port

v2: Update comment (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8c0b05826304370ef9e5f1e607d0f0305a0eb759)

4 years agointel/perf: take into account that reports read can be fairly old
Lionel Landwerlin [Tue, 3 Dec 2019 14:19:24 +0000 (16:19 +0200)]
intel/perf: take into account that reports read can be fairly old

If we read the OA reports late enough after the query happens, we can
get a timestamp in the report that is significantly in the past
compared to the start timestamp of the query. The current code must
deal with the wraparound of the timestamp value (every ~6 minute). So
consider that if the difference is greater than half that wraparound
period, we're probably dealing with an old report and make the caller
aware it should read more reports when they're available.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b364e920bf8c6805bcc3ff1cedf6b77dbb61b1e0)

4 years agointel/perf: set read buffer len to 0 to identify empty buffer
Lionel Landwerlin [Tue, 3 Dec 2019 14:12:03 +0000 (16:12 +0200)]
intel/perf: set read buffer len to 0 to identify empty buffer

We always add an empty buffer in the list when creating the query.
Let's set the len appropriately so that we can recognize it when we
read OA reports up to the end of a query.

We were using an 0 timestamp value associated with the empty buffer
and incorrectly assuming this was a valid value. In turn that led to
not reading enough reports and resulted in deltas added to our counter
values which should have been discarded because those would be flagged
for a different context.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9d0a5c817ce21adabeda5153035b30609e2862b2)

4 years agointel/perf: fix invalid hw_id in query results
Lionel Landwerlin [Tue, 3 Dec 2019 14:08:12 +0000 (16:08 +0200)]
intel/perf: fix invalid hw_id in query results

Accumulation happens between 2 reports, it can be between a start/end
report from another context. So only consider updating the hw_id of
the results when it's not already valid and that we have a valid value
to put in there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 41b54b5faf ("i965: move OA accumulation code to intel/perf")
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit acea59dbf8056b46444c820115d86c42d0411686)

4 years agoVERSION: bump version for 19.3-rc6
Dylan Baker [Wed, 4 Dec 2019 21:14:01 +0000 (13:14 -0800)]
VERSION: bump version for 19.3-rc6

4 years agoaco: fix a couple of value numbering issues
Daniel Schürmann [Fri, 29 Nov 2019 15:47:13 +0000 (16:47 +0100)]
aco: fix a couple of value numbering issues

Fixes: 3a20ef4a3299fddc886f9d5908d8b3952dd63a54 'aco: refactor value numbering'

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
4 years agoanv: Set up SBE_SWIZ properly for gl_Viewport
Jason Ekstrand [Tue, 26 Nov 2019 21:08:43 +0000 (15:08 -0600)]
anv: Set up SBE_SWIZ properly for gl_Viewport

gl_Viewport is also in the VUE header so we need to whack the read
offset to 0 and emit a default (no overrides) SBE_SWIZ entry in that
case as well.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit b1f37688ba717db81a7e9c97e2a875d528d85112)

4 years agoiris: Allow max dynamic pool size of 2GB for gen12
Jordan Justen [Sat, 25 May 2019 08:33:17 +0000 (01:33 -0700)]
iris: Allow max dynamic pool size of 2GB for gen12

Reworks:
 * Adjust comment to list the state packets that curro found to be
   affected.

Fixes: 8125d7960b6 ("intel/dev: Add preliminary device info for Tigerlake")
Cc: 19.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit e277009d8dbdc9aec4be26aed5357ec41f359937)

4 years agonir/lower_io_to_vector: don't create arrays when not needed
Rhys Perry [Thu, 14 Nov 2019 15:31:52 +0000 (15:31 +0000)]
nir/lower_io_to_vector: don't create arrays when not needed

Some backends require that there are no array varyings.

If there were no arrays in the input shader, the pass shouldn't have to
create new ones.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2103
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2167
Fixes: bcd14756eec ('nir/lower_io_to_vector: add flat mode')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
(cherry picked from commit 5404b7aaa36fad18df19e12abcc8af69014e74c2)

4 years agoradv: set writes_memory for global memory stores/atomics
Rhys Perry [Thu, 28 Nov 2019 11:30:55 +0000 (11:30 +0000)]
radv: set writes_memory for global memory stores/atomics

Fixes: 13ab63bb62b ('radv: Implement VK_EXT_buffer_device_address.')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 35fab1ba3395604f748cd13ba82991372ca0cae7)

4 years agoaco: don't split live-ranges of linear VGPRs
Daniel Schürmann [Fri, 29 Nov 2019 15:43:24 +0000 (16:43 +0100)]
aco: don't split live-ranges of linear VGPRs

Fixes: 93c8ebfa780ebd1495095e794731881aef29e7d3 'aco: Initial commit of independent AMD compiler'

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
(cherry picked from commit 8861a82be7df2a5816254b45d390ddafad7d8711)

4 years agoaco: add v_nop inbetween exec write and VMEM/DS/FLAT
Rhys Perry [Wed, 27 Nov 2019 17:20:15 +0000 (17:20 +0000)]
aco: add v_nop inbetween exec write and VMEM/DS/FLAT

LLVM and the proprietary compiler seem to do this

Fixes: b01847bd9 ("aco/gfx10: Fix mitigation of VMEMtoScalarWriteHazard.")
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit a9fc81b098ca36d063dbdb6f69ffde1ab215d34b)

4 years agoaco: fix i2i64
Rhys Perry [Wed, 27 Nov 2019 17:24:23 +0000 (17:24 +0000)]
aco: fix i2i64

Fixes: 93c8ebfa ('aco: Initial commit of independent AMD compiler')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit 11f43caaeca166c96ae49dbd506b6f58dd4a13fb)

4 years agoaco: propagate p_wqm on an image_sample's coordinate p_create_vector
Rhys Perry [Thu, 28 Nov 2019 15:29:40 +0000 (15:29 +0000)]
aco: propagate p_wqm on an image_sample's coordinate p_create_vector

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2156
Fixes: 93c8ebfa780 ('aco: Initial commit of independent AMD compiler')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit ff70ccad16a2efb3be1fbc4ca03453d38721a267)