platform/upstream/mesa.git
3 years agodocs: show 'Edit on GitLab'-link
Erik Faye-Lund [Wed, 16 Sep 2020 09:54:21 +0000 (11:54 +0200)]
docs: show 'Edit on GitLab'-link

It's easier to contribute to the documentation if we have links to the
document on GitLab. This will allow people to easily edit docs, or to
realize where in the source-tree they are without having to search.

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

3 years agodocs: escape backquote character
Erik Faye-Lund [Fri, 25 Sep 2020 10:58:30 +0000 (12:58 +0200)]
docs: escape backquote character

This unescaped backquote charcter confuses Sphinx, making it emit a
warning and slightly confused HTML in the end.

Let's escape it instead, to keep things sane.

Fixes: fdff24d930d ("docs: add release notes for 20.1.8")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6863>

3 years agolima: set clear depth value to 0x00ffffff as default
Andreas Baierl [Wed, 23 Sep 2020 14:59:19 +0000 (16:59 +0200)]
lima: set clear depth value to 0x00ffffff as default

According to the specs, the initial depth value for a
depth buffer clear is 1. Use 0x00ffffff like the blob does.

We can remove setting this value in lima_clear, because it's
set during job creation now.

Fixes the following dEQP tests:

dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb565_depth_component16
dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb5_a1_depth_component16
dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb4_depth_component16
dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgba_depth_component16
dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgb_depth_component16

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6842>

3 years agoandroid: pan/bi: fix typo in bifrost_gen_disasm.c gen rules
Mauro Rossi [Fri, 25 Sep 2020 22:09:07 +0000 (00:09 +0200)]
android: pan/bi: fix typo in bifrost_gen_disasm.c gen rules

Gen rules were erroneusly named as bifrost_gen_disasm*s*
This patch fixes them

Fixes: 792b51713bf4 ("android: pan/bi: Use new disassembler")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6873>

3 years agopanfrost: Fix bifrost tiler job emission
Boris Brezillon [Fri, 25 Sep 2020 08:27:33 +0000 (10:27 +0200)]
panfrost: Fix bifrost tiler job emission

The tiler descriptor pointer and padding sections were not filled.

Fixes: d289209ea68f ("panfrost: XML-ify the compute job descriptor")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6859>

3 years agopanfrost: Fix bifrost tiler descriptor definition
Boris Brezillon [Fri, 25 Sep 2020 08:24:43 +0000 (10:24 +0200)]
panfrost: Fix bifrost tiler descriptor definition

The bifrost tiler descriptor definition was wrong, leading to a buffer
overflow.

Fixes: efce73d99d0e ("panfrost: XML-ify the bifrost tiler descriptors")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6859>

3 years agoci: add dEQP-VK.info.device_extensions to the list of skipped tests
Samuel Pitoiset [Thu, 24 Sep 2020 11:15:58 +0000 (13:15 +0200)]
ci: add dEQP-VK.info.device_extensions to the list of skipped tests

It regularly fails when a new KHR extension is implemented.

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

3 years agoclover: set LLVM min version to 8.0.1
Serge Martin [Sun, 23 Aug 2020 05:57:12 +0000 (07:57 +0200)]
clover: set LLVM min version to 8.0.1

It also bump from 8.0.0 to .1 for AMD gallium and VK

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6336>

3 years agoclover/nir: Call the memcpy lowering pass
Jason Ekstrand [Mon, 14 Sep 2020 20:56:48 +0000 (15:56 -0500)]
clover/nir: Call the memcpy lowering pass

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agospirv: Add support for OpCopyMemorySized
Jason Ekstrand [Mon, 14 Sep 2020 19:18:24 +0000 (14:18 -0500)]
spirv: Add support for OpCopyMemorySized

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agonir: Add a lowering pass to lower memcpy
Jason Ekstrand [Mon, 14 Sep 2020 20:20:37 +0000 (15:20 -0500)]
nir: Add a lowering pass to lower memcpy

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agonir: Add a new memcpy intrinsic
Jason Ekstrand [Mon, 14 Sep 2020 20:21:47 +0000 (15:21 -0500)]
nir: Add a new memcpy intrinsic

