platform/upstream/mesa.git
3 years agomesa: gather errors and call _mesa_error only once in validate_Draw
Marek Olšák [Mon, 25 Jan 2021 04:48:06 +0000 (23:48 -0500)]
mesa: gather errors and call _mesa_error only once in validate_Draw

This mainly skips all the jumping around various _mesa_error calls that
are never taken. There is a tiny measurable improvement in CPU overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute draw time determination of enabled vertex arrays
Marek Olšák [Mon, 25 Jan 2021 22:07:29 +0000 (17:07 -0500)]
mesa: precompute draw time determination of enabled vertex arrays

Another draw time optimization that precomputes the value only when
_VPMode is changed.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute _mesa_get_vao_vp_inputs
Marek Olšák [Tue, 26 Jan 2021 00:02:39 +0000 (19:02 -0500)]
mesa: precompute _mesa_get_vao_vp_inputs

It's called for every draw, so this is important.

All inputs of _mesa_get_vao_vp_inputs are changed when
update_attribute_map_mode is called, so we can just compute
the value there.

The assertion ensures correct behavior in debug builds.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: set _DrawVAOEnabledAttribs only when it changes
Marek Olšák [Mon, 25 Jan 2021 22:15:43 +0000 (17:15 -0500)]
mesa: set _DrawVAOEnabledAttribs only when it changes

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move gl_context::varying_vp_inputs into ctx->VertexProgram._VaryingInputs
Marek Olšák [Mon, 25 Jan 2021 21:53:34 +0000 (16:53 -0500)]
mesa: move gl_context::varying_vp_inputs into ctx->VertexProgram._VaryingInputs

This is where it belongs.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize set_varying_vp_inputs by precomputing the conditions
Marek Olšák [Mon, 25 Jan 2021 21:47:38 +0000 (16:47 -0500)]
mesa: optimize set_varying_vp_inputs by precomputing the conditions

set_varying_vp_inputs is called every draw call, which checks
_Maintain*Program. Let's move that checking out of there.

This adds a new flag that determines whether set_varying_vp_inputs
should do anything.

All code that changes _Maintain*Program must now reinitialize the new
flag. This is done by new function _mesa_reset_vertex_processing_mode.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: validate numInstances in common functions to unify code
Marek Olšák [Mon, 25 Jan 2021 18:48:51 +0000 (13:48 -0500)]
mesa: validate numInstances in common functions to unify code

Just a cleanup.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move disallowed TFB in DrawElements on GLES from draws to state changes
Marek Olšák [Mon, 25 Jan 2021 18:27:01 +0000 (13:27 -0500)]
mesa: move disallowed TFB in DrawElements on GLES from draws to state changes

glDrawElements is disallowed by GLES when transform feedback is active
and GS is not supported.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: add a separate valid primitive mask just for glDrawElements
Marek Olšák [Mon, 25 Jan 2021 18:25:17 +0000 (13:25 -0500)]
mesa: add a separate valid primitive mask just for glDrawElements

No change in behavior.

This will be used for draw validation required by glDrawElements but not
glDrawArrays.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: don't skip draws with count == 0 or numInstances == 0
Marek Olšák [Mon, 25 Jan 2021 18:08:20 +0000 (13:08 -0500)]
mesa: don't skip draws with count == 0 or numInstances == 0

These are checked by drivers (all gallium drivers and
_mesa_draw_gallium_fallback), so they are redundant here.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: skip MultiDrawArrays with primcount == 0
Marek Olšák [Mon, 25 Jan 2021 18:03:52 +0000 (13:03 -0500)]
mesa: skip MultiDrawArrays with primcount == 0

This is the only zero parameter that gallium can't handle.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove an optional GL error about mapped buffers during execution
Marek Olšák [Mon, 25 Jan 2021 16:55:19 +0000 (11:55 -0500)]
mesa: remove an optional GL error about mapped buffers during execution

Not having this here, even if the branch is not taken, increases
CPU performance by 2% on radeonsi. If some drivers need this, the spec
does allow GL termination, meaning abort(), which is a more effective
alternative given that this never happens.

You may ask, do we really pay a 2% performance hit for every conditional
not taken? For some of them, we do.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: call _mesa_update_state() before validation
Marek Olšák [Mon, 25 Jan 2021 16:14:09 +0000 (11:14 -0500)]
mesa: call _mesa_update_state() before validation

It's called in both the no_error path and the draw validation path, so we
might as well call it before the no_error conditional.

