143956 Commits

Author SHA1 Message Date
Adam Jackson
bfad9e75c0 glx: Store the context vtable on the glx screen
Again this is rewriting part of driX_create_context_attribs to be
caller-agnostic, so that we can eventually unify it among the DRI
backends.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12456>
2021-08-18 21:11:02 +00:00
Adam Jackson
145992890c glx: Fix and simplify the share context compatibility check
We only end up with one DRI provider per screen, so the only way the
context vtable can differ is if they're not the same directness. Rewrite
the test in those terms to help us unify some of this code away in the
future. Also apply the same logic to the indirect context creation path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12456>
2021-08-18 21:11:02 +00:00
Adam Jackson
5c71bf065f dri: Reformat DRI context attribute #defines
These were confusingly sorted before.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12456>
2021-08-18 21:11:02 +00:00
Mike Blumenkrantz
78c5cdf7e6 zink: clear current gfx/compute program upon unbinding its shaders
this simplifies a lot of code

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12428>
2021-08-18 20:58:36 +00:00
Mike Blumenkrantz
c39cbd49c1 zink: do compute shader change on bind
we can do this update earlier to optimize the actual compute path

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12428>
2021-08-18 20:58:36 +00:00
Mike Blumenkrantz
26b5f4c45e zink: flag the gfx pipeline dirty and unset pipeline shader module on shader change
there's no need to leave this until the module updating when the info
is known much earlier

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12428>
2021-08-18 20:58:36 +00:00
Mike Blumenkrantz
f676e6a64b zink: remove repeated lazy batch dd casts
these all have an ergonomic cost

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12427>
2021-08-18 20:46:24 +00:00
Mike Blumenkrantz
193ce77265 zink: remove redundant asserts from lazy descriptor set populate
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12427>
2021-08-18 20:46:24 +00:00
Mike Blumenkrantz
96a6b8c808 zink: simplify get_descriptor_set_lazy params
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12427>
2021-08-18 20:46:24 +00:00
Boyuan Zhang
35c3f5f08b radeon/vcn: check frame size change for vp9 header flags
Beside show_frame and error_resilient_mode, also need to check if frame size
changes. FRAME_HDR_INFO_VP9_USE_PREV_IN_FIND_MV_REFS flag should be OFF if
frame size changes.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12368>
2021-08-18 19:13:33 +00:00
Boyuan Zhang
0b6f8588a2 radeon/vcn: track width and height of the last frame
Adding last width/height to keep tracking the size of the last frame.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12368>
2021-08-18 19:13:33 +00:00
Boyuan Zhang
912d78d4f2 radeon/vcn: initilize num_temporal_layers for hevc
Fixes: 51935d59

num_temporal_layers has not been initialized for hevc, which will cause hevc
encode failure.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12434>
2021-08-18 18:06:21 +00:00
Jordan Justen
7faad66ab0 intel/pci-ids: Re-enable DG1 and add SG1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11584>
2021-08-18 17:35:41 +00:00
Sagar Ghuge
57bfd7122f anv: Fix VK_EXT_memory_budget to consider VRAM if available
Instead of calling the OS query, re-run anv_update_meminfo to get the
latest from either the kernel memory info API or the OS as appropriate.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5173
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12433>
2021-08-18 17:13:00 +00:00
Jason Ekstrand
758662759d anv: compute available memory in anv_init_meminfo
We can now detect EXT_memory_budget support based on whether or not we
have non-zero available system memory.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12433>
2021-08-18 17:13:00 +00:00
Jason Ekstrand
5c79c545e3 anv: Rework init_meminfo
Instead of making LMEM the special case, unify the two paths by setting
up a fake drm_i915_query_memory_regions struct and filling it out based
on OS queries.  The important functional change here is that we now pass
system memory through the same GTT size and 3/4 filter that we were
using with the OS queries.  This should make behavior consistent on
integrated GPUs regardless of whether or not we have the memory region
query API.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12433>
2021-08-18 17:13:00 +00:00
Jason Ekstrand
be216ae9d9 anv: Move compute_heap_size lower in the file
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12433>
2021-08-18 17:13:00 +00:00
Mike Blumenkrantz
e0bd2fae8b softpipe: fix ci rule ordering to avoid unnecessarily running jobs
fixes #5242

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12445>
2021-08-18 14:11:42 +00:00
Mark Janes
09c1792d1f anv: warn if system memory is used
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12318>
2021-08-18 13:55:14 +00:00
Mark Janes
e610f4b5f2 anv: Allocate workaround buffer in local memory if present
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12318>
2021-08-18 13:55:13 +00:00
Mark Janes
0afda06441 anv: Use local memory for block pool BO
Allocating block pool BO into local memory means indirectly it allows us to
push our aux map table into local memory too.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12318>
2021-08-18 13:55:13 +00:00
Mike Blumenkrantz
649251ad4e nir/lower_vectorize_tess_levels: set num_components for vectorized loads
this otherwise explodes when rewriting e.g., a single array component load to a vec4

Fixes: f5adf27fb92 ("nir,radv: add and use nir_vectorize_tess_levels()")