This matches SPIR-V's OpCopyMemorySized

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agospirv: Use the new types helpers
Jason Ekstrand [Mon, 14 Sep 2020 21:30:16 +0000 (16:30 -0500)]
spirv: Use the new types helpers

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agocompiler/types: Add glsl_baseN_t_type(bit_size) helpers
Jason Ekstrand [Mon, 14 Sep 2020 21:30:03 +0000 (16:30 -0500)]
compiler/types: Add glsl_baseN_t_type(bit_size) helpers

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>

3 years agogallivm: add support for lowered IO in vertex shaders
Marek Olšák [Fri, 11 Sep 2020 23:59:32 +0000 (19:59 -0400)]
gallivm: add support for lowered IO in vertex shaders

for Selection/Feedback/RasterPos in st/mesa.

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

3 years agomeson/anv: Use variable that checks for --build-id
Dylan Baker [Tue, 22 Sep 2020 16:02:46 +0000 (09:02 -0700)]
meson/anv: Use variable that checks for --build-id

fixes: d1992255bb29054fa51763376d125183a9f602f3
       ("meson: Add build Intel "anv" vulkan driver")

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

3 years agovtn/opencl: Switch fma to conditionally use libclc for 32bit floats
Jesse Natalie [Tue, 18 Aug 2020 15:00:29 +0000 (08:00 -0700)]
vtn/opencl: Switch fma to conditionally use libclc for 32bit floats

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

3 years agovtn/opencl: Only use libclc ldexp when lower_ldexp is set
Jesse Natalie [Tue, 18 Aug 2020 14:59:56 +0000 (07:59 -0700)]
vtn/opencl: Only use libclc ldexp when lower_ldexp is set

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

3 years agovtn/opencl: Switch some nir-sequence ops to use libclc
Jesse Natalie [Tue, 18 Aug 2020 14:58:20 +0000 (07:58 -0700)]
vtn/opencl: Switch some nir-sequence ops to use libclc

All of these are pretty well-defined. Rather than implementing them
as a sequence of nir ops, we can just use the libclc implementation.

v2 (idr): Delete functions that are now unused.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn/opencl: Switch division-related ops to use libclc
Jesse Natalie [Tue, 18 Aug 2020 14:55:42 +0000 (07:55 -0700)]
vtn/opencl: Switch division-related ops to use libclc

Specifically, fmod only uses libclc if it was going to be lowered.
Also, add missing half_divide and half_recip handling.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn/opencl: Switch exp/pow/log to use libclc
Jesse Natalie [Tue, 18 Aug 2020 14:52:27 +0000 (07:52 -0700)]
vtn/opencl: Switch exp/pow/log to use libclc

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn/opencl: Switch non-native trig to use libclc
Jesse Natalie [Tue, 18 Aug 2020 14:42:51 +0000 (07:42 -0700)]
vtn/opencl: Switch non-native trig to use libclc

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn/opencl: Hook up OpenCL async copy and group wait opcodes via libclc
Jesse Natalie [Fri, 25 Sep 2020 19:13:17 +0000 (12:13 -0700)]
vtn/opencl: Hook up OpenCL async copy and group wait opcodes via libclc

Adds an additional hook for spirv_to_nir to handle a core opcode via
the OpenCL libclc infrastructure, and adds handling for SpvOpGroupAsyncCopy and
SpvOpGroupWaitEvents.

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

3 years agovtn/opencl: Rework handle_instr to be able to handle core SPIR-V opcodes via libclc
Jesse Natalie [Fri, 25 Sep 2020 19:11:14 +0000 (12:11 -0700)]
vtn/opencl: Rework handle_instr to be able to handle core SPIR-V opcodes via libclc

The OpenCL async copy/wait opcodes are core SPIR-V, rather than OpenCL extension opcodes.

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

3 years agovtn/opencl: Implement a lot of opcodes via libclc
Jesse Natalie [Tue, 18 Aug 2020 14:37:00 +0000 (07:37 -0700)]
vtn/opencl: Implement a lot of opcodes via libclc

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

3 years agoclover: handle libclc shader (v3)
Dave Airlie [Wed, 10 Apr 2019 00:24:46 +0000 (10:24 +1000)]
clover: handle libclc shader (v3)

This works by taking the spirv produced by libclc which contains
a lot of mangled function entrypoints identified with LinkageAttribute decorations.

This patch just sets up clover to load the libclc blob and convert it to
library nir, and support inlining application nir with calls to libclc.

v2: Add a disk cache support for this object, to avoid the spirv parsing
overheads each time. move spirv->nir to lazy instantiation to avoid
the mess with glsl types and constructor ordering.
v3: make disk cache optional

