mesa.git
4 years agovulkan/wsi/x11: Ensure we create at least minImageCount images.
Bas Nieuwenhuizen [Sat, 28 Mar 2020 21:43:32 +0000 (22:43 +0100)]
vulkan/wsi/x11: Ensure we create at least minImageCount images.

Doom Eternal happily creates a swapchain with 2 images for IMMEDIATE...

This fixes a 10% performance issues with Doom Eternal for me.

Since the game only sets a minImageCount increasing till our own minimum
is totally okay.

CC: <stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2684
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3156
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4368>

4 years agozink: clamp VkImageCreateInfo.arrayLayers to 1 for image resource creation
Mike Blumenkrantz [Fri, 29 May 2020 18:38:02 +0000 (14:38 -0400)]
zink: clamp VkImageCreateInfo.arrayLayers to 1 for image resource creation

this is required by spec, so we can generally assume that any time it's 0 here
this is the result of us being lazy elsewhere in the zink driver when we're
manually creating this sort of buffer

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

4 years agogitlab-ci: update the list of expected CTS failures for RADV/ACO
Samuel Pitoiset [Fri, 19 Jun 2020 13:18:27 +0000 (15:18 +0200)]
gitlab-ci: update the list of expected CTS failures for RADV/ACO

Based on Vulkan CTS 1.2.3.

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

4 years agonir: Fix divergence analysis for tessellation input/outputs
Kenneth Graunke [Tue, 5 May 2020 18:03:12 +0000 (11:03 -0700)]
nir: Fix divergence analysis for tessellation input/outputs

The load_per_vertex_{input,output} intrinsics simply mean that they're
reading an arrayed input/output, which have one element per invocation.
Most accesses to those use gl_InvocationID as the subscript.  However,
it's totally possible to read any element of the array.  For example,
an evaluation shader might read gl_in[2].gl_Position, or a control
shader might read output[0].

For threads processing a single patch, an input/output load is
convergent if and only if both sources (the per-vertex-array subscript
and the offset) are convergent.  For threads processing multiple
patches, we continued to mark them divergent.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5613>

4 years agointel: Disable loading drivers on DG1 devices for now
Kenneth Graunke [Tue, 23 Jun 2020 21:04:42 +0000 (14:04 -0700)]
intel: Disable loading drivers on DG1 devices for now

Kernel support for DG1 has not yet been merged upstream; per our
long-standing DRM subsystem policy, we should not enable the platform
in userspace until the kernel patches are merged and functional.

We will re-enable this in the future.  In the meantime, we retain all
of the infrastructure and code for the platform so that we can continue
developing DG1 support in upstream.

See a discussion here:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956#note_547775

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5617>

4 years agoCI: Disable Panfrost Mali-T820, Lima Mali-400 and Lima Mali-450 jobs
Kenneth Graunke [Wed, 24 Jun 2020 02:23:32 +0000 (19:23 -0700)]
CI: Disable Panfrost Mali-T820, Lima Mali-400 and Lima Mali-450 jobs

The runners appear to be unhealthy.  Disable for now so people can merge
patches for other drivers in the meantime.

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

4 years agoiris/compute: Split out iris_load_indirect_location
Jordan Justen [Wed, 13 Feb 2019 19:10:39 +0000 (11:10 -0800)]
iris/compute: Split out iris_load_indirect_location

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

4 years agoiris: Split walker and state update into iris_upload_gpgpu_walker
Jordan Justen [Wed, 13 Feb 2019 02:11:16 +0000 (18:11 -0800)]
iris: Split walker and state update into iris_upload_gpgpu_walker

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

4 years agoanv/cmd_buffer: Split GPGPU_WALKER out to emit_gpgpu_walker
Jordan Justen [Wed, 14 Nov 2018 19:41:23 +0000 (11:41 -0800)]
anv/cmd_buffer: Split GPGPU_WALKER out to emit_gpgpu_walker

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

4 years agoanv/pipeline: Split VFE/INTERFACE_DESCRIPTOR out to emit_media_cs_state
Jordan Justen [Wed, 14 Nov 2018 18:49:05 +0000 (10:49 -0800)]
anv/pipeline: Split VFE/INTERFACE_DESCRIPTOR out to emit_media_cs_state

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

4 years agoturnip: use pipeline cs for shader programs instead of separate bo
Jonathan Marek [Tue, 23 Jun 2020 14:37:56 +0000 (10:37 -0400)]
turnip: use pipeline cs for shader programs instead of separate bo

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

4 years agoturnip: fix ts_cs_memory typo
Jonathan Marek [Tue, 23 Jun 2020 14:37:18 +0000 (10:37 -0400)]
turnip: fix ts_cs_memory typo

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

4 years agofreedreno: Handle DRM_FORMAT_MOD_INVALID in shared code
Kristian H. Kristensen [Tue, 23 Jun 2020 17:39:14 +0000 (10:39 -0700)]
freedreno: Handle DRM_FORMAT_MOD_INVALID in shared code

layout_resource_for_modifier() needs to handle DRM_FORMAT_MOD_INVALID
as well, since src/gallium/frontends/dri/dri2.c uses this to indicate
"no modifier" when it's called through the older non-modifier entry
points.

This is similar to 334788d4 ("freedreno: allow INVALID modifier") but
for the generic implementation.

Fixes: 98910626 ("freedreno/a6xx: Implement layout for DRM_FORMAT_MOD_QCOM_COMPRESSED")
Closes: #3154
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5611>

4 years agointel/eu: Add the RNDU opcode
Jason Ekstrand [Thu, 22 Aug 2019 16:15:50 +0000 (11:15 -0500)]
intel/eu: Add the RNDU opcode