This decreases CPU overhead a lot, which I'm unable to explain. It seems
to be random gcc behavior, which I've seen quite a lot now.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove optional draw validation code to increase performance
Marek Olšák [Mon, 25 Jan 2021 16:22:24 +0000 (11:22 -0500)]
mesa: remove optional draw validation code to increase performance

Some drivers do similar validation in their draw calls.

If drivers need some of this, we can do it in the drivers or even in
_mesa_draw_gallium_fallback for classic drivers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: remove VERBOSE_DRAW
Marek Olšák [Mon, 25 Jan 2021 01:14:28 +0000 (20:14 -0500)]
mesa: remove VERBOSE_DRAW

Let's declutter the code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize the dual source blend error checking using a bitmask
Marek Olšák [Tue, 26 Jan 2021 04:55:55 +0000 (23:55 -0500)]
mesa: optimize the dual source blend error checking using a bitmask

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline _mesa_valid_to_render now that it doesn't do validation
Marek Olšák [Sun, 24 Jan 2021 23:09:19 +0000 (18:09 -0500)]
mesa: inline _mesa_valid_to_render now that it doesn't do validation

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move blending validation from draws to state changes
Marek Olšák [Sun, 24 Jan 2021 21:48:13 +0000 (16:48 -0500)]
mesa: move blending validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move GL_FILL_RECTANGLE validation from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:18:06 +0000 (19:18 -0500)]
mesa: move GL_FILL_RECTANGLE validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move ARB program and integer FBO validation from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:16:06 +0000 (19:16 -0500)]
mesa: move ARB program and integer FBO validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move FBO completeness checking from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:09:37 +0000 (19:09 -0500)]
mesa: move FBO completeness checking from draws to state changes

_mesa_update_framebuffer_visual already calls _mesa_update_valid_to_render-
_state, so we just need to call it where FBOs are marked incomplete.

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move some uniform debug code from draws to state changes
Marek Olšák [Sun, 31 Jan 2021 00:01:36 +0000 (19:01 -0500)]
mesa: move some uniform debug code from draws to state changes

This is a step towards removing _mesa_valid_to_render.

I don't know what this code does. This commit probably breaks it, but it
doesn't seem important. We could remove the code.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move sampler uniform validation from draws to state changes
Marek Olšák [Sat, 30 Jan 2021 23:59:10 +0000 (18:59 -0500)]
mesa: move sampler uniform validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move shader pipeline validation from draws to state changes
Marek Olšák [Sat, 30 Jan 2021 23:59:10 +0000 (18:59 -0500)]
mesa: move shader pipeline validation from draws to state changes

This is a step towards removing _mesa_valid_to_render.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: don't report 1 for GL_VALIDATE_STATUS if user didn't validate pipeline
Marek Olšák [Sun, 31 Jan 2021 04:22:10 +0000 (23:22 -0500)]
mesa: don't report 1 for GL_VALIDATE_STATUS if user didn't validate pipeline

dEQP expects GL_VALIDATE_STATUS to be set to 0 if the user didn't call
glValidateProgramPipeline even if the pipeline is valid, but we will
validate pipeline objects in state changes, not draw calls.

This will fix a failure in this test caused by the next commit:
dEQP-GLES31.functional.state_query.program_pipeline.validate_status_get_program_pipelineiv

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: add skeleton code for DrawPixels/CopyPixels/Bitmap precomputed validation
Marek Olšák [Sat, 30 Jan 2021 23:56:38 +0000 (18:56 -0500)]
mesa: add skeleton code for DrawPixels/CopyPixels/Bitmap precomputed validation

This is for precomputing draw time validation in state changes.
The next commit will use this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: inline check_valid_to_render
Marek Olšák [Sun, 24 Jan 2021 20:13:04 +0000 (15:13 -0500)]
mesa: inline check_valid_to_render

because it has only one use.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: fold most of check_valid_to_render into _mesa_update_valid_to_render_state
Marek Olšák [Sat, 16 Jan 2021 16:30:44 +0000 (11:30 -0500)]
mesa: fold most of check_valid_to_render into _mesa_update_valid_to_render_state

Set the mask (ValidPrimMask) to 0 if draw calls should generate
GL_INVALID_OPERATION. The mask is updated when states are changed.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: move check_valid_to_render call into _mesa_valid_prim_mode
Marek Olšák [Sun, 24 Jan 2021 19:55:10 +0000 (14:55 -0500)]
mesa: move check_valid_to_render call into _mesa_valid_prim_mode

