Commit Graph

131291 Commits

Author SHA1 Message Date
Marek Olšák d6df35b304 gallium/u_threaded: add support for multi draws
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:25 +00:00
Marek Olšák 52ad436740 gallium/u_threaded: store start/count in min/max_index for better packing
This increases the maximum number of draws per batch from 192 to 256.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:25 +00:00
Marek Olšák 1cd455b17b gallium: extend draw_vbo to support multi draws
Essentially rename multi_draw to draw_vbo and remove start and count
from pipe_draw_info.

This is only an interface change. It doesn't add multi draw support
anywhere.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:25 +00:00
Marek Olšák 80b391077f gallium: add missing bits of the direct multi draw interface
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák f038fb60b4 gallium/u_threaded: improve draw merging by clearing pipe_draw_info fields
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák 72ff53098c gallium: add pipe_draw_info::index_bounds_valid
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák 920bbfb3a0 gallium/u_threaded: clean up direct vs indirect draws
It's called draw_single because multi draws will use a different structure.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák d5b37dd3c2 gallium/u_threaded: lift DIV_ROUND_UP to eliminate it for constant expressions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák abe8ef862f gallium: make pipe_draw_indirect_info * a draw_vbo parameter
This removes 8 bytes from pipe_draw_info (think u_threaded_context)
and a lot of info->indirect pointer indirections.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák 1a717dca04 gallium: move count_from_stream_output into pipe_draw_indirect_info
This removes some overhead from tc_draw_vbo and increases the maximum number
of draws per batch from 153 to 192 in u_threaded_context.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák 238ee7b801 mesa: add Driver.DrawTransformFeedback
to remove some overhead from Driver.Draw.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Alejandro Piñeiro c77409a87e turnip: minor tu_queue fixes related to vk_base_object
Include:
   * Missing call to tu_queue_finish
   * Use the proper free method for device->queues

Fixes 5d3fdbc52b

Tested-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7663>
2020-11-18 00:58:29 +00:00
Eric Anholt 008872aa30 turnip: Assert about the storage buffer offset alignment.
Giving us an unaligned pointer is invalid, and this helps switch a CTS bug
from being a flake to a consistent crash.

https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2661

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7662>
2020-11-18 00:38:02 +00:00
Michel Zou fdfe4a4d30 libgl-gdi: add zink support
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>

Closes #3802

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7643>
2020-11-18 00:03:12 +00:00
Michel Zou eebcd6a502 zink: fix unused variable warning
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7643>
2020-11-18 00:03:12 +00:00
Alejandro Piñeiro 3d1260aa91 v3dv: implement VK_EXT_private_data
Which is using base class's implementation.

Based on Hyunjun's commit d941c6b74f

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7627>
2020-11-17 23:55:14 +00:00
Alejandro Piñeiro 30b6fbc496 v3dv: use the common base object type and struct
Used as reference Hyujun's commit
5d3fdbc52b, that does the same for
turnip.

This commit also replaces in several cases alloc for zalloc, and adds
checks on more Destroy methods if the object to be free is NULL or
not. Most of them were needed to avoid crashes/weird behaviour due
trying to use un-initialized data. Note that now that vk_object_free
iterates over a array, making it more against un-initialized or just
NULL data.

Additionally, using zalloc we can also remove some memset to 0. In
fact we needed to remove them, as if not, they would override the
vk_object_base object to 0 (the alternative would me doing a memset
computing a pointer offset, but that's is not needed as we can just
use zalloc).

v2:
   * Call memset(0) on reused descriptor sets when calling
     ResetDescriptorPool, not when reallocating them (Iago)
   * Add null check when calling DestroyImageView (detected by a full CTS run)

v3: Fixed rebase conflicts after last meta copy/clear changes

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7627>
2020-11-17 23:55:14 +00:00
Marek Olšák c3432ad852 radeonsi: add an option to enable 2x2 coarse shading for non-GUI elements
This is for experiments with VRS.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7646>
2020-11-17 22:16:19 +00:00
Marek Olšák c13370e816 amd: add register enums for VRS
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7646>
2020-11-17 22:16:19 +00:00
Andres Gomez f054a261a8 ci: update some radv trace checksums
After 16c756e55d ("spirv: reverse order in matrix multiplication")
some checksums for the radv driver remained to be updated.

v2:
  - Correct typo (Mihai).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7645>
2020-11-17 21:54:18 +00:00
Andres Gomez 9b9d1db90e ci: update some radv trace checksums
After 24a18b1a4b ("nir: scalarize fdot in reverse") some checksums
for the radv driver remained to be updated.

v2:
  - Correct typo (Mihai).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7645>
