platform/upstream/mesa.git
4 years agoanv: Mark anv_dump_{start,finish} as PUBLIC
Rohan Garg [Thu, 30 Jul 2020 14:23:09 +0000 (16:23 +0200)]
anv: Mark anv_dump_{start,finish} as PUBLIC

In order to call these functions from gdb we need to mark both of them
as PUBLIC.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6125>

4 years agozink: invalidate pipeline hash on more changes
Mike Blumenkrantz [Mon, 10 Aug 2020 18:49:58 +0000 (14:49 -0400)]
zink: invalidate pipeline hash on more changes

some cases were missed here, causing an assert to trigger

Fixes: 1185b3f32d9 "zink: pre-hash gfx-pipeline-state"

Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6262>

4 years agoutil/macros: Add ATTRIBUTE_NOINLINE definition for MSVC
Jesse Natalie [Thu, 13 Aug 2020 20:10:41 +0000 (13:10 -0700)]
util/macros: Add ATTRIBUTE_NOINLINE definition for MSVC

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

4 years agou_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE
Jesse Natalie [Thu, 13 Aug 2020 17:33:29 +0000 (10:33 -0700)]
u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE

Fixes: d0d14f3f ("util: Add unit test for stack backtrace caputure")

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

4 years agoiris: Make iris_bo_import_dmabuf take a modifier
Nanley Chery [Thu, 30 Jul 2020 18:47:23 +0000 (11:47 -0700)]
iris: Make iris_bo_import_dmabuf take a modifier

Replace the tiling parameter with a modifier parameter. I find it more
straightforward to have this function figure out the tiling from the
modifier than to have its caller do it.

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

4 years agoiris: Don't call SET_TILING for dmabuf imports
Nanley Chery [Wed, 12 Aug 2020 00:01:31 +0000 (17:01 -0700)]
iris: Don't call SET_TILING for dmabuf imports

Calling SET_TILING on a DMA buffer with the gen12 CCS modifier can fail
unnecessarily. The main surface in the BO is Y-tiled, but the CCS portion is
linear and can have a stride that's not a multiple of 128B. Because SET_TILING
is called on the CCS plane with I915_TILING_Y, the ioctl will sometimes reject
the stride.

SET_TILING was originally used in b6d45e7f748e9ff7e198391f5ce5d1253101fedb to
fix an assertion failure in iris_resource_from_handle. Assigning the BO's
tiling_mode field is sufficient to avoid the failure.

Fixes: c19492bcdb9 ("iris: Handle importing aux-enabled surfaces on TGL")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6296>

4 years agoturnip: implement VK_EXT_custom_border_color
Jonathan Marek [Mon, 27 Jul 2020 17:20:04 +0000 (13:20 -0400)]
turnip: implement VK_EXT_custom_border_color

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

4 years agoutil/format: expose generated format packing functions through a header
Jonathan Marek [Wed, 5 Aug 2020 03:32:11 +0000 (23:32 -0400)]
util/format: expose generated format packing functions through a header

Some of the generated functions can be useful without going through the
format table (filling border color struct in turnip). By not calling these
functions through the format table, we should eventually be able to garbage
collect the unused packing functions, and also allows LTOs to happen.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093>

4 years agopanfrost: add missing dependency on midgard_pack.h
Jonathan Marek [Thu, 13 Aug 2020 15:18:13 +0000 (11:18 -0400)]
panfrost: add missing dependency on midgard_pack.h

Fixes build failing when libpanfrost is built before midgard_pack.

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

4 years agopanfrost: Fix border colour
Icecream95 [Thu, 13 Aug 2020 07:35:00 +0000 (19:35 +1200)]
panfrost: Fix border colour

The border colour was being set to the red colour for all channels.
Fixes tex-border-1 from piglit.

Fixes: f74186baa5e ("panfrost: XMLify Midgard samplers")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6298>

4 years agonir/lower_idiv: Port recent LLVM fixes to emit_udiv
Tony Wasserka [Tue, 11 Aug 2020 14:25:37 +0000 (16:25 +0200)]
nir/lower_idiv: Port recent LLVM fixes to emit_udiv

This change fixes off-by-one results in corner cases such as
0xffffffff / 0x11111111. For details refer to LLVM bug 46212.