It's going to be mostly eliminated by ValidPrimMask, so let's put them
together.

This also enables check_valid_to_render for glBegin, which seems to have
been omitted accidentally.

_mesa_valid_to_render is now always called by _mesa_valid_prim_mode.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute draw time prim validation during state changes
Marek Olšák [Sat, 16 Jan 2021 14:36:45 +0000 (09:36 -0500)]
mesa: precompute draw time prim validation during state changes

This moves the body of _mesa_valid_prim_mode into new function
_mesa_update_valid_to_render_state, which is called when the affected
states are changed and sets new variable gl_context::ValidPrimMask,
which determines errors reported by draw calls.

_mesa_valid_prim_mode only has to check ValidPrimMask and choose
between GL_INVALID_ENUM and GL_INVALID_OPERATION depending on whether
the primitive would be allowed by the GL version and extensions
(GL_INVALID_OPERATION) or not (GL_INVALID_ENUM).

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: precompute all valid primitive types at context creation
Marek Olšák [Sat, 16 Jan 2021 12:58:17 +0000 (07:58 -0500)]
mesa: precompute all valid primitive types at context creation

New variable gl_context::MaxValidPrimMask is set at context creation
and determines the valid primitive types for that context.

The Max prefix indicates that the mask doesn't mask out primitives
disallowed by current states and shaders.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agomesa: optimize draw index type checking
Marek Olšák [Sat, 16 Jan 2021 12:16:08 +0000 (07:16 -0500)]
mesa: optimize draw index type checking

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>

3 years agofreedreno: Add missing dep on freedreno tracepoints.
Eric Anholt [Mon, 15 Feb 2021 18:36:49 +0000 (10:36 -0800)]
freedreno: Add missing dep on freedreno tracepoints.

We were only get guaranteed that libfreedreno (and thus the tracepoints
generation) was ready when we linked, not when we compiled the gmemtool.c
that also used it.

