platform/upstream/mesa.git
3 years agopanfrost: Move draw_vbo to pan_cmdstream.c
Alyssa Rosenzweig [Tue, 6 Jul 2021 21:27:07 +0000 (17:27 -0400)]
panfrost: Move draw_vbo to pan_cmdstream.c

This needs to be conditionally compiled per-generation.

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

3 years agoaco: fix emitting a16 for MIMG instructions on GFX10+
Samuel Pitoiset [Tue, 6 Jul 2021 16:06:40 +0000 (18:06 +0200)]
aco: fix emitting a16 for MIMG instructions on GFX10+

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

3 years agoaco: fix emitting d16 for MIMG instructions on GFX9+
Samuel Pitoiset [Tue, 6 Jul 2021 16:06:10 +0000 (18:06 +0200)]
aco: fix emitting d16 for MIMG instructions on GFX9+

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

3 years agov3dv: account for dst offset of copy query results operations
Iago Toral Quiroga [Wed, 7 Jul 2021 09:52:17 +0000 (11:52 +0200)]
v3dv: account for dst offset of copy query results operations

This fixes several CTS tests with this pattern:
  dEQP-VK.query_pool.occlusion_query.copy_results*dstoffset

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11758>

3 years agoci: Bump virglrenderer
Corentin Noël [Wed, 16 Jun 2021 17:31:52 +0000 (19:31 +0200)]
ci: Bump virglrenderer

Use the latest commit from master branch

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11572>

3 years agoci: Re-enable virgl tesselation shader
Corentin Noël [Wed, 23 Jun 2021 17:21:15 +0000 (19:21 +0200)]
ci: Re-enable virgl tesselation shader

Partially undoes c8c7450fc73b8 ("llvmpipe: move coroutines out of noopt case")
as the required features are now implemented in llvmpipe.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11572>

3 years agoagx: Ensure we don't overallocate registers
Alyssa Rosenzweig [Wed, 7 Jul 2021 02:11:31 +0000 (22:11 -0400)]
agx: Ensure we don't overallocate registers

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>

3 years agoagx: Pipe in nir_register
Alyssa Rosenzweig [Wed, 7 Jul 2021 01:54:01 +0000 (21:54 -0400)]
agx: Pipe in nir_register

This is kind of lazy...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>

3 years agoagx: Assign registers locally
Alyssa Rosenzweig [Sat, 19 Jun 2021 18:34:44 +0000 (14:34 -0400)]
agx: Assign registers locally

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>

3 years agoagx: Count read registers as well
Alyssa Rosenzweig [Sat, 19 Jun 2021 18:33:30 +0000 (14:33 -0400)]
agx: Count read registers as well

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>

3 years agoagx: Don't choke on registers in the optimizer
Alyssa Rosenzweig [Wed, 7 Jul 2021 02:16:20 +0000 (22:16 -0400)]
agx: Don't choke on registers in the optimizer

Just skip over them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>

3 years agozink: store the default variant hash for a program
Mike Blumenkrantz [Fri, 14 May 2021 22:30:58 +0000 (18:30 -0400)]
zink: store the default variant hash for a program

the first created pipeline with a program is the default variants, and
this is likely to be the most common, so we can store the hash to avoid
needing to recalc it later

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

3 years agozink: flag shader modules as default
Mike Blumenkrantz [Fri, 14 May 2021 22:17:23 +0000 (18:17 -0400)]
zink: flag shader modules as default

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

3 years agozink: keep a mask of stages present in a gfx program
Mike Blumenkrantz [Fri, 14 May 2021 22:15:42 +0000 (18:15 -0400)]
zink: keep a mask of stages present in a gfx program

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

3 years agozink: flag all shaders for create during gfx program init
Mike Blumenkrantz [Fri, 14 May 2021 22:10:08 +0000 (18:10 -0400)]
zink: flag all shaders for create during gfx program init

now we can avoid needing extra conditionals in the update hotpath

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

3 years agozink: remove zink_shader_module refcounting
Mike Blumenkrantz [Fri, 14 May 2021 21:57:16 +0000 (17:57 -0400)]
zink: remove zink_shader_module refcounting

this is no longer necessary

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

3 years agofeatures: mark off VK_EXT_multi_draw for radv
Mike Blumenkrantz [Wed, 7 Jul 2021 02:09:03 +0000 (22:09 -0400)]
features: mark off VK_EXT_multi_draw for radv

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