Fixes: 8b98d0954e6 ('nir/lower_idiv: add new llvm-based path')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6281>

4 years agoaco: do not set valid_mask for POS0 exports on GFX 10.3
Samuel Pitoiset [Tue, 11 Aug 2020 09:09:36 +0000 (11:09 +0200)]
aco: do not set valid_mask for POS0 exports on GFX 10.3

This hardware issue seems only present 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/6278>

4 years agopanfrost: XMLify enum mali_format
Alyssa Rosenzweig [Wed, 12 Aug 2020 01:30:46 +0000 (21:30 -0400)]
panfrost: XMLify enum mali_format

Note we are just handling the index part of the format. This is *not*
the full format, which would include the swizzle (or v7 equivalent) and
the sRGB flag. But in the interest of incremental progress, let's move
this part over first and save on decoding complexity.

To avoid substantial churn from prefixing FORMAT to format names, we
special case the enums to avoid the prefix. This is undesirable but
reduces churn, especially since format handling is slated for an
overhaul soon to accomodate v7

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

4 years agopanfrost: XMLify exception access
Alyssa Rosenzweig [Wed, 12 Aug 2020 01:19:52 +0000 (21:19 -0400)]
panfrost: XMLify exception access

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

4 years agopanfrost: XMLify MSAA writeout mode
Alyssa Rosenzweig [Wed, 12 Aug 2020 01:04:01 +0000 (21:04 -0400)]
panfrost: XMLify MSAA writeout mode

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

4 years agopanfrost: XMLify Block Format
Alyssa Rosenzweig [Wed, 12 Aug 2020 01:00:47 +0000 (21:00 -0400)]
panfrost: XMLify Block Format

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

4 years agopanfrost: Drop unused mali_channel_swizzle
Alyssa Rosenzweig [Thu, 6 Aug 2020 22:29:51 +0000 (18:29 -0400)]
panfrost: Drop unused mali_channel_swizzle

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

4 years agopanfrost: XMLify Bifrost textures
Alyssa Rosenzweig [Thu, 6 Aug 2020 22:12:28 +0000 (18:12 -0400)]
panfrost: XMLify Bifrost textures

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

4 years agopanfrost: XMLify Midgard textures
Alyssa Rosenzweig [Tue, 11 Aug 2020 21:27:36 +0000 (17:27 -0400)]
panfrost: XMLify Midgard textures

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

4 years agopanfrost: XMLify Bifrost samplers
Alyssa Rosenzweig [Tue, 11 Aug 2020 22:25:03 +0000 (18:25 -0400)]
panfrost: XMLify Bifrost samplers

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

4 years agopanfrost: XMLify Midgard samplers
Alyssa Rosenzweig [Tue, 11 Aug 2020 22:23:12 +0000 (18:23 -0400)]
panfrost: XMLify Midgard samplers

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

4 years agopanfrost: Don't mask coverage mask to 4-bits
Alyssa Rosenzweig [Thu, 6 Aug 2020 14:31:28 +0000 (10:31 -0400)]
panfrost: Don't mask coverage mask to 4-bits

While it is correct for MSAA 4x, it will break for MSAA 8x and 16x, and
it is only dubiously correct for no-MSAA. Drop the mask.

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

4 years agopanfrost: Simplify depth/stencil/alpha
Alyssa Rosenzweig [Wed, 12 Aug 2020 15:42:11 +0000 (11:42 -0400)]
panfrost: Simplify depth/stencil/alpha

The alpha test is lowered by the frontend so we can drop that unused
code path, and stencil state can be computed at CSO create time to
reduce draw-time complexity.

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

4 years agopanfrost: Simplify zsa == NULL case
Alyssa Rosenzweig [Thu, 6 Aug 2020 14:02:35 +0000 (10:02 -0400)]
panfrost: Simplify zsa == NULL case

Stencil fields are only used if stenciling is enabled.

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

4 years agopanfrost: XMLify stencil test
Alyssa Rosenzweig [Thu, 6 Aug 2020 02:02:32 +0000 (22:02 -0400)]
panfrost: XMLify stencil test

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