Fixes: a02dcb970fff ("freedreno: Add GPU tracepoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9056>

3 years agovulkan: document flags choice for vkGetDeviceQueue
Lionel Landwerlin [Mon, 15 Feb 2021 16:25:16 +0000 (18:25 +0200)]
vulkan: document flags choice for vkGetDeviceQueue

Signed-off-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/9053>

3 years agoci/v3d: Add V3D and V3DV testing
Juan A. Suarez Romero [Fri, 12 Feb 2021 12:29:19 +0000 (13:29 +0100)]
ci/v3d: Add V3D and V3DV testing

Add OpenGL and Vulkan testing for V3D and V3DV respectively.

Add also a couple of manual piglit jobs for V3D.

v2:
 - Replace custom mustpass with running fraction of tests (Eric)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8745>

3 years agoci: add option to overwrite CPU arch
Juan A. Suarez Romero [Tue, 26 Jan 2021 18:13:21 +0000 (19:13 +0100)]
ci: add option to overwrite CPU arch

When loading Vulkan ICD file, it uses the CPU machine identifier to
load the correct one, in case multiple versions are installed.

This is fine if the machine where Mesa has been built and the machine
where the test is run are exactly the same. But this is not always the
case. As example, for armhf architecture, the machine where Mesa is
built is identified as `arm7hlf`, but the Raspberry Pi 4 is identified
as `armv7l`, so it will fail to load the ICD file, though both are
totally compatible.

This allow to define the architecture instead.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8745>

3 years agoaco: add DeviceInfo
Rhys Perry [Thu, 28 Jan 2021 13:07:11 +0000 (13:07 +0000)]
aco: add DeviceInfo

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

3 years agoaco: consider that GFX10.3 allocates LDS in 1024 byte blocks
Rhys Perry [Fri, 11 Dec 2020 17:33:03 +0000 (17:33 +0000)]
aco: consider that GFX10.3 allocates LDS in 1024 byte blocks

fossil-db (GFX10.3):
Totals from 3 (0.00% of 139391) affected shaders:
VMEM: 513 -> 511 (-0.39%)
SMEM: 94 -> 92 (-2.13%)
VClause: 31 -> 30 (-3.23%)

fossil-db (GFX10.3, wave32):
Totals from 4 (0.00% of 139391) affected shaders:
VClause: 82 -> 81 (-1.22%)

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

3 years agoradv,aco: add radv_nir_compiler_options::wgp_mode
Rhys Perry [Mon, 1 Feb 2021 15:14:01 +0000 (15:14 +0000)]
radv,aco: add radv_nir_compiler_options::wgp_mode

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

3 years agoaco: add Program::wgp_mode
Rhys Perry [Thu, 28 Jan 2021 11:07:26 +0000 (11:07 +0000)]
aco: add Program::wgp_mode

Instead of assuming WGP mode on GFX10+ in different places, add a member
to Program that can be used instead.

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

3 years agoaco: fix waves calculation for wave32
Rhys Perry [Thu, 28 Jan 2021 11:04:02 +0000 (11:04 +0000)]
aco: fix waves calculation for wave32

fossil-db (GFX10.3, wave32):
Totals from 176 (0.13% of 139391) affected shaders:
SGPRs: 16648 -> 16640 (-0.05%)
VGPRs: 18920 -> 19076 (+0.82%); split: -0.30%, +1.12%
CodeSize: 2354172 -> 2354288 (+0.00%); split: -0.01%, +0.01%
MaxWaves: 1618 -> 1627 (+0.56%); split: +0.68%, -0.12%
Instrs: 435756 -> 435761 (+0.00%); split: -0.02%, +0.02%
Cycles: 8858360 -> 8869960 (+0.13%); split: -0.01%, +0.14%
VMEM: 55899 -> 57220 (+2.36%); split: +2.53%, -0.17%
SMEM: 10323 -> 10374 (+0.49%); split: +0.73%, -0.23%
VClause: 8307 -> 8290 (-0.20%); split: -0.24%, +0.04%
SClause: 16573 -> 16577 (+0.02%); split: -0.01%, +0.03%
Copies: 24641 -> 24652 (+0.04%); split: -0.24%, +0.28%

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

3 years agoradv: round up max_lds_per_simd / lds_per_wave
Rhys Perry [Thu, 28 Jan 2021 13:31:33 +0000 (13:31 +0000)]
radv: round up max_lds_per_simd / lds_per_wave

If each SIMD has to get an different number of waves, report the maximum.

One example of a situation is when a single-wave workgroup uses more than
max_lds_per_simd. This change causes radv_get_max_waves() to report a
single wave per SIMD instead of none.

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

3 years agoradv: use lds_{encode,alloc}_granularity
Rhys Perry [Thu, 28 Jan 2021 12:03:03 +0000 (12:03 +0000)]
radv: use lds_{encode,alloc}_granularity

This fixes a issue in radv_get_max_waves() where it aligned the LDS
allocation to 512 bytes instead of 1024 on GFX10.3.

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

3 years agoac: split lds_granularity into encode and allocation granularities
Rhys Perry [Thu, 28 Jan 2021 11:59:21 +0000 (11:59 +0000)]
ac: split lds_granularity into encode and allocation granularities

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

3 years agoradv: switch MaxWaves statistic to wave32 waves
Rhys Perry [Thu, 28 Jan 2021 11:42:35 +0000 (11:42 +0000)]
radv: switch MaxWaves statistic to wave32 waves

Always return the wave32 waves instead of wave64 waves because the wave32
wave count is more precise in the case of wave32.

This also fixes usage of lds_per_wave in wave32.

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

3 years agoradv: fix max_lds_per_simd on GFX10
Rhys Perry [Thu, 28 Jan 2021 11:44:43 +0000 (11:44 +0000)]
radv: fix max_lds_per_simd on GFX10

num_simd_per_compute_unit was the number of SIMDs per compute unit, but
lds_size_per_workgroup was the bytes of LDS per WGP.

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

3 years agoci: Bump deqp to current vulkan-cts-1.2.5.1
Juan A. Suarez Romero [Thu, 11 Feb 2021 15:57:50 +0000 (16:57 +0100)]
ci: Bump deqp to current vulkan-cts-1.2.5.1

This new version contains several fixes.

v2:
 - Bump lava kernel+rootfs tag (Eric)

v3:
 - Drop {x86,arm}_test-base tag bumps (Michel)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8990>

3 years agointel/dump_gpu: mark bo as unmapped if its address changes
Marcin Ślusarz [Fri, 12 Feb 2021 11:44:03 +0000 (12:44 +0100)]
intel/dump_gpu: mark bo as unmapped if its address changes

Fixes crash in ppgtt_lookup when the same bo is used twice
with different offsets.

It's possible to hit this with i965 and always_flush_batch=true.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9008>

3 years agointel/tools/aub: remove superfluous new line from error messages
Marcin Ślusarz [Wed, 10 Feb 2021 14:06:59 +0000 (15:06 +0100)]
intel/tools/aub: remove superfluous new line from error messages

This function is used as a callback and the other instance
of this callback doesn't add its own new line.
Messages printed by this function already end with a new line.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8988>

3 years agointel/tools/aub: handle truncated input file
Marcin Ślusarz [Wed, 10 Feb 2021 14:05:31 +0000 (15:05 +0100)]
intel/tools/aub: handle truncated input file

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8988>

3 years agointel/tools/aub: print better error message when mmap fails
Marcin Ślusarz [Wed, 10 Feb 2021 11:22:11 +0000 (12:22 +0100)]
intel/tools/aub: print better error message when mmap fails

Aubinator creates lots of 4k mappings, so for large traces it's
possible to hit system limit on the number of mappings created
by a single process.

Ideally, aubinator should merge those mappings, but that's tricky
and I'm not sure it's worth spending time on.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8988>

3 years agopanfrost: Move the blend logic out of the gallium driver
Boris Brezillon [Wed, 10 Feb 2021 07:47:39 +0000 (08:47 +0100)]
panfrost: Move the blend logic out of the gallium driver

Most of it is API-independent, so let's move it out of the gallium
driver so it can be shared with the Vulkan driver.

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

3 years agopanfrost: Move the blend lowering code out of the gallium driver
Boris Brezillon [Tue, 9 Feb 2021 17:06:59 +0000 (18:06 +0100)]
panfrost: Move the blend lowering code out of the gallium driver

Will be used by the pan_blend library.

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

3 years agopanfrost: Rename pan_blend.h into pan_blend_cso.h
Boris Brezillon [Tue, 9 Feb 2021 17:46:09 +0000 (18:46 +0100)]
panfrost: Rename pan_blend.h into pan_blend_cso.h

We are about to add a pan_blend.h in src/panfrost/lib. Rename the
existing pan_blend.h so we can include both.

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

3 years agopanfrost: Use the pan_shader_prepare_rsd() helper
Boris Brezillon [Sat, 13 Feb 2021 08:01:15 +0000 (09:01 +0100)]
panfrost: Use the pan_shader_prepare_rsd() helper

This implies late preparation of the fragment shader RSD, but given the
simplicity of pan_shader_prepare_rsd() (it's basically a 1:1 translation
between shader info and the RSD fields), it's unlikely to make a
difference. If we really want to optimize the time spent preparing the
RSD, we should consider caching a packed version at the batch level and
re-using it when nothing changed.

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

3 years agopanfrost: Provide a helper to prepare the shader related parts of an RSD
Boris Brezillon [Sat, 13 Feb 2021 07:41:47 +0000 (08:41 +0100)]
panfrost: Provide a helper to prepare the shader related parts of an RSD

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

3 years agopanfrost: Move the shader compilation logic out of the gallium driver
Boris Brezillon [Sat, 13 Feb 2021 07:24:03 +0000 (08:24 +0100)]
panfrost: Move the shader compilation logic out of the gallium driver

While at it, rework the code to avoid copies between intermediate
structures: the pan_shader_info is passed to the compiler context so
the compiler can fill shader information directly.

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

3 years agopanfrost: Keep the compiler inputs in the context
Boris Brezillon [Fri, 12 Feb 2021 17:11:06 +0000 (18:11 +0100)]
panfrost: Keep the compiler inputs in the context

So we don't have to copy data around.

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

3 years agopanfrost: Move sysval_to_id out of panfrost_sysvals
Boris Brezillon [Fri, 12 Feb 2021 16:49:23 +0000 (17:49 +0100)]
panfrost: Move sysval_to_id out of panfrost_sysvals

So we can re-use the panfrost_sysvals definition outside of the
compiler without dragging the sysval_to_id hash table.

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

3 years agopanfrost: Prefix shader related helpers with pan_shader_
Boris Brezillon [Fri, 12 Feb 2021 15:59:59 +0000 (16:59 +0100)]
panfrost: Prefix shader related helpers with pan_shader_

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

3 years agopanfrost: Hide backend compiler internals
Boris Brezillon [Fri, 12 Feb 2021 15:54:17 +0000 (16:54 +0100)]
panfrost: Hide backend compiler internals

Move panfrost_compile_shader() and panfrost_get_shader_options() to
pan_shader.c and drop the {bifrost,midgard}_compile.h include so backend
compiler internals are not directly exposed to the gallium driver.

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

3 years agopanfrost: Use panfrost_get_shader_options() in panfrost_build_blit_shader()
Boris Brezillon [Fri, 12 Feb 2021 15:51:07 +0000 (16:51 +0100)]
panfrost: Use panfrost_get_shader_options() in panfrost_build_blit_shader()

We should use Bifrost NIR options when compiling for Bifrost.

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

3 years agoamd: update addrlib
Marek Olšák [Tue, 27 Oct 2020 04:13:42 +0000 (00:13 -0400)]
amd: update addrlib

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8896>

3 years agoradv: Properly handle modifier import failure.
Bas Nieuwenhuizen [Fri, 12 Feb 2021 14:08:32 +0000 (15:08 +0100)]
radv: Properly handle modifier import failure.

The layout code can fail now in the non-delayed case with modifiers.

Fixes: 7f7da82dbb7 ("radv: Add image layout with drm format modifiers.")
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9012>

3 years agoradv: Remove vk_format_has_stencil/depth helpers.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 21:22:16 +0000 (22:22 +0100)]
radv: Remove vk_format_has_stencil/depth helpers.

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

