831 Commits

Author SHA1 Message Date
Gert Wollny
28f046d189 r600: Pre-EG - Set wrap texture modes to repeat when seemless cube is used
On Pre-Evergreen hardware we have a flag
   "Force Clamp X,Y policy to wrap for CubeMaps"
but it doesn't seem to affect how border clamping is done. With
bf3027 this is set to PIPE_TEX_WRAP_CLAMP_TO_EDGE for cube maps,
and results in the regression reported in #9028.
Forcing repeat mode fixes the issue.

Fixes: bf3027c391
   mesa/st: Normalize wrap modes for seamless cubes

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9028

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23848>
(cherry picked from commit 91fa1970c9)
2023-07-18 22:38:06 +01:00
Yiwei Zhang
f36154ea23 venus: fix leaks from tracked present src images
The cmd can be reset and freed during render pass recording as well.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
(cherry picked from commit fe4cf26687)
2023-07-18 22:38:06 +01:00
Yiwei Zhang
032ed1f999 venus: fix a cmd tmp storage leak
When the pool is destroyed, cmds are implicitly freed. Cmd level allocs
have to be cleaned up to avoid leak.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
(cherry picked from commit ee3f17ca79)
2023-07-18 22:38:06 +01:00
Lionel Landwerlin
e887283d70 intel/fs: disable coarse pixel shader with interpolater messages at sample
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9292
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23962>
(cherry picked from commit c26c0a36d3)
2023-07-18 22:38:06 +01:00
Alyssa Rosenzweig
af763b3a58 nir: Add nir_foreach_function_impl helper
Most users of nir_foreach_function actually want the nir_function_impl, not the
nir_function, and want to skip empty functions (though some graphics-specific
passes sometimes fail to do that part). Add a nir_foreach_function_impl macro
to make that case more ergonomic.

   nir_foreach_function_impl(impl, shader) {
      ...
      foo(impl)
   }

is equivalent to:

   nir_foreach_function(func, shader) {
      if (func->impl) {
         ...
         foo(func->impl);
      }
   }

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23807>
(cherry picked from commit 19daa9283c)
2023-07-18 22:38:06 +01:00
Marek Olšák
55c7e46e8e vbo: correctly restore _VaryingInputs for display list fast path
Fixes: 3a294ff0 - mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9007

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23796>
(cherry picked from commit 7b10877078)
2023-07-18 22:38:06 +01:00
Sviatoslav Peleshko
d5ff432d7d glsl: Fix yylloc.source propagation in YYLLOC_DEFAULT
Currently, it's always initialized to 0, but we should take the value from
the grouping passed to the macro. This way parser will have the full
location info, and errors originating from it will show the correct
source file number.

Fixes: a0cfe8c4 ("glsl: Fix missing initialization of yylloc.source")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9229
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23966>
(cherry picked from commit 791785c2b4)
2023-07-16 22:11:49 +01:00
Patrick Lerda
a5e9f7633a radeonsi: fix refcnt imbalance related to util_blitter_save_fragment_constant_buffer_slot()
Indeed, util_blitter_clear() requires a call to
util_blitter_save_fragment_constant_buffer_slot(),
but most other blitter functions do not.

For instance, this issue is triggered with:
"piglit/bin/object-namespace-pollution glDrawPixels buffer -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 03bc7503d4 ("radeonsi: save the fs constant buffer to the util blitter context")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23856>
(cherry picked from commit 80ccc3f822)
2023-07-16 22:11:49 +01:00
Boris Brezillon
ed9e36ef8c winsys/panfrost: Make sure we reset scanout on error in create_kms_dumb_buffer_for_resource()
If an error occured, make sure we reset the scanout object before
leaving, otherwise the next user of this handle will hit the
refcnt == 0 assert.

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>
(cherry picked from commit 7a0033a1c9)
2023-07-16 22:11:49 +01:00
Boris Brezillon
44175d888c renderonly: Make sure we reset scanout on error in create_kms_dumb_buffer_for_resource()
If an error occured, make sure we reset the scanout object before
leaving, otherwise the next user of this handle will hit the
refcnt == 0 assert.

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>
(cherry picked from commit 45a27adc3b)
2023-07-16 22:11:49 +01:00
Boris Brezillon
88d9ba028c renderonly: Fix potential NULL deref in the error path
scanout can be NULL.

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>
(cherry picked from commit 8568a46c1c)
2023-07-16 22:11:49 +01:00
Robert Beckett
b5bc8d8233 winsys/panfrost: Fix a scanout resource leak
Use ro->bo_map to alloc scanout and make sure we initialize the refcnt
to one.