fixes zmike/mesa#94

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12419>
2021-08-18 12:18:15 +00:00
Erik Faye-Lund
45a61f1782 gallivm: fix texture-mapping with 16-bit result
16bit integer support also implies using 16-bit results when sampling
textures.

Because we're returning the results in float SSA values instead of int,
we need to bitcast back to integers before truncating the values.

Fixes: 00ff60f799c ("gallivm: add 16-bit integer support")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12413>
2021-08-18 07:55:34 +00:00
Mao, Marc
fae1e99a15 iris: declare padding for iris_vue_prog_key
Otherwise with some compilers/environments (Android) padding
may contain garbage and memcmp of the key will fail.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12438>
2021-08-18 07:17:59 +00:00
Samuel Pitoiset
b16f3261a7 radv: fix fast clearing depth images with mips on GFX10+
Found by inspection.

Cc: 21.2 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/12325>
2021-08-18 08:27:32 +02:00
Emma Anholt
c94ff7dd81 freedreno/a5xx: Reduce packet emits for SSBO state.
This is what I see happening in
dEQP-VK.spirv_assembly.instruction.compute.opatomic_storage_buffer.load on
pixel 2 (also where I found a buffer big enough to show how to encode the
size).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Emma Anholt
f10c7c4a5d freedreno/a5xx: Use ST4_ constants for SSBO/image state types.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Eric Anholt
5b5dcbfe89 freedreno/a6xx: Skip setting up image dims constants.
We just use resinfo anyway.  Notably, a6xx was only doing its setup in the
FS case and not CS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Eric Anholt
994793c500 freedreno/ir3: Move a6xx's get_ssbo_size shl to NIR.
Just cleaning up a TODO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Eric Anholt
547a2aa051 freedreno/ir3: Use the resinfo path for ssbo sizes on GL, too.
Less state walking at draw time, in exchange for a SHL in the lookup.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Emma Anholt
513920ba82 freedreno/ir3: Only lower cube image sizes once.
shader variants can cause ir3_nir_finalize() to run more than once, which
would make us keep dividing the size by 6.

Fixes: a48fc88571f9 ("freedreno/a6xx: Apply the cube image size lowering to GL, too.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12258>
2021-08-18 00:15:18 +00:00
Rob Clark
89ab2a7b6f freedreno: Add a680 support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12041>
2021-08-17 23:24:23 +00:00
Jordan Justen
cf23fbb040 meson: Check that bin/meson_get_version.py ran without an error
According to https://mesonbuild.com/Reference-manual.html, the check
parameter is supported since meson 0.47.0.

This could have helped to catch the issue fixed by:

221871fb6da ("meson: Search for python3 before python for bin/meson_get_version.py")

as it would have caused the build to fail immediately.

It's still a good idea to check the result even though that issue is
now fixed.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12404>
2021-08-17 15:18:03 -07:00
Icecream95
56ea259b42 panfrost: drm-shim support
Reviewed-and-tested-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12431>
2021-08-17 22:06:17 +00:00
Mike Blumenkrantz
8b810e545f zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12423>
2021-08-17 21:49:01 +00:00
Mike Blumenkrantz
c1d342e986 zink: enable compat contexts
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12423>
2021-08-17 21:49:01 +00:00
Jason Ekstrand
3ed4ddf076 anv,vulkan: Add a vk_image::wsi_legacy_scanout bit
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
def2cb9808 anv,vulkan: Move drm_format_mod to vk_image
Even though we can't really do the parsing on behalf of the driver (it's
too complicated), storing it in the vk_image lets us provide a common
implementation of vkGetImageDrmFormatModifierPropertiesEXT().  It'll
also be useful in the next few commits for swapchain images.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
0f2afa0abc anv,vulkan: Move ANV image layout helpers to common code
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
ea410173d6 anv: Make anv_image_view derive from vk_image_view
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
9cc004b3d0 vulkan: Add a vk_image_view struct
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
48e8efd00e vulkan,radv: Move vk_format_depth/stencil_only to common code
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
7878d516c6 radv: Add asserts to vk_format_depth/stencil_only
It doesn't make sense to ask for the depth-only or stencil-only format
if there is no depth or stencil.  One bit of radv_image.c did seem to
take advantage of the default case in vk_format_depth_only so throw an
`if (vk_format_has_depth(format))` around it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Bas Nieuwenhuizen
3b00696117 radv: Check format before calling depth_only/stencil_only.
Breaks when we drop the fallback in those functions.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
c36ff60a52 vulkan: Refactor and better document vk_image_expand_aspect_mask
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
83b4d4f17d anv,vulkan: Move VkImageSubresource* helpers from ANV
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
e45e4e3ba1 anv,vulkan: Move anv_image_expand_aspects to common code
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:35 +00:00
Jason Ekstrand
25d4cffabf anv: Make anv_image derive from vk_image
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:34 +00:00
Jason Ekstrand
0e6c320a7d vulkan: Add a vk_image struct
Currently, this is optional for drivers to carry around but it scrapes
up most of VkImageCreateInfo for you and parses a couple of extension
structs.  We also add a few useful little helpers copied over from ANV.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:34 +00:00
Jason Ekstrand
fc5a6eedbc anv: Delete anv_image::format
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
2021-08-17 21:29:34 +00:00