3 years agoradv: Remove the format table.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 21:19:55 +0000 (22:19 +0100)]
radv: Remove the format table.

Kill some code!

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

3 years agoradv: Start using util_format_description for everything.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 21:14:12 +0000 (22:14 +0100)]
radv: Start using util_format_description for everything.

Steps:

git reset --hard
sed -i 's/struct vk_format_description \*/struct util_format_description \*/g' *.{c,h}
sed -i 's/VK_FORMAT_COLORSPACE/UTIL_FORMAT_COLORSPACE/g' *.c
sed -i 's/= VK_FORMAT_COLORSPACE/= UTIL_FORMAT_COLORSPACE/g' *.h
sed -i 's/enum vk_format_colorspace /enum util_format_colorspace /g' *.h
sed -i 's/VK_FORMAT_TYPE/UTIL_FORMAT_TYPE/g' *.c
sed -i 's/VK_FORMAT_LAYOUT/UTIL_FORMAT_LAYOUT/g' *.c
sed -i 's/vk_format_channel_description/util_format_channel_description/g' *.c
sed -i 's/vk_format_description(/vk_format_description_legacy(/g' *.py
sed -i 's/const struct vk_format_description \*/static const struct vk_format_description \*/g' *.py

Then manually:

1) Rename the vk_format_colorspace definition back (only want the uses renamed)
2) Fix the desc->format == VK_FORMAT_... warnings
3) Add vk_format_description implementation (and remove warning pragmas)

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

