platform/upstream/mesa.git
3 years agoanv,iris: Move the SHADER_RELOC enums to brw_compiler.h
Jason Ekstrand [Fri, 4 Sep 2020 17:00:42 +0000 (12:00 -0500)]
anv,iris: Move the SHADER_RELOC enums to brw_compiler.h

They're common between the two drivers and we want to add a couple more
that get emitted from code in src/intel/compiler.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add support for binding ray-tracing pipelines
Jason Ekstrand [Fri, 7 Aug 2020 03:51:01 +0000 (22:51 -0500)]
anv: Add support for binding ray-tracing pipelines

This includes not only vkCmdBindPipeline but also descriptor sets and
push constants.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add a ray-tracing pipeline object
Jason Ekstrand [Thu, 6 Aug 2020 23:56:54 +0000 (18:56 -0500)]
anv: Add a ray-tracing pipeline object

This just adds the core data structure which we'll build on going
forward.

v2: Add VK_EXT_pipeline_creation_cache_control handling (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Get ready for more pipeline stages
Jason Ekstrand [Thu, 21 Jan 2021 22:58:50 +0000 (16:58 -0600)]
anv: Get ready for more pipeline stages

This makes a bunch of loops use ARRAY_SIZE instead of MESA_SHADER_STAGES,
extends a few arrays, and adds a bunch of array length asserts.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add minimal boilerplate for VK_KHR_ray_tracing_pipeline
Jason Ekstrand [Wed, 5 Aug 2020 21:53:12 +0000 (16:53 -0500)]
anv: Add minimal boilerplate for VK_KHR_ray_tracing_pipeline

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add support for binding acceleration structures
Jason Ekstrand [Wed, 5 Aug 2020 22:28:48 +0000 (17:28 -0500)]
anv: Add support for binding acceleration structures

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add stub support for acceleration structures
Jason Ekstrand [Wed, 13 May 2020 21:22:02 +0000 (16:22 -0500)]
anv: Add stub support for acceleration structures

This just adds a base struct and trivial implementations of all the
create/destroy/bind functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agoanv: Add minimal boilerplate for VK_KHR_acceleration_structure
Jason Ekstrand [Wed, 13 May 2020 20:44:11 +0000 (15:44 -0500)]
anv: Add minimal boilerplate for VK_KHR_acceleration_structure

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agospirv: Create acceleration structure and shader record variables
Jason Ekstrand [Mon, 1 Feb 2021 22:55:33 +0000 (16:55 -0600)]
spirv: Create acceleration structure and shader record variables

spirv_to_nir now requires NIR variables to be created for everything.

Fixes: 10b3eecd361af "spirv: Don't remove variables used by resource..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>

3 years agozink: don't clear batch resources on fence finish
Mike Blumenkrantz [Fri, 7 May 2021 12:10:00 +0000 (08:10 -0400)]
zink: don't clear batch resources on fence finish

this eliminates the need for locking here and has no noticeable
increase in overhead, so the reduction of complexity seems worthwhile

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

3 years agozink: move some end-of-batch stuff to submit thread
Mike Blumenkrantz [Thu, 17 Jun 2021 01:40:37 +0000 (21:40 -0400)]
zink: move some end-of-batch stuff to submit thread

no reason to do this on the driver thread when it could be async

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

3 years agozink: flag scanout updates to batch state, not resource
Mike Blumenkrantz [Wed, 9 Jun 2021 15:29:36 +0000 (11:29 -0400)]
zink: flag scanout updates to batch state, not resource

now that submission is serialized better, it's not actually the resource that should be
tagged for scanout sync, it's the batch state, as multiple contexts might reuse the same
resource, thus requiring synchronization on every submit

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

3 years agozink: move fence reset to submit thread
Mike Blumenkrantz [Wed, 9 Jun 2021 15:25:28 +0000 (11:25 -0400)]
zink: move fence reset to submit thread

try to reduce job queue latency

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

3 years agozink: move sparse buffer commit to screen queue
Mike Blumenkrantz [Sun, 9 May 2021 16:56:06 +0000 (12:56 -0400)]
zink: move sparse buffer commit to screen queue

all queue submission must be serialized with the dispatch thread

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

3 years agozink: move queue submit thread to screen
Mike Blumenkrantz [Sun, 9 May 2021 16:55:39 +0000 (12:55 -0400)]
zink: move queue submit thread to screen

this needs to be a screen-based queue in order to serialize properly
with multiple contexts

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

3 years agozink: enforce multi-context waiting for unflushed resources on foreign batches
Mike Blumenkrantz [Thu, 17 Jun 2021 01:32:14 +0000 (21:32 -0400)]
zink: enforce multi-context waiting for unflushed resources on foreign batches

this doesn't seem to be a real issue now that tc doesn't break makeCurrent
anymore, but if such a thing were to once again become a problem, at least
there will be handling for it

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

3 years agozink: make init_mem_range() a public function
Mike Blumenkrantz [Fri, 14 May 2021 18:56:35 +0000 (14:56 -0400)]
zink: make init_mem_range() a public function

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

3 years agozink: break out offset alignment calculation into helper
Mike Blumenkrantz [Wed, 9 Jun 2021 20:15:03 +0000 (16:15 -0400)]
zink: break out offset alignment calculation into helper

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

3 years agozink: apply zink_resource_object::offset for memory flush/invalidates
Mike Blumenkrantz [Thu, 13 May 2021 12:54:51 +0000 (08:54 -0400)]
zink: apply zink_resource_object::offset for memory flush/invalidates

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

3 years agozink: queue v3.0
Mike Blumenkrantz [Thu, 17 Jun 2021 01:28:46 +0000 (21:28 -0400)]
zink: queue v3.0

this uses a pointer to a batch state substruct for timeline tracking,
which provides a few nice benefits:
* explicit ability to detect unflushed batches (even on other contexts)
* the context doesn't need to have a "current" timeline id
* timeline (batch) ids can be distributed during submit, not when recording begins
* an abstracted api which can be more easily changed under the hood

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

3 years agozink: remove no-longer-used resource helper functions
Mike Blumenkrantz [Fri, 7 May 2021 12:52:50 +0000 (08:52 -0400)]
zink: remove no-longer-used resource helper functions

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

3 years agozink: use batch usage api for resource helper function
Mike Blumenkrantz [Fri, 7 May 2021 12:52:18 +0000 (08:52 -0400)]
zink: use batch usage api for resource helper function

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

3 years agozink: add and use fencing functions which take batch usage structs
Mike Blumenkrantz [Fri, 7 May 2021 12:45:15 +0000 (08:45 -0400)]
zink: add and use fencing functions which take batch usage structs

this hides the exact mechanics of fencing based on batch usage and makes
the usage a bit more explicit

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

3 years agozink: improve tc fence disambiguation
Mike Blumenkrantz [Fri, 7 May 2021 12:39:27 +0000 (08:39 -0400)]
zink: improve tc fence disambiguation

instead of storing separate batch_id values onto the tc fence for matching:
* use a fence pointer on the main context to indicate the current deferred fence
* add a monotonic counter to each batch state which double-increments on each use,
  thereby enabling direct determination by the tc fence as to whether this is the same
  batch state it was created with

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

3 years agozink: only update last_finished during batch reset if the batch was used
Mike Blumenkrantz [Thu, 8 Apr 2021 13:09:06 +0000 (09:09 -0400)]
zink: only update last_finished during batch reset if the batch was used

0 is never a valid batch_id, so don't try to update this

minor cosmetic change

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

3 years agofreedreno: Fix leak of the screen hash table.
Emma Anholt [Tue, 22 Jun 2021 19:09:44 +0000 (12:09 -0700)]
freedreno: Fix leak of the screen hash table.

Now we have no leaks detected on a run of a basic deqp test
(dEQP-GLES2.functional.shaders.constants.const_float_assignment_3_fragment).

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

3 years agocrocus/bufmgr: fix userptr left over fail
Dave Airlie [Tue, 22 Jun 2021 01:13:04 +0000 (11:13 +1000)]
crocus/bufmgr: fix userptr left over fail

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

3 years agocroucs: limit stencil swizzle change to older generations
Dave Airlie [Tue, 22 Jun 2021 01:05:29 +0000 (11:05 +1000)]
croucs: limit stencil swizzle change to older generations

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

3 years agozink: clear textures directly when possible
Mike Blumenkrantz [Thu, 15 Apr 2021 16:18:35 +0000 (12:18 -0400)]
zink: clear textures directly when possible

now that overhead for resuming renderpasses has been made mostly nonexistent,
this is by far the better option and cuts cpu usage by ~90% in some cases,
e.g., tomb raider benchmark

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11430>

3 years agocrocus/gen8: add support for cherryview (env var for bdw)
Dave Airlie [Mon, 21 Jun 2021 19:42:54 +0000 (05:42 +1000)]
crocus/gen8: add support for cherryview (env var for bdw)

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

3 years agocrocus/gen8: hookup gen8 state generators
Dave Airlie [Mon, 21 Jun 2021 19:40:49 +0000 (05:40 +1000)]
crocus/gen8: hookup gen8 state generators

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

3 years agocrocus/gen8: handle sampler differences
Dave Airlie [Mon, 21 Jun 2021 19:36:55 +0000 (05:36 +1000)]
crocus/gen8: handle sampler differences

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

3 years agocroucs/gen8: handle gfx8 surface aux addr reloc.
Dave Airlie [Mon, 21 Jun 2021 19:23:57 +0000 (05:23 +1000)]
croucs/gen8: handle gfx8 surface aux addr reloc.

This is ported from i965

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

3 years agocrocus/gen8: port over VFE/compute state changes
Dave Airlie [Mon, 21 Jun 2021 19:22:58 +0000 (05:22 +1000)]
crocus/gen8: port over VFE/compute state changes

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

3 years agocrocus/gen8: port over ps/wm state changes from iris.
Dave Airlie [Mon, 21 Jun 2021 19:22:07 +0000 (05:22 +1000)]
crocus/gen8: port over ps/wm state changes from iris.

This emits the PS extra packet as well

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

3 years agocrocus/gen8: port over vs/gs/ds state changes.
Dave Airlie [Mon, 21 Jun 2021 19:21:10 +0000 (05:21 +1000)]
crocus/gen8: port over vs/gs/ds state changes.

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

3 years agocrocus/gen8: add depth stencil state support
Dave Airlie [Mon, 21 Jun 2021 19:20:23 +0000 (05:20 +1000)]
crocus/gen8: add depth stencil state support

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

3 years agocrocus/gen8: add viewport support
Dave Airlie [Mon, 21 Jun 2021 19:19:38 +0000 (05:19 +1000)]
crocus/gen8: add viewport support

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

3 years agocrocus/gen8: add rasterizer state changes.
Dave Airlie [Mon, 21 Jun 2021 19:18:37 +0000 (05:18 +1000)]
crocus/gen8: add rasterizer state changes.

Port over raster packet and state changes

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

3 years agocrocus/gen8: refactor blend state for gen8
Dave Airlie [Mon, 21 Jun 2021 19:16:50 +0000 (05:16 +1000)]
crocus/gen8: refactor blend state for gen8

gen8 emits these packets differently, port the i965 style

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

3 years agocrocus/gen8: add PS blend command support.
Dave Airlie [Mon, 21 Jun 2021 19:14:38 +0000 (05:14 +1000)]
crocus/gen8: add PS blend command support.

This adds support for new gen8 command

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

3 years agocrocus/gen8: add VF SGVS support.
Dave Airlie [Mon, 21 Jun 2021 19:11:25 +0000 (05:11 +1000)]
crocus/gen8: add VF SGVS support.

This is moved functionality on gen8

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

3 years agocrocus/gen8: add SBE swiz support
Dave Airlie [Mon, 21 Jun 2021 19:06:36 +0000 (05:06 +1000)]
crocus/gen8: add SBE swiz support

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

3 years agocrocus/gen8: add streamout support
Dave Airlie [Mon, 21 Jun 2021 19:02:59 +0000 (05:02 +1000)]
crocus/gen8: add streamout support

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

3 years agocrocus/gen8: add PMA fix from iris
Dave Airlie [Mon, 21 Jun 2021 18:57:07 +0000 (04:57 +1000)]
crocus/gen8: add PMA fix from iris

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

3 years agocrocus/gen8: add VF topology support
Dave Airlie [Mon, 21 Jun 2021 18:54:11 +0000 (04:54 +1000)]
crocus/gen8: add VF topology support

this is a new command on gen8

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

3 years agocrocus/gen8: state base address + misc setup state.
Dave Airlie [Mon, 21 Jun 2021 18:51:23 +0000 (04:51 +1000)]
crocus/gen8: state base address + misc setup state.

This ports over SBA setup and some misc packets needed to
setup the context

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

3 years agocrocus/gen8: add support for vertex instancing and index buffers.
Dave Airlie [Mon, 21 Jun 2021 18:48:37 +0000 (04:48 +1000)]
crocus/gen8: add support for vertex instancing and index buffers.

This ports over the VF instancing code from iris

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

3 years agocrocus/gen8: add raw pipe control support for gen8 workarounds
Dave Airlie [Mon, 21 Jun 2021 07:35:06 +0000 (17:35 +1000)]
crocus/gen8: add raw pipe control support for gen8 workarounds

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

3 years agocrocus/gen8: limit vertex buffer workarounds to ivb
Dave Airlie [Mon, 21 Jun 2021 07:32:27 +0000 (17:32 +1000)]
crocus/gen8: limit vertex buffer workarounds to ivb

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

3 years agocrocus/gen8: extending gen7 binding table pointers
Dave Airlie [Mon, 21 Jun 2021 07:29:39 +0000 (17:29 +1000)]
crocus/gen8: extending gen7 binding table pointers

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

3 years agocrocus/gen8: add l3 config support
Dave Airlie [Mon, 21 Jun 2021 07:29:09 +0000 (17:29 +1000)]
crocus/gen8: add l3 config support

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

3 years agocrocus/gen8: add sampler / border color support for gen8
Dave Airlie [Mon, 21 Jun 2021 07:25:55 +0000 (17:25 +1000)]
crocus/gen8: add sampler / border color support for gen8

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

3 years agocrocus/gen8: extend predicate handling to gen8.
Dave Airlie [Mon, 21 Jun 2021 07:24:08 +0000 (17:24 +1000)]
crocus/gen8: extend predicate handling to gen8.

This adds some gen8 specific code to do MI_PREDICATE properly,
otherwise just extends the hsw code

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

3 years agocrocus: extend hsw cut index to gen8
Dave Airlie [Mon, 21 Jun 2021 07:19:42 +0000 (17:19 +1000)]
crocus: extend hsw cut index to gen8

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

3 years agocrocus/gen8: extend image support to gen8
Dave Airlie [Mon, 21 Jun 2021 07:06:08 +0000 (17:06 +1000)]
crocus/gen8: extend image support to gen8

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

3 years agocrocus/gen8: extend some compute + state functions to gen8
Dave Airlie [Mon, 21 Jun 2021 07:00:37 +0000 (17:00 +1000)]
crocus/gen8: extend some compute + state functions to gen8

This just extends some hsw functionality to gen8

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

3 years agocrocus/gen8: add push constant support (extend hsw)
Dave Airlie [Mon, 21 Jun 2021 06:57:48 +0000 (16:57 +1000)]
crocus/gen8: add push constant support (extend hsw)

This just extends the gen7 checks and adds the gen8 value

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

3 years agocrocus: extend l3 config setup to gen8
Dave Airlie [Mon, 21 Jun 2021 06:53:42 +0000 (16:53 +1000)]
crocus: extend l3 config setup to gen8

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

3 years agocrocus/query: add gen8 support to queries by extending hsw checks
Dave Airlie [Mon, 21 Jun 2021 06:52:39 +0000 (16:52 +1000)]
crocus/query: add gen8 support to queries by extending hsw checks

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

3 years agocrocus/stencil: limit stencil workaround to gen7
Dave Airlie [Mon, 21 Jun 2021 06:52:21 +0000 (16:52 +1000)]
crocus/stencil: limit stencil workaround to gen7

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

3 years agocrocus: limit texture gather workarounds to gen7/hsw
Dave Airlie [Mon, 21 Jun 2021 06:47:23 +0000 (16:47 +1000)]
crocus: limit texture gather workarounds to gen7/hsw

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

3 years agocrocus/gen8: limit some pipe controls to gen7/hsw
Dave Airlie [Mon, 21 Jun 2021 06:47:05 +0000 (16:47 +1000)]
crocus/gen8: limit some pipe controls to gen7/hsw

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

3 years agocrocus: refactor blend state code.
Dave Airlie [Mon, 21 Jun 2021 06:31:51 +0000 (16:31 +1000)]
crocus: refactor blend state code.

This just refactors this code before adding gen8 support which
needs more changes in this area.

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

3 years agocrocus: convert a bunch of is_haswell into verx10 checks.
Dave Airlie [Mon, 21 Jun 2021 06:24:17 +0000 (16:24 +1000)]
crocus: convert a bunch of is_haswell into verx10 checks.

This just make things easier when gen8 support is added

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

3 years agocrocus: fixup workaround_bo to match 965.
Dave Airlie [Mon, 21 Jun 2021 05:31:06 +0000 (15:31 +1000)]
crocus: fixup workaround_bo to match 965.

Always add to the batch, and don't set the reloc write flag when
adding to reloc list, as this will confuse the render/compute sync
code and cause over syncing.

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

3 years agocrocus: rename genX proto functions to avoid iris conflicts.
Dave Airlie [Mon, 21 Jun 2021 06:10:38 +0000 (16:10 +1000)]
crocus: rename genX proto functions to avoid iris conflicts.

If we start adding gen8, then conflicts occur, but the crocus
ones into their own namespace to avoid this.

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

3 years agocrocus: fixup stray tab
Dave Airlie [Mon, 21 Jun 2021 07:17:02 +0000 (17:17 +1000)]
crocus: fixup stray tab

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

3 years agocrocus: drop dead gen prototypes.
Dave Airlie [Mon, 21 Jun 2021 06:06:23 +0000 (16:06 +1000)]
crocus: drop dead gen prototypes.

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

3 years agoi915g: Clear xfails for vertex texturing.
Emma Anholt [Mon, 21 Jun 2021 20:26:23 +0000 (13:26 -0700)]
i915g: Clear xfails for vertex texturing.

Fixes: 7378c6479278 ("i915: Disable vertex texturing and delete the code.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11512>

3 years agoi915g: Use the color swizzle to reshuffle the blend const color.
Emma Anholt [Mon, 21 Jun 2021 16:28:59 +0000 (09:28 -0700)]
i915g: Use the color swizzle to reshuffle the blend const color.

If we're remapping RGBA from the shader into dst channels, we also need to
remap the blend constant color.  The previous static mapping only worked
for ARGB cbufs, but we get ABGR in surfaceless deqp.

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

3 years agoi915g: Simplify color write mask setup.
Emma Anholt [Tue, 22 Jun 2021 17:05:07 +0000 (10:05 -0700)]
i915g: Simplify color write mask setup.

Use the surface's precomputed swizzle instead of doing a local format
table.

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

3 years agoi915g: Move cbuf color swizzle lookup to CSO creation time.
Emma Anholt [Sun, 20 Jun 2021 16:19:59 +0000 (09:19 -0700)]
i915g: Move cbuf color swizzle lookup to CSO creation time.

Saves walking the loop, and makes a nice place to store a swizzle for use
in other atoms.

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

3 years agoi915g: Compute 3DSTATE_BUF_INFO flags at surface create time.
Emma Anholt [Sun, 20 Jun 2021 15:52:25 +0000 (08:52 -0700)]
i915g: Compute 3DSTATE_BUF_INFO flags at surface create time.

No need to compute them at state emit.

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

3 years agoi915g: Create an i915_surface for our pipe_surfaces.
Emma Anholt [Sun, 20 Jun 2021 15:41:50 +0000 (08:41 -0700)]
i915g: Create an i915_surface for our pipe_surfaces.

Nothing added in yet, just wrapping the struct.

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

3 years agoi915g: Remove nr_cbufs loop.
Emma Anholt [Sun, 20 Jun 2021 15:34:16 +0000 (08:34 -0700)]
i915g: Remove nr_cbufs loop.

This hardware definitely only does one cbuf.

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

3 years agoradeon/vcn: use st_rps_bits only when it's set
Boyuan Zhang [Wed, 16 Jun 2021 20:07:31 +0000 (16:07 -0400)]
radeon/vcn: use st_rps_bits only when it's set

Fixes: c9baccb5

For certain player which doesn't implement st_rps_bits, or when st_rps_bits
is set to 0 (e.g. it doesn't have rps explicitly defined in slice header),
we don't set st_rps_bits and the related flag, since we don't skip parsing
the rps structure in these cases.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11432>

3 years agodocs/isl: Consistently use 3-space tabs
Jason Ekstrand [Tue, 22 Jun 2021 16:05:11 +0000 (11:05 -0500)]
docs/isl: Consistently use 3-space tabs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agodocs/nir: Use 3-space tabs
Jason Ekstrand [Tue, 22 Jun 2021 16:00:29 +0000 (11:00 -0500)]
docs/nir: Use 3-space tabs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agoeditorconfig: Use 3-space tabs for .rst
Jason Ekstrand [Tue, 22 Jun 2021 16:02:37 +0000 (11:02 -0500)]
editorconfig: Use 3-space tabs for .rst

This is what all the sphinx examples do and is what most of docs/
currently does.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agoci/llvmpipe: Mark two more multithread program link flakes.
Emma Anholt [Mon, 21 Jun 2021 21:01:46 +0000 (14:01 -0700)]
ci/llvmpipe: Mark two more multithread program link flakes.

Seen in #mesa-swrast-ci since adding the IRC channel.

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

3 years agofreedreno: Cooperate with tc to stop checking the BC for resource_busy().
Emma Anholt [Mon, 21 Jun 2021 19:31:14 +0000 (12:31 -0700)]
freedreno: Cooperate with tc to stop checking the BC for resource_busy().

The resource_busy() hook was having to check the batch cache for usage of
the resource, since TC didn't know how long our driver would.  By
committing to calling the tc_driver_internal_flush_notify() hook on
non-deferred flushes, TC keeps track of which buffers have been used but
not flushed and considers them busy, saving us needing to look in the BC
(which we won't be able to do once we move it to being per-context).

drawoverhead test results (all numbers are throughput, n=5):

   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change:      -4.94214% +/- 2.45047%
   7, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ vertex attrib change: 48.3992% +/- 5.02827%
   8, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 1 texture change:     26.0974% +/- 1.14932%
   9, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 8 textures change:    12.6963% +/- 3.01077%
  17, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 8 UBOs change:        54.3846% +/- 35.0049%

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

3 years agovk/util: add macros for multidraw
Mike Blumenkrantz [Tue, 30 Mar 2021 18:48:50 +0000 (14:48 -0400)]
vk/util: add macros for multidraw

this simplifies implementations since a lot of the code is going to be
copy/pasted around, enabling related tweaks to be made in a centralized place

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

3 years agoradv: advertise extendedDynamicState2LogicOp
Samuel Pitoiset [Mon, 17 May 2021 08:42:03 +0000 (10:42 +0200)]
radv: advertise extendedDynamicState2LogicOp

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

3 years agoradv: implement dynamic logic op
Samuel Pitoiset [Mon, 17 May 2021 08:41:24 +0000 (10:41 +0200)]
radv: implement dynamic logic op

This is part of VK_EXT_extended_dynamic_state2.

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

3 years agoaco/gfx10: Emit barrier at the start of NGG VS and TES.
Timur Kristóf [Sat, 19 Jun 2021 12:36:15 +0000 (14:36 +0200)]
aco/gfx10: Emit barrier at the start of NGG VS and TES.

The Navi 1x NGG hardware can hang in certain conditions when
not every wave launched before s_sendmsg(GS_ALLOC_REQ).

As a workaround, to ensure this never happens, let's emit a
workgroup barrier at the beginning of NGG VS and TES.
Note that NGG GS already has a workgroup barrier so it doesn't
need this.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>

3 years agoaco/gfx10: NGG zero output workaround for conservative rasterization.
Timur Kristóf [Mon, 17 May 2021 10:28:15 +0000 (12:28 +0200)]
aco/gfx10: NGG zero output workaround for conservative rasterization.

Navi 1x GPUs have an issue: they can hang when the output vertex
and primitive counts are zero. The workaround is exporting a dummy
triangle.

This commit changes the dummy triangle's vertex so its positions
are all NaN. This should make sure the triangle is never rendered.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>

3 years agoradv/llvm: Emit s_barrier at the beginning of NGG non-GS shaders.
Timur Kristóf [Mon, 17 May 2021 12:00:58 +0000 (14:00 +0200)]
radv/llvm: Emit s_barrier at the beginning of NGG non-GS shaders.

This is to fix a hang that can potentially happen when not every
wave had launched when a gs_alloc_req is executed.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>

3 years agopanfrost: Add a Vulkan driver for Midgard/Bifrost GPUs
Boris Brezillon [Tue, 16 Jul 2019 17:20:49 +0000 (19:20 +0200)]
panfrost: Add a Vulkan driver for Midgard/Bifrost GPUs

Based on turnip.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11139>

3 years agopan/midg: Add a flag to dump internal shaders
Boris Brezillon [Mon, 17 May 2021 12:51:11 +0000 (14:51 +0200)]
pan/midg: Add a flag to dump internal shaders

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

3 years agopanfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer
Boris Brezillon [Thu, 6 May 2021 06:43:00 +0000 (08:43 +0200)]
panfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer

In the vulkan driver we need to patch job headers when re-submitting
an already submitted batch. Change panfrost_scoreboard_initialize_tiler()
prototype to allow that.

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

3 years agopanfrost: Constify the constants pointers passed to pan_blend functions
Boris Brezillon [Wed, 19 May 2021 07:49:28 +0000 (09:49 +0200)]
panfrost: Constify the constants pointers passed to pan_blend functions

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

3 years agoanv: adjust headers for non-GNU after e9e1e0362b6c
Jan Beich [Tue, 22 Jun 2021 00:29:40 +0000 (00:29 +0000)]
anv: adjust headers for non-GNU after e9e1e0362b6c

src/intel/vulkan/anv_device.c:27:10: fatal error: 'sys/sysmacros.h' file not found
 #include <sys/sysmacros.h>
          ^~~~~~~~~~~~~~~~~

Fixes: e9e1e036 ("anv: implement VK_EXT_physical_device_drm")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11516>

3 years agoradv: implement VK_EXT_physical_device_drm
Simon Ser [Fri, 8 Jan 2021 15:06:51 +0000 (16:06 +0100)]
radv: implement VK_EXT_physical_device_drm

This adds support for the Vulkan extension introduced in [1]. The
extension allows to get a VkPhysicalDevice's DRM node device IDs.

[1]: https://github.com/KhronosGroup/Vulkan-Docs/pull/1356

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8390>

3 years agozink: use multidraw
Mike Blumenkrantz [Wed, 20 Jan 2021 19:29:14 +0000 (14:29 -0500)]
zink: use multidraw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11498>

3 years agozink: support multidraw
Mike Blumenkrantz [Wed, 20 Jan 2021 19:23:20 +0000 (14:23 -0500)]
zink: support multidraw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11498>

3 years agozink: clear the fb clears array instead of freeing it on reset
Mike Blumenkrantz [Mon, 21 Jun 2021 15:25:04 +0000 (11:25 -0400)]
zink: clear the fb clears array instead of freeing it on reset

this cuts cpu usage by ~2% in sourcemark due to not reallocating the array
on every draw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11499>

3 years agozink: add more clear hooks
Mike Blumenkrantz [Fri, 18 Jun 2021 15:47:23 +0000 (11:47 -0400)]
zink: add more clear hooks

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

3 years agozink: add a flag for disabling conditional render during blit
Mike Blumenkrantz [Fri, 18 Jun 2021 15:55:54 +0000 (11:55 -0400)]
zink: add a flag for disabling conditional render during blit

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

3 years agospirv_to_nir: Add environment variable to change default log level
Charlie Turner [Thu, 17 Jun 2021 09:17:26 +0000 (10:17 +0100)]
spirv_to_nir: Add environment variable to change default log level

During dEQP runs for radv, I see a lot of warnings like,

ERROR - dEQP error: SPIR-V WARNING:
ERROR - dEQP error:     In file ../src/compiler/spirv/spirv_to_nir.c:1073
ERROR - dEQP error:     Decoration not allowed on struct members: SpvDecorationRestrict
ERROR - dEQP error:     408 bytes into the SPIR-V binary

This fails jobs on Gitlab, due to,

Job's log exceeded limit of 4194304 bytes.
Job execution will continue but no more output will be collected.

Since it doesn't seem feasible right now to fix the many shaders in
the VK-CTS triggering this warning, add an environment toggle that
allows test runners to only see the level of commentary they want.

v2 from Martin:
 - Add my SoB

v3 from Martin:
 - fix the indentation (suggested by Eric)
 - put the declarations at the top of the function

v4 from Martin:
 - make vtn_default_log_level() static (Marcin)
 - cache the default level in vtn_log (Marcin)
 - move vtn_log_level_strings inside vtn_default_log_level()
 - Fix the build issue on MSC

Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11491>