2020-11-17 21:54:18 +00:00
Michel Zou 5195a30d27 util: fix -Wshift-count-overflow warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7392>
2020-11-17 21:23:20 +00:00
Tony Wasserka 526405dfec meson: Treat LLVM headers as a system dependency
This will suppress warnings from LLVM includes.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7632>
2020-11-17 20:40:23 +00:00
Leo Liu 381824d14f frontends/omx/av1: enable AV1 OMX Bellagio support
By adding name, role and profile to OMX decoder

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu f1b23d8299 frontends/omx/av1: add AV1 tasks management
This handles different task queues based on OMX bellagio

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 2874f87348 frontends/omx/av1: add AV1 OBU header parsers
Based on AV1 spec: https://aomediacodec.github.io/av1-spec

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 6ab3030f92 frontends/omx/bellagio: add AV1 initial support to omx dec
Also add bitstream base parser based on AV1 spec

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 7ed3028194 radeonsi: cap AV1 support to SIENNA CICHLID
since AV1 is avaiable from VCN3

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 33690167a4 radeonsi: cap AV1 codec configuration
This defines the support size to 8K and no interlaced buffer

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu d78821b3ba radeon/vcn: fill up the probs buffer
with the segmetation data and mask

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 07a8d4634d radeon/vcn: get AV1 message buffer
This passes parameters to firmware based on interface by frames.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu e08f6a1846 radeon/vcn: fill up the context buffer
with the mode tables, mv probs tables, and coef probs tables

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 057293a508 radeon/vcn: add AV1 context buffer
The context buffer will be filled up with the tables, and used
by firmware for decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 7e7e753d27 radeon/vcn: add AV1 default tables for the context
These tables will be used by firmware

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 9a46b1086f radeon/vcn: add AV1 dpb buffer size
Just use the default size for now

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 6230407e82 radeon/vcn: add AV1 support to the decoder
This adds AV1 stream type to the AV1 decoder

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 80f145a0a7 radeon/vcn: add AV1 codec driver firmware interfaces
This collects parameters that firmware and hardware require for
the AV1 codec.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Leo Liu 0267a567f6 vl: add AV1 codec picture support
This adds AV1 video profile, format and picture description to vl.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
2020-11-17 19:04:44 +00:00
Chad Versace 87dc3106b0 anv/image: Define anv_image_get_aux_addr (v3)
Simple refactor. No intended change in behavior.

Replace each derivation of aux address with anv_image_get_aux_addr().

The function will soon do more in support of
VK_EXT_image_drm_format_modifier, where the image bo and aux bo may be
disjoint.

v2:
  - Replace param 'aspect' with 'plane'.
v3:
  - Workaround for stencil ccs. If no aux surface, then return
    ANV_NULL_ADDRESS.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v3)
2020-11-17 10:36:45 -08:00
Chad Versace 5fa0e5b87d anv/image: Check surface offsets after adding each surface
Pre-patch, we checked the offsets once per aspect after adding all
surfaces for the aspect. The additional checks will make it easier to
diagnose layout bugs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace 9f0abc2a22 anv/image: Rewrite check_surfaces() [v2]
Pure refactor. No intended change in behavior.

This makes the code infinitely easier to understand. And it uncovers
a potential bug (marked with XXX comment).

v2: Fix narrowing conversions on 32-bit arch. s/size_t/uintmax_t/.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
2020-11-17 10:36:45 -08:00
Chad Versace 15642a52ce anv/image: Further split add_*_surface funcs (v2)
Months ago, make_surface() added *all* surfaces required for the given
aspect. It was a monster monolithic function, and difficult to reason
about its correctness. In commit c652ff8c (2020-03-06), I split the code
for aux surfaces into its own function, add_aux_surface_if_supported().

This patch continues the splitting, therefore making bugs easier to
identify.

Code changes:
   - Move the code that adds the shadow surface from make_surface() to
     a new function add_shadow_surface(), called from
     add_all_surfaces().
   - Move the call to add_aux_surface_if_supported() from make_surface()
     to add_all_surfaces().
   - To preserve correctness of the assertions on image layout in
     make_surface(), move them to the loop in add_all_surfaces() after
     all the aspect's surfaces have been added.
   - Rename make_surface() to add_primary_surface() because now that's
     what it does.

Pure refactor, no intended change in behavior.

v2:
  - Rebase onto "anv: Fix isl_surf_usage_flags for stencil images".
  - Sanitize the image's extent earlier.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
2020-11-17 10:36:45 -08:00
Chad Versace 9f2073c76e anv/image: Define add_all_surfaces()
This deduplicates the loops in anv_image_create() and
resolve_ahw_image().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace 2bfd43ba0b anv/image: Add more asserts to choose_isl_tiling_flags
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace 8636adf856 anv/image: Move some DRM code in anv_get_image_format_properties()
In anv_get_image_format_properties(), the special-case code for
VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT is tiny. It is mostly a detached
'case' in the 'switch' block for VkImageType. So move the special-case
code to immediately follow the 'switch' block.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace 40ac4c9cdc anv/image: Emit error message for non-2D DRM images
In vkGetPhysicalDeviceImageFormatProperties.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace c892e24258 anv/image: Drop redundant rejection of YCbCr formats with modifiers
The check in anv_get_image_format_properties() is already handled in
anv_get_image_format_features().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace c9f2a74b5a anv/image: Respect VkImageFormatListCreateInfo for VkImageFormatProperties (v2)
When filling VkImageFormatProperties, anv_get_image_format_properties()
checks the requested VkImageUsageFlags and VkImageCreateFlags against
the VkFormatFeatureFlags available to the queried VkFormat. However, we
neglected to consider if any formats given in
VkImageFormatListCreateInfo
further restricted the available VkFormatFeatureFlags.

The image view formats are more likely to introduce additional
restrictions when DRM format modifiers are present.

v2:
  - Do not drop anv_formats_ccs_e_compatible().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
2020-11-17 10:36:45 -08:00
Chad Versace ce4f6bda66 anv/image: Fail earlier in anv_get_image_format_properties
If anv_get_image_format_features reports that the inputs are
unsupported, fail immediately.

Without the early fail, I have less confidence in the function's
correctness when a DRM format modifier is present.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00
Chad Versace 8c5b4b1e1d anv/image: Minor refactor of VkImageFormatProperties::sampleCounts
The code in anv_get_image_format_properties() that set sampleCounts
appears correct, but weirdly inconsistent. Clean the code to
consistently set sampleCounts in the same location as
maxExtent/maxMipLevels/maxArraySize.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2020-11-17 10:36:45 -08:00