3 years agoradv: Only support format with a PIPE_FORMAT.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 21:44:40 +0000 (22:44 +0100)]
radv: Only support format with a PIPE_FORMAT.

Otherwise non-supported format will be mapped to PIPE_FORMAT_NONE and
as such get a non-NULL description.

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

3 years agoradv: Stop using plane_count.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 21:06:25 +0000 (22:06 +0100)]
radv: Stop using plane_count.

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

3 years agoradv: Stop checking for MULTIPLANE layout.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 20:59:40 +0000 (21:59 +0100)]
radv: Stop checking for MULTIPLANE layout.

It is not a single layout in the util code.

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

3 years agoradv: Do not use generated table for plane formats.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 18:15:58 +0000 (19:15 +0100)]
radv: Do not use generated table for plane formats.

I want to remove the table and this is a fairly small amount of code.

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

3 years agoradv: Do no use vk_format for getting divisors.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 18:14:15 +0000 (19:14 +0100)]
radv: Do no use vk_format for getting divisors.

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

3 years agoradv: Remove VK_SWIZZLE_*.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 17:49:41 +0000 (18:49 +0100)]
radv: Remove VK_SWIZZLE_*.

Values are the same as PIPE_SWIZZLE_*.

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

3 years agoradv: Use u_format helpers when possible.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 17:49:14 +0000 (18:49 +0100)]
radv: Use u_format helpers when possible.

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

3 years agoradv: Add plane width/height helpers.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 17:34:54 +0000 (18:34 +0100)]
radv: Add plane width/height helpers.

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

3 years agoradv: Determine swizzles correctly.
Bas Nieuwenhuizen [Sat, 30 Jan 2021 20:35:59 +0000 (21:35 +0100)]
radv: Determine swizzles correctly.

Previously we were calculating the inverse swizzle instead and doing something
horrible to get 0/1 right, and then "fixing" our table.