4 years agopanfrost: XMLify UBOs
Alyssa Rosenzweig [Thu, 6 Aug 2020 01:39:25 +0000 (21:39 -0400)]
panfrost: XMLify UBOs

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

4 years agopanfrost: XMLify viewport
Alyssa Rosenzweig [Wed, 5 Aug 2020 23:33:20 +0000 (19:33 -0400)]
panfrost: XMLify viewport

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

4 years agopanfrost: XMLify wrap modes
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:53:41 +0000 (18:53 -0400)]
panfrost: XMLify wrap modes

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

4 years agopanfrost: XMLify stencil op
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:51:27 +0000 (18:51 -0400)]
panfrost: XMLify stencil op

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

4 years agopanfrost: XMLify mali_func
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:47:52 +0000 (18:47 -0400)]
panfrost: XMLify mali_func

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

4 years agopanfrost: XMLify draw_mode
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:44:36 +0000 (18:44 -0400)]
panfrost: XMLify draw_mode

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

4 years agopanfrost: XMLify job_type
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:40:44 +0000 (18:40 -0400)]
panfrost: XMLify job_type

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

4 years agopan/decode: Add helper to dump GPU structures
Alyssa Rosenzweig [Wed, 5 Aug 2020 23:43:58 +0000 (19:43 -0400)]
pan/decode: Add helper to dump GPU structures

Based on generating unpack/print.

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

4 years agopanfrost: Redirect cmdstream includes through GenXML
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:13:11 +0000 (18:13 -0400)]
panfrost: Redirect cmdstream includes through GenXML

This will provide a way to incrementally upgrade.

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

4 years agopanfrost: Build midgard_pack.h via meson
Alyssa Rosenzweig [Wed, 5 Aug 2020 21:48:51 +0000 (17:48 -0400)]
panfrost: Build midgard_pack.h via meson

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

4 years agopanfrost: Adopt gen_pack_header.py via v3d
Alyssa Rosenzweig [Tue, 4 Aug 2020 19:05:43 +0000 (15:05 -0400)]
panfrost: Adopt gen_pack_header.py via v3d

We fork gen_pack_header.py from v3d, which in turn forks GenXML from
Intel. Selected changes for Mali:

* Custom prefix/vendoring
* Cull supported types
* Drop <register> and <packet> support (no cmdstream)
* Pack 32-bit words instead of 8-bit bytes
* Inline packing helpers
* Introduce exact attribute
* Introduce general minus(..) and shr(..) modifiers
* Introduce word:bit syntax
* Introduce prettyprinters

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

4 years agopanfrost: Add stub midgard.xml
Alyssa Rosenzweig [Wed, 5 Aug 2020 22:16:38 +0000 (18:16 -0400)]
panfrost: Add stub midgard.xml

This will be filled in incrementally.

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

4 years agoutil: Fix up indentation in the generated format tables code.
Eric Anholt [Thu, 9 Jul 2020 16:24:04 +0000 (09:24 -0700)]
util: Fix up indentation in the generated format tables code.

I did this as a separate commit to make the previous one more reviewable.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826>

4 years agoutil: Change a codegenned switch statement to a nice little table.
Eric Anholt [Wed, 1 Jul 2020 20:00:16 +0000 (13:00 -0700)]
util: Change a codegenned switch statement to a nice little table.

This saves us 13 to 35kb on release drivers in my builds.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826>

4 years agoutil: Split the pack/unpack functions out of the format desc.
Eric Anholt [Wed, 1 Jul 2020 20:19:47 +0000 (13:19 -0700)]
util: Split the pack/unpack functions out of the format desc.

This gives the compiler a chance to GC pack/unpack functions separate from
the format descriptions.  For drivers that use everything, this is
+10-20kb, while for libvulkan_intel it's -1.3MB.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1048434
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826>

4 years agodocs: update calendar for 20.2.0-rc2
Dylan Baker [Wed, 12 Aug 2020 17:43:13 +0000 (10:43 -0700)]
docs: update calendar for 20.2.0-rc2

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

4 years agodocs: update calendar for 20.2.0-rc1
Dylan Baker [Wed, 12 Aug 2020 17:42:59 +0000 (10:42 -0700)]
docs: update calendar for 20.2.0-rc1

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