This fixes leaking the scanout object and the underlying dumb-buffer.

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>
(cherry picked from commit 8087f784e4)
2023-07-16 22:11:49 +01:00
Mike Blumenkrantz
d766ffcc24 aux/trace: fix bindless texture dumping
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23971>
(cherry picked from commit 46b488151f)
2023-07-16 22:11:49 +01:00
Mike Blumenkrantz
6453019667 zink: don't destroy swapchain on initial CreateSwapchainKHR fail
this used to be correct at some point but now it no longer is

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23970>
(cherry picked from commit 54bd804ad3)
2023-07-16 22:11:49 +01:00
Janne Grunau
8841b3ab06 st/mesa: Set gl_config.floatMode based on color_format
Sets the float color component type in st_visual_to_context_mode()
ensuring float color values are not clamped.
Fixes dEQP-EGL.functional.wide_color.window_fp16_default_colorspace on
asahi, iris and most likely every other driver having it marked as fail
or flake.

Closes: mesa/mesa#9276

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23914>
(cherry picked from commit fd4d0e1cc2)
2023-07-16 14:18:22 +01:00
José Roberto de Souza
5217a77d6d anv: Fix compute maximum number of threads value
There is no mention in spec about subtract one of the number of
threads, also Iris and blorp code don't subtract.