We don't want to use it on gen5 and earlier because only RNDD can be
done with a single instruction and we can implement RNDU(x) as -RNDD(-x)
so it's better to just do that when we have the instruction.  On gen6
and above, we may as well just use the right instruction.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/eu: Set the right subnr for ALIGN16 destinations
Jason Ekstrand [Thu, 17 Oct 2019 14:54:02 +0000 (09:54 -0500)]
intel/eu: Set the right subnr for ALIGN16 destinations

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/eu: Add a brw_urb_dest_msg_type helper
Jason Ekstrand [Thu, 12 Sep 2019 18:23:46 +0000 (13:23 -0500)]
intel/eu: Add a brw_urb_dest_msg_type helper

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/eu: Add a brw_urb_desc helper
Kenneth Graunke [Fri, 9 Aug 2019 02:16:32 +0000 (19:16 -0700)]
intel/eu: Add a brw_urb_desc helper

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/compiler: Expose brw_texture_offset to C
Jason Ekstrand [Tue, 13 Aug 2019 16:08:40 +0000 (11:08 -0500)]
intel/compiler: Expose brw_texture_offset to C

Some day we probably want to move it out of brw_shader if we're going to
share it with IBC but that can be another day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/fs: Move more prog_data setup into populate_wm_prog_data
Jason Ekstrand [Thu, 24 Oct 2019 22:31:18 +0000 (17:31 -0500)]
intel/fs: Move more prog_data setup into populate_wm_prog_data

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/fs: Break wm_prog_data setup into a helper
Jason Ekstrand [Thu, 18 Jul 2019 14:23:47 +0000 (09:23 -0500)]
intel/fs: Break wm_prog_data setup into a helper

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agointel/fs: Expose a couple of NIR lowering helpers
Jason Ekstrand [Thu, 18 Jul 2019 14:23:23 +0000 (09:23 -0500)]
intel/fs: Expose a couple of NIR lowering helpers

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

4 years agoiris: Delete useless #define
Kenneth Graunke [Mon, 22 Jun 2020 22:49:31 +0000 (15:49 -0700)]
iris: Delete useless #define

When I was bringing up the driver, I had BLORP use #ifdefs for
softpin-mode vs. relocation-mode.  That all got reworked during
review, but apparently this #define is still kicking around,
even though nothing uses it.

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

4 years agonir: only uniforms with dynamically_uniform offset are dynamically_uniform
Jose Maria Casanova Crespo [Wed, 17 Jun 2020 00:30:23 +0000 (02:30 +0200)]
nir: only uniforms with dynamically_uniform offset are dynamically_uniform

Previously all nir_intrinsic_load_uniform that were used as sources were
considered to be dynamically_uniform but when offsets of load_uniform
are indirect it can not be determined.

This fixes artefacts in Google Maps 3D view in V3D.

Fixes: 886d46b08971 ("nir: Add a function to determine if a source is dynamically uniform")
Reviewed-by: Neil Roberts <nroberts@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5587>

4 years agobin/symbols-check: explain C++ symbols workaround
Eric Engestrom [Fri, 19 Jun 2020 10:44:41 +0000 (12:44 +0200)]
bin/symbols-check: explain C++ symbols workaround

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

4 years agoturnip: implement CmdDrawIndirectByteCountEXT
Jonathan Marek [Sat, 20 Jun 2020 19:09:05 +0000 (15:09 -0400)]
turnip: implement CmdDrawIndirectByteCountEXT

Fixes these deqp tests:
dEQP-VK.transform_feedback.simple.backward_dependency*
dEQP-VK.transform_feedback.simple.draw_indirect*

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

4 years agoturnip: enable VK_EXT_index_type_uint8
Jonathan Marek [Sat, 20 Jun 2020 19:02:10 +0000 (15:02 -0400)]
turnip: enable VK_EXT_index_type_uint8

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

4 years agoturnip: refactor CmdDraw* functions (and a few fixes)
Jonathan Marek [Mon, 22 Jun 2020 16:47:47 +0000 (12:47 -0400)]
turnip: refactor CmdDraw* functions (and a few fixes)

This cleans up the CmdDraw* functions to be more straightforward. And a few
fixes applied while going through it:
* Fix indirect draw commands not adding the buffer->bo_offset, and ignoring
 drawCount/stride parameters (deqp tests not testing indirect draws very
 much apparently).
* Fixed a potential issue with RESTART_INDEX + secondary command bufs.
* Add missing logic for 8-bit indices

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
# Conflicts:
# src/freedreno/vulkan/tu_cmd_buffer.c

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

4 years agoturnip: rework streamout state and add missing counter buffer read/writes
Jonathan Marek [Sat, 20 Jun 2020 17:46:01 +0000 (13:46 -0400)]
turnip: rework streamout state and add missing counter buffer read/writes

Rework the streamout state and at the same time fix some issues, the
biggest one being to actually use the counter buffers instead of ignoring
them completely.

(note it appears the dEQP tests are bad and able to pass with the previous
broken behavior of not ever reading/writing from the counter buffers)

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

4 years agodocs: add planning for 20.2
Eric Engestrom [Wed, 27 May 2020 23:40:11 +0000 (01:40 +0200)]
docs: add planning for 20.2

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

4 years agodocs: add some padding to the release calendar
Eric Engestrom [Wed, 17 Jun 2020 22:10:51 +0000 (00:10 +0200)]
docs: add some padding to the release calendar

This extra padding allows for `-rcX` suffixes.

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

4 years agoci: remove some freedreno a6xx skips
Rob Clark [Sat, 20 Jun 2020 16:21:02 +0000 (09:21 -0700)]
ci: remove some freedreno a6xx skips

These don't seem to be flakey anymore.  I did still see a flake with
dEQP-GLES31.functional.layout_binding.ssbo.fragment_binding_array so
I put that one back in.

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

4 years agodriconf: add workarounds for SPECviewperf13
Marek Olšák [Sat, 13 Jun 2020 21:19:51 +0000 (17:19 -0400)]
driconf: add workarounds for SPECviewperf13

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

4 years agoglsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13
Marek Olšák [Sat, 13 Jun 2020 21:18:34 +0000 (17:18 -0400)]
glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13

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

4 years agoradeonsi: replace ctx->screen with sscreen in si_flush_gfx_cs
Marek Olšák [Tue, 16 Jun 2020 18:39:04 +0000 (14:39 -0400)]
radeonsi: replace ctx->screen with sscreen in si_flush_gfx_cs

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