4 years agoradeonsi: fix compute-based culling with VERTEX_COUNTER_GDS_MODE == 1
Marek Olšák [Sat, 8 Aug 2020 20:40:54 +0000 (16:40 -0400)]
radeonsi: fix compute-based culling with VERTEX_COUNTER_GDS_MODE == 1

Discovered when testing Sienna Cichlid.

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

4 years agoradeonsi: disable NGG culling on gfx10.3 because of hangs
Marek Olšák [Sat, 8 Aug 2020 20:39:09 +0000 (16:39 -0400)]
radeonsi: disable NGG culling on gfx10.3 because of hangs

Fixes: a23802bcb9a - ac,radeonsi: start adding support for gfx10.3

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

4 years agozink: handle more draw modes
Mike Blumenkrantz [Tue, 7 Jul 2020 19:46:04 +0000 (15:46 -0400)]
zink: handle more draw modes

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

4 years agozink: change pipeline hashes to index based on vk primitive type
Mike Blumenkrantz [Wed, 12 Aug 2020 13:21:48 +0000 (09:21 -0400)]
zink: change pipeline hashes to index based on vk primitive type

this is a bit more convenient since we always support vk types but not
necessarily gallium types

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

4 years agoanv/nir: Unify inputs_read/outputs_written between geometry stages
Danylo Piliaiev [Mon, 27 Jul 2020 15:00:41 +0000 (18:00 +0300)]
anv/nir: Unify inputs_read/outputs_written between geometry stages

inputs_read/outputs_written are used for a shader stage to
determine the layout of input and output storage. Adjacent stages must
agree on the layout, so adjacent input/output bitfields must match.

Most of the time, cross-stage optimizations make that happen anyway,
but there are some cases (with special values like clip distances and
point size) where this doesn't happen.

Fixes crashes in dEQP-VK.subgroups.*.framebuffer.*_tess_eval

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3210
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6102>

4 years agopanfrost: Implement panfrost_query_dmabuf_modifiers
Alyssa Rosenzweig [Wed, 22 Jul 2020 16:11:39 +0000 (12:11 -0400)]
panfrost: Implement panfrost_query_dmabuf_modifiers

v2: Only advertise AFBC if PAN_MESA_DEBUG=afbc is set. This is to avoid
sharing AFBC buffers as SCANOUT until corresponding kernel bugfixes are
landed. Technically a kernel issue but let's prevent a regression.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Ensure AFBC slices are aligned
Alyssa Rosenzweig [Wed, 22 Jul 2020 18:51:45 +0000 (14:51 -0400)]
panfrost: Ensure AFBC slices are aligned

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Allocate enough space for tiled formats
Alyssa Rosenzweig [Wed, 22 Jul 2020 17:44:35 +0000 (13:44 -0400)]
panfrost: Allocate enough space for tiled formats

We need to align and possible reserve space for a header.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Enable YTR where allowed
Alyssa Rosenzweig [Wed, 22 Jul 2020 15:08:06 +0000 (11:08 -0400)]
panfrost: Enable YTR where allowed

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Implement YTR availability check
Alyssa Rosenzweig [Wed, 22 Jul 2020 15:07:03 +0000 (11:07 -0400)]
panfrost: Implement YTR availability check

Depends on format.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Choose AFBC when available
Alyssa Rosenzweig [Tue, 21 Jul 2020 16:34:33 +0000 (12:34 -0400)]
panfrost: Choose AFBC when available

There are lots of reasons we might fallback on u-interleaved tiling, but
when we can use AFBC, it's a big win.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Import staging routines from freedreno
Alyssa Rosenzweig [Tue, 21 Jul 2020 16:57:25 +0000 (12:57 -0400)]
panfrost: Import staging routines from freedreno

For software access to AFBC textures.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Respect modifiers in resource management
Alyssa Rosenzweig [Mon, 20 Jul 2020 22:03:56 +0000 (18:03 -0400)]
panfrost: Respect modifiers in resource management

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Account for modifiers when creating BO
Alyssa Rosenzweig [Mon, 20 Jul 2020 21:51:52 +0000 (17:51 -0400)]
panfrost: Account for modifiers when creating BO