v1-Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

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

3 years agoutil: add missing extern C
Dave Airlie [Thu, 27 Aug 2020 20:17:46 +0000 (06:17 +1000)]
util: add missing extern C

This code is included in c++ code via disk_cache in theory,
in practice it never has been.

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

3 years agovtn/opencl: Add infrastructure for calling out to libclc
Jesse Natalie [Tue, 18 Aug 2020 14:16:32 +0000 (07:16 -0700)]
vtn/opencl: Add infrastructure for calling out to libclc

This patch adds a function remap table with name mangling, which
can convert a SPIR-V OpenCL extension opcode to a call to the external
libclc shader, which will be lowered/inlined after conversion.

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

3 years agoclover/nir: add libclc lowering pass
Dave Airlie [Mon, 18 Nov 2019 06:37:28 +0000 (16:37 +1000)]
clover/nir: add libclc lowering pass

This pass goes through all the functions in the shader, checks
if the matching function is in the clc spir-v library and inlines
the replacement from there it is.

v2 (daniels): Also copy variables from the libclc shader
v3 (jekstrand): Fix progress return, only run variable inlining once
v4 (jekstrand): Have function inlining also copy vars for us

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn/opencl: Rework type handling for CL extension opcodes
Jesse Natalie [Tue, 18 Aug 2020 13:49:32 +0000 (06:49 -0700)]
vtn/opencl: Rework type handling for CL extension opcodes

 - Change dest type information to be vtn_type rather than glsl_type
 - Add source type information, also in vtn_type form

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agonir/vtn: Add handling for SPIR-V event variables
Jesse Natalie [Tue, 18 Aug 2020 13:41:18 +0000 (06:41 -0700)]
nir/vtn: Add handling for SPIR-V event variables

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agovtn: add an option to create a nir library from spirv
Dave Airlie [Mon, 18 Nov 2019 06:39:09 +0000 (16:39 +1000)]
vtn: add an option to create a nir library from spirv

This adds an options to turn a spir-v library into a set of nir
functions. There is no entry point and all function implentations
are emitted.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agonir: Add glsl_base_type unsigned -> signed version helper
Jesse Natalie [Mon, 22 Jun 2020 22:00:20 +0000 (15:00 -0700)]
nir: Add glsl_base_type unsigned -> signed version helper

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>

3 years agonir: Add an internal flag to shader_info
Jesse Natalie [Wed, 26 Aug 2020 21:22:07 +0000 (14:22 -0700)]
nir: Add an internal flag to shader_info

Don't print the shader if it's marked internal, unless NIR_PRINT
has been explicitly set to 2 (or higher).

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

3 years agodriconf: Use nesting macros for defining options.
Eric Anholt [Wed, 16 Sep 2020 19:44:14 +0000 (12:44 -0700)]
driconf: Use nesting macros for defining options.

Manually balancing the BEGIN/ENDs is a recipe for xml validation failures,
just make the macros do the balancing.  The only ugly bit I think is that
enums take a list of DRI_CONF_ENUM() without ','s in between them.

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

3 years agovirgl: Clean up the driconf definition of GLES_SAMPLES_PASSED_VALUE.
Eric Anholt [Wed, 16 Sep 2020 20:03:14 +0000 (13:03 -0700)]
virgl: Clean up the driconf definition of GLES_SAMPLES_PASSED_VALUE.

The right values ended up being passed to DRI_CONF_OPT_BEGIN_V, they were just
named wrong.

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

3 years agoutil/xmlconfig: Add a unit test of the code.
Eric Anholt [Thu, 10 Sep 2020 22:13:03 +0000 (15:13 -0700)]
util/xmlconfig: Add a unit test of the code.

I want to build a non-XML-based alternative for Android, and to do that I
want to know that my equivalent code still works.

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

3 years agoblorp: Ensure aligned HIZ_CCS_WT partial clears
Nanley Chery [Thu, 24 Sep 2020 17:01:11 +0000 (10:01 -0700)]
blorp: Ensure aligned HIZ_CCS_WT partial clears

Fixes: 5425fcf2cb3 ("intel/blorp: Satisfy HIZ_CCS fast-clear alignments")
Reported-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6854>