Alchemist PRMs: Volume 2a: Command Reference: Instructions: CFE_STATE: Maximum Number of Threads:
	Normally set to the maximum number of threads: (# EUs) * (# threads/EU)

Cc: mesa-stable
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23973>
(cherry picked from commit c142736f52)
2023-07-15 23:00:48 +01:00
Konstantin Seurer
e4dd65fc4f nir/opt_dead_cf: Handle if statements ending in a jump correctly
If a then/else block ends in a jump, the phi nodes do not necessarily
have to reference the always taken branch because they are dead code.
Avoid crashing in this case by only rewriting phis, if the block does
not end in a jump.

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23150>
(cherry picked from commit e379b9ad8c)
2023-07-15 23:00:31 +01:00
Shan-Min Chao
44b0a656b4 tu/kgsl: Fix memory overwrite with vkFlushMappedMemoryRanges when more than 1 range
Fixes: 5a59410962 ("turnip: add cached and cached-coherent memory types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23504>
(cherry picked from commit ece34ec127)
2023-07-15 22:52:39 +01:00
Eric Engestrom
fa3baf1336 util/disk_cache: fix ~/.cache/ permissions
XDG Base Dir spec [1] says:
> If, when attempting to write a file, the destination directory is
> non-existent an attempt should be made to create it with permission
> `0700`. If the destination directory exists already the permissions
> should not be changed.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4103
Fixes: 87ab26b2ab ("glsl: Add initial functions to implement an on-disk cache")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23952>
(cherry picked from commit e32cb99dcb)
2023-07-15 22:52:38 +01:00
Dave Airlie
5398b13476 draw/gs: handle extra shader outputs in geometry.
When geometry shader is used with unfilled lines and front face,
we don't handle the extra shader output.

Instead of taking the output from the gs, ask draw for the total
which should give the correct answer.

Fixes a test program attached to:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8644

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23943>
(cherry picked from commit 384c8677f5)
2023-07-15 22:52:37 +01:00
Alyssa Rosenzweig
981aeaba49 pan/mdg: Fix temp count calculation
1. Always calculate when asked. This is the sort of optimization that just
   introduces bugs. Like one I hit when shuffling register indices around with
   the register access changes.

2. Ask before using in RA.

3. Account for precoloured blend inputs.

Small shader-db hit, didn't investigate too much.

   total instructions in shared programs: 1518017 -> 1518168 (<.01%)
   instructions in affected programs: 2895 -> 3046 (5.22%)
   helped: 0
   HURT: 24
   Instructions are HURT.

   total bundles in shared programs: 646756 -> 646782 (<.01%)
   bundles in affected programs: 1119 -> 1145 (2.32%)
   helped: 1
   HURT: 19
   Bundles are HURT.

   total quadwords in shared programs: 1133694 -> 1133728 (<.01%)
   quadwords in affected programs: 1736 -> 1770 (1.96%)
   helped: 0
   HURT: 20
   Quadwords are HURT.

   total registers in shared programs: 90596 -> 90612 (0.02%)
   registers in affected programs: 108 -> 124 (14.81%)
   helped: 0
   HURT: 16
   Registers are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>
(cherry picked from commit 23010acc10)
2023-07-15 22:52:36 +01:00
Mike Blumenkrantz
182761d468 zink: fix separate shader program refcounting
this fixes the refcount for the separate shader program to not have a leaked ref
and then fixes the owned program to have the expected number of refs

this happened to work some of the time before because there was an arbitrary unref
in replace_separable_prog(), but this shouldn't have been necessary

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")

fixes #9274

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23888>
(cherry picked from commit 4e38061643)
2023-07-15 22:52:35 +01:00
Mike Blumenkrantz
29d3034e44 zink: do initial program unref during program creation
this ensures that programs are never created with more than $num_shaders
refs, which is otherwise not necessarily a bug but can lead to bugs

Fixes: a0e69e7601 ("zink: split out first-time shader module creation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23888>
(cherry picked from commit 84bb6078f4)
2023-07-15 22:49:58 +01:00
Konstantin Seurer
99f9fa0378 gallivm: Clamp the texel buffer size
Fixes arb_texture_buffer_object-texture-buffer-size-clamp.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22828>
(cherry picked from commit 7d4135ac10)
2023-07-15 22:49:57 +01:00
Timur Kristóf
9d6698fe37 ac/nir/ngg: Call nir_convert_to_lcssa before divergence analysis.
I've recently learned that this is necessary to get
correct results from divergence analysis.

No Fossil DB stats changes on GFX10.3.

Note, when backporting this patch to stable, make sure
the call to nir_convert_to_lcssa is before nir_divergence_analysis,
which may be located in a different place in the stable branch.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23946>
(cherry picked from commit ddeabcc19b)
2023-07-15 22:49:56 +01:00
Dave Airlie
78ba499ab3 lavapipe: check sampler pointer before deref
This fixes the vulkan samples deferred demo from crashing in here.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23542>
(cherry picked from commit e385913c21)
2023-07-15 22:49:55 +01:00
Mike Blumenkrantz
cc99571213 zink: get new bda when rebinding invalidated buffers
this otherwise yields a broken descriptor

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23803>
(cherry picked from commit d2a7ddf066)
2023-07-15 22:49:54 +01:00
Mike Blumenkrantz
ce554c8867 zink: fix unbinding generated gs on real gs bind
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23803>
(cherry picked from commit 041591d972)
2023-07-15 22:49:54 +01:00
Mike Blumenkrantz
6d84d3794f zink: fix assert for inline uniform invalidation with generated gs bound
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23803>
(cherry picked from commit a30379488e)
2023-07-15 22:49:53 +01:00
Juston Li
aa92db5ea4 radv: fix incorrect size for primitives generated query
Primitives generated queries write 1 integer, the primitives-generated
count that is incremented every time a primitive emitted to that stream
reaches the transform feedback stage.

Fixes: 1ebf463a5a ("radv: implement VK_EXT_primitives_generated_query")
Signed-off-by: Juston Li <justonli@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23915>
(cherry picked from commit 33ee59af1d)
2023-07-15 22:49:50 +01:00
Patrick Lerda
62537eecff util/blitter: revert util_blitter_clear_buffer()
The previous change was creating a regression.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9252
Fixes: 23c003b88c ("util/blitter: fix util_blitter_clear_buffer() refcnt imbalance")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23923>
(cherry picked from commit 9ca1bb3cf8)
2023-07-15 22:47:56 +01:00
Corentin Noël
082154ca1e nir/split_64bit_vec3_and_vec4: Use the right number of components
Always make sure to correctly deref and store a 64bits variable
from the right number of components.

This fixes the `spec@arb_enhanced_layouts@matching_fp64_types_`
piglit tests for virgl.

Corrects this validation issue:
```
	decl_var  INTERP_MODE_FLAT dvec2[] var_7@2
	decl_var  INTERP_MODE_FLAT dvec2[] var_7@3
...
	vec1 32 ssa_302 = deref_var &var_7@2 (function_temp dvec2[])
	vec1 32 ssa_303 = deref_var &var_7@3 (function_temp dvec2[])
	vec1 32 ssa_304 = deref_array &(*ssa_302)[ssa_301] (function_temp dvec2) /* &var_7@2[ssa_301] */
	vec1 32 ssa_305 = deref_array &(*ssa_303)[ssa_301] (function_temp dvec2) /* &var_7@3[ssa_301] */
	vec1 64 ssa_306 = mov ssa_110.z
	intrinsic store_deref (ssa_305, ssa_306) (wrmask=x, access=0)
error: instr->num_components == glsl_get_vector_elements(dst->type) (../src/compiler/nir/nir_validate.c:632)

	vec4 64 ssa_111 = vec4 ssa_14, ssa_13, ssa_12, ssa_109
	vec1 32 ssa_307 = load_const (0x00000000 = 0.000000)
	vec1 32 ssa_308 = iadd ssa_307, ssa_61
	vec1 32 ssa_309 = deref_var &var_7@2 (function_temp dvec2[])
	vec1 32 ssa_310 = deref_var &var_7@3 (function_temp dvec2[])
	vec1 32 ssa_311 = deref_array &(*ssa_309)[ssa_308] (function_temp dvec2) /* &var_7@2[ssa_308] */
	vec1 32 ssa_312 = deref_array &(*ssa_310)[ssa_308] (function_temp dvec2) /* &var_7@3[ssa_308] */
	vec1 64 ssa_313 = mov ssa_111.w
	intrinsic store_deref (ssa_312, ssa_313) (wrmask=, access=0)
error: (nir_intrinsic_write_mask(instr) & ~component_mask) == 0 (../src/compiler/nir/nir_validate.c:803)
```

Fixes: 496fd59d71 (add pass to split 64 bit vec3/4 variable access)
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23880>
(cherry picked from commit a8d669b593)
2023-07-15 22:47:54 +01:00
Eric Engestrom
f5b693d772 .pick_status.json: Update to 9bcdc45ee7 2023-07-15 22:46:31 +01:00
Iago Toral Quiroga
e6c4d6dacd broadcom/compiler: don't leak v3d_compile when finding a new best strategy
If we had selected a best strategy and find an even better one we need to
make sure we free the previous one.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24001>
(cherry picked from commit be91133f87)
2023-07-11 12:50:35 +01:00
Eric Engestrom
cee098a320 .pick_status.json: Update to ba0ceb3be3 2023-07-11 12:50:29 +01:00
Lionel Landwerlin
836d642c34 anv: fix utrace batch allocation
The introduction of a workaround adding lots of MI_NOOPs broke our
computation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b9aa66d5d0 ("anv: disable preemption for 3DPRIMITIVE during streamout")
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23792>
(cherry picked from commit a13ac83f1b)
2023-06-28 18:30:05 +01:00
Samuel Pitoiset
84d40dcf31 radv/amdgpu: workaround a kernel bug when replacing sparse mappings
AMDGPU has a bug when clearing mappings for BOs that are always valid
in VM with OP_REPLACE.

See https://lists.freedesktop.org/archives/amd-gfx/2023-June/094648.html

The current workaround is to re-use OP_MAP/OP_UNMAP until all stable
kernels have the fix.

This partially reverts "radv/winsys: update sparse mappings with
OP_REPLACE instead of OP_MAP/OP_UNMAP".

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23741>
(cherry picked from commit 9b00867327)
2023-06-28 18:28:53 +01:00
Samuel Pitoiset
a59ae56afb radv/amdgpu: skip adding per VM BOs for sparse during CS BO list build
This should be similar but it will help for re-introducing
OP_MAP/ON_UNMAP instead of OP_REPLACE.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23741>
(cherry picked from commit 51caece74c)
2023-06-28 18:25:55 +01:00
Matt Turner
455c266ec5 anv: Only expose video decode bits with KHR_video_decode_queue
This fixes dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm
in combination with the CTS fix from
https://gerrit.khronos.org/c/vk-gl-cts/+/12191

Fixes: 9361481780 ("anv: add video format features for the one supported video output format")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8263
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23776>
(cherry picked from commit 561cce32f1)
2023-06-28 18:25:17 +01:00
Matt Turner
c6f3c29ab0 anv: Pipe anv_physical_device to anv_get_image_format_features2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23776>
(cherry picked from commit 727335045d)
2023-06-28 18:23:19 +01:00
Kenneth Graunke
dbb2b8df97 intel: Initialize FF_MODE2 on all Gfx12 platforms
On Alchemist, the FF_MODE2 documentation says that we must set the
FF_MODE2 timer values for GS and HS to 224.  The hardware performance
tuning guide also recommends setting the TDS timer to 4.

On Tigerlake, i915 applies workarounds to set the GS timer to 224
(failing to do so can cause HS/DS unit hangs), and the TDS timer to 4
(for performance).  It doesn't currently apply a HS timer there, and
I'm not sure if it's strictly necessary, but given that Alchemist
needed it, and the other two settings matched, let's assume that it
ought to match as well.

Unfortunately, there has been a bug in the i915 workarounds
infrastructure for non-masked context registers where writing one
field of the register zeroes out all the others.  So, I believe the
Tigerlake TDS timer value of 4 isn't being applied correctly there,
though the register is also not readable on that platform which
makes it hard to verify.  So, this may also speed up tessellation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9233
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23839>
(cherry picked from commit 1b3669a1ed)
2023-06-28 18:09:26 +01:00
Francisco Jerez
952380c90c intel/gfx12.5: Enable L3 partial write merging for compressible surfaces among other cases.
This enables L3 partial write merging for a number of cases that seem
to be getting accidentally disabled by the kernel, which was causing a
serious performance bottleneck on DG2 and MTL platforms.  The
"Compressible Partial Write Merge Enable", "Coherent Partial Write
Merge Enable" and "Cross-Tile Partial Write Merge Enable" bits in
L3SQCREG5 were expected to be enabled by default (and confusingly,
they even read off as enabled if you ran 'intel_reg read 0xb158' on an
idle system), but they are getting clobbered during 3D context
initialization by an i915 workaround.

Enabling L3 partial write merging of compressible surfaces in
particular seems to increase rendering fillrate by over 3x in some
cases (e.g. the
"VulkanFillRate/FillRateGPU/resolution:1[0-3]/format:*/blend:0"
fillrate-bound microbenchmarks).  Significant improvements can also be
reproduced in most real-world workloads we've tested so far,
e.g. Counter Strike GO improves by ~11%, Shadow Of the Tomb Raider
improves by ~5.5%, and AztecRuins-VK improves by ~6.5% on DG2-512 --
Thanks a lot to Caleb Callaway for these figures.  No regressions have
been observed so far.

Even though this patch might strike as surprisingly simple for such a
large payoff, it's the result of Felix DeGrood and I trying to
root-cause the rendering performance gap of DG2 on Linux vs Windows on
and off during the last year, and some of the OA statistics captured
by Felix early this month were greatly helpful for me to connect the
last few dots, so Felix deserves a big chunk of the credit for this
work.

Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23783>
(cherry picked from commit 427fee3507)
2023-06-28 18:04:06 +01:00
Eric Engestrom
879fdb8ea8 .pick_status.json: Update to e67337bebf 2023-06-28 18:02:35 +01:00
Rob Clark
689746c886 freedreno: Reallocate on unshared export
If we need to export a handle on a resource which was not originally
allocated with PIPE_BIND_SHARED, then re-allocate with shared flag and
try again.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9110
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
(cherry picked from commit b94d35f74d)
2023-06-28 16:08:29 +01:00
Rob Clark
37cc02d26e freedreno: Add aux-context support
A global aux-context can be created on-demand for cases where we need to
(for example) blit a resource when we only have a screen ptr.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
(cherry picked from commit 75193262fd)
2023-06-28 16:08:22 +01:00
Rob Clark
a88f2eab77 freedreno: Handle export error handling
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
(cherry picked from commit 221a6986ba)
2023-06-28 16:08:16 +01:00
Rob Clark
4ddc83be95 freedreno/drm: Don't try to export suballoc bo
Suballoc BOs don't have a real handle, so attempting to dmabuf export
won't work.  Likewise for handle or flink-name export.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
(cherry picked from commit 7cc8185ca3)
2023-06-28 16:08:11 +01:00
Vinson Lee
b98eb78f58 tu: Fix missing unlock
Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking dev->vma_mutex.

Fixes: c20139c292 ("tu: Enable bufferDeviceAddressCaptureReplay")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23490>
(cherry picked from commit 46764815ac)
2023-06-28 16:07:44 +01:00
Alyssa Rosenzweig
5300cff16c nir/lower_bool_to_int32: Fix progress reporting
If we only lower parameters, that's still progress. Technically.

Fixes: 6a29cb2654 ("nir/lower_bool_to_int32: add support for lowering functions.")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23804>
(cherry picked from commit 5c8f21412f)
2023-06-27 14:14:39 +01:00
Corentin Noël
1e149d37df compiler: Allow the explicit_stride of aoa types to be zero
The explicit stride doesn't have to be defined to aoa and therefore can be
zero in some cases, like in arrays of arrays of uniform blocks.

Resolves crash with spec@arb_gl_spirv@execution@ubo@aoa-2.shader_test piglit test for virgl.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23648>
(cherry picked from commit bc2828a436)
2023-06-27 14:14:36 +01:00