If specified, use the modifier directly. If unspecified, pick our own
modifier.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Use modifier instead of layout throughout
Alyssa Rosenzweig [Wed, 22 Jul 2020 14:23:50 +0000 (10:23 -0400)]
panfrost: Use modifier instead of layout throughout

Instead of converting back and forth we should stick with fourcc codes
as the canonical layout definition. Furthermore modifiers allow all the
variants of AFBC to be encoded canonically, whereas the previous enum
does not (info about YTR is encoded out of band, for instance).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Introduce create_with_modifier helper
Alyssa Rosenzweig [Mon, 20 Jul 2020 21:23:55 +0000 (17:23 -0400)]
panfrost: Introduce create_with_modifier helper

As a stepping stone to full modifier support.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Remove hint-based AFBC heuristic
Alyssa Rosenzweig [Tue, 11 Aug 2020 21:56:32 +0000 (17:56 -0400)]
panfrost: Remove hint-based AFBC heuristic

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agopanfrost: Set `initialized` more conservatively
Alyssa Rosenzweig [Tue, 21 Jul 2020 20:05:20 +0000 (16:05 -0400)]
panfrost: Set `initialized` more conservatively

In case Gallium doesn't ask for direct but we give a direct mapping
anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agogallium/dri2: Support Arm modifiers
Alyssa Rosenzweig [Mon, 20 Jul 2020 22:50:29 +0000 (18:50 -0400)]
gallium/dri2: Support Arm modifiers

This is needed to share both Utgard-style tiled and a subset of Arm
FrameBuffer Compression (AFBC) tiled framebuffers across processes in
Wayland.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

4 years agozink: print error when getprocaddr fails for extension functions
Mike Blumenkrantz [Sat, 11 Jul 2020 13:46:23 +0000 (09:46 -0400)]
zink: print error when getprocaddr fails for extension functions

make this more visible on errors

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

4 years agoradv: Update CI expectations for the recent descriptor indexing regressions.
Bas Nieuwenhuizen [Wed, 12 Aug 2020 01:12:12 +0000 (03:12 +0200)]
radv: Update CI expectations for the recent descriptor indexing regressions.

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

4 years agoiris: Add support for MESA_SHADER_KERNEL in the disk cache
Jason Ekstrand [Tue, 11 Aug 2020 21:13:47 +0000 (16:13 -0500)]
iris: Add support for MESA_SHADER_KERNEL in the disk cache

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

4 years agoiris: Upload kernel inputs with system values
Jason Ekstrand [Tue, 11 Aug 2020 15:30:42 +0000 (10:30 -0500)]
iris: Upload kernel inputs with system values

Clover doesn't upload a cbuf0 but instead provides the kernel inputs as
part of the pipe_grid.  The most obvious thing to do is to upload them
along with system values.

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

4 years agoiris: Copy dest size from the original intrinsic in setup_uniforms
Jason Ekstrand [Tue, 11 Aug 2020 15:38:22 +0000 (10:38 -0500)]
iris: Copy dest size from the original intrinsic in setup_uniforms

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

4 years agoiris/disk_cache: Stop assuming stage == cache_id
Jason Ekstrand [Tue, 11 Aug 2020 21:12:55 +0000 (16:12 -0500)]
iris/disk_cache: Stop assuming stage == cache_id

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

4 years agoiris: Add a kernel_input_size field for compiled shaders
Jason Ekstrand [Tue, 11 Aug 2020 15:07:55 +0000 (10:07 -0500)]
iris: Add a kernel_input_size field for compiled shaders

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

4 years agoiris: Use blob_write_uint32 for num_system_values
Jason Ekstrand [Tue, 11 Aug 2020 15:04:28 +0000 (10:04 -0500)]
iris: Use blob_write_uint32 for num_system_values

We read it with blob_read_uint32; we should write it as uint32 as well.

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

4 years agointel/compiler: Allow MESA_SHADER_KERNEL
Jason Ekstrand [Mon, 4 Feb 2019 01:46:16 +0000 (19:46 -0600)]
intel/compiler: Allow MESA_SHADER_KERNEL

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

