Erik Faye-Lund
41698eee96
docs/panfrost: fix numbered list
...
This got broken when it got moved into the documentation.
Fixes: e0752673be
("docs/panfrost: Move description of instancing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29902 >
2024-07-01 14:17:26 +00:00
Samuel Pitoiset
484f613a97
radv: use radv_get_user_sgpr_loc() for the GS copy shader too
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29957 >
2024-07-01 13:39:51 +00:00
Samuel Pitoiset
f22ee282fc
radv: add radv_get_user_sgpr{_loc}() helpers
...
To simplify all the user sgpr computations which are very redundant.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29957 >
2024-07-01 13:39:51 +00:00
Samuel Pitoiset
bf852536fc
radv: rename radv_get_user_sgpr() to radv_get_user_sgpr_info()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29957 >
2024-07-01 13:39:51 +00:00
Sergi Blanch Torne
81424e1d50
Revert "ci: disable Collabora's farm due to maintenance"
...
This reverts commit c0138e99e6
.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29978 >
2024-07-01 12:21:10 +00:00
Juan A. Suarez Romero
f77216e9ac
Revert "ci: disable Igalia farm"
...
This reverts commit f0b0a71a9b
.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29984 >
2024-07-01 11:57:43 +00:00
Eric Engestrom
48a7c212ba
radeonsi/ci: mark test as fixed
...
This was fixed by one of the commits in the range 5cb15a6c...6006588a.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29981 >
2024-07-01 10:01:38 +00:00
Luc Ma
6b5a12611b
meson: Build pipe-loader when build-tests is true
...
Gallium/tests/trivial requires dynamic pipe loader at runtime, that is,
$prefix/$libdir/gallium-pipe/pipe_*.so must get built and installed.
so let's build it if build-tests is enabled.
v2:
- Fix error of meson when both of clover and tests are enabled (dbaker)
Signed-off-by: Luc Ma <luc@sietium.com >
Acked-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Dylan Baker <dylan@pnwbakers.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27180 >
2024-07-01 09:24:49 +00:00
Lionel Landwerlin
884397b587
anv: workaround flaky xfb query results on Gfx11
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29836 >
2024-07-01 09:04:12 +00:00
Juan A. Suarez Romero
feaa5ce1ec
vc4: fix out-of-bounds access to array
...
Detected by by Undefined Behaviour Sanitizer (UBSan), this fixes trying
to access index 5 in `util_format_channel_description`, which is
declared of size 4.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
b827aee3a3
vc4: do not create 0-bytes variable length arrays
...
When declaring an array with variable length, like `nir_variable
*vars[num_entries]`, ensure the length is always greater than 0
This has been detected by Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
2a16575dec
vc4: do not pass NULL pointer to function not expecting NULLs
...
memcmp() pointers arguments are declared to be non NULL.
This has been detected by Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
eab3ee8d71
vc4: do not access member of a NULL structure
...
Check if the structure is NULL before trying to get access to its
members.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
5e09b2b3f3
vc4: use unsigned types when performing bitshifting
...
Ensure unsigned integers of proper size are used instead of signed ones
when performing left bit shifts.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
1bcf9c5da9
v3d: do not pass NULL pointer to function not expecting NULLs
...
memcpy() pointers arguments are declared to be non NULL.
This has been detected by Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
417f70ef5a
v3d: do not access member of a NULL structure
...
Check if the structure is NULL before trying to get access to its
members.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
fc286867fb
v3dv: fix misalignment in descriptor layout structure
...
Current memory layout for v3dv_descriptior_set_layout structure is the
following:
```
/* offset size */
type = struct v3dv_descriptor_set_layout {
struct vk_object_base base; /* 0 64 */
VkDescriptorSetLayoutCreateFlags flags; /* 64 4 */
uint32_t binding_count; /* 68 4 */
uint32_t bo_size; /* 72 4 */
uint16_t shader_stages; /* 76 2 */
/* PAD 2 */
uint32_t descriptor_count; /* 80 4 */
uint16_t dynamic_offset_count; /* 84 2 */
/* PAD 2 */
uint32_t ref_cnt; /* 88 4 */
struct v3dv_descriptor_set_binding_layout binding[0]; /* 92 32 */
} [...] binding[1]; /* 124 32 */
```
Besides wasting 4 bytes in padding, the main problem is that `binding`
fields are not aligned to 8 bytes (64-bits), which is undefined behaviour
in C.
Just moving `descriptor_count` field below we get the new layout:
```
/* offset size */
type = struct v3dv_descriptor_set_layout {
struct vk_object_base base; /* 0 64 */
VkDescriptorSetLayoutCreateFlags flags; /* 64 4 */
uint32_t binding_count; /* 68 4 */
uint32_t bo_size; /* 72 4 */
uint16_t shader_stages; /* 76 2 */
uint16_t dynamic_offset_count; /* 78 2 */
uint32_t descriptor_count; /* 80 4 */
uint32_t ref_cnt; /* 84 4 */
struct v3dv_descriptor_set_binding_layout binding[0]; /* 88 32 */
} [...] binding[1]; /* 120 32 */
```
Which removes the padding requirement, and more important, make the
`binding` pointers to be correctly aligned.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
9696fd378a
v3dv: restrict to channels when encoding border color
...
Not all the formats have 4 channels, so let's restrict the border
encoding to the number of channels.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
3ee47dc6d9
v3dv: do not pass NULL pointer to function not expecting NULLs
...
memcpy() pointers arguments are declared to be non NULL.
This has been detected by Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
1d71be8e60
v3dv: do not access member of a NULL structure
...
Check if the structure is NULL before trying to get access to its
members.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Juan A. Suarez Romero
7dc6b8df11
broadcom/compiler: use unsigned types when performing bitshifting
...
Ensure unsigned integers are used instead of signed ones when performing
left bit shifts.
This has been detected by the Undefined Behaviour Sanitizer (UBSan).
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29911 >
2024-07-01 08:02:07 +00:00
Lionel Landwerlin
b8f8926026
anv: emit the right shader instruction for protected mode
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29778 >
2024-07-01 06:48:06 +00:00
Lionel Landwerlin
57e74d7b56
anv: allocate compute scratch using the right scratch pool
...
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29778 >
2024-07-01 06:48:06 +00:00
Lionel Landwerlin
3ccf80f9b1
anv: prepare 2 variants of all shader instructions
...
One variant uses a protected scratch surface the other not.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29778 >
2024-07-01 06:48:06 +00:00
Lionel Landwerlin
08a4e0a2e3
anv: add a protected scratch pool
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29778 >
2024-07-01 06:48:06 +00:00
Sergi Blanch Torne
c0138e99e6
ci: disable Collabora's farm due to maintenance
...
Planned downtime in the farm:
* Start: 2024-07-01 07:00 UTC
* End: 2024-07-01 13:00 UTC
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29891 >
2024-07-01 05:53:15 +00:00
David Heidelberg
68215332a8
build: pass licensing information in SPDX form
...
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Dylan Baker <dylan.c.baker@intel.com >
Acked-by: Eric Engestrom <eric@igalia.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Signed-off-by: David Heidelberg <david@ixit.cz >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29972 >
2024-06-29 12:42:49 -07:00
José Roberto de Souza
3b6e2475e4
intel/perf: Enable perf on Xe KMD
...
Support was added in the previous patches, so this check can now be
removed.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
936e87a7f9
anv: Implement Xe KMD query pools
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
3c1b545057
intel/perf: Implement Xe KMD perf stream read
...
Xe KMD perf stream reads just returns the samples, there is no header.
For error checking there is other uAPI that is not handled here yet.
So to mantain compatibility here reading the perf stream, adding a
header then copying the sample.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
da63c54db5
intel/perf: Remove i915_drm.h includes from common code
...
Only place that still has i915_drm.h includes in common code is
intel_perf_query.c.
This are the last i915_drm.h includes in headers in common code \o/.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
00c6b09812
tool/pps: Add Xe KMD support
...
This is the same config as intel.cfg only changing:
data_sources {
config {
name: "gpu.counters.i915"
gpu_counter_config {
counter_period_ns: 100000
}
}
}
to:
data_sources {
config {
name: "gpu.counters.xe"
gpu_counter_config {
counter_period_ns: 100000
}
}
}
Otherwise pps would not accept due to different KMD names.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
c2fd848002
intel/perf: Refactor and add Xe KMD support to change stream metrics id
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
b22899b494
intel/perf: Refactor and add Xe KMD support to enable and disable perf stream
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
981090f173
intel/perf: Add Xe KMD perf stream open function
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
6258c84375
intel/perf: Refactor and add Xe KMD support to add and remove configs
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
0e68d7a735
intel/perf: Replace i915_perf_version and i915_query_supported by a feature bitmask
...
Replacing the i915_perf_version that is i915 specific by a feature
mask makes easier to support Xe KMD.
Also this allow us to group a bool and a int into a single enum(int).
No changes in behavior is expected here.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
a56b085661
intel/perf: Add function to check if OA/perf is supported by Xe KMD
...
This is a uAPI added after initial Xe KMD upstreaming so not supported
by every version, also by default it requires high privilege
permissions so it check if current applications has it.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
f0c62b6438
intel/perf: Implement function that returns OA format for Xe KMD
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
José Roberto de Souza
bdeeaaff59
intel: Sync xe_drm.h
...
Sync xe_drm.h with 406d058dc323 ("drm/xe/oa/uapi: Allow preemption to be disabled on the stream exec queue").
Patch available in https://gitlab.freedesktop.org/drm/kernel/-/blob/drm-next/ .
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312 >
2024-06-29 01:17:37 +00:00
Sushma Venkatesh Reddy
d52dd5a9e9
anv/drirc: add option to provide low latency hint
...
GuC offers a mechanism for KMD/UMD to provide workload hints and one of
that strategy is low latency hint. We can utilize this hint when the
workload is more latency sensitive like compute usecases.
Signed-off-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com >
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28282 >
2024-06-28 21:45:59 +00:00
Jesse Natalie
d0151df322
mesa: Add ASSERTED to assert-only local variable
...
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29970 >
2024-06-28 20:44:36 +00:00
Jesse Natalie
13d11ab442
zink: Add ASSERTED to assert-only local variable
...
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29970 >
2024-06-28 20:44:36 +00:00
Jesse Natalie
c2b53d7bd0
nir: Remove assert-only variable by inlining its single use
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29970 >
2024-06-28 20:44:36 +00:00
Alyssa Rosenzweig
30db807f79
nir/algebraic: explicitly suffix constants
...
Make our intentions super duper clear.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Suggested-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29952 >
2024-06-28 19:53:36 +00:00
Alyssa Rosenzweig
270446ee21
nir: fix miscompiles with rules with INT32_MIN
...
812b3415
added rules for upcasts with comparisons with a variety of
types. The float & unsigned rules should be ok, but the signed integer rules are
unsound as currently implemented. This can cause end-to-end miscompiles.
I originally hit this issue while debugging a large real world OpenCL kernel. I
found the bug symptoms changed when disabling loop unrolling, which tipped me
off to a compiler bug. I've reduced it to a minimal test case. Imagine my
surprise when I find out the NIR my backend ingested was already constant folded
to be wrong.
In the minimal test case, during optimization we have NIR:
32 %6 = ....
64 %9 = i2i64 %6
64 %44 = load_const (0x0000000000000001)
1 %45 = ilt %9, %44 (0x1)
This is a simple check (int64_t)%6 < 1.
nir_opt_algebraic turns this into:
32 %6 = ...
64 %9 = i2i64 %6
64 %44 = load_const (0x0000000000000001)
64 %55 = load_const (0x0000000080000000 = 2147483648)
1 %56 = ilt %55 (0x80000000), %44 (0x1)
64 %57 = load_const (0x000000007fffffff = 2147483647)
1 %58 = ilt %57 (0x7fffffff), %44 (0x1)
32 %59 = i2i32 %44 (0x1)
1 %60 = ilt %6, %59
1 %61 = ior %58, %60
1 %62 = iand %56, %61
This pile of math constant-folds to an unconditional "false"! The problem is
%56. At first glance, INT32_MIN < 1 is true so %56 should be true. Indeed, it
should. But here's the kicker: both constants are 64-bit here, so the ilt
operation is a 64-bit comparison -- that left-hand side is INT32_MIN
zero-extended to 64-bit for the signed comparison at 64-bit. So in fact, it
evaluates to false, causing the whole expression to go false. If we're going to
do a 64-bit comparison for %56, then we need to sign-extend the bound. So we'll
just adjust the Python and be on our way, right?
Unfortunately the issue is deeper. According to the comment in the generated
nir_opt_algebraic.c file, the guilty algebraic rule is:
('ilt', ('i2i64', 'a@32'), '#b') =>
('iand', ('ilt', -2147483648, 'b'), ('ior', ('ilt', 2147483647, 'b'), ('ilt', 'a', ('i2i32', 'b'))))
From a Python perspective? That rule is correct. -2147483648 < 1 is a true
statement. Adjusting the Python rule is not the appropriate solution here, since
the issue is more fundamental and might affect other rules. The real problem is
the translation of that Python replacement tree into C, incorrectly
zero-extending -2147483648 into 0x0000000080000000 instead of sign-extending to
0xffffffff80000000.
Crawling down the rabbit hole of the generated algebraic file, we see the
constant encoded as:
{ .constant = {
{ nir_search_value_constant, 64 },
nir_type_int, { -0x80000000 /* -2147483648 */ },
} },
NIR correctly translates the negative constant to a C level negate operation of
its absolute value. This maps to the correct sign-extension...
...for all constants except for INT_MIN. Because that constant lacks a ULL
suffix, it is a 32-bit integer. And for this integer (only), negating it hits
signed integer overflow (UB!) and then we end up with an effective
zero-extension when going to 64-bit.
This patch fixes the end-to-end miscompile.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Closes : #11402
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29952 >
2024-06-28 19:53:36 +00:00
Maaz Mombasawala
8b756a0d0e
svga: Replace shared surface flag and simplify surface creation
...
The shared flag vmw_svga_winsys_surface was used to create shareable surfaces
and these surfaces are not discarded.
Since all surfaces created right now are shareable, there is no need for this
flag except to mark surfaces which should not be discarded. Renaming it to
nodiscard accordingly.
This also simplifies surface creation.
Signed-off-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com >
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com >
Reviewed-by: Ian Forbes <ian.forbes@broadcom.com >
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29948 >
2024-06-28 19:41:02 +00:00
Neha Bhende
8b8f347e4b
svga: Retrieve stride info from hwtnl->cmd.vdecl for swtnl draws
...
This fixes spec@!opengl 1.0@gl-1.0-polygon-line-aa
spec@!opengl 1.1@clipflat and multiple piglit tests
failures on VGPU9 device
Fixes: 76725452
("gallium: move vertex stride to CSO")
Reviewed-by: Brian Paul <brian.paul@broadcom.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29947 >
2024-06-28 19:24:46 +00:00
Rémi Bernon
f9a15b37ef
zink: Add VKAPI_PTR specifier to generated stub functions.
...
Same as 8d210ae232
but for when NDEBUG
isn't defined.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29863 >
2024-06-28 18:15:34 +00:00
Mike Blumenkrantz
6466a977e4
zink: add a driver workaround to disable 2D_VIEW_COMPATIBLE+sparse
...
this fixes a lot of stuff on intel and hopefully never hits any corner
case app use
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29197 >
2024-06-28 17:44:00 +00:00