Let's do it right an align with the mesa-wide table.

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

3 years agozink: fix detection of KHR_maintenance1/2
Hoe Hao Cheng [Sat, 13 Feb 2021 18:29:34 +0000 (02:29 +0800)]
zink: fix detection of KHR_maintenance1/2

Since some extensions never got their dedicated feature structs, not all
extensions promoted to core Vulkan have the relevant feature bits in
`VkPhysicalDeviceVulkanXYFeatures`. Those extensions are supported by
the device when the device version is high enough.

For those extensions, set the screen flags directly if the device
version is sufficient, otherwise check for the extension as usual.

Fixes: efe6f00e ("zink/codegen: do not enable extensions that are now core")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9030>

3 years agolima: implement GL_EXT_texture_swizzle
Erico Nunes [Wed, 10 Feb 2021 22:23:30 +0000 (23:23 +0100)]
lima: implement GL_EXT_texture_swizzle

This is a desktop OpenGL 2.1 extension that seems to be required by
glamor to support glyph rendering acceleration with R8 textures.
Implementation borrowed from vc4.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8969>

3 years agor600/sfn: Initialize FragmentShaderFromNir member m_pos_input.
Vinson Lee [Fri, 12 Feb 2021 04:07:00 +0000 (20:07 -0800)]
r600/sfn: Initialize FragmentShaderFromNir member m_pos_input.

Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member m_pos_input is not
initialized in this constructor nor in any functions that it
calls.

Fixes: 374bc76706e ("r600/sfn: Add the position input as varying")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9004>

3 years agoradeonsi: add debug options nodisplaytiling and nodisplaydcc
Marek Olšák [Tue, 20 Oct 2020 00:21:58 +0000 (20:21 -0400)]
radeonsi: add debug options nodisplaytiling and nodisplaydcc

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoradeonsi: skip s_sendmsg(gs_alloc_req) for NGG passthrough on new chips
Marek Olšák [Tue, 26 Jan 2021 22:43:32 +0000 (17:43 -0500)]
radeonsi: skip s_sendmsg(gs_alloc_req) for NGG passthrough on new chips

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoamd: sort chip enums based on hw revision
Marek Olšák [Tue, 26 Jan 2021 22:34:37 +0000 (17:34 -0500)]
amd: sort chip enums based on hw revision

A future commit will depend on this.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: conceal L2 cache sizes
Marek Olšák [Thu, 4 Feb 2021 06:55:34 +0000 (01:55 -0500)]
ac/gpu_info: conceal L2 cache sizes

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: inline get_l2_cache_size and set cache sizes farther down
Marek Olšák [Thu, 4 Feb 2021 06:18:12 +0000 (01:18 -0500)]
ac/gpu_info: inline get_l2_cache_size and set cache sizes farther down

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: remove redundant radeon_info::num_sdp_interfaces
Marek Olšák [Thu, 4 Feb 2021 06:17:19 +0000 (01:17 -0500)]
ac/gpu_info: remove redundant radeon_info::num_sdp_interfaces

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: add radeon_info::num_tcc_blocks
Marek Olšák [Thu, 4 Feb 2021 06:11:38 +0000 (01:11 -0500)]
ac/gpu_info: add radeon_info::num_tcc_blocks

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: rename num_tcc_blocks -> max_tcc_blocks
Marek Olšák [Thu, 4 Feb 2021 05:50:32 +0000 (00:50 -0500)]
ac/gpu_info: rename num_tcc_blocks -> max_tcc_blocks

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agoac/gpu_info: print use_late_alloc
Marek Olšák [Sat, 6 Feb 2021 00:20:44 +0000 (19:20 -0500)]
ac/gpu_info: print use_late_alloc

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>

3 years agowinsys/amdgpu: disallow pb_cache for backing buffers of sparse buffers
Marek Olšák [Sat, 6 Feb 2021 05:32:31 +0000 (00:32 -0500)]
winsys/amdgpu: disallow pb_cache for backing buffers of sparse buffers

because amdgpu_bo_wait doesn't wait for active CS jobs using the buffers.
This fixes incorrect buffer reuse of busy buffers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8895>

3 years agocompiler: Drop now unused gl_varying_slot_name()
Caio Marcelo de Oliveira Filho [Thu, 11 Feb 2021 20:35:44 +0000 (12:35 -0800)]
compiler: Drop now unused gl_varying_slot_name()

There's reuse of values depending on the stage, so a function that
just takes the value might produce invalid results.  All the codebase
was already changed to use the gl_varying_slot_name_for_stage()
instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