4 years agointel/compiler: Use C99 array initializers for prog_data/key sizes
Caio Marcelo de Oliveira Filho [Wed, 19 Feb 2020 16:47:20 +0000 (10:47 -0600)]
intel/compiler: Use C99 array initializers for prog_data/key sizes

This is way better than a pile of STATIC_ASSERTs.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>

4 years agointel/cs_intrinsics: Handle 64-bit intrinsics
Jason Ekstrand [Thu, 15 Nov 2018 03:57:59 +0000 (21:57 -0600)]
intel/cs_intrinsics: Handle 64-bit intrinsics

It's safe to do the math in 32 bits because they're all local workgroup
calculations.  We just need to do a conversion at the end.  For a couple
of intrinsics, we just turn them into 32-bit intrinsics and add a u2u64.

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

4 years agoiris: Add support for serialized NIR
Jason Ekstrand [Tue, 11 Aug 2020 00:05:56 +0000 (19:05 -0500)]
iris: Add support for serialized NIR

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

4 years agoiris: Implement set_global_binding
Jason Ekstrand [Thu, 25 Oct 2018 22:53:23 +0000 (17:53 -0500)]
iris: Implement set_global_binding

All this has to do is track which globals are bound and make sure the
batch references them every time.  We use A64 messages to access them so
there are no binding table entries to manage.

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

4 years agoiris: no-op implement set_compute_resources
Jason Ekstrand [Thu, 25 Oct 2018 22:51:04 +0000 (17:51 -0500)]
iris: no-op implement set_compute_resources

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

4 years agogitlab-ci: test Fossilize with GFX1030
Samuel Pitoiset [Mon, 10 Aug 2020 11:29:14 +0000 (13:29 +0200)]
gitlab-ci: test Fossilize with GFX1030

To make sure we don't completely break ACO GFX1030 support.

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

4 years agoradv/winsys: add null winsys entries for Sienna Cichild/Navy Flounder
Samuel Pitoiset [Mon, 10 Aug 2020 11:28:10 +0000 (13:28 +0200)]
radv/winsys: add null winsys entries for Sienna Cichild/Navy Flounder

We don't know the PCI ID yet.

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

4 years agoradv: fix emitting the border color pointer on the compute queue
Samuel Pitoiset [Tue, 11 Aug 2020 08:00:42 +0000 (10:00 +0200)]
radv: fix emitting the border color pointer on the compute queue

This was just missing.

Fixes: 57e796a12a8 ("radv: Implement VK_EXT_custom_border_color")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: John Galt <johngaltfirstrun@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6276>

4 years agoutil: Fix memory leaks in unit test.
Vinson Lee [Sun, 9 Aug 2020 04:26:12 +0000 (21:26 -0700)]
util: Fix memory leaks in unit test.

Fix warnings reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable bt1 going out of scope leaks the storage
it points to.
leaked_storage: Variable bt2 going out of scope leaks the storage
it points to.

Fixes: d0d14f3f6481 ("util: Add unit test for stack backtrace caputure")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6246>

4 years agosrc/mesa: add GL_NV_half_float extension support (v2)
Yogesh Mohan Marimuthu [Fri, 17 Jul 2020 12:08:19 +0000 (17:38 +0530)]
src/mesa: add GL_NV_half_float extension support (v2)

This patch adds support for GL_NV_half_float
extension.

v2: fix main_test failure

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6219>

4 years agodri_util: Update internal_format to GL_RGB8 for MESA_FORMAT_B8G8R8X8_UNORM
Nanley Chery [Mon, 22 Jun 2020 22:19:38 +0000 (15:19 -0700)]
dri_util: Update internal_format to GL_RGB8 for MESA_FORMAT_B8G8R8X8_UNORM

Port the change done for RGBX8888 in
02a1f95386b43bf46cd1c8297d0955242f554fa2.

If XR24 images are considered to be VIEW_CLASS_24_BITS-compatible, it's
reasonable to assume that XB24 images would be as well.

Fixes: bf576772ab4d ("dri_util: add driImageFormatToSizedInternalGLFormat function")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6095>

4 years agoaco: execute branch instructions in WQM if necessary
Daniel Schürmann [Mon, 10 Aug 2020 14:56:25 +0000 (16:56 +0200)]
aco: execute branch instructions in WQM if necessary