3 years agozink: consolidate and optimize index buffer handling during draw
Mike Blumenkrantz [Tue, 11 May 2021 17:50:51 +0000 (13:50 -0400)]
zink: consolidate and optimize index buffer handling during draw

this can be reorganized to have more readable handling

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

3 years agozink: move descriptor update closer to start of draw
Mike Blumenkrantz [Wed, 7 Jul 2021 01:41:51 +0000 (21:41 -0400)]
zink: move descriptor update closer to start of draw

this can trigger flushes, so ensure that it doesn't break the cmdbuf

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

3 years agozink: update streamout buffer strides inline
Mike Blumenkrantz [Tue, 11 May 2021 16:50:32 +0000 (12:50 -0400)]
zink: update streamout buffer strides inline

loops--

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

3 years agozink: use last_vertex_stage pointer to optimize streamout emission during draw
Mike Blumenkrantz [Tue, 11 May 2021 16:43:38 +0000 (12:43 -0400)]
zink: use last_vertex_stage pointer to optimize streamout emission during draw

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

3 years agozink: store the last vertex stage to the context during bind
Mike Blumenkrantz [Tue, 11 May 2021 16:39:42 +0000 (12:39 -0400)]
zink: store the last vertex stage to the context during bind

make this more readily accessible

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

3 years agoutil/radeonsi: add radeonsi workaround for Nuclear Throne
Timothy Arceri [Sun, 4 Jul 2021 11:20:59 +0000 (21:20 +1000)]
util/radeonsi: add radeonsi workaround for Nuclear Throne

Without radeonsi_sync_compile the game crashes at startup. The
game engine uses a custom global new operator which doesn't
play well with multithreading.

Fixes: f1cc13727c68 ("radeonsi: enable workarounds for YoYo engine based games")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5023

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

3 years agorelnotes: EXT_extended_dynamic_state2 for lavapipe
Mike Blumenkrantz [Wed, 7 Jul 2021 00:38:02 +0000 (20:38 -0400)]
relnotes: EXT_extended_dynamic_state2 for lavapipe

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

3 years agofeatures: EXT_extended_dynamic_state2 for lavapipe
Mike Blumenkrantz [Wed, 7 Jul 2021 00:37:55 +0000 (20:37 -0400)]
features: EXT_extended_dynamic_state2 for lavapipe

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

3 years agolavapipe: implement EXT_extended_dynamic_state2
Mike Blumenkrantz [Tue, 6 Jul 2021 18:26:05 +0000 (14:26 -0400)]
lavapipe: implement EXT_extended_dynamic_state2

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

3 years agolavapipe: only apply pipeline state for depth bias if it's enabled
Mike Blumenkrantz [Tue, 6 Jul 2021 16:20:54 +0000 (12:20 -0400)]
lavapipe: only apply pipeline state for depth bias if it's enabled

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

3 years agozink: remove unnecessary stall during device-local map case
Mike Blumenkrantz [Mon, 17 May 2021 12:44:26 +0000 (08:44 -0400)]
zink: remove unnecessary stall during device-local map case

this stalls after the copy already, no need to also stall before it

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

3 years agozink: redo streamout and texture components of memory_barrier hook
Mike Blumenkrantz [Mon, 17 May 2021 23:03:08 +0000 (19:03 -0400)]
zink: redo streamout and texture components of memory_barrier hook

this is more consolidated (and legal)

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

3 years agozink: optimize buffer rebinds
Mike Blumenkrantz [Tue, 11 May 2021 15:08:03 +0000 (11:08 -0400)]
zink: optimize buffer rebinds

this leverages all the slot masks to more optimally run through all
the rebinds, also enabling some code consolidation

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

3 years agozink: remove barriers from buffer rebinds
Mike Blumenkrantz [Tue, 11 May 2021 14:53:58 +0000 (10:53 -0400)]
zink: remove barriers from buffer rebinds

these aren't needed anymore

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

3 years agozink: make image_bind_count work for buffers
Mike Blumenkrantz [Tue, 11 May 2021 14:34:40 +0000 (10:34 -0400)]
zink: make image_bind_count work for buffers

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