3 years agost/atifs: Use gl_varying_slot_name_for_stage()
Caio Marcelo de Oliveira Filho [Thu, 11 Feb 2021 20:31:41 +0000 (12:31 -0800)]
st/atifs: Use gl_varying_slot_name_for_stage()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

3 years agoetnaviv: Use gl_varying_slot_name_for_stage()
Caio Marcelo de Oliveira Filho [Thu, 11 Feb 2021 20:30:49 +0000 (12:30 -0800)]
etnaviv: Use gl_varying_slot_name_for_stage()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

3 years agofreedreno/ir3: Use gl_varying_slot_name_for_stage()
Caio Marcelo de Oliveira Filho [Thu, 11 Feb 2021 20:30:19 +0000 (12:30 -0800)]
freedreno/ir3: Use gl_varying_slot_name_for_stage()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

3 years agointel/compiler: Use gl_varying_slot_name_for_stage()
Caio Marcelo de Oliveira Filho [Thu, 11 Feb 2021 20:19:13 +0000 (12:19 -0800)]
intel/compiler: Use gl_varying_slot_name_for_stage()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

3 years agozink: flag exact alu op results in ntv with NoContraction
Mike Blumenkrantz [Wed, 29 Jul 2020 14:22:55 +0000 (10:22 -0400)]
zink: flag exact alu op results in ntv with NoContraction

this propagates the exact flag and ensures precision isn't lost during
optimizations

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

3 years agoaco: remove dead code for the handling of exec temporaries
Daniel Schürmann [Thu, 4 Feb 2021 15:01:44 +0000 (16:01 +0100)]
aco: remove dead code for the handling of exec temporaries

Totals from 26026 (18.67% of 139391) affected shaders (Navi10):
PreSGPRs: 370993 -> 326177 (-12.08%)

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

3 years agoaco: make all exec accesses non-temporaries
Daniel Schürmann [Wed, 3 Feb 2021 14:44:49 +0000 (15:44 +0100)]
aco: make all exec accesses non-temporaries

So that they are not counted into the register demand.

Totals from 107336 (77.00% of 139391) affected shaders (Navi10):
VGPRs: 4023452 -> 4023248 (-0.01%); split: -0.01%, +0.01%
SpillSGPRs: 14088 -> 12571 (-10.77%); split: -11.03%, +0.26%
CodeSize: 266816164 -> 266765528 (-0.02%); split: -0.04%, +0.02%
MaxWaves: 1553339 -> 1553374 (+0.00%); split: +0.00%, -0.00%
Instrs: 50977701 -> 50973093 (-0.01%); split: -0.02%, +0.01%
Cycles: 1733911128 -> 1733605320 (-0.02%); split: -0.05%, +0.03%
VMEM: 40867650 -> 40900204 (+0.08%); split: +0.13%, -0.05%
SMEM: 6835980 -> 6829073 (-0.10%); split: +0.10%, -0.20%
VClause: 1032783 -> 1032788 (+0.00%); split: -0.01%, +0.01%
SClause: 2103705 -> 2104115 (+0.02%); split: -0.09%, +0.11%
Copies: 3195658 -> 3193656 (-0.06%); split: -0.30%, +0.24%
Branches: 1140213 -> 1140120 (-0.01%); split: -0.05%, +0.04%
PreSGPRs: 3603785 -> 3437064 (-4.63%); split: -5.13%, +0.50%
PreVGPRs: 3321996 -> 3321850 (-0.00%)

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

3 years agoaco: handle non-temp phi definitions and operands
Daniel Schürmann [Thu, 4 Feb 2021 14:55:23 +0000 (15:55 +0100)]
aco: handle non-temp phi definitions and operands

This will be necessary as we make exec non-temp.

No fossil-db changes.

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

3 years agoaco: don't create unnecessary exec phi on merge blocks
Daniel Schürmann [Wed, 3 Feb 2021 14:32:32 +0000 (15:32 +0100)]
aco: don't create unnecessary exec phi on merge blocks

No fossil-db changes.

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

3 years agov3dv/meta_copy: get tlb compatible BC compressed formats for copies
Alejandro Piñeiro [Thu, 11 Feb 2021 23:18:02 +0000 (00:18 +0100)]
v3dv/meta_copy: get tlb compatible BC compressed formats for copies

So we can use the tlb path for several operations (copy image, clear,
copy buffer to image, etc).

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8929>