4 years agoradeonsi: don't wait for idle at the end of gfx IBs
Marek Olšák [Mon, 4 May 2020 21:41:41 +0000 (17:41 -0400)]
radeonsi: don't wait for idle at the end of gfx IBs

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

4 years agogitlab-ci: stop testing RADV with LLVM
Samuel Pitoiset [Thu, 18 Jun 2020 10:28:42 +0000 (12:28 +0200)]
gitlab-ci: stop testing RADV with LLVM

ACO is going to be our default compiler soon and it seems useless
to waste CI resources for LLVM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5543>

4 years agoaco: fix printing ASM on GFX6-7 again
Samuel Pitoiset [Mon, 22 Jun 2020 11:33:21 +0000 (13:33 +0200)]
aco: fix printing ASM on GFX6-7 again

Checking errno is actually wrong because it's only updated if
popen() fails (ie. NULL). One solution is to check if the first
line is empty.

Fixes: c95d258d1bc ("aco: fix printing ASM on GFX6-7 if clrxdisasm is not found")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5591>

4 years agogitlab-ci: Update CTS runner
Tomeu Vizoso [Mon, 15 Jun 2020 13:39:40 +0000 (15:39 +0200)]
gitlab-ci: Update CTS runner

We need a newer version to be able to successfully run the OpenGL suites
in dEQP.

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

4 years agogitlab-ci: Test virgl with Khronos' OpenGL CTS
Tomeu Vizoso [Wed, 13 May 2020 07:46:06 +0000 (09:46 +0200)]
gitlab-ci: Test virgl with Khronos' OpenGL CTS

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

4 years agogitlab-ci: Add manual tests for Virgl using GLES on the host
Tomeu Vizoso [Tue, 12 May 2020 08:18:48 +0000 (10:18 +0200)]
gitlab-ci: Add manual tests for Virgl using GLES on the host

The ones that run automatically will use big GL on the host.

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

4 years agogitlab-ci: Run more dEQP tests for virgl
Tomeu Vizoso [Tue, 12 May 2020 08:03:25 +0000 (10:03 +0200)]
gitlab-ci: Run more dEQP tests for virgl

Llvmpipe seems to have become faster, and we can run more tests while
still being under 5 minutes per job.

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

4 years agoglthread: handle ARB_vertex_attrib_binding
Marek Olšák [Sat, 30 May 2020 21:42:46 +0000 (17:42 -0400)]
glthread: handle ARB_vertex_attrib_binding

This handles ARB_vertex_attrib_binding for vertex uploads correctly.
Before this, the extension might have led to crashes if non-VBO vertex
attribs were present.

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

4 years agoglthread: rename non_vbo_attrib_mask -> user_buffer_mask, attribs -> buffers
Marek Olšák [Sun, 31 May 2020 02:39:54 +0000 (22:39 -0400)]
glthread: rename non_vbo_attrib_mask -> user_buffer_mask, attribs -> buffers

just a cleanup, no change in behavior

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

4 years agoglapi: fix incorrect param names in ARB_vertex_attrib_binding functions
Marek Olšák [Sat, 30 May 2020 21:21:32 +0000 (17:21 -0400)]
glapi: fix incorrect param names in ARB_vertex_attrib_binding functions

no change in behavior

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

4 years agoac/nir: fix 64-bit division for GL CTS
Marek Olšák [Wed, 17 Jun 2020 19:25:28 +0000 (15:25 -0400)]
ac/nir: fix 64-bit division for GL CTS

This fixes: KHR-GL45.gpu_shader_fp64.builtin.mod_*

Fixes: ba2ec1f3 "ac/nir: use llvm.amdgcn.rcp in ac_build_fdiv()"
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5531>

4 years agoradeonsi: compact MRTs to save PS export memory space
Marek Olšák [Wed, 17 Jun 2020 22:04:53 +0000 (18:04 -0400)]
radeonsi: compact MRTs to save PS export memory space

If there are holes between color outputs (e.g. a shader exports MRT1, but
not MRT0), we can remove the holes by moving higher MRTs lower.

The hardware will remap the MRTs to their correct locations if we remove
holes in SPI_SHADER_COL_FORMAT but not CB_SHADER_MASK.

This is a performance optimization, but MRTs with holes are pretty rare,
so there is most likely no effect on any app.

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

4 years agoanv: Bump the advertised patch version to 145
Jason Ekstrand [Mon, 22 Jun 2020 21:15:02 +0000 (16:15 -0500)]
anv: Bump the advertised patch version to 145

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

4 years agovulkan: Update Vulkan XML and headers to 1.2.145
Jason Ekstrand [Mon, 22 Jun 2020 21:12:39 +0000 (16:12 -0500)]
vulkan: Update Vulkan XML and headers to 1.2.145

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

4 years agodocs: cat maintainer keys to a single file
Eric Engestrom [Fri, 19 Jun 2020 22:35:58 +0000 (00:35 +0200)]
docs: cat maintainer keys to a single file

The original issue asked for all the keys in a single file, but I didn't
do that because it's much easier to manage and verify the keys as
separate files, but sphinx doesn't provide a way to expose a folder so
we'd need to create an index.html and have it list all the keys
manually, which is very error prone.

At this point, we might as well just concatenate the keys and expose
a single file, so let's do that.

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

4 years agodocs: drop deleted file from extra sphinx files
Eric Engestrom [Fri, 19 Jun 2020 22:41:53 +0000 (00:41 +0200)]
docs: drop deleted file from extra sphinx files

Fixes: 3e37b7e6bbad007c168a ("docs: remove plain-text copy of versions.rst")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5567>

4 years agoanv: Make use of devinfo has_aux_map field
Jordan Justen [Sat, 14 Mar 2020 08:02:00 +0000 (01:02 -0700)]
anv: Make use of devinfo has_aux_map field

Reworks:
 * Use device rather than physical_device for info. (Lionel)

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

4 years agoiris: Make use of devinfo has_aux_map field
Jordan Justen [Sat, 14 Mar 2020 08:01:35 +0000 (01:01 -0700)]
iris: Make use of devinfo has_aux_map field

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