3 years agozink: make samplerview bind mask apply to buffer resources too
Mike Blumenkrantz [Tue, 11 May 2021 14:13:45 +0000 (10:13 -0400)]
zink: make samplerview bind mask apply to buffer resources too

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

3 years agozink: add a per-stage bind mask for ssbos
Mike Blumenkrantz [Tue, 11 May 2021 14:12:39 +0000 (10:12 -0400)]
zink: add a per-stage bind mask for ssbos

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

3 years agozink: add a per-stage mask for ubo binds
Mike Blumenkrantz [Tue, 11 May 2021 14:09:06 +0000 (10:09 -0400)]
zink: add a per-stage mask for ubo binds

optimizing buffer replacement was never so difficult

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

3 years agozink: remove some descriptor_refs_dirty checks from resource binding
Mike Blumenkrantz [Tue, 11 May 2021 14:20:35 +0000 (10:20 -0400)]
zink: remove some descriptor_refs_dirty checks from resource binding

these no longer provide any optimization

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

3 years agozink: remove fb surface resource refs
Mike Blumenkrantz [Tue, 11 May 2021 13:39:11 +0000 (09:39 -0400)]
zink: remove fb surface resource refs

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

3 years agozink: remove fb surface refs
Mike Blumenkrantz [Tue, 11 May 2021 13:24:26 +0000 (09:24 -0400)]
zink: remove fb surface refs

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

3 years agozink: remove samplerview refs
Mike Blumenkrantz [Tue, 11 May 2021 13:23:25 +0000 (09:23 -0400)]
zink: remove samplerview refs

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

3 years agozink: remove imageview refs from shader images
Mike Blumenkrantz [Tue, 11 May 2021 13:23:06 +0000 (09:23 -0400)]
zink: remove imageview refs from shader images

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

3 years agozink: set new batch usage during surface rebinds
Mike Blumenkrantz [Tue, 11 May 2021 13:32:41 +0000 (09:32 -0400)]
zink: set new batch usage during surface rebinds

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

3 years agozink: add surface ref during rebind if unflushed usage
Mike Blumenkrantz [Tue, 11 May 2021 13:22:25 +0000 (09:22 -0400)]
zink: add surface ref during rebind if unflushed usage

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

3 years agozink: remove refs from desc ref updating
Mike Blumenkrantz [Tue, 11 May 2021 13:21:37 +0000 (09:21 -0400)]
zink: remove refs from desc ref updating

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

3 years agozink: remove resource refs from samplerviews
Mike Blumenkrantz [Tue, 11 May 2021 13:21:17 +0000 (09:21 -0400)]
zink: remove resource refs from samplerviews

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

3 years agozink: remove refs from shader images
Mike Blumenkrantz [Tue, 11 May 2021 13:20:47 +0000 (09:20 -0400)]
zink: remove refs from shader images

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

3 years agozink: remove refs from shader buffers
Mike Blumenkrantz [Tue, 11 May 2021 13:20:25 +0000 (09:20 -0400)]
zink: remove refs from shader buffers

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

3 years agozink: remove refs from ubos
Mike Blumenkrantz [Tue, 11 May 2021 13:20:13 +0000 (09:20 -0400)]
zink: remove refs from ubos

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

3 years agozink: remove refs from vertex buffers
Mike Blumenkrantz [Tue, 11 May 2021 13:20:02 +0000 (09:20 -0400)]
zink: remove refs from vertex buffers

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

3 years agozink: remove refs from buffer rebinds
Mike Blumenkrantz [Tue, 11 May 2021 14:21:41 +0000 (10:21 -0400)]
zink: remove refs from buffer rebinds

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

3 years agozink: move resource object ref to batch in init_storage_object
Mike Blumenkrantz [Wed, 12 May 2021 11:17:19 +0000 (07:17 -0400)]
zink: move resource object ref to batch in init_storage_object

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

3 years agozink: move resource object ref to batch in invalidate hook
Mike Blumenkrantz [Wed, 12 May 2021 11:16:54 +0000 (07:16 -0400)]
zink: move resource object ref to batch in invalidate hook

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

3 years agozink: add util function for transferring resource refs to batch
Mike Blumenkrantz [Tue, 11 May 2021 14:27:55 +0000 (10:27 -0400)]
zink: add util function for transferring resource refs to batch

there's no point in doing unref->ref if it's known that this will happen

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