It could happen that only the branch condition was computed in WQM
and not the branch instruction.
There is now some rendundancy which should be cleaned up.

Fixes: 3817fa7a4d1f51c385b28a2e45a1edf227526028 ('aco: fix WQM handling in nested loops')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6260>

4 years agonir: nir_range_analysis needs to be updated for vec16
Jesse Natalie [Tue, 11 Aug 2020 03:28:34 +0000 (20:28 -0700)]
nir: nir_range_analysis needs to be updated for vec16

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

4 years agoaco: don't move memory accesses to before control barriers
Rhys Perry [Tue, 4 Aug 2020 18:20:21 +0000 (19:20 +0100)]
aco: don't move memory accesses to before control barriers

Fixes random failures of dEQP-VK.image.qualifiers.volatile.cube_array.r32i
and similar tests on Vega.

fossil-db (Navi):
Totals from 6 (0.00% of 135946) affected shaders:
VMEM: 1218 -> 1110 (-8.87%); split: +2.46%, -11.33%
SMEM: 174 -> 189 (+8.62%)
Copies: 84 -> 87 (+3.57%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: cd392a10d05 ('radv/aco,aco: use scoped barriers')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6174>

4 years agoradv: limit LATE_ALLOC_GS to prevent a GPU hang on GFX10
Samuel Pitoiset [Tue, 11 Aug 2020 09:26:16 +0000 (11:26 +0200)]
radv: limit LATE_ALLOC_GS to prevent a GPU hang on GFX10

Found by inspection, doesn't fix anything known.

Cc: mesa-stable
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/6279>

4 years agoradv/gfx10: add missing initialization of registers
Samuel Pitoiset [Tue, 11 Aug 2020 08:13:47 +0000 (10:13 +0200)]
radv/gfx10: add missing initialization of registers

Found by inspection.

Cc: mesa-stable
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/6277>

4 years agoetnaviv: completely turn off MSAA
Christian Gmeiner [Tue, 23 Jun 2020 16:33:18 +0000 (18:33 +0200)]
etnaviv: completely turn off MSAA

MSAA worked before etnaviv landed in upstream mesa but got
broken over time. Disable MSAA completely until it is fixed again.

Fixes problems/crashes with applications that want to make use of MSAA.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5608>

4 years agonir/lower_ssbo: Don't set align_* for atomics
Alyssa Rosenzweig [Thu, 6 Aug 2020 13:13:32 +0000 (09:13 -0400)]
nir/lower_ssbo: Don't set align_* for atomics

Fixes crashes when lowering atomic SSBOs:

   run: ../src/compiler/nir/nir.h:1875: nir_intrinsic_align_mul: Assertion `info->index_map[NIR_INTRINSIC_ALIGN_MUL] > 0' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6204>

4 years agoanv: add a check for depthStencilState before using it
Tapani Pälli [Sat, 8 Aug 2020 07:28:43 +0000 (10:28 +0300)]
anv: add a check for depthStencilState before using it

v2: move the code under existing correct check!

Fixes: e4590c075009 ("anv: depth/stencil dynamic state support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3375
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6240>

4 years agoanv: fix up dynamic clip emission
Lionel Landwerlin [Mon, 10 Aug 2020 20:58:55 +0000 (23:58 +0300)]
anv: fix up dynamic clip emission

There were 2 issues :

   * We were not emitting the clip state when the pipeline changed

   * On Gen7 we did not program the front facing & cull mode dynamic
     values in the clip state

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c34d8ac26e0a21 ("anv: handle dynamic viewport count")
Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3379

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6265>

4 years agoanv: centralize vk to gen arrays
Lionel Landwerlin [Mon, 10 Aug 2020 21:30:10 +0000 (00:30 +0300)]
anv: centralize vk to gen arrays

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6265>

4 years agofreedreno/decode: try harder to not crash in disasm
Rob Clark [Mon, 10 Aug 2020 15:47:40 +0000 (08:47 -0700)]
freedreno/decode: try harder to not crash in disasm

Move the handling for catching asserts when we start decoding garbage
into disasm-a3xx.  This way it can also cover other cases where cffdec
tries to disassemble memory, such as SP_xS_OBJ_START.

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

4 years agofreedreno/crashdec: handle section name typos
Rob Clark [Sat, 8 Aug 2020 16:50:08 +0000 (09:50 -0700)]
freedreno/crashdec: handle section name typos

The fixes tag isn't so much because it was incorrect before, but because
I'm going to send a kernel patch to fix the typo, and that will break
old crashdec.

Fixes: 1ea4ef0d3be ("freedreno: slurp in decode tools")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>

4 years agofreedreno/ir3: add more disasm stats
Rob Clark [Thu, 6 Aug 2020 17:03:51 +0000 (10:03 -0700)]
freedreno/ir3: add more disasm stats

Add tracking for # of instructions per category, similar to the last
patch.  Also add a few other shader-db stats that were missing on the
disasm side, to make it easier to compare to shaders from cmdstream
traces.

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

4 years agofreedreno/ir3: add tracking for # of instructions per category
Rob Clark [Thu, 6 Aug 2020 16:24:50 +0000 (09:24 -0700)]
freedreno/ir3: add tracking for # of instructions per category

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

4 years agogallium/u_transfer_helper: add util functions for doing deinterleaving during map
Mike Blumenkrantz [Thu, 4 Jun 2020 15:31:28 +0000 (11:31 -0400)]
gallium/u_transfer_helper: add util functions for doing deinterleaving during map

in some cases (e.g., zink and d3d12) we only want to split the depth and stencil
buffers when we're mapping them, and we can handle packed buffers in other cases,
so being able to reuse the u_transfer_helper functionality is still desired but
only if we can preserve the underlying buffer the rest of the time

Kenneth Graunke notes during post-review:
Vulkan reads/copies on packed Z24S8 only return depth, so we need to use separate
Z24 and S8 reads and do packing tricks.

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

4 years agogallium: add pipe_transfer_usage for z/s only mappings
Mike Blumenkrantz [Mon, 10 Aug 2020 21:32:05 +0000 (17:32 -0400)]
gallium: add pipe_transfer_usage for z/s only mappings

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

4 years agointel/fs: work around gen12 lower-precision source modifier limitation
Mark Janes [Fri, 7 Aug 2020 20:11:08 +0000 (13:11 -0700)]
intel/fs: work around gen12 lower-precision source modifier limitation

GEN:BUG:1604601757 prevents source modifiers for multiplication of
lower precision integers.

lower_mul_dword_inst() splits 32x32 multiplication into 32x16, and
needs to eliminate source modifiers in this case.

Closes: #3329
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
4 years agointel/fs: Assert if lower_source_modifiers converts 32x16 to 32x32 multiplication
Mark Janes [Fri, 7 Aug 2020 23:35:32 +0000 (16:35 -0700)]
intel/fs: Assert if lower_source_modifiers converts 32x16 to 32x32 multiplication

Lowering source modifiers will convert a 16bit source to a 32bit
value.  In the case of integer multiplication, this will reverse
previous lowering performed by lower_mul_dword_inst.

Assert to prevent an illegal DxD operation (and GPU hang).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
4 years agoandroid: pan/bi: Separate disasm/compiler targets
Mauro Rossi [Mon, 10 Aug 2020 15:07:03 +0000 (17:07 +0200)]
android: pan/bi: Separate disasm/compiler targets

Fixes the following building errors:

ld.lld: error: undefined symbol: bi_interp_mode_name
>>> referenced by bi_print.c:207 (external/mesa/src/panfrost/bifrost/bi_print.c:207)
...
ld.lld: error: undefined symbol: bi_round_mode_name
>>> referenced by bi_print.c:285 (external/mesa/src/panfrost/bifrost/bi_print.c:285)

ld.lld: error: undefined symbol: bi_clause_type_name
>>> referenced by disassemble.c:142 (external/mesa/src/panfrost/bifrost/disassemble.c:142)
...
ld.lld: error: undefined symbol: bi_ldst_type_name
>>> referenced by disassemble.c:0 (external/mesa/src/panfrost/bifrost/disassemble.c:0)

Fixes: 14bb72c68 ("pan/bi: Separate disasm/compiler targets")
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/6261>