4 years agogitlab-ci: drop gettext from the build images
Eric Engestrom [Fri, 12 Jun 2020 19:06:38 +0000 (21:06 +0200)]
gitlab-ci: drop gettext from the build images

Suggested-by: Pierre-Eric Pelloux-Prayer <pelloux@gmail.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>

4 years agoutil: rename xmlpool.h to driconf.h
Eric Engestrom [Fri, 12 Jun 2020 09:42:32 +0000 (11:42 +0200)]
util: rename xmlpool.h to driconf.h

To make it clearer what it is and does.

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

4 years agodriconf: drop now unused translation facility
Eric Engestrom [Fri, 12 Jun 2020 09:22:42 +0000 (11:22 +0200)]
driconf: drop now unused translation facility

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

4 years agodriconf: drop 9% swedish translation
Eric Engestrom [Fri, 12 Jun 2020 09:19:49 +0000 (11:19 +0200)]
driconf: drop 9% swedish translation

Only 7 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agodriconf: drop 8% dutch translation
Eric Engestrom [Fri, 12 Jun 2020 09:18:54 +0000 (11:18 +0200)]
driconf: drop 8% dutch translation

Only 6 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agodriconf: drop 6% french translation
Eric Engestrom [Fri, 12 Jun 2020 09:18:13 +0000 (11:18 +0200)]
driconf: drop 6% french translation

Only 4 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agodriconf: drop 26% spanish translation
Eric Engestrom [Fri, 12 Jun 2020 09:17:20 +0000 (11:17 +0200)]
driconf: drop 26% spanish translation

Only 19 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agodriconf: drop 15% german translation
Eric Engestrom [Fri, 12 Jun 2020 09:16:26 +0000 (11:16 +0200)]
driconf: drop 15% german translation

Only 11 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agodriconf: drop 28% catalan translation
Eric Engestrom [Fri, 12 Jun 2020 09:11:05 +0000 (11:11 +0200)]
driconf: drop 28% catalan translation

Only 20 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.

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

4 years agozink: use correct define value for reserved slot count in ntv
Mike Blumenkrantz [Mon, 22 Jun 2020 14:16:21 +0000 (10:16 -0400)]
zink: use correct define value for reserved slot count in ntv

this is zero-indexed, so we need to include the zero index in the count

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

4 years agointel/dev: Add device info for DG1
Jordan Justen [Tue, 31 Jul 2018 04:52:02 +0000 (21:52 -0700)]
intel/dev: Add device info for DG1

Reworks:
 * Anuj: Set is_dg1
 * Anuj: Add dg1 to gen_device_name_to_pci_device_id
 * Anuj: Update simulator id
 * Rafael: has_llc = false

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

4 years agoanv/dg1: Don't use SET_TILING kernel uapi.
Rafael Antognolli [Mon, 27 Apr 2020 22:54:51 +0000 (22:54 +0000)]
anv/dg1: Don't use SET_TILING kernel uapi.

It is not available on discrete platforms anymore.

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

4 years agoiris/bufmgr: Do not use map_gtt or use set/get_tiling on DG1
Rafael Antognolli [Mon, 4 Nov 2019 22:04:25 +0000 (14:04 -0800)]
iris/bufmgr: Do not use map_gtt or use set/get_tiling on DG1

We are starting to see platforms that don't support the get/set tiling
uAPI. (For example, DG1.)

Additionally on DG1 we shouldn't be using the map_gtt anymore.

Let's add some asserts and make sure we don't take those paths
accidentally.

Rework:
 * Jordan: Only apply for DG1, not all gen12
 * Rafael: Use has_tiling_uapi
 * Jordan: Copy has_tiling_uapi from devinfo
 * Jordan: merge in "iris: Rework iris_bo_import_dmabuf() a little."
 * Jordan: Continue to call get/set_tiling on modifier path

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

4 years agointel/devinfo: Add function to check for DRM_I915_GEM_GET_TILING.
Rafael Antognolli [Wed, 3 Jun 2020 17:19:50 +0000 (17:19 +0000)]
intel/devinfo: Add function to check for DRM_I915_GEM_GET_TILING.

Future (discrete) platforms won't have support for get/set tiling. This
function allows our drivers to query for that, by simply trying to get
the tiling from a dummy buffer.

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

4 years agointel/l3: Return the URB size from devinfo for DG1
Rafael Antognolli [Fri, 15 Nov 2019 23:49:13 +0000 (15:49 -0800)]
intel/l3: Return the URB size from devinfo for DG1

We don't have any URB size set in the L3 config, since it's a fixed
value now. So just return the value that we know from gen_device_info.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>

4 years agointel/isl: Update mocs for DG1
Rafael Antognolli [Tue, 5 Nov 2019 23:34:53 +0000 (15:34 -0800)]
intel/isl: Update mocs for DG1

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>

4 years agointel/l3: Add DG1 L3 configuration
Anuj Phogat [Tue, 2 Apr 2019 21:35:34 +0000 (14:35 -0700)]
intel/l3: Add DG1 L3 configuration

Reworks:
 * Jordan: Make DG1 L3 config table empty

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

4 years agoanv: Set L3 full way allocation at context init if L3 cfg is NULL
Jordan Justen [Fri, 12 Jun 2020 10:02:02 +0000 (03:02 -0700)]
anv: Set L3 full way allocation at context init if L3 cfg is NULL

If the platform's default L3 config is NULL, then it now gets
initialized only at context init time, and cmd_buffer_config_l3 will
always return immediately.

Rework:
 * Remove unneeded check on !cfg in cmd_buffer_config_l3 (Jason)

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

4 years agoiris/l3: Enable L3 full way allocation when L3 config is NULL
Jordan Justen [Fri, 2 Aug 2019 07:32:17 +0000 (00:32 -0700)]
iris/l3: Enable L3 full way allocation when L3 config is NULL

Reworks:
 * Jordan: Check for cfg == NULL rather than is_dg1

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

4 years agointel/l3: Allow platforms to have no l3 configurations
Jordan Justen [Mon, 8 Jun 2020 10:19:08 +0000 (03:19 -0700)]
intel/l3: Allow platforms to have no l3 configurations