3 years agorelnotes: more lavapipe features
Mike Blumenkrantz [Tue, 6 Jul 2021 21:09:23 +0000 (17:09 -0400)]
relnotes: more lavapipe features

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

3 years agofeatures: more lavapipe extensions
Mike Blumenkrantz [Tue, 6 Jul 2021 21:09:13 +0000 (17:09 -0400)]
features: more lavapipe extensions

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

3 years agolavapipe: implement KHR_separate_depth_stencil_layouts
Mike Blumenkrantz [Tue, 6 Jul 2021 19:04:55 +0000 (15:04 -0400)]
lavapipe: implement KHR_separate_depth_stencil_layouts

this is a conformant implementation

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

3 years agolavapipe: implement EXT_separate_stencil_usage
Mike Blumenkrantz [Tue, 6 Jul 2021 19:04:55 +0000 (15:04 -0400)]
lavapipe: implement EXT_separate_stencil_usage

this is a conformant implementation

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

3 years agopan/decode: Handle IDVS jobs on Bifrost
Alyssa Rosenzweig [Tue, 22 Jun 2021 15:16:37 +0000 (11:16 -0400)]
pan/decode: Handle IDVS jobs on Bifrost

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>

3 years agopanfrost: Add secondary shader XML fields
Alyssa Rosenzweig [Tue, 22 Jun 2021 15:05:22 +0000 (11:05 -0400)]
panfrost: Add secondary shader XML fields

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>

3 years agopanfrost/genxml: Decode Bifrost index-driven vertex jobs
Daniel Stone [Wed, 16 Jun 2021 09:10:48 +0000 (10:10 +0100)]
panfrost/genxml: Decode Bifrost index-driven vertex jobs

Bifrost has a new type of job called 'index-driven vertex', which takes
in two shaders. The primary shader, called for all values, performs
position shading to a cacheline-aligned attribute buffer. The secondary
shader, called for values still live after culling, performs varying
shading.

It is the responsiblilty of the implementation to ensure that vertices
from different instances do not share a cacheline.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>

3 years agoiris: Use isl_surf_get_uncompressed_surf
Jason Ekstrand [Mon, 28 Jun 2021 22:15:28 +0000 (17:15 -0500)]
iris: Use isl_surf_get_uncompressed_surf

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agoiris: Don't leak the surface if uncompressed re-interp fails
Jason Ekstrand [Tue, 29 Jun 2021 00:11:46 +0000 (19:11 -0500)]
iris: Don't leak the surface if uncompressed re-interp fails

Fixes: a032a9665f27 "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agointel/isl: Add more cases to isl_surf_get_uncompressed_surf
Jason Ekstrand [Tue, 29 Jun 2021 00:03:18 +0000 (19:03 -0500)]
intel/isl: Add more cases to isl_surf_get_uncompressed_surf

We can actually create array surfaces instead of requiring single-slice
in a few cases.  This does require us to be very careful about our
checks, though.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agointel/blorp: Use isl_surf_get_uncompressed_surf
Jason Ekstrand [Thu, 22 Feb 2018 22:31:00 +0000 (14:31 -0800)]
intel/blorp: Use isl_surf_get_uncompressed_surf

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agointel/blorp: Adjust the compressed copy rectangle before convert_to_single_slice
Jason Ekstrand [Fri, 23 Feb 2018 19:51:55 +0000 (11:51 -0800)]
intel/blorp: Adjust the compressed copy rectangle before convert_to_single_slice

It doesn't matter for the actual copy rectangle and this makes the
asserts a bit nicer as we don't need to bother with the intratile
offsets because there aren't any yet.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agointel/isl: Pull the uncompressed surface view code from anv
Jason Ekstrand [Thu, 22 Feb 2018 21:48:52 +0000 (13:48 -0800)]
intel/isl: Pull the uncompressed surface view code from anv

This adds a helper isl_surf_get_uncompressed_surf for creating a surface
which provides an uncompressed view into a compressed surface.  The code
is basically a direct port of the uncompressed surface code from the
Vulkan driver which, in turn, was a port from BLORP.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

3 years agocrocus: Reduce SSBO alignment requirements from 64B to 4B.
Kenneth Graunke [Fri, 2 Jul 2021 19:47:38 +0000 (12:47 -0700)]
crocus: Reduce SSBO alignment requirements from 64B to 4B.

