Commit Graph

127131 Commits

Author SHA1 Message Date
Jason Ekstrand 92db942fc6 nir: Add and use nir_foreach_block_unstructured helpers
These are safe to call on either structured or unstructured NIR but
don't provide the nice ordering guarantees of nir_foreach_block and
friends.  While we're here, we use them for a very small selection of
passes which are known to be safe for unstructured control-flow.  The
most important such pass is nir_dominance which is required for
structurizing.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
2020-08-14 20:35:36 +00:00
Karol Herbst 4768ea1a77 nir: Add a structured flag to nir_shader
v2 (Jason Ekstrand):
 - Make "structured" a property of nir_function_impl not nir_shader
 - More validation and asserts

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
2020-08-14 20:35:36 +00:00
Karol Herbst 19f35735a0 spirv: rename vtn_emit_cf_list to vtn_emit_cf_list_structured
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
2020-08-14 20:35:36 +00:00
Karol Herbst 16f858968f util/set: add _mesa_set_intersects
v2 (Jason Ekstrand): add asserts and iterate over smaller set

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
2020-08-14 20:35:36 +00:00
Mauro Rossi acf756a64f android: panfrost: Redirect cmdstream includes through GenXML (v2)
bifrost requires both "pafrost/lib/midgard_pack.h" and "midgard_pack.h" headers

Fixes the following building error:

In file included from external/mesa/src/panfrost/bifrost/cmdline.c:33:
In file included from external/mesa/src/panfrost/bifrost/test/bit.h:31:
external/mesa/src/panfrost/lib/pan_device.h:40:10: fatal error: 'midgard_pack.h' file not found
#include <midgard_pack.h>
         ^~~~~~~~~~~~~~~~
1 error generated.

Fixes: bce1a7e9 ("android: panfrost: Redirect cmdstream includes through GenXML")
Fixes: 88dc4c21 ("panfrost: Redirect cmdstream includes through GenXML")
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/6322>
2020-08-14 19:01:38 +02:00
Jonathan Marek 92f65e28fe turnip: add missing tu_bo_list_add in CmdWriteTimestamp
Fixes an issue observed in renderdoc.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6320>
2020-08-14 14:28:11 +00:00
Jonathan Marek ddac5933f8 turnip: call packing functions directly for pack_gmem_clear_value
This involves rolling our own int packing functions, because the u_format
versions do clamping which differs from VK spec requirement.

This reduces the size of libvulkan_freedreno.so significantly.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek 201331edbf turnip: rework format_to_ifmt
Make it somewhat generic instead of listing formats individually.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek aa5ebf0a6d turnip: fix CmdBlitImage with D32_SFLOAT_S8_UINT
Fixes these dEQP tests:

dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.depth_stencil.2d_d32_sfloat_s8_uint_d32_sfloat_s8_uint.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek f83e89507d turnip: delete a blit_image TODO that has already been resolved
All the blit_image tests now pass when forcing the 3D path, so this TODO
is no longer relevant.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek 2ca1ccc18d turnip: remove dead tu_minify/typed_memcpy functions
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Mauro Rossi 99372547be android: panfrost/bifrost: add libpanfrost_lib static dependency
Fixes the following building error:

external/mesa/src/panfrost/bifrost/test/bit.h:30:10: fatal error: 'panfrost/lib/midgard_pack.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 88dc4c21e ("panfrost: Redirect cmdstream includes through GenXML")
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/6317>
2020-08-14 15:19:36 +02:00
Mauro Rossi bce1a7e97f android: panfrost: Redirect cmdstream includes through GenXML
Fixes the following building error:

external/mesa/src/panfrost/lib/decode.c:26:10: fatal error: 'midgard_pack.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

Fixes: 88dc4c21e ("panfrost: Redirect cmdstream includes through GenXML")
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/6317>
2020-08-14 15:19:31 +02:00
Bas Nieuwenhuizen 0980d1d5ab radv: Clean up setting the surface flags.
If we don't give the init function access to the fields we will not
accidentally start setting them.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6274>
2020-08-14 10:29:44 +00:00
Bas Nieuwenhuizen d19bc94e4e radv: When importing an image, redo the layout based on the metadata.
When importing a DMA-BUF, the image layout created in vkImageCreate may
not match the imported BO's. To make this work we redo the layout based
on the metadata of the imported image.

The original patch did a delayed allocation just as for AHB, but that
does not work for images that are not imported (but e.g. exported only).

Original patch by Simon Ser <contact@emersion.fr>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2801
CC: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6274>
2020-08-14 10:29:44 +00:00
Dave Airlie a0d67b7a1c anv: add no reloc flags on empty and simple bo paths.
These two paths should have no relocs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6288>
2020-08-14 17:14:23 +10:00
Rohan Garg 00b9a3443b 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>
2020-08-14 06:35:11 +00:00
Mike Blumenkrantz f024bc8314 zink: invalidate pipeline hash on more changes
some cases were missed here, causing an assert to trigger

Fixes: 1185b3f32d "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>
2020-08-14 04:30:11 +00:00
Jesse Natalie 65d7172d17 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>
2020-08-13 23:18:36 +00:00
Jesse Natalie 58af31186a 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>
2020-08-13 23:18:36 +00:00
Nanley Chery 493298528a 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>
2020-08-13 22:03:48 +00:00
Nanley Chery c111e9099c 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 b6d45e7f74 to
fix an assertion failure in iris_resource_from_handle. Assigning the BO's
tiling_mode field is sufficient to avoid the failure.

Fixes: c19492bcdb ("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>
2020-08-13 22:03:48 +00:00
Jonathan Marek 0c97e601a4 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>
2020-08-13 16:54:06 +00:00
Jonathan Marek 84ed2d0980 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>
2020-08-13 16:54:06 +00:00
Jonathan Marek a322924d9c 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>
2020-08-13 16:54:06 +00:00
Icecream95 8557b1a8eb panfrost: Fix border colour
The border colour was being set to the red colour for all channels.
Fixes tex-border-1 from piglit.

Fixes: f74186baa5 ("panfrost: XMLify Midgard samplers")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6298>
2020-08-13 13:45:00 +00:00
Tony Wasserka 8277334f39 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: 8b98d0954e ('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>
2020-08-13 10:11:57 +00:00
Samuel Pitoiset d452c04aa1 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>
2020-08-13 07:13:56 +00:00
Alyssa Rosenzweig 0c621dcf0e 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>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 78445ce695 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>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 99d17fb771 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>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig c9bdba26b0 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>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 8c1ac96eb6 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig ad0b32cdbd 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig f008a6314c 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig b10c3c869d 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig f74186baa5 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig c4c8c8e8fb 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 6afd4addef 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 1675d92d66 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 931e7b4c7a 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig fa949678c1 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>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 7f487e087f 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig ef20691e3d 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig e9ca320461 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig d182a6057f 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 32dbc80979 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 4b7056b8c8 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig d2ddd4d565 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>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 88dc4c21e6 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>
2020-08-13 08:55:15 +02:00