On some gen12 platforms we will use the L3FullWayAllocationEnable and
never reconfigure the L3 setup.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>

4 years agointel/l3: Don't rely on cfg entry URB size being 0 as a sentinal
Jordan Justen [Tue, 16 Apr 2019 07:42:45 +0000 (00:42 -0700)]
intel/l3: Don't rely on cfg entry URB size being 0 as a sentinal

An example entry with URB size being 0 is in the cnl list.

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

4 years agointel/devinfo: Add is_dg1 to device info
Anuj Phogat [Thu, 11 Apr 2019 22:14:13 +0000 (15:14 -0700)]
intel/devinfo: Add is_dg1 to device info

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>

4 years agoturnip: Enable tessellationShader physical device feature
Brian Ho [Fri, 24 Apr 2020 20:49:19 +0000 (13:49 -0700)]
turnip: Enable tessellationShader physical device feature

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

4 years agoir3: Unconditionally enable MERGEDREGS on a6xx
Brian Ho [Thu, 18 Jun 2020 16:17:31 +0000 (12:17 -0400)]
ir3: Unconditionally enable MERGEDREGS on a6xx

As per discussion on !5059, we don't see any particular reason as to
why MERGEDREGS should be disabled on HS/DS/GS, and none of the dEQP
tests (both VK and GL) fail when MERGEDREGS is enabled. In fact, some
of the VK dEQP tests fail when MERGEDREGS is disabled (e.g. tests
with shaders that employ a0.x). As a result, let's just enable
MERGEDREGS unconditionally on a6xx.

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

4 years agoturnip: Force sysmem for tessellation
Brian Ho [Tue, 9 Jun 2020 18:48:49 +0000 (14:48 -0400)]
turnip: Force sysmem for tessellation

Tessellation is incompatible with HW binning (dEQP tests fail when
we set forcebin), so force sysmem when we finish recording a command
buffer that uses a tess pipeline.

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

4 years agoturnip: Support tess for draws
Brian Ho [Fri, 24 Apr 2020 19:52:05 +0000 (12:52 -0700)]
turnip: Support tess for draws

This commit adds tessellation support for draws. We store the IR3
patch type in tu_pipeline so we can use it in tu_emit_draw_*. We then
convert the IR3 patch type to the native adreno patch type and set
the appropriate reg values.

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

4 years agoturnip: Emit HS/DS user consts as draw states
Brian Ho [Thu, 18 Jun 2020 13:59:22 +0000 (09:59 -0400)]
turnip: Emit HS/DS user consts as draw states

Just like VS/GS/FS.

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

4 years agoturnip: Update VFD_CONTROL with tess system values
Brian Ho [Fri, 24 Apr 2020 19:20:10 +0000 (12:20 -0700)]
turnip: Update VFD_CONTROL with tess system values

Support for TessCoord, PatchID, TCSHeader.

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

4 years agoturnip: Allocate tess BOs as a function of draw size
Brian Ho [Fri, 15 May 2020 17:52:43 +0000 (10:52 -0700)]
turnip: Allocate tess BOs as a function of draw size

To store tess outputs, the HS stg's into two buffers, one for
per-vertex/per-patch output variables (tess_param) and one for
TessLevelInner/Outer (tess_factor). The addresses of these buffers
are uploaded as consts to the HS/DS and the tess_factor iova is
written to REG_A6XX_PC_TESSFACTOR_ADDR. While the sizes of these
buffers are a function of vetex count and patch count, allocation is
relatively straightforward on freedreno- just keep track of the max
required buffer size for the entire batch and allocate before batch
submit.

In Vulkan, however, a given pipeline can be bound multiple times
across any number of command buffers, each drawing with a different
number of vertices. One solution is to track the max buffer size for
the entire command buffer (similar to fd_batch) and on
vkEndCommandBuffer, allocate appropriately sized tess BOs. Since the
tess BOs addresses are emitted as part of the pipeline state setup
(e.g. PKT4 to REG_A6XX_PC_TESSFACTOR_ADDR), we need to create a new
state group independent of a specific pipeline and parameterize its
IB with the command buffer specific tess BO iovas.

Without a larger refactor, the simplest way to do this is just to
emit per-draw call consts and leverage scratch_bo to re-use buffers.
This way we won't have to store and rewrite earlier packets in the
command stream on vkEndCommandBuffer.

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

4 years agoturnip: Parse tess state and support PATCH primtype
Brian Ho [Fri, 24 Apr 2020 15:51:04 +0000 (08:51 -0700)]
turnip: Parse tess state and support PATCH primtype

This commit adds support for VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
primitive topologies.

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

4 years agoturnip: Offset by component when lowering gl_TessLevel*
Brian Ho [Fri, 24 Apr 2020 15:22:20 +0000 (08:22 -0700)]
turnip: Offset by component when lowering gl_TessLevel*

lower_tess_ctrl_block assumes that the gl_TessLevel*
intrinsic_store_outputs have already been collapsed into a single
instruction before the tess lowering step:

store_output ... /* base=0 */ /* wrmask=xyzw */ /* component=0 */
store_output ... /* base=1 */ /* wrmask=xy */ /* component=0 */

While this is true in fd because of st_nir_vectorize_io, we don't do
the same lowering in turnip so each tess level component still has
its own store instruction:

store_output ... /* base=0 */ /* wrmask=x */ /* component=0 */
store_output ... /* base=0 */ /* wrmask=x */ /* component=1 */
store_output ... /* base=0 */ /* wrmask=x */ /* component=2 */
store_output ... /* base=0 */ /* wrmask=x */ /* component=3 */
store_output ... /* base=1 */ /* wrmask=x */ /* component=0 */
store_output ... /* base=1 */ /* wrmask=x */ /* component=1 */

This commit adds a component offset to the tess control lowering. An
alternative is to also perform nir_lower_io_to_vector in turnip, but
ir3 seems to generate the same assembly either way and it's nice to
not have a lowering prereq before tess lowering.

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

4 years agoturnip: Lower shaders for tessellation
Brian Ho [Fri, 24 Apr 2020 15:05:48 +0000 (08:05 -0700)]
turnip: Lower shaders for tessellation