3 years agomeson: add support for loongson's mips/mips64 arch.
zhu yong [Wed, 23 Sep 2020 02:37:01 +0000 (10:37 +0800)]
meson: add support for loongson's mips/mips64 arch.

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

3 years agofreedreno/layout: add tile_all flag to the layout
Samuel Iglesias Gonsálvez [Fri, 25 Sep 2020 11:01:48 +0000 (13:01 +0200)]
freedreno/layout: add tile_all flag to the layout

Added a new tile_all flag which is used to set the TILE_ALL flag of
the texture. Enabled tile_all to depth/stencil images are they are
non-linear.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6848>

3 years agonir/liveness: Consider if uses in nir_ssa_defs_interfere
Jason Ekstrand [Tue, 22 Sep 2020 21:56:42 +0000 (16:56 -0500)]
nir/liveness: Consider if uses in nir_ssa_defs_interfere

Fixes: f86902e75d9 "nir: Add an SSA-based liveness analysis pass"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3428
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6824>

3 years agoturnip: implement VK_EXT_extended_dynamic_state
Jonathan Marek [Thu, 17 Sep 2020 14:16:42 +0000 (10:16 -0400)]
turnip: implement VK_EXT_extended_dynamic_state

Passes dEQP-VK.pipeline.extended_dynamic_state.*

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

3 years agoturnip: move A6XX_RB_ALPHA_CONTROL write to init_hw
Jonathan Marek [Thu, 17 Sep 2020 13:38:57 +0000 (09:38 -0400)]
turnip: move A6XX_RB_ALPHA_CONTROL write to init_hw

Its always 0.

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

3 years agoturnip: fix wrong indentation in tu6_draw_common
Jonathan Marek [Thu, 17 Sep 2020 13:36:43 +0000 (09:36 -0400)]
turnip: fix wrong indentation in tu6_draw_common

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

3 years agonir/instr_set: hash intrinsic sources
Rhys Perry [Tue, 18 Aug 2020 15:07:32 +0000 (16:07 +0100)]
nir/instr_set: hash intrinsic sources