Mirroring a change in iris; see the previous commit for rationale.
One difference is that crocus does sometimes use CPU maps on Atoms
for *reads*...but writes don't go through CPU caches.  Should be OK.

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

3 years agoiris: Reduce SSBO alignment requirements from 64B to 4B
Kenneth Graunke [Fri, 2 Jul 2021 19:39:49 +0000 (12:39 -0700)]
iris: Reduce SSBO alignment requirements from 64B to 4B

Back when SSBOs were first enabled in i965, we tried to work around
issues where the CPU and GPU were incoherently writing to the same
cacheline by forcing an alignment such that different sections of
data would fall in different cachelines.  This seems wrong.

On integrated GPUs with LLC, CPU and GPU writes should be coherent.
On integrated GPUs without LLC, we either enable snooping (so they
are again coherent), or we use WC maps (so the CPU cache isn't used).
Discrete GPUs always use WC maps (so the CPU cache isn't used).

This should work.  In other words, I think the increased alignment
was just working around coherency problems on atoms that have been
fixed in the intervening 6 year time period.

Untyped surface messages require 4B alignment.

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

3 years agopanfrost: Eliminate redundant flushes with AFBC
Alyssa Rosenzweig [Fri, 28 May 2021 22:29:03 +0000 (18:29 -0400)]
panfrost: Eliminate redundant flushes with AFBC

We have all the information we need easily available.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>

3 years agopanfrost: Split "flush writer" from "flush accessing"
Alyssa Rosenzweig [Fri, 28 May 2021 22:23:37 +0000 (18:23 -0400)]
panfrost: Split "flush writer" from "flush accessing"

Since writers are counted in the accessor set, the old implementation
had a redundant flush in the "flush accessing" case. To fix, split the
two modes into separate functions, removing the redundancy and offering
a much more ergonomic API.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>

3 years agopanfrost: Do tracking of resources, not BOs
Boris Brezillon [Wed, 12 May 2021 16:23:19 +0000 (18:23 +0200)]
panfrost: Do tracking of resources, not BOs

Squashed together with commits from Boris's original dependency tracking
cleanup series.

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

3 years agopanfrost: Wrap occlusion query in pipe_resource
Alyssa Rosenzweig [Mon, 17 May 2021 19:56:53 +0000 (15:56 -0400)]
panfrost: Wrap occlusion query in pipe_resource

For proper tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>

3 years agopanfrost: Express dependencies as resources, not BOs
Alyssa Rosenzweig [Mon, 17 May 2021 18:42:13 +0000 (14:42 -0400)]
panfrost: Express dependencies as resources, not BOs

This is a more ergnomic API, and will allow further optimizations.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>

3 years agopanfrost: Replace the batch->bos hashmap by a sparse array
Boris Brezillon [Wed, 12 May 2021 17:49:08 +0000 (19:49 +0200)]
panfrost: Replace the batch->bos hashmap by a sparse array

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

3 years agonir: Free the instructions in a DCE instr removal.
Emma Anholt [Mon, 28 Jun 2021 21:42:21 +0000 (14:42 -0700)]
nir: Free the instructions in a DCE instr removal.

No significant change in shader-db time (n=11), but should be a little win
for memory usage by the compiler.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>

3 years agonir: Use remove_and_dce for nir_shader_lower_instructions().
Emma Anholt [Mon, 28 Jun 2021 17:51:06 +0000 (10:51 -0700)]
nir: Use remove_and_dce for nir_shader_lower_instructions().

Reduces the work that other shader passes have to do to look at dead code,
and possibly extra rounds around the optimization loop if dce wasn't the
last pass in it.

shader-db runtime -1.12919% +/- 0.264337% (n=49) on SKL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>

3 years agonir: Add a nir_instr_remove that recursively removes dead code.
Emma Anholt [Fri, 25 Jun 2021 23:53:55 +0000 (16:53 -0700)]
nir: Add a nir_instr_remove that recursively removes dead code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>

3 years agoanv: Fix unused var warning on release builds from an assertion.
Emma Anholt [Mon, 28 Jun 2021 20:08:37 +0000 (13:08 -0700)]
anv: Fix unused var warning on release builds from an assertion.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>

3 years agozinK: tweak shader module update -> pipeline combined_dirty conditional
Mike Blumenkrantz [Fri, 14 May 2021 21:44:29 +0000 (17:44 -0400)]
zinK: tweak shader module update -> pipeline combined_dirty conditional

make this more explicit

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

3 years agozink: remove shader_id
Mike Blumenkrantz [Fri, 14 May 2021 19:17:03 +0000 (15:17 -0400)]
zink: remove shader_id

now that shaders are per-program, shader_id is no longer useful

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

3 years agozink: remove gfx program slot mapping
Mike Blumenkrantz [Fri, 14 May 2021 17:29:48 +0000 (13:29 -0400)]
zink: remove gfx program slot mapping

if shaders aren't being shared between programs, they can instead directly
assign io between the shader stages such that only the producer and consumer
pair need to have their slots match up

this requires that each gfx program struct stores base nir for a given shader
in order to avoid breaking io for other programs which reuse shader states

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

3 years agozink: set gfx program shaders and generate internal tcs during program creation
Mike Blumenkrantz [Fri, 14 May 2021 21:48:53 +0000 (17:48 -0400)]
zink: set gfx program shaders and generate internal tcs during program creation

the base shader states will never change for a program, and tcs will never
change its io, so there's no point in having this in the shader update hotpath

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

3 years agozink: split up shader cache per-stage
Mike Blumenkrantz [Fri, 14 May 2021 20:02:52 +0000 (16:02 -0400)]
zink: split up shader cache per-stage

this reduces overhead from lookups by ensuring that the number of entries
in a given table are minimized

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

3 years agozink: make shader cache local to a single program
Mike Blumenkrantz [Mon, 10 May 2021 21:34:25 +0000 (17:34 -0400)]
zink: make shader cache local to a single program

sharing caches makes things complicated and doesn't yield much benefit

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

3 years agogbm: Load backend based on DRM device driver name
James Jones [Thu, 18 Mar 2021 22:36:07 +0000 (15:36 -0700)]
gbm: Load backend based on DRM device driver name

After attempting to use the GBM backend specified by the user
via an environment variable, if any, but before falling back
to the built-in GBM backends, attempt to dlopen
libg<DRM driver name>_gbm.so in the GBM backend library search
path (Defaults to "$libdir/gbm") and initialize a device using
it. This enables automatic backend discovery for devices that
do not provide a DRI driver.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Support dynamically loading named backends
James Jones [Sat, 14 Dec 2019 02:05:39 +0000 (18:05 -0800)]
gbm: Support dynamically loading named backends

If the user specifies a backend name explicitly
via an environment variable and it is not in the
list of built-in backends, attempt to load it at
runtime.

runtime-loaded backends get a new gbm_backend_desc
struct instance for each device using them (A
small increase in memory usage to eliminate the
need for the locking and bookkeeping sharing them
would require), so these structures need to be
freed when destroying devices using runtime-loaded
backends.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Put common device creation in a helper function
James Jones [Wed, 23 Jun 2021 01:00:01 +0000 (18:00 -0700)]
gbm: Put common device creation in a helper function

Subsequent changes will use this same logic to
instantiate devices with the correct version and
set up their backend reference.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Rename the DRI backend from gbm_dri.so to dri
James Jones [Wed, 23 Jun 2021 00:44:17 +0000 (17:44 -0700)]
gbm: Rename the DRI backend from gbm_dri.so to dri

A subsequent change will allow loading backends
from DSOs specified by the GBM_BACKEND environment
variable. The exact DSO name and path are derived
by the common loader code and will be of the form:

 <gbm_backend_path>/<GBM_BACKEND>_gbm.so

E.g., a user would set the environment variable to
"external" to load "external_gbm.so". Users will
also still be able to explicitly request any
builtin backends by name as well, so this change
helps keep the environment variable syntax
consistent between internal and external backends.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agomeson: Add a GBM backends search path build option
James Jones [Fri, 23 Apr 2021 06:18:49 +0000 (23:18 -0700)]
meson: Add a GBM backends search path build option

This is the list of locations where GBM will look
for alternate backend implementations based on the
DRM driver name. It defaults to $libdir/gbm.

On Android, this path is currently hard-coded to
/vendor/lib[64]/gbm.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agoloader: Factor out driver library loading code
James Jones [Fri, 23 Apr 2021 06:17:08 +0000 (23:17 -0700)]
loader: Factor out driver library loading code

Separate the path-building and dlopen() portion of
loader_open_driver() from the DRI extension
loading logic. The former will be shared by the
GBM backend loading logic in a subsequent change.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Rename backend description list to builtin_backends
James Jones [Fri, 23 Apr 2021 19:46:25 +0000 (12:46 -0700)]
gbm: Rename backend description list to builtin_backends

This just makes it clearer the array isn't a global
list of all backends in use.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Add backend ABI-check test
James Jones [Thu, 24 Jun 2021 21:03:38 +0000 (14:03 -0700)]
gbm: Add backend ABI-check test

This is based on the wayland EGL library ABI test
framework. The helper macros were copied from
there and expanded to support more than one
struct/type, and to additionally check member
type compatibility by default.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Version the GBM backend interface
James Jones [Thu, 17 Oct 2019 05:16:53 +0000 (22:16 -0700)]
gbm: Version the GBM backend interface

Define a version number for the interface GBM uses
to offload work to its backends/drivers. Store the
version in the backend interface structs provided
to the loader by backends, as well as in the core
interface struct provided to backends by the GBM
loader code to backends.

The backend can create structures of any version
it supports, which can be greater or less than the
interface version specified by GBM in the core
interface structure. Hence, GBM will need to take
care to check the backend version before accessing
any members added to structs defined in
gbm_backend_abi.h after this change.

Similarly, the backend may need to check the
interface version supported by the GBM library
before passing back data in any structure members
that require the GBM library to interact with
them for correct operation. For example, if for
some reason a structure defined in
gbm_backend_abi.h gained a field which was a
pointer to memory allocated by the backend and
freed by GBM, the backend should avoid allocating
this memory if the GBM library did not specify an
interface version new enough to indicate that it
was aware of the new structure member.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Move majority of gbmint.h to gbm_backend_abi.h
James Jones [Thu, 3 Jun 2021 22:36:10 +0000 (15:36 -0700)]
gbm: Move majority of gbmint.h to gbm_backend_abi.h

The content of gbm_backend_abi.h are nearly an
identical copy of the old gbmint.h. Only minimal
modifications have been made to ease history
tracking. Subsequent changes will further
formalize the ABI structures in gbm_backend_abi.h

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Add gbm_core struct to export code to backends
James Jones [Thu, 3 Jun 2021 22:24:43 +0000 (15:24 -0700)]
gbm: Add gbm_core struct to export code to backends

The GBM core/loader code defines one helper
function used by both itself and the built-in DRI
backend. Presumably, external backend authors
would want to use such functions as well, so
package them into a single struct that will be
passed explicitly to externally loaded backends in
subsequent changes.

Another option considered was to simply export
the gbm_format_canonicalize() function directly,
optionally renaming it to better indicate it is
intended only for "internal" use first. However,
even with a rename, this would expose it to
potential use by applications as well, which is
not ideal, as it is not intended to be part of
the application-facing GBM ABI.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Give gbm_device a reference to its backend
James Jones [Sat, 14 Dec 2019 00:32:57 +0000 (16:32 -0800)]
gbm: Give gbm_device a reference to its backend

This will be used for looking up the backend
again at destruction time to perform any backend-
agnostic cleanup.  To facilitate that, also
dispatch device destruction to the backend manager
code.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Give getenv backend override its own function
James Jones [Thu, 3 Jun 2021 21:20:03 +0000 (14:20 -0700)]
gbm: Give getenv backend override its own function

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Consolidate env var and default backend loops
James Jones [Sat, 14 Dec 2019 00:20:02 +0000 (16:20 -0800)]
gbm: Consolidate env var and default backend loops

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Create device directly in find_backend
James Jones [Sat, 14 Dec 2019 00:14:41 +0000 (16:14 -0800)]
gbm: Create device directly in find_backend

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Inline load_backend function content
James Jones [Fri, 13 Dec 2019 23:54:53 +0000 (15:54 -0800)]
gbm: Inline load_backend function content

It was a functional no-op with the currently
available backends (Only DRI), and its implied
intended functionality is implemented elsewhere
in subsequent patches.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

3 years agogbm: Remove stat and refcount fields from gbm_device
James Jones [Wed, 2 Jun 2021 00:35:27 +0000 (17:35 -0700)]
gbm: Remove stat and refcount fields from gbm_device

These were unused.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>