To enable lowering of tess-related shaders, this commit sets the
tessellation primitive field of the ir3_shader_key. In addition,
this commit sets various tessellation flags for
spirv_to_nir configuration.

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

4 years agonir: Add an option for lowering TessLevelInner/Outer to vecs
Brian Ho [Thu, 14 May 2020 19:17:48 +0000 (12:17 -0700)]
nir: Add an option for lowering TessLevelInner/Outer to vecs

The GLSL to NIR compiler supports the LowerTessLevel flag to convert
gl_TessLevelInner/Outer from their GLSL declarations as arrays of
floats to vec4/vec2s to better match how they are represented in
hardware.

This commit adds the similar support to the SPIR-V to NIR compiler so
turnip can use the same IR3/NIR tess lowering passes as freedreno.

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

4 years agonir: Support sysval tess levels in SPIR-V to NIR
Brian Ho [Thu, 14 May 2020 18:51:43 +0000 (11:51 -0700)]
nir: Support sysval tess levels in SPIR-V to NIR

This commit adds a tess_levels_are_sysvals flag to
spirv_to_nir_options similar to GLSLTessLevelsAsInputs in the GLSL to
NIR compiler options. This will be used by turnip as the tess IR3
lowering pass (ir3_nir_lower_tess) operates on TessLevelInner and
TessLevelOuter in the DS as sysvals.

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

4 years agov3d: Disable PIPE_CAP_PRIMITIVE_RESTART
Neil Roberts [Thu, 18 Jun 2020 13:53:03 +0000 (15:53 +0200)]
v3d: Disable PIPE_CAP_PRIMITIVE_RESTART

The hardware can only support the PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX
subset. This will make it stop advertising the NV_primitive_restart
extension without breaking GLES 3.0 support.

v2: Update features.txt

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed by: Erik Faye-Lund <erik.faye-lund@collabora.com>

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

4 years agomesa: Add PrimitiveRestartFixedIndex to gl_constants
Neil Roberts [Thu, 18 Jun 2020 13:48:12 +0000 (15:48 +0200)]
mesa: Add PrimitiveRestartFixedIndex to gl_constants

This is a fine-grained subset of the NV_primitive_restart extension that
only uses the fixed indices provided by GLES 3.0. There’s no public
extension to advertise this behaviour so the bool is added to
gl_constants instead of gl_extensions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed by: Erik Faye-Lund <erik.faye-lund@collabora.com>

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

4 years agogallium: Add pipe cap for primitive restart with fixed index
Neil Roberts [Thu, 18 Jun 2020 13:18:54 +0000 (15:18 +0200)]
gallium: Add pipe cap for primitive restart with fixed index

Adds PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX which is a subset of the
primitive restart cap for when the hardware can only support the fixed
indices specified in GLES.

The switch statements were automatically modified with this command:

find \( \( -name \*.cpp -o -name \*.c \) \! -type l \) \
 -exec sed -i -r \
 's/^(\s*case\s+PIPE_CAP_PRIMITIVE_RESTART)\s*:.*$/\0\n\1_FIXED_INDEX:/' \
 {} \;

v2: Add a note in screen.rst

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed by: Erik Faye-Lund <erik.faye-lund@collabora.com>

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

4 years agonv50/ir/ra: fix memory corruption when spilling
Karol Herbst [Tue, 12 Nov 2019 21:59:26 +0000 (22:59 +0100)]
nv50/ir/ra: fix memory corruption when spilling

When doing RA we end up with adding ValueDef references to Values across
all over the shader. This is all fine until we remove the Instruction
defining those Values, which happens when spilling values.

Instead of manipulating the values directly we should just track all
merged in defs in a seperate structure and remove stale references when
an instruction gets deleted in the spiller.

fixes following libasan report:
=================================================================
==612087==ERROR: AddressSanitizer: heap-use-after-free on address 0x6150003ea380 at pc 0x7f1d12142fe9 bp 0x7fffca6fd120 sp 0x7fffca6fd110
READ of size 8 at 0x6150003ea380 thread T0
    #0 0x7f1d12142fe8 in nv50_ir::ValueDef::get() const ../src/gallium/drivers/nouveau/codegen/nv50_ir.h:648
    #1 0x7f1d12143c02 in nv50_ir::Value::getUniqueInsn() const ../src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h:229
    #2 0x7f1d1221530d in nv50_ir::RegAlloc::BuildIntervalsPass::addLiveRange(nv50_ir::Value*, nv50_ir::BasicBlock const*, int) ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:333
    #3 0x7f1d1221872e in nv50_ir::RegAlloc::BuildIntervalsPass::visit(nv50_ir::BasicBlock*) ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:686
    #4 0x7f1d1215676c in nv50_ir::Pass::doRun(nv50_ir::Function*, bool, bool) ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:495
    #5 0x7f1d121563ed in nv50_ir::Pass::run(nv50_ir::Function*, bool, bool) ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:477
    #6 0x7f1d122262b8 in nv50_ir::RegAlloc::execFunc() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1910
    #7 0x7f1d122256b0 in nv50_ir::RegAlloc::exec() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1849
    #8 0x7f1d12226f1e in nv50_ir::Program::registerAllocation() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1970
    #9 0x7f1d1214092a in nv50_ir_generate_code ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1275
    #10 0x7f1d1227461b in nvc0_program_translate ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:634
    #11 0x7f1d12294b21 in nvc0_sp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:620
    #12 0x7f1d12294d90 in nvc0_fp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:661
    #13 0x7f1d12ad4912 in st_create_fp_variant ../src/mesa/state_tracker/st_program.c:1498
    #14 0x7f1d12ad4cd5 in st_get_fp_variant ../src/mesa/state_tracker/st_program.c:1525
    #15 0x7f1d12ad8252 in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:2053
    #16 0x7f1d12c9c851 in st_program_string_notify ../src/mesa/state_tracker/st_cb_program.c:185
    #17 0x7f1d12d17731 in st_link_tgsi ../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:7441
    #18 0x7f1d12cabaf0 in st_link_shader ../src/mesa/state_tracker/st_glsl_to_ir.cpp:175
    #19 0x7f1d127c85ca in _mesa_glsl_link_shader ../src/mesa/program/ir_to_mesa.cpp:3186
    #20 0x7f1d1252a9f7 in link_program ../src/mesa/main/shaderapi.c:1285
    #21 0x7f1d1252a9f7 in link_program_error ../src/mesa/main/shaderapi.c:1384
    #22 0x7f1d1252deb3 in _mesa_LinkProgram ../src/mesa/main/shaderapi.c:1876
    #23 0x403e13 in main._omp_fn.0 /home/kherbst/git/shader-db/run.c:926
    #24 0x7f1d17b8b4b5 in GOMP_parallel (/lib64/libgomp.so.1+0x124b5)
    #25 0x4029e4 in main /home/kherbst/git/shader-db/run.c:765
    #26 0x7f1d179b51a2 in __libc_start_main ../csu/libc-start.c:308
    #27 0x402d1d in _start (/home/kherbst/git/shader-db/run+0x402d1d)