ministat (CSE only):
Difference at 95.0% confidence
-9.80325 +/- 0.173089
-41.4434% +/- 0.461972%
(Student's t, pooled s = 0.0763653)

ministat (entire run):
Difference at 95.0% confidence
-3.13667 +/- 0.61519
-5.11107% +/- 0.990737%
(Student's t, pooled s = 0.271416)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6860>

3 years agolima: fix glCopyTexSubImage2D
Andreas Baierl [Wed, 16 Sep 2020 07:57:45 +0000 (09:57 +0200)]
lima: fix glCopyTexSubImage2D

The reload texture descriptor needs to take care of the mipmap level
and the layer in case of GL_TEXTURE_CUBE_MAP.

glCopyTexSubImage2D triggers the lima_blit function which ends in a draw.
A reload is necessary. The reload texture descriptor is always built with
just one mipmap level, but this needs to be the level we want to reload,
not just 0. We also have to take care of the cubemap face.

This fixes the following dEQP tests:

dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgb
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgba
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_rgb
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_rgba

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6816>

3 years agokmsro: Extend to include imx-dcss
Guido Günther [Fri, 17 Jan 2020 17:33:52 +0000 (18:33 +0100)]
kmsro: Extend to include imx-dcss

This allows using the dcss display controllers (with the dcss drm
modesetting driver) along with the Etnaviv render-only drivers. DCSS is
found on i.MX SoCs.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3449>

3 years agointel/fs: Disable sample mask predication for scratch stores
Danylo Piliaiev [Thu, 23 Jul 2020 12:15:34 +0000 (15:15 +0300)]
intel/fs: Disable sample mask predication for scratch stores

Scratch stores are being lowered to the instructions with side-effects,
however they should be enabled in fs helper invocations, since they
are produced from operations which don't imply side-effects.

To fix this - we move the decision of whether the sample mask predication
is enable to the point where logical brw instructions are created.

GLSL example of the issue:

 int tmp[1024];
 ...
 do {
   // changes to tmp
 } while (some_condition(tmp))

If `tmp` is lowered to scrach memory, `some_condition` would be
undefined if scratch write is predicated on sample mask, making
possible for the while loop to become infinite and hang the GPU.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3256
Fixes: 53bfcdeecf4c9632e09ee641d2ca02dd9ec25e34
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6056>

3 years agozink: only set stencil-ref for back if two-sided
Erik Faye-Lund [Thu, 24 Sep 2020 20:25:28 +0000 (22:25 +0200)]
zink: only set stencil-ref for back if two-sided

Otherwise, we want to set both front and back to the same state.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6853>

3 years agozink: store base-object of DSA-state
Erik Faye-Lund [Thu, 24 Sep 2020 20:20:53 +0000 (22:20 +0200)]
zink: store base-object of DSA-state

This is useful in the next commit, where we need to inspect the
base-state.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6853>

3 years agozink: correct typo in stencil-setup
Erik Faye-Lund [Thu, 24 Sep 2020 19:31:39 +0000 (21:31 +0200)]
zink: correct typo in stencil-setup

Without this, we end up using two-sided stencil when one-sided stencil
should be used. Whoops.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6853>

3 years agoradeonsi: remove redundant info.uses_fbfetch
Marek Olšák [Fri, 18 Sep 2020 00:31:02 +0000 (20:31 -0400)]
radeonsi: remove redundant info.uses_fbfetch

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

3 years agoradeonsi: remove redundant variables from struct si_compute
Marek Olšák [Thu, 17 Sep 2020 23:43:41 +0000 (19:43 -0400)]
radeonsi: remove redundant variables from struct si_compute

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

3 years agoradeonsi: assume that constant load_local_group_size has been optimized out
Marek Olšák [Fri, 18 Sep 2020 06:21:26 +0000 (02:21 -0400)]
radeonsi: assume that constant load_local_group_size has been optimized out

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

3 years agoradeonsi: run NIR optimizations that glsl_to_nir runs but other places might not
Marek Olšák [Fri, 18 Sep 2020 06:20:48 +0000 (02:20 -0400)]
radeonsi: run NIR optimizations that glsl_to_nir runs but other places might not

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

3 years agoradeonsi: get input/output usage flags from shader_info directly
Marek Olšák [Thu, 17 Sep 2020 23:09:19 +0000 (19:09 -0400)]
radeonsi: get input/output usage flags from shader_info directly

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

3 years agoradeonsi: get information about FS color outputs from shader_info directly
Marek Olšák [Fri, 18 Sep 2020 00:28:09 +0000 (20:28 -0400)]
radeonsi: get information about FS color outputs from shader_info directly

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

3 years agoradeonsi: use info.system_values_read
Marek Olšák [Fri, 11 Sep 2020 23:35:00 +0000 (19:35 -0400)]
radeonsi: use info.system_values_read

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

3 years agoradeonsi: call nir_shader_gather_info after lowering and optimizing NIR
Marek Olšák [Thu, 17 Sep 2020 23:12:13 +0000 (19:12 -0400)]
radeonsi: call nir_shader_gather_info after lowering and optimizing NIR

to get more accurate info

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

3 years agoradeonsi: fix indirect dispatches with variable block sizes
Marek Olšák [Thu, 17 Sep 2020 23:45:14 +0000 (19:45 -0400)]
radeonsi: fix indirect dispatches with variable block sizes

The block size input was uninitialized.

Fixes: 77c81164bc1c "radeonsi: support ARB_compute_variable_group_size"

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

3 years agoetnaviv: simplify linear stride implementation
Christian Gmeiner [Sat, 4 Jan 2020 06:13:47 +0000 (07:13 +0100)]
etnaviv: simplify linear stride implementation

As documented in the galcore kernel driver "only LOD0 is valid
for this register". This makes sense, as NTE's LINEAR_STRIDE is
only capable to store one linear stride value per sampler.
This fixes linear textures in sampler slot != 0.

Fixes: 34458c1cf6c ("etnaviv: add linear sampling support")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3285>

3 years agoci: Extend meson-clang coverage by compiling all gallium drivers
Boris Brezillon [Tue, 22 Sep 2020 10:00:18 +0000 (12:00 +0200)]
ci: Extend meson-clang coverage by compiling all gallium drivers

Some compile-time regressions go unnoticed because not all gallium
drivers are compiled as part of the meson-clang job. Let's pass an
explicit list of drivers to compile instead of setting GALLIUM_DRIVERS
to "auto" to increase CI coverage.

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

3 years agopanfrost: gen_pack: Fix gnu-empty-initializer errors
Boris Brezillon [Tue, 22 Sep 2020 06:56:03 +0000 (08:56 +0200)]
panfrost: gen_pack: Fix gnu-empty-initializer errors

Fixes: 1b27817f1755 ("panfrost: gen_pack: Allow empty structs")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6811>

3 years agonir: gather information about fbfetch and dual source color
Marek Olšák [Fri, 18 Sep 2020 00:25:22 +0000 (20:25 -0400)]
nir: gather information about fbfetch and dual source color

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758>

3 years agonir: fix input/output info gathering for lowered IO
Marek Olšák [Fri, 18 Sep 2020 03:51:58 +0000 (23:51 -0400)]
nir: fix input/output info gathering for lowered IO

Ooops.

Fixes: 17af07024df - nir: gather all IO info from IO intrinsics

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758>

3 years agonir: gather fs.uses_sample_qualifier from lowered IO
Marek Olšák [Wed, 16 Sep 2020 06:03:21 +0000 (02:03 -0400)]
nir: gather fs.uses_sample_qualifier from lowered IO

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

3 years agonir: set system_values_read for all intrinsics
Marek Olšák [Fri, 11 Sep 2020 23:33:26 +0000 (19:33 -0400)]
nir: set system_values_read for all intrinsics

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758>

3 years agonir: gather tess.tcs_cross_invocation info from lowered IO intrinsics
Marek Olšák [Wed, 16 Sep 2020 06:31:58 +0000 (02:31 -0400)]
nir: gather tess.tcs_cross_invocation info from lowered IO intrinsics

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758>

3 years agonir: gather indirect info from lowered IO intrinsics
Marek Olšák [Wed, 16 Sep 2020 05:11:31 +0000 (01:11 -0400)]
nir: gather indirect info from lowered IO intrinsics

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

3 years agospirv: vtn_fail with a nice message on unsupported rounding modes
Jason Ekstrand [Wed, 23 Sep 2020 20:54:34 +0000 (15:54 -0500)]
spirv: vtn_fail with a nice message on unsupported rounding modes

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

3 years agogallium/dri2: Move image->texture assignment after image NULL check.
Vinson Lee [Tue, 22 Sep 2020 01:20:25 +0000 (18:20 -0700)]
gallium/dri2: Move image->texture assignment after image NULL check.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking image suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

Fixes: ad609bf55a87 ("frontend/dri: Implement mapping individual planes.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6807>

3 years agor600/sfn: Initialize GPRValue member m_pin_to_channel.
Vinson Lee [Wed, 23 Sep 2020 00:41:35 +0000 (17:41 -0700)]
r600/sfn: Initialize GPRValue member m_pin_to_channel.

Fix defects reported by Coverity Scan.

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

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

3 years agogallium/drm: Make the pipe loader handle the driconf merging.
Eric Anholt [Wed, 16 Sep 2020 17:33:02 +0000 (10:33 -0700)]
gallium/drm: Make the pipe loader handle the driconf merging.

We can pretty easily handle merging the driver's driconf with the common
driverconf right there, rather than pushing that to each driver.

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

3 years agogallium/drm: Define the DRM entrypoints in drm_helper.h
Eric Anholt [Wed, 16 Sep 2020 16:24:27 +0000 (09:24 -0700)]
gallium/drm: Define the DRM entrypoints in drm_helper.h

This cuts even more code duplication.

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

3 years agogallium/drm: Refactor the stub screen create functions.
Eric Anholt [Wed, 16 Sep 2020 16:09:19 +0000 (09:09 -0700)]
gallium/drm: Refactor the stub screen create functions.

This gives me one place to document why it works this way.  This does make
the debug message a little less helpful ("etna" instead of "etnaviv" and
"vmwgfx" instead of "svga", but you should only be able to reach this when
doing something like trying the radeon/nouveau vdpau target on the wrong
DRM device for example.

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

3 years agogallium/drm: Deduplicate screen creation for the dynamic (clover) pipe loader.
Eric Anholt [Wed, 16 Sep 2020 15:54:12 +0000 (08:54 -0700)]
gallium/drm: Deduplicate screen creation for the dynamic (clover) pipe loader.

We can just reuse drm_helper.h, which has either the real code or the stub
for all pipe_screens based on the GALLIUM_* driver defines, and the
dynamic pipe loader's .c build will only define one GALLIUM_* driver
define.  The remaining stubs should get GCed by the linker.

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

3 years agoradeonsi: Only call nir_lower_var_copies at the end of the opt loop
Jason Ekstrand [Wed, 23 Sep 2020 18:14:26 +0000 (13:14 -0500)]
radeonsi: Only call nir_lower_var_copies at the end of the opt loop

In 283ad85944b5d, radeonsi started using nir_find_var_copies.  However,
it was also calling nir_lower_var_copies in the optimization loop and
the two can end up fighting.  The simple solution is to wait to lower
copies until the end of the optimization loop.

Fixes: 283ad85944b5d
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3550

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

3 years agozink: reorder create_stream_output_target to fix failure case leak
Mike Blumenkrantz [Tue, 25 Aug 2020 13:39:06 +0000 (09:39 -0400)]
zink: reorder create_stream_output_target to fix failure case leak

the previous version of this leaked a reference to the streamout buffer here

thanks to deltragon on my blog for pointing this out!

Fixes: 37778fcd9a35 ("zink: implement transform feedback support to finish off opengl 3.0")

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

3 years agozink: apply viewport count when creating pipelines
Mike Blumenkrantz [Mon, 3 Aug 2020 15:52:14 +0000 (11:52 -0400)]
zink: apply viewport count when creating pipelines

without VK_EXT_extended_dynamic_state, we need to pass this directly or
else only the first viewport will work

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

3 years agozink: correctly set up fb-sized scissors for each viewport
Mike Blumenkrantz [Mon, 3 Aug 2020 15:49:26 +0000 (11:49 -0400)]
zink: correctly set up fb-sized scissors for each viewport

each viewport must have a corresponding scissor, so we need to generate
an array of these to ensure our states match up

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

3 years agozink: set multiviewport cap in ntv when gl_ViewportIndex is a written output
Mike Blumenkrantz [Mon, 3 Aug 2020 15:48:15 +0000 (11:48 -0400)]
zink: set multiviewport cap in ntv when gl_ViewportIndex is a written output

this cap varies based on the shader stage, but it must be enabled any time this
output is written

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

3 years agozink: move viewport count to zink_gfx_pipeline_state
Mike Blumenkrantz [Mon, 3 Aug 2020 15:47:17 +0000 (11:47 -0400)]
zink: move viewport count to zink_gfx_pipeline_state

this is part of the pipeline state (there's an extension for setting it
dynamically but we don't supprot that atm

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

3 years agozink: implement ARB_instanced_arrays
Mike Blumenkrantz [Fri, 10 Jul 2020 13:48:23 +0000 (09:48 -0400)]
zink: implement ARB_instanced_arrays

this is just a simple case of connecting up the vertex state to the pipeline
state

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

3 years agozink: verify that src and dst aspects are the same in resource_copy_region hook
Mike Blumenkrantz [Mon, 15 Jun 2020 15:48:29 +0000 (11:48 -0400)]
zink: verify that src and dst aspects are the same in resource_copy_region hook

this is required by spec

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

3 years agozink: clamp min created fb size to 1x1
Mike Blumenkrantz [Sun, 14 Jun 2020 05:45:54 +0000 (01:45 -0400)]
zink: clamp min created fb size to 1x1

this is required by spec

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

3 years agozink: use correct layer count when creating framebuffer
Mike Blumenkrantz [Sun, 14 Jun 2020 04:37:52 +0000 (00:37 -0400)]
zink: use correct layer count when creating framebuffer

pipe_framebuffer_state::layers doesn't necessarily reflect the value we
need to use here, so we can use the util function to verify

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

3 years agozink: use correct number of samples on framebuffer in set_framebuffer_state
Mike Blumenkrantz [Sun, 14 Jun 2020 04:32:25 +0000 (00:32 -0400)]
zink: use correct number of samples on framebuffer in set_framebuffer_state

state->samples doesn't necessarily reflect the correct value here, so we need
to use the util function

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

3 years agozink: use correct value for color buffer sample count when creating renderpass
Mike Blumenkrantz [Sun, 14 Jun 2020 04:31:37 +0000 (00:31 -0400)]
zink: use correct value for color buffer sample count when creating renderpass

nr_samples is valid on the texture pipe_resource, not the surface

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

3 years agoRevert "nir: replace lower_ffma and fuse_ffma with has_ffma"
Kenneth Graunke [Thu, 24 Sep 2020 15:46:31 +0000 (08:46 -0700)]
Revert "nir: replace lower_ffma and fuse_ffma with has_ffma"

This reverts commit 939ddf3f67de2ed1700c093e60cf95c1b72ff20b.

Intel has a separate pass for fusing FFMAs selectively.  We split
these flags in commit 1b72c31e1f1947123d8c236b56e230f030f60cf9 and
the reasoning still stands.  The patch being reverted was just a
cleanup, so there should be no issue with reverting it.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6849>

3 years agoradv: use syncobj for wsi fence
Jonathan Marek [Wed, 23 Sep 2020 17:16:35 +0000 (13:16 -0400)]
radv: use syncobj for wsi fence

Note: this also fixes vk_object_base_init() not being called for the wsi
fences, now that it goes through radv_CreateFence().

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6846>

3 years agoradv: fix incorrect ResetFences path for WSI fence
Jonathan Marek [Wed, 23 Sep 2020 16:46:46 +0000 (12:46 -0400)]
radv: fix incorrect ResetFences path for WSI fence

Looks like this path is meant for RADV_FENCE_WINSYS type fences.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6846>

3 years agoamd/tmz: move uses_secure_bos to radeon_winsys
Pierre-Eric Pelloux-Prayer [Mon, 27 Jul 2020 10:24:27 +0000 (12:24 +0200)]
amd/tmz: move uses_secure_bos to radeon_winsys

This allows to inline radeon_uses_secure_bos calls and reduce CPU overhead.

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

3 years agoradeonsi/tmz: add workaround for mpv/vaapi subtitles
Pierre-Eric Pelloux-Prayer [Fri, 24 Jul 2020 14:04:14 +0000 (16:04 +0200)]
radeonsi/tmz: add workaround for mpv/vaapi subtitles

Subtitles are rendering with an upload through a staging texture.
So the sequence is:
  1. draw video (with a secure cs)
  2. copy staging texture to the real texture (via si_resource_copy_region) in
    a non-secure cs.
  3. draw video (with a secure cs)

Step 2 and 3 both generates a flush with RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION.
These flushes are executed quite late: right before doing the draw/dispatch,
so maybe the issue here is the handling of dependencies.

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

3 years agoradeonsi/tmz: add a tmz variant for sctx::eop_bug_scratch
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 14:52:35 +0000 (16:52 +0200)]
radeonsi/tmz: add a tmz variant for sctx::eop_bug_scratch

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

3 years agoradeonsi: disable primitive discard if tmz is in use
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 15:11:12 +0000 (17:11 +0200)]
radeonsi: disable primitive discard if tmz is in use

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

3 years agoradeonsi/tmz: add tmz variant for sctx::tess_rings
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 14:54:08 +0000 (16:54 +0200)]
radeonsi/tmz: add tmz variant for sctx::tess_rings

tess_rings must be encrypted when used in a secure job so this commit
introduces a tess_rings_tmz resource.

The cs_preamble_state doesn't contain the tess_rings address anymore since
it can change. The tess_rings related registers go in a separate preamble.

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

3 years agoradeonsi/tmz: add tmz variant of sctx::wait_mem_scratch
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 14:53:30 +0000 (16:53 +0200)]
radeonsi/tmz: add tmz variant of sctx::wait_mem_scratch

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

3 years agoradeonsi/tmz: fail si_texture_transfer_map if tex is encrypted
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 14:46:40 +0000 (16:46 +0200)]
radeonsi/tmz: fail si_texture_transfer_map if tex is encrypted

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

3 years agoamd/winsys: add RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 13:05:27 +0000 (15:05 +0200)]
amd/winsys: add RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION

Instead of exposing a cs_set_secure() callback that always needs a call
to si_flush_gfx_cs before a switch, this commit introduces a new
flag to switch between secure and non-secure on submissions.

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

3 years agoradeonsi/tmz: allow secure job if the app made a tmz allocation
Pierre-Eric Pelloux-Prayer [Thu, 23 Jul 2020 08:51:56 +0000 (10:51 +0200)]
radeonsi/tmz: allow secure job if the app made a tmz allocation

This commit makes TMZ always allowed instead of being either off or forced-on
with AMD_DEBUG=tmz.

With this change:
- secure job can be used as soon as the application made a tmz allocation. Driver
  internal allocations are not enough to enable secure jobs (if tmz is supported
  and enabled by the kernel)
- AMD_DEBUG=tmz forces all scanout/depth/stencil buffers to be allocated as TMZ.
  This is useful to test app thats don't explicitely support protected content.

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