Commit Graph

128487 Commits

Author SHA1 Message Date
Jonathan Marek f3109c4579 turnip: avoid heap allocations in QueueSubmit when semaphores are used
Use the stack. (note: we already do for drm_msm_gem_submit_cmd array, and
using calloc() for heap allocations in a VK driver is wrong

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6687>
2020-09-14 18:11:59 +00:00
Italo Nicola 00914e2179 nir/algebraic: fold some nested comparisons with ball and bany
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6604>
2020-09-14 17:47:39 +00:00
Pierre-Eric Pelloux-Prayer 8a2a9e9bb8 glsl: fix per_vertex_accumulator::fields size
49d35f3d88 moved gl_Layer/gl_ViewportIndex/gl_ViewportMask
as builtins but fields size wasn't increased.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3508
Fixes: 49d35f3d88 ("glsl: declare gl_Layer/gl_ViewportIndex/gl_ViewportMask as vs builtins")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6688>
2020-09-14 15:24:32 +02:00
Timur Kristóf 26299c87f8 aco: Add base argument to emit_mbcnt.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6699>
2020-09-14 12:19:24 +00:00
Timur Kristóf f3780e7b8c aco: Clean up emit_mbcnt.
Make it less error-prone and more consistent with other helpers.
Pass the masks as a single argument rather than two.
In wave64 mode, split the argument into low and high halves in
emit_mbcnt rather than where it is called.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6699>
2020-09-14 12:19:24 +00:00
Timur Kristóf efa1c760d1 aco: Fix emit_boolean_exclusive_scan in wave32 mode.
Use the lane mask instead of s2 for the register class.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6699>
2020-09-14 12:19:24 +00:00
Tapani Pälli 12567de2be glsl: mark some builtins with correct glsl(es) version check
GLSL Desktop spec 1.30.x:
   "New built-ins: trunc(), round(), roundEven(), isnan(), isinf(), modf()"

For ES, 3.00.x is the first ES spec that mentions the builtins.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6455>
2020-09-14 11:12:55 +03:00
Erico Nunes 4868ce1451 lima: dont split vec3 unaligned load inputs
It seems that the mali400 pp is unable to load vec3 unaligned varyings.
This can happen in the current state with mesa if a varying float is put
into the first component of a vec4 and a vec3 is packed right after it.
This would be fine as by default nir would create a vec4 load followed
by a mov with swizzle to realign the components into a vec3.
In lima_nir_split_load_input, this becomes a separate vec3 load
expecting the unaligned load.
Since this can't happen, skip the load input splitting for this special
case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6507>
2020-09-13 10:09:29 +00:00
Jonathan Marek bea6290ca0 turnip: device global bo list
Avoid having to deal with BO tracking. However, the kernel still requires a
bo list, so keep a global one which can be re-used for every submit.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6686>
2020-09-13 04:04:58 +00:00
Jordan Justen 20a4235c4c anv, iris: Set MediaSamplerDOPClockGateEnable for gen12+
This has been shown to help performance on TGL and DG1. This could be
applied to gen9+, but we still need to show if it helps with those
platforms.

Rework:
 * Make change in src/intel/vulkan/genX_cmd_buffer.c too. (Ken)
 * Keep mask as 3 for gen < 12

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6684>
2020-09-11 17:40:03 -07:00
Nanley Chery e3101c96bb anv/image: Disable multi-layer CCS_E on TGL+
Anv doesn't do multi-layer fast-clear tracking, but TGL may add
fast-clears to multiple layers. Disable CCS_E for image arrays on TGL+
until anv gets more clear color tracking abilities.

With this change, anv+TGL now passes:
* dEQP-VK.multiview.readback_implicit_clear.15_15_15_15
* dEQP-VK.multiview.readback_implicit_clear.8_1_1_8
* dEQP-VK.multiview.readback_implicit_clear.1_2_4_8_16_32
* dEQP-VK.multiview.renderpass2.readback_implicit_clear.15_15_15_15
* dEQP-VK.multiview.renderpass2.readback_implicit_clear.8_1_1_8
* dEQP-VK.multiview.renderpass2.readback_implicit_clear.1_2_4_8_16_32

v2. Mention HSD 14010672564. (Sagar)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6528>
2020-09-11 23:35:28 +00:00
Marek Olšák 656d8edd9e nir/opt_vectorize: don't lose exact and no_*_wrap flags
This fixes a bunch of dEQP GLES tests.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6694>
2020-09-11 17:41:14 -04:00
Rob Clark eceb4fb904 freedreno: fix fence-fd leak
sync_accumulate() does not take ownership.

Fixes: bf23ff83e6 ("freedreno: fence_server_sync() fixes")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6692>
2020-09-11 13:11:52 -07:00
Qiang Yu ef980ac0c1 radeonsi: fix max syncobj wait timeout
syncobj wait takes int64_t timeout and won't clamp it
in kernel code, so we have to pass in INT64_MAX instead
of OS_TIMEOUT_INFINITE which is UINT64_MAX. Otherwise
syncobj wait with OS_TIMEOUT_INFINITE case just return
fail.

Fixes: c638301b42 "radeonsi: fix syncobj wait timeout"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6676>
2020-09-11 12:47:27 +00:00
Iago Toral Quiroga 3182209673 v3d/compiler: fix V3D double-rounding of .8 fixed-point XY coordinates
Pre-V3D 4.3 hardware has a quirk where it expects XY coordinates in
.8 fixed-point format, but then it will internally round it to .6 fixed-point,
introducing a double rounding. The double rounding can cause very slight
differences in triangle raterization coverage that can actually be noticed by
some CTS tests.

The correct fix for this as recommended by Broadcom is to convert to
.8 fixed-point with ffloor().

Fixes:
dEQP-VK.renderpass.suballocation.subpass_dependencies.late_fragment_tests.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6677>
2020-09-11 09:51:33 +02:00
Timothy Arceri 367ac07efc disk_cache: move cache item loading code into disk_cache_load_item() helper
This should be helpful if someone chooses to implement cache support on
windows. Also providing this greater level of abstraction makes it easier
to implement alterative cache layouts in future.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 8598dc1a75 disk_cache: add new OS specific helper disk_cache_evict_item()
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 7893dc405c disk_cache: move get_cache_file() to an OS specific helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 593ef166ae disk_cache: create new helper for writing cache items to disk
This pulls out the cache item writing code from cache_put() into
a new helper. In this patch we also move various functions called
by this code into the new disk_cache_os.c file.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri b4a3a80403 disk_cache: move evict_lru_item() to an OS specific helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri e1236470dc disk_cache: move munmap into an OS specific helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 889356e731 disk_cache: move index mmap into OS specific helper
This will make windows support easier to add in future.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 62c4339118 disk_cache: add disk_cache_enabled() helper
This will make windows support easier to add in future.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Timothy Arceri 4339ecde35 disk_cache: move cache dir generation into OS specific helper file
This will make windows support easier to add in future. To avoid code
churn this temporarily duplicates the mkdir_if_needed() function, we
will delete the duplicate in a following patch.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
2020-09-11 06:03:58 +00:00
Vinson Lee 65d0fa0852 nv50/ir: Remove duplicate mask assignment.
A duplicate assignment was added in f2924994bd ("nv50/ir: add
nv50_ir_prog_info_out").

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6674>
2020-09-11 00:44:49 +00:00
Vinson Lee a2a330a4ed nv50/ir: Add fallthrough statement.
Fix defect reported by Coverity Scan.

Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value
nir_intrinsic_bindless_image_samples is not terminated by a 'break'
statement.

Suggested-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6645>
2020-09-10 17:30:16 -07:00
Marek Olšák 50d335804f nir/algebraic: add late optimizations that optimize out mediump conversions (v3)
v2: move *2*mp patterns to the end of late_optimizations
v3: remove ftrunc from the optimizations to fix:
    dEQP-GLES3.functional.shaders.builtin_functions.common.modf.vec2_lowp_vertex

Reviewed-by: Rob Clark <robdclark@chromium.org> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák b86305bb57 nir/algebraic: collapse conversion opcodes (many patterns)
mediump inserts a lot of conversions. This cleans up the IR.
All other combinations are covered too.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák cdd498bbe8 nir: add new mediump opcodes f2[ui]mp, i2fmp, u2fmp
Algebraic optimizations will select them.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák 385b4dbc39 nir: enforce 32-bit src type requirement for f2fmp and i2imp
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák 3d3df8dbff nir: remove redundant opcode u2ump
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák 26fc5e1f4a nir/algebraic: expand existing 32-bit patterns to all bit sizes using loops
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Marek Olšák 3c8934a644 nir/algebraic: add flrp patterns for 16 and 64 bits
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Alyssa Rosenzweig 3064feb235 pan/mdg: Obey f2fmp size restriction in fuse_io_16
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
2020-09-10 23:35:13 +00:00
Nanley Chery 5cd6235958 blorp: Drop trailing whitespace in blorp_clear.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6650>
2020-09-10 22:09:28 +00:00
Nanley Chery 1eff389bd3 blorp: Fix alignment test for HIZ_CCS_WT fast-clears
Remove the extra logical ORs in the ternary operation.

Fixes: 5425fcf2cb ("intel/blorp: Satisfy HIZ_CCS fast-clear alignments")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6650>
2020-09-10 22:09:28 +00:00
Marek Olšák 40f7afc1e9 nir: fix lower_mediump_outputs to not require variables
If IO is lowered, NIR doesn't have to contain any IO variables
(and in fact radeonsi removes them and other drivers should too).

This makes the pass work without variables.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6621>
2020-09-10 19:52:57 +00:00
Marek Olšák c2ae39e0ce nir: add mediump flag to IO semantics
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6621>
2020-09-10 19:52:57 +00:00
Adam Jackson 5e9e457383 glx/dri3: Implement GLX_EXT_swap_control_tear
Not wired up for DRI2 because it would require server-side support,
which I'm not especially interested in writing.

Fixes: mesa/mesa#96
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
2020-09-10 14:48:19 -04:00
Adam Jackson 60ebeb4608 glx: Implement GLX_EXT_swap_control for DRI2 and DRI3
This is a slight generalization of the existing SGI and MESA swap
control extensions, and a prerequisite for GLX_EXT_swap_control_tear.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
2020-09-10 14:48:19 -04:00
Adam Jackson b8239abdf8 glx: Reject glXSwapIntervalMESA greater than INT_MAX
It wouldn't work in any case, as the internal API only stores a signed
int, and GLX_EXT_swap_control_tear will overload the meaning of negative
values so we should avoid ambiguity.

If your application needs a swap interval in excess of ~414.25 days, I'm
very sorry.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
2020-09-10 14:48:19 -04:00
Adam Jackson e648442ceb glx: Collect all the non-applegl extensions in the GetProcAddress table
No functional change, just reducing #ifdef clutter.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
2020-09-10 14:48:19 -04:00
Adam Jackson 72a0f7496a glx: Use GLX_FUNCTION2 only for actually aliased function names
I find the __glX naming convention distasteful for a bunch of reasons,
not least that I expect "vi -t glXBindTexImageEXT" to take me someplace
useful. The functions we're referencing here should not be exported from
libGL (hence the static / _X_HIDDEN) but that's no reason not to name
them correctly.

This does have one possible, very minor, correct functional change,
glXGetMscRateOML now returns Bool (unsigned int) instead of GLboolean
(unsigned char); if your psABI really only writes to a single byte of
the return register when the return type is char-like, then we probably
would not have returned false when we meant to. At least for amd64 this
does not seem to be an issue; the old code wrote 0 to %eax, the new code
does a zero-extended load from %al to %eax (since the internal function
still returns GLboolean).

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
2020-09-10 14:48:19 -04:00
Adam Jackson 77d2562793 wsi/x11: Hook up VK_PRESENT_MODE_FIFO_RELAXED_KHR
This is just PresentOptionAsync.

Fixes: mesa/mesa#3483
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6673>
2020-09-10 14:17:47 -04:00
Christian Gmeiner 2f62a44df0 ci: do not build libdrm for vc4, reedreno and etnaviv
They are using a in source tree version of the needed libdrm
functionality or are shipping all needed headers in the source tree.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6672>
2020-09-10 14:13:37 +00:00
Jonathan Marek 52becd39a5 turnip: rework vertex buffers draw state handling
This exploits a HW optimization for when only the size of a draw state is
changed, to make things simpler and more optimal (assuming a well behaved
user which doesn't unecessarily call CmdBindVertexBuffers many times)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6665>
2020-09-10 13:14:05 +00:00
Marcin Ślusarz 69e65b9cf0 intel/tools: fix possible randomly increased verbosity of error2aub
Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
2020-09-10 12:16:58 +00:00
Marcin Ślusarz 18eb853ac8 intel/compiler: quiet Coverity warnings
Coverity complains about possible out-of-bounds write & read, because
it thinks that "loc + i" can be bigger than sizes of the 2 used arrays.

It's not obvious from the code it cannot happen, so add asserts here.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
2020-09-10 12:16:58 +00:00
Marcin Ślusarz 5b6fd2a314 intel/tools: handle ftell errors
Found by Coverity, as "argument cannot be negative", referring to
fread's 2nd argument.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
2020-09-10 12:16:58 +00:00
Marcin Ślusarz 46a82aa3a6 intel/tools: fix possible memory leak in the error path
Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
2020-09-10 12:16:58 +00:00