0x6150003ea380 is located 0 bytes inside of 504-byte region [0x6150003ea380,0x6150003ea578)
freed by thread T0 here:
    #0 0x7f1d17e5d96f in operator delete(void*) (/usr/lib64/libasan.so.5.0.0+0x11096f)
    #1 0x7f1d1214ec0f in __gnu_cxx::new_allocator<nv50_ir::ValueDef>::deallocate(nv50_ir::ValueDef*, unsigned long) /usr/include/c++/9/ext/new_allocator.h:128
    #2 0x7f1d1214dc00 in std::allocator_traits<std::allocator<nv50_ir::ValueDef> >::deallocate(std::allocator<nv50_ir::ValueDef>&, nv50_ir::ValueDef*, unsigned long) /usr/include/c++/9/bits/alloc_traits.h:470
    #3 0x7f1d1214c5fb in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_M_deallocate_node(nv50_ir::ValueDef*) /usr/include/c++/9/bits/stl_deque.h:624
    #4 0x7f1d121498c4 in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_M_destroy_nodes(nv50_ir::ValueDef**, nv50_ir::ValueDef**) /usr/include/c++/9/bits/stl_deque.h:758
    #5 0x7f1d1214704d in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::~_Deque_base() /usr/include/c++/9/bits/stl_deque.h:680
    #6 0x7f1d12145371 in std::deque<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::~deque() /usr/include/c++/9/bits/stl_deque.h:1069
    #7 0x7f1d1213bc5b in nv50_ir::Instruction::~Instruction() ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:615
    #8 0x7f1d1213fb2f in nv50_ir::Program::releaseInstruction(nv50_ir::Instruction*) ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1148
    #9 0x7f1d122250fb in nv50_ir::SpillCodeInserter::run(std::__cxx11::list<std::pair<nv50_ir::Value*, nv50_ir::Value*>, std::allocator<std::pair<nv50_ir::Value*, nv50_ir::Value*> > > const&) ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1830
    #10 0x7f1d12221445 in nv50_ir::GCRA::allocateRegisters(nv50_ir::ArrayList&) ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1541
    #11 0x7f1d122262e9 in nv50_ir::RegAlloc::execFunc() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1913
    #12 0x7f1d122256b0 in nv50_ir::RegAlloc::exec() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1849
    #13 0x7f1d12226f1e in nv50_ir::Program::registerAllocation() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp:1970
    #14 0x7f1d1214092a in nv50_ir_generate_code ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1275
    #15 0x7f1d1227461b in nvc0_program_translate ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:634
    #16 0x7f1d12294b21 in nvc0_sp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:620
    #17 0x7f1d12294d90 in nvc0_fp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:661
    #18 0x7f1d12ad4912 in st_create_fp_variant ../src/mesa/state_tracker/st_program.c:1498
    #19 0x7f1d12ad4cd5 in st_get_fp_variant ../src/mesa/state_tracker/st_program.c:1525
    #20 0x7f1d12ad8252 in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:2053
    #21 0x7f1d12c9c851 in st_program_string_notify ../src/mesa/state_tracker/st_cb_program.c:185
    #22 0x7f1d12d17731 in st_link_tgsi ../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:7441
    #23 0x7f1d12cabaf0 in st_link_shader ../src/mesa/state_tracker/st_glsl_to_ir.cpp:175
    #24 0x7f1d127c85ca in _mesa_glsl_link_shader ../src/mesa/program/ir_to_mesa.cpp:3186
    #25 0x7f1d1252a9f7 in link_program ../src/mesa/main/shaderapi.c:1285
    #26 0x7f1d1252a9f7 in link_program_error ../src/mesa/main/shaderapi.c:1384
    #27 0x7f1d1252deb3 in _mesa_LinkProgram ../src/mesa/main/shaderapi.c:1876
    #28 0x403e13 in main._omp_fn.0 /home/kherbst/git/shader-db/run.c:926

previously allocated by thread T0 here:
    #0 0x7f1d17e5c9d7 in operator new(unsigned long) (/usr/lib64/libasan.so.5.0.0+0x10f9d7)
    #1 0x7f1d1215046f in __gnu_cxx::new_allocator<nv50_ir::ValueDef>::allocate(unsigned long, void const*) /usr/include/c++/9/ext/new_allocator.h:114
    #2 0x7f1d1214ebec in std::allocator_traits<std::allocator<nv50_ir::ValueDef> >::allocate(std::allocator<nv50_ir::ValueDef>&, unsigned long) /usr/include/c++/9/bits/alloc_traits.h:444
    #3 0x7f1d1214dbd3 in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_M_allocate_node() /usr/include/c++/9/bits/stl_deque.h:617
    #4 0x7f1d1214c464 in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_M_create_nodes(nv50_ir::ValueDef**, nv50_ir::ValueDef**) (/home/kherbst/local/lib64/dri//nouveau_dri.so+0x829464)
    #5 0x7f1d121495cd in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_M_initialize_map(unsigned long) /usr/include/c++/9/bits/stl_deque.h:716
    #6 0x7f1d12146f7d in std::_Deque_base<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::_Deque_base() /usr/include/c++/9/bits/stl_deque.h:507
    #7 0x7f1d1214518d in std::deque<nv50_ir::ValueDef, std::allocator<nv50_ir::ValueDef> >::deque() /usr/include/c++/9/bits/stl_deque.h:912
    #8 0x7f1d1213b9c9 in nv50_ir::Instruction::Instruction(nv50_ir::Function*, nv50_ir::operation, nv50_ir::DataType) ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:605
    #9 0x7f1d1224dd44 in nv50_ir::Function::convertToSSA() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ssa.cpp:385
    #10 0x7f1d1224d381 in nv50_ir::Program::convertToSSA() ../src/gallium/drivers/nouveau/codegen/nv50_ir_ssa.cpp:310
    #11 0x7f1d121407c0 in nv50_ir_generate_code ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1264
    #12 0x7f1d1227461b in nvc0_program_translate ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:634
    #13 0x7f1d12294b21 in nvc0_sp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:620
    #14 0x7f1d12294d90 in nvc0_fp_state_create ../src/gallium/drivers/nouveau/nvc0/nvc0_state.c:661
    #15 0x7f1d12ad4912 in st_create_fp_variant ../src/mesa/state_tracker/st_program.c:1498
    #16 0x7f1d12ad4cd5 in st_get_fp_variant ../src/mesa/state_tracker/st_program.c:1525
    #17 0x7f1d12ad8252 in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:2053
    #18 0x7f1d12c9c851 in st_program_string_notify ../src/mesa/state_tracker/st_cb_program.c:185
    #19 0x7f1d12d17731 in st_link_tgsi ../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:7441
    #20 0x7f1d12cabaf0 in st_link_shader ../src/mesa/state_tracker/st_glsl_to_ir.cpp:175
    #21 0x7f1d127c85ca in _mesa_glsl_link_shader ../src/mesa/program/ir_to_mesa.cpp:3186
    #22 0x7f1d1252a9f7 in link_program ../src/mesa/main/shaderapi.c:1285
    #23 0x7f1d1252a9f7 in link_program_error ../src/mesa/main/shaderapi.c:1384
    #24 0x7f1d1252deb3 in _mesa_LinkProgram ../src/mesa/main/shaderapi.c:1876
    #25 0x403e13 in main._omp_fn.0 /home/kherbst/git/shader-db/run.c:926

SUMMARY: AddressSanitizer: heap-use-after-free ../src/gallium/drivers/nouveau/codegen/nv50_ir.h:648 in nv50_ir::ValueDef::get() const
Shadow bytes around the buggy address:
  0x0c2a80075420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a80075430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a80075440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a80075450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
  0x0c2a80075460: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c2a80075470:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a80075480: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a80075490: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a800754a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c2a800754b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2a800754c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==612087==ABORTING

v2: full rework
v3: manage a full copy instead of recreating new lists on every access

Closes: #3066
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5277>

4 years agonv50/ir/ra: convert some for loops to Range-based for loops
Karol Herbst [Wed, 15 Jan 2020 19:37:27 +0000 (20:37 +0100)]
nv50/ir/ra: convert some for loops to Range-based for loops

I will touch them in the next commit

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5277>

4 years agopanfrost: Copy resources when mapping to avoid waiting for readers
Icecream95 [Sat, 20 Jun 2020 07:30:54 +0000 (19:30 +1200)]
panfrost: Copy resources when mapping to avoid waiting for readers

It is often faster to copy the whole resource and modify that than
to flush and wait for readers of the BO.

Helps anything which updates textures after already using them in a
frame, such as most GLQuake ports.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agopanfrost: Update sampler views when the texture bo changes
Icecream95 [Sat, 20 Jun 2020 07:09:03 +0000 (19:09 +1200)]
panfrost: Update sampler views when the texture bo changes

The BO reallocation path in panfrost_transfer_map caused textures and
sampler views to get out of sync.

v2: Use the GPU address of the BO in case two BOs get allocated at the
    same address.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agopanfrost: RGBA4 and RGB5_A1 framebuffer support
Icecream95 [Sat, 20 Jun 2020 06:53:33 +0000 (18:53 +1200)]
panfrost: RGBA4 and RGB5_A1 framebuffer support

Tested with fbo_firecube.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agopan/mdg: Fix max_comp calculation for constant printing
Icecream95 [Sat, 20 Jun 2020 06:20:59 +0000 (18:20 +1200)]
pan/mdg: Fix max_comp calculation for constant printing

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agopan/decode: Add missing wrap modes
Icecream95 [Sat, 20 Jun 2020 06:20:03 +0000 (18:20 +1200)]
pan/decode: Add missing wrap modes

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agopan/decode: Fix helper invocations when tracing
Icecream95 [Sat, 20 Jun 2020 05:54:19 +0000 (17:54 +1200)]
pan/decode: Fix helper invocations when tracing

midgard1.flags_lo was being changed when tracing, causing helper
invocations to be disabled.

This was found by using mprotect to make BOs read only in
pandecode_fetch_gpu_mem.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

4 years agor600/sfn: Don't set num_components on TESS sysvalue intrinsics
Gert Wollny [Sat, 20 Jun 2020 15:01:15 +0000 (17:01 +0200)]
r600/sfn: Don't set num_components on TESS sysvalue intrinsics

These instructions are not vectorized, and validation rules added for
this with 167fa2887f09
    nir/validate: validate intr->num_components

Fixes: 46a3033b43b9b51cae5c60eea39e7e5af325c4db
    r600/sfn: Emit some LDS instructions

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

4 years agor600/sfn: Add support for shared atomics
Gert Wollny [Sat, 16 May 2020 13:54:11 +0000 (15:54 +0200)]
r600/sfn: Add support for shared atomics

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

4 years agor600/sfn: Add lowering pass for shared IO
Gert Wollny [Mon, 18 May 2020 18:36:16 +0000 (20:36 +0200)]
r600/sfn: Add lowering pass for shared IO

Lower shared load and store to use the r600 specific intrinsics.

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