platform/upstream/mesa.git
3 years agocrocus: inline the d/s resource handling functions
Dave Airlie [Fri, 2 Jul 2021 20:36:32 +0000 (06:36 +1000)]
crocus: inline the d/s resource handling functions

These are pretty simple, so inlining is fine and helps drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>

3 years agodraw/tess: write correct primitive id into vertices
Dave Airlie [Wed, 26 May 2021 05:53:46 +0000 (15:53 +1000)]
draw/tess: write correct primitive id into vertices

The code was using a prim assembler after the tess stage, however
tess prims aren't necessarily the output prim types, so just put
the prim ids into the vertices at tess stage, and skip prim assembly.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11000>

3 years agodraw: fix tessellation output vertex size calculation
Dave Airlie [Wed, 26 May 2021 04:27:14 +0000 (14:27 +1000)]
draw: fix tessellation output vertex size calculation

This ensures space for the extra outputs is calculated in the
tes vertex outputs.

dEQP-VK.pipeline.misc.primitive_id_from_tess

Fixes: dacf8f5f5c82 ("draw: hook up final bits of tessellation")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11000>

3 years agocrocus: fixup index buffer dirtying.
Dave Airlie [Mon, 5 Jul 2021 02:45:13 +0000 (12:45 +1000)]
crocus: fixup index buffer dirtying.

This fixes a possible problem if a non-indexed draw comes in first
in a new batch, then the batch might not emit the index buffer.

I'm unsure if we see this, I just spotted it trying to fix alacritty

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11705>

3 years agocrocus: fix crash on index buffer rebinding.
Dave Airlie [Mon, 5 Jul 2021 01:43:52 +0000 (11:43 +1000)]
crocus: fix crash on index buffer rebinding.

This was crashing in plasmashell.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11704>

3 years agocrocus/gen5: enable support for GL_EXT_gpu_shader4
Dave Airlie [Thu, 1 Jul 2021 02:23:09 +0000 (12:23 +1000)]
crocus/gen5: enable support for GL_EXT_gpu_shader4

There has been a few requests for this and I've got patches for glamor
to use this to speed up the paths that use GLSL 1.30 now.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>

3 years agocrocus: expose ARB_blend_func_extended on gen 45/50
Dave Airlie [Thu, 1 Jul 2021 00:52:52 +0000 (10:52 +1000)]
crocus: expose ARB_blend_func_extended on gen 45/50

In theory the docs say 965gm can support this but the original
965 can't, but we can't distinguish that yet.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>

3 years agocrocus: cleanup some deadcode in the gen5 blend emit
Dave Airlie [Fri, 2 Jul 2021 06:12:03 +0000 (16:12 +1000)]
crocus: cleanup some deadcode in the gen5 blend emit

The rt->blend_enable is always 1 at this point, and the gen5
specific code isn't being used anymore, it just looked like it
was.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>

3 years agonir/ifind_msb_rev: fix input check
Thomas H.P. Andersen [Mon, 28 Jun 2021 22:54:40 +0000 (00:54 +0200)]
nir/ifind_msb_rev: fix input check

ifind_msb_rev was introduced in a5747f8ab357ff00c630b937b221e5fb59d90289.

ifind_msb_rev guards against src0 being both 0 or -1 at the same time.
That is always true. This patch changes it to check for those values
individually.

Spotted from a compile warning.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: a5747f8ab35 (\"nir: add opcodes for *find_msb_rev and lowering\")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11630>

3 years agoiris: make iris_bind_reserve_3d and Wa_1604061319 only check for dirty render bindings
Dave Airlie [Sat, 3 Jul 2021 00:04:47 +0000 (10:04 +1000)]
iris: make iris_bind_reserve_3d and Wa_1604061319 only check for dirty render bindings

+    9.31%  drawover:gdrv0  iris_dri.so      [.] iris_binder_reserve_3d

+    2.36%  drawover:gdrv0  iris_dri.so         [.] iris_binder_reserve_3d

If the app never uses compute, then the compute bindings bit will always
be dirty causing these two paths never get shortcuts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11699>

3 years agopanfrost: Only upload UBOs when needed
Icecream95 [Wed, 19 May 2021 21:10:40 +0000 (09:10 +1200)]
panfrost: Only upload UBOs when needed

If all of the used values from a UBO are pushed, it doesn't need to be
uploaded.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>

3 years agopan/mdg: Create a mask of UBOs that need to be uploaded
Icecream95 [Thu, 20 May 2021 10:07:05 +0000 (22:07 +1200)]
pan/mdg: Create a mask of UBOs that need to be uploaded

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>

3 years agopan/bi: Create a mask of UBOs that need to be uploaded
Icecream95 [Tue, 18 May 2021 02:19:57 +0000 (14:19 +1200)]
pan/bi: Create a mask of UBOs that need to be uploaded

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>

3 years agopanfrost: Don't set dirty_mask for constant buffers
Icecream95 [Sat, 3 Jul 2021 07:52:21 +0000 (19:52 +1200)]
panfrost: Don't set dirty_mask for constant buffers

It is unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>

3 years agocrocus: Make the driver loader use PCI IDs for crocus
Zoltán Böszörményi [Fri, 2 Jul 2021 10:18:12 +0000 (12:18 +0200)]
crocus: Make the driver loader use PCI IDs for crocus

Add PCI IDs based in pci_ids/i965_pci_ids.h and move crocus before
iris in driver_map[].

This allows Xorg to load the crocus driver since iris would claim
the devices handled by crocus (because the i915 kernel driver is
used for all Intel devices) then fail during initialization.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11694>

3 years agocrocus: Add pipe loader driver
Zoltán Böszörményi [Fri, 2 Jul 2021 09:04:13 +0000 (11:04 +0200)]
crocus: Add pipe loader driver

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11694>

3 years agovulkan/wsi: Fix prime blits to use system memory for the destination
Kenneth Graunke [Thu, 1 Jul 2021 20:38:25 +0000 (13:38 -0700)]
vulkan/wsi: Fix prime blits to use system memory for the destination

The intention here was to pass VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT to
select_memory_types() when requesting device local memory, or simply
pass 0 for the prime blit destination which should be in system memory.

Unfortunately, that meant we did (type.propertyFlags & 0) == 0 which
was vacuously true, causing us to not filter out device local types.

Fixes hybrid display of Vulkan apps on Intel TGL+DG1 systems.

Tested-by: Luis Felipe Strano Moraes <luis.strano@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11680>

3 years agoi915g: Make sure the 1D texture Y channel is initialized.
Emma Anholt [Thu, 1 Jul 2021 04:58:23 +0000 (21:58 -0700)]
i915g: Make sure the 1D texture Y channel is initialized.

Even with the wrap mode forced to REPEAT, we get undefined results in
CelShading when the Y channel is unwritten since the beginning of the
program.

I dropped the coords==0 case in the process, since that's not possible and
made the 1D case confusing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11457>

3 years agoi915g: Force 1D textures to use wrap mode for the Y coordinate.
Emma Anholt [Fri, 18 Jun 2021 04:30:06 +0000 (21:30 -0700)]
i915g: Force 1D textures to use wrap mode for the Y coordinate.

There are no 1D textures in HW, so we use 2D, but at the shader level
there no Y coordinate to 1D sampling, so we need that value to be ignored.
WRAP mode can get us that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11457>

3 years agomeson: Make prefer-{crocus,iris} always take effect
Adam Jackson [Wed, 30 Jun 2021 13:44:26 +0000 (09:44 -0400)]
meson: Make prefer-{crocus,iris} always take effect

As written this would require that the driver be built before we looked
at the option. This is wrong because it affects code outside of the
driver, it's in libGL's PCI ID table. This is sort of harmless for
crocus at the moment, but for iris you would need to build it in order
to remove it from the table; if you built just i965 and tried to run it
against gen9, the libGL you just built would direct the loader to the
iris driver you just didn't, and setup would fail, which is: goofy.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11655>

3 years agoiris: Delete unused bo->cache_coherent flag
Kenneth Graunke [Mon, 28 Jun 2021 18:42:24 +0000 (11:42 -0700)]
iris: Delete unused bo->cache_coherent flag

This was used in the heuristics for deciding whether to CPU map,
but those have since been deleted, so this is now unused.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>

3 years agoiris: Fail BO allocation if we can't enable snooping properly.
Kenneth Graunke [Mon, 28 Jun 2021 18:38:08 +0000 (11:38 -0700)]
iris: Fail BO allocation if we can't enable snooping properly.

If the caller has asked for a coherent BO with snooping, and the kernel
fails to set it for whatever reason, we were happily returning them a
non-coherent buffer.  This isn't what they wanted and could lead to
surprising results.

Better to simply fail the allocation.  Probably.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>

3 years agoiris: Stop calling I915_GEM_SET_CACHING on discrete GPUs
Kenneth Graunke [Mon, 28 Jun 2021 18:31:50 +0000 (11:31 -0700)]
iris: Stop calling I915_GEM_SET_CACHING on discrete GPUs

On integrated GPUs without LLC, we enable snooping when someone requests
coherency for a buffer.  (With LLC, it's already coherent.)

For discrete GPUs...if someone requests coherency, we allocate the
buffer in SMEM and resort to WC maps rather than WB maps with CPU
caches enabled.  There's no snooping to enable, and calling this ioctl
is nonsensical, and may fail.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>

3 years agoi915g: whitespace fixup from the cube map fix.
Emma Anholt [Wed, 30 Jun 2021 21:13:35 +0000 (14:13 -0700)]
i915g: whitespace fixup from the cube map fix.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>

3 years agoi915g: Add support for per-vertex point size.
Emma Anholt [Wed, 30 Jun 2021 20:02:28 +0000 (13:02 -0700)]
i915g: Add support for per-vertex point size.

Closes: #4973
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>

3 years agoradv: allow more fast clears for depth surfaces without TC-compat HTILE
Samuel Pitoiset [Mon, 5 Apr 2021 12:19:42 +0000 (14:19 +0200)]
radv: allow more fast clears for depth surfaces without TC-compat HTILE

With HTILE only, all values between 0.0 and 1.0 are fetchable.
This should allow more fast clears for depth surfaces where
TC-compat HTILE is disabled.

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/10035>

3 years agoradv: prevent fast clearing HTILE depth for unrestricted ranges
Samuel Pitoiset [Tue, 22 Jun 2021 12:13:36 +0000 (14:13 +0200)]
radv: prevent fast clearing HTILE depth for unrestricted ranges

VK_EXT_depth_range_unrestricted removes the restriction that the
clear value must be between 0.0 and 1.0.

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/10035>

3 years agoradv: add support for more HTILE clear codes
Samuel Pitoiset [Mon, 5 Apr 2021 12:18:27 +0000 (14:18 +0200)]
radv: add support for more HTILE clear codes

The HTILE clear code is now computed based on the floating point value.

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/10035>

3 years agoradv: advertise VK_EXT_color_write_enable
Samuel Pitoiset [Mon, 3 May 2021 12:02:53 +0000 (14:02 +0200)]
radv: advertise VK_EXT_color_write_enable

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/11530>

3 years agoradv: implement VK_EXT_color_write_enable
Samuel Pitoiset [Thu, 18 Mar 2021 14:25:42 +0000 (15:25 +0100)]
radv: implement VK_EXT_color_write_enable

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/11530>

3 years agoFix up leftover "state_trackers" references to "frontends"
Michel Dänzer [Thu, 1 Jul 2021 14:40:16 +0000 (16:40 +0200)]
Fix up leftover "state_trackers" references to "frontends"

Fixes: d6287a94b69 "gallium: rename 'state tracker' to 'frontend'"
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11676>

3 years agonir_lower_readonly_images: Clear variable data when changing the type
Jesse Natalie [Wed, 30 Jun 2021 23:36:51 +0000 (16:36 -0700)]
nir_lower_readonly_images: Clear variable data when changing the type

For images, variable data includes the format. For samplers, variable
data is used for OpenCL inline samplers. When converting a variable
from one to the other, zero out the data so we don't accidentally
interpret a converted image as an inline sampler.

Fixes: fa677c86 ("nir_lower_readonly_images_to_tex: Support non-CL semantics")
Acked-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11674>

3 years agozink: check last_finished before timeline waiting
Mike Blumenkrantz [Wed, 26 May 2021 12:19:35 +0000 (08:19 -0400)]
zink: check last_finished before timeline waiting

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>

3 years agozink: add a screen function for waiting on a batch id
Mike Blumenkrantz [Wed, 12 May 2021 15:36:46 +0000 (11:36 -0400)]
zink: add a screen function for waiting on a batch id

this is super hacky for the non-timeline case but whatever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>

3 years agozink: stop screwing up buffer offsets during for maps
Mike Blumenkrantz [Mon, 17 May 2021 21:46:01 +0000 (17:46 -0400)]
zink: stop screwing up buffer offsets during for maps

stop using the memory bind offset

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>

3 years agozink: use 0 as the offset when mapping qbos
Mike Blumenkrantz [Thu, 13 May 2021 12:53:49 +0000 (08:53 -0400)]
zink: use 0 as the offset when mapping qbos

zink_resource_object::offset is the memory offset, which is unrelated to
the offset in a buffer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>

3 years agozink: use pipe_resource::width0 for clamping ssbo sizes
Mike Blumenkrantz [Thu, 13 May 2021 12:53:04 +0000 (08:53 -0400)]
zink: use pipe_resource::width0 for clamping ssbo sizes

zink_resource_object::size is the size of the memory allocation, which
is effectively unrelated

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>

3 years agozink: don't add mem allocation offset when copying buf2image
Mike Blumenkrantz [Thu, 13 May 2021 12:40:04 +0000 (08:40 -0400)]
zink: don't add mem allocation offset when copying buf2image

this doesn't apply to any image/buffer operations, it's solely for memory
allocation/binding/mapping

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>

3 years agozink: only flag persistent resource maps for invalidation if they aren't coherent
Mike Blumenkrantz [Fri, 14 May 2021 18:52:20 +0000 (14:52 -0400)]
zink: only flag persistent resource maps for invalidation if they aren't coherent

coherent is already synchronized

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11688>

3 years agozink: use vkresult helper for map return
Mike Blumenkrantz [Mon, 17 May 2021 19:03:11 +0000 (15:03 -0400)]
zink: use vkresult helper for map return

consistency++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11689>

3 years agoutil/disk_cache: Don't leak when cache is empty
Daniel Stone [Thu, 1 Jul 2021 22:58:49 +0000 (23:58 +0100)]
util/disk_cache: Don't leak when cache is empty

When we exit early having failed to find any candidate cache files to
evict, don't leak the list head whilst doing so.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: f58e6fee7452 ("util/disk_cache: delete more cache items in one go when full")
Ref: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11523>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11682>

3 years agozink: add resource refs after last descriptor unbind
Mike Blumenkrantz [Tue, 11 May 2021 13:17:28 +0000 (09:17 -0400)]
zink: add resource refs after last descriptor unbind

redundant at this point; no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: split samplerview/imageview usage/refcounting calls
Mike Blumenkrantz [Tue, 11 May 2021 13:13:42 +0000 (09:13 -0400)]
zink: split samplerview/imageview usage/refcounting calls

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: split batch usage setting from refcounting
Mike Blumenkrantz [Tue, 11 May 2021 12:44:29 +0000 (08:44 -0400)]
zink: split batch usage setting from refcounting

batch tracking has until now been the same as refcounting, but this
is inefficient and incurs additional overhead from constant atomic ops,
so make them separate

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: split out resource tracking into more incremental functions
Mike Blumenkrantz [Mon, 10 May 2021 23:39:34 +0000 (19:39 -0400)]
zink: split out resource tracking into more incremental functions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: remove stencil resource batch tracking
Mike Blumenkrantz [Mon, 10 May 2021 23:32:05 +0000 (19:32 -0400)]
zink: remove stencil resource batch tracking

I think maybe I misunderstood how things worked, or there were issues
generally with resource lifetimes, or whatever, but this isn't needed anymore

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: don't add batch tracking during buffer rebinds if refs are dirty
Mike Blumenkrantz [Mon, 10 May 2021 19:48:26 +0000 (15:48 -0400)]
zink: don't add batch tracking during buffer rebinds if refs are dirty

this will be handled automatically

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>

3 years agozink: add more explicit casts to draw code
Mike Blumenkrantz [Fri, 2 Jul 2021 01:13:17 +0000 (21:13 -0400)]
zink: add more explicit casts to draw code

this makes c++ happy

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>

3 years agozink: add c++ header guards
Mike Blumenkrantz [Fri, 2 Jul 2021 01:13:06 +0000 (21:13 -0400)]
zink: add c++ header guards

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>

3 years agozink: remove unnecessary return from zink_desc_type_from_vktype()
Mike Blumenkrantz [Tue, 11 May 2021 18:21:07 +0000 (14:21 -0400)]
zink: remove unnecessary return from zink_desc_type_from_vktype()

this doesn't compile in c++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>

3 years agozink: rename 'template' struct member
Mike Blumenkrantz [Wed, 12 May 2021 11:39:12 +0000 (07:39 -0400)]
zink: rename 'template' struct member

this is a c++ keyword

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>

3 years agozink: make prim type a bitfield in pipeline info
Mike Blumenkrantz [Tue, 11 May 2021 17:51:47 +0000 (13:51 -0400)]
zink: make prim type a bitfield in pipeline info

match draw info here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>

3 years agonir: Fix constant folding for irhadd/urhadd
Alyssa Rosenzweig [Wed, 30 Jun 2021 22:16:55 +0000 (18:16 -0400)]
nir: Fix constant folding for irhadd/urhadd

This should be a subtract, not an add. The comment's proof is correct,
but the (wrong) expression we actually use isn't what it's in the
comment! Correct the discrepancy.

The lowering in nir_opt_algebraic was correctly typed.

Fixes: 272e927d0e9 ("nir/spirv: initial handling of OpenCL.std extension opcodes")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11671>

3 years agozink: rework pipeline cache implementation
Mike Blumenkrantz [Sun, 9 May 2021 15:13:09 +0000 (11:13 -0400)]
zink: rework pipeline cache implementation

this is now a screen-based queue which can be triggered to serialize
cache updates, ensuring synchronization

the cache is on the program object, enabling incremental updates as well as
variant loading for an entire pipeline collection at once

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11595>

3 years agozink: merge some streamout state emission into the same draw conditional
Mike Blumenkrantz [Tue, 11 May 2021 16:42:11 +0000 (12:42 -0400)]
zink: merge some streamout state emission into the same draw conditional

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11667>

3 years agozink: move line width and depth bias updating into conditional during draw
Mike Blumenkrantz [Tue, 11 May 2021 16:38:57 +0000 (12:38 -0400)]
zink: move line width and depth bias updating into conditional during draw

only do calculations when needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11667>

3 years agozink: unify fb surface unbinding
Mike Blumenkrantz [Tue, 11 May 2021 13:37:10 +0000 (09:37 -0400)]
zink: unify fb surface unbinding

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11666>

3 years agozink: add a ref for flush resource
Mike Blumenkrantz [Fri, 28 May 2021 19:06:53 +0000 (15:06 -0400)]
zink: add a ref for flush resource

the lifetime of this needs to always be preserved

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11665>

3 years agozink: break up ctx descriptor state updating to per-type functions
Mike Blumenkrantz [Mon, 10 May 2021 19:14:06 +0000 (15:14 -0400)]
zink: break up ctx descriptor state updating to per-type functions

this is a bit easier to read/manage going forward

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11664>

3 years agozink: unify/consolidate some barrier queuing
Mike Blumenkrantz [Mon, 10 May 2021 18:52:55 +0000 (14:52 -0400)]
zink: unify/consolidate some barrier queuing

this queuing is based on bind counts, and it's all the same, so it
can mostly be combined for better reuse

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11663>

3 years agozink: avoid unnecessarily rewriting gl_DrawID
Mike Blumenkrantz [Fri, 29 Jan 2021 22:12:44 +0000 (17:12 -0500)]
zink: avoid unnecessarily rewriting gl_DrawID

with tc enabled, we get genuine multidraws with valid drawids, so we can
update this to reflect the new capabilities...which are the same as the old
ones except that potentially some drivers can now do direct multidraws

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11662>

3 years agomicrosoft/compiler: Change behavior for emitting inexpressible barriers
Jesse Natalie [Sun, 11 Apr 2021 21:32:09 +0000 (14:32 -0700)]
microsoft/compiler: Change behavior for emitting inexpressible barriers

If the barrier tries to apply to memory that we can't express, just
don't apply the memory portion of the barrier. Similarly, if it tries
to apply a global memory barrier at invocation level, upgrade it to
thread-group.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11670>

3 years agodocs/isl/tiling: Fix swizzle pattern for X-tiling
Jason Ekstrand [Thu, 1 Jul 2021 19:05:41 +0000 (14:05 -0500)]
docs/isl/tiling: Fix swizzle pattern for X-tiling

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11679>

3 years agolavapipe: Add a missing VKAPI_ATTR.
Georg Lehmann [Mon, 7 Jun 2021 17:31:25 +0000 (19:31 +0200)]
lavapipe: Add a missing VKAPI_ATTR.

Signed-off-by: Georg Lehmann's avatarGeorg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>

3 years agolavapipe: Use common default allocator.
Georg Lehmann [Tue, 1 Jun 2021 15:37:06 +0000 (17:37 +0200)]
lavapipe: Use common default allocator.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>

3 years agooverlay_layer: add missing undef
Luis Felipe Strano Moraes [Wed, 23 Jun 2021 21:03:11 +0000 (14:03 -0700)]
overlay_layer: add missing undef

reviewed-by: Dylan Baker <dylan@pnwbakers.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11673>

3 years agomeson: print information about layers being built as part of summary
Luis Felipe Strano Moraes [Wed, 12 May 2021 23:12:36 +0000 (16:12 -0700)]
meson: print information about layers being built as part of summary

reviewed-by: Dylan Baker <dylan@pnwbakers.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11673>

3 years agogallium/u_threaded: do not apply start twice
Erik Faye-Lund [Tue, 29 Jun 2021 08:45:44 +0000 (10:45 +0200)]
gallium/u_threaded: do not apply start twice

We already apply start when setting the bits in writable_buffer, so
shifting the bits up by start just makes us apply the offset twice.

Caught by Coverity.

Fixes: 988d0917208 ("gallium/u_threaded: clear valid buffer range only if it's not bound for write")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11635>

3 years agoradv: disable DCC for DOOM 2016 and Wolfenstein II
Samuel Pitoiset [Wed, 30 Jun 2021 15:32:25 +0000 (17:32 +0200)]
radv: disable DCC for DOOM 2016 and Wolfenstein II

Both games perform two image layout transitions with the same image
in the same pipeline barrier with UNDEFINED and this re-initializes
DCC to the uncompressed state. No ideal solution sadly. Note that
both games declare all images as CONCURRENT.

This fixes rendering issues on GFX10+ because DCC for stores is
supported and this implicitly enables DCC for concurrent.

Fixes: da166f648f6 ("radv: enable DCC for concurrent images on GFX10")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4927
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4607
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/11656>

3 years agozink: drop getenv hacking now that gallium is fixed.
Dave Airlie [Tue, 29 Jun 2021 19:25:10 +0000 (05:25 +1000)]
zink: drop getenv hacking now that gallium is fixed.

This drops the getenv hacks which cause problems testing multithread apps

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11643>

3 years agogallium/sw: add sw_vk bit to avoid having to futz with env vars for lavapipe
Dave Airlie [Tue, 29 Jun 2021 19:22:58 +0000 (05:22 +1000)]
gallium/sw: add sw_vk bit to avoid having to futz with env vars for lavapipe

lavapipe really only currently works with llvmpipe, and likely for the forseeable
future.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11643>

3 years agoradv: enable VK_KHR_shader_subgroup_uniform_control_flow
Rhys Perry [Mon, 21 Jun 2021 15:54:56 +0000 (16:54 +0100)]
radv: enable VK_KHR_shader_subgroup_uniform_control_flow

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11626>

3 years agoaco: handle NIR loops without breaks
Rhys Perry [Tue, 22 Jun 2021 14:23:37 +0000 (15:23 +0100)]
aco: handle NIR loops without breaks

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11626>

3 years agoci: update VK-GL-CTS to 1.2.6.2
Juan A. Suarez Romero [Wed, 30 Jun 2021 12:13:31 +0000 (14:13 +0200)]
ci: update VK-GL-CTS to 1.2.6.2

v1:
 - Fix typos (Emma)
 - Remove needless sort (Adam)

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11654>

3 years agoRevert "CI: Disable LAVA devices for maintenance"
Daniel Stone [Wed, 30 Jun 2021 21:54:05 +0000 (22:54 +0100)]
Revert "CI: Disable LAVA devices for maintenance"

This actually came back a few hours ago.

This reverts commit b07dc014c44849af59f98afa3a1703c9d9d3cf27.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11669>

3 years agoturnip/kgsl: new flag TU_USE_KGSL
Hyunjun Ko [Fri, 18 Jun 2021 00:52:00 +0000 (00:52 +0000)]
turnip/kgsl: new flag TU_USE_KGSL

There are some cases using kgsl backend on linux that is still not usual
setup though, we need to consider too.

Regarding the timeline semaphore feature, we could implement it for
the kgsl backend in the future, and probalby it should be using the
existing code in tu_drm.

See #4738, #4907

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11488>

3 years agovenus: fix AHB VkBuffer memory requirement
Yiwei Zhang [Wed, 30 Jun 2021 18:39:00 +0000 (18:39 +0000)]
venus: fix AHB VkBuffer memory requirement

Layering AHB on top of dma_buf_fd requires venus to combine the memory
type bits internally for VkBuffer.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: handle ahb backed VkBuffer creation properly
Yiwei Zhang [Wed, 30 Jun 2021 17:28:47 +0000 (17:28 +0000)]
venus: handle ahb backed VkBuffer creation properly

Venus needs to override the external handle type from AHB to dma buf.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: prepare vn_CreateBuffer for AHB
Yiwei Zhang [Wed, 30 Jun 2021 06:04:39 +0000 (06:04 +0000)]
venus: prepare vn_CreateBuffer for AHB

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: add more logs for Android WSI debugging
Yiwei Zhang [Wed, 30 Jun 2021 06:02:17 +0000 (06:02 +0000)]
venus: add more logs for Android WSI debugging

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agolavapipe: implement EXT_vertex_input_dynamic_state
Mike Blumenkrantz [Fri, 28 May 2021 20:19:20 +0000 (16:19 -0400)]
lavapipe: implement EXT_vertex_input_dynamic_state

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11231>

3 years agolavapipe: hook up some bits for handling dynamic line stipple state
Mike Blumenkrantz [Mon, 7 Jun 2021 23:26:30 +0000 (19:26 -0400)]
lavapipe: hook up some bits for handling dynamic line stipple state

this won't actually work, but it stubs out some (functional) placeholder
code for later code to build on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11231>

3 years agoanv: remove dead code
Thomas H.P. Andersen [Tue, 29 Jun 2021 20:31:06 +0000 (22:31 +0200)]
anv: remove dead code

The unused bo_flags here is a leftover from the past. A similar
setup of bo_flags is now performed within anv_device_alloc_bo
via a call to anv_bo_alloc_flags_to_bo_flags.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11645>

3 years agofreedreno: Flush the shadowed resource's write batch up front.
Emma Anholt [Tue, 22 Jun 2021 22:16:00 +0000 (15:16 -0700)]
freedreno: Flush the shadowed resource's write batch up front.

This simplifies my mental model of the swapping/blit process for resource
shadowing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agofreedreno: Swap needs_ubwc_clear when shadowing.
Emma Anholt [Tue, 22 Jun 2021 22:10:12 +0000 (15:10 -0700)]
freedreno: Swap needs_ubwc_clear when shadowing.

The destination of the upcoming blit (the old rsc struct that houses the
fresh BO) wouldn't have its ubwc cleared first, which if it got
unfortunate data in a recycled BO could lead to blit failures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agofreedreno: Stop manually marking blit dst buffers as valid.
Emma Anholt [Tue, 22 Jun 2021 22:06:47 +0000 (15:06 -0700)]
freedreno: Stop manually marking blit dst buffers as valid.

fd_batch_resource_write() does this already.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agofreedreno/a5xx: Make sure to mark blit read/write access in the BC.
Emma Anholt [Tue, 22 Jun 2021 22:05:37 +0000 (15:05 -0700)]
freedreno/a5xx: Make sure to mark blit read/write access in the BC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agofreedreno: swap ->valid when shadowing resources.
Emma Anholt [Tue, 22 Jun 2021 21:55:37 +0000 (14:55 -0700)]
freedreno: swap ->valid when shadowing resources.

The valid flag indicates whether the bo has had any data written to it.
Failure to swap it meant that if for some reason we fell back to SW
mappings during the blit from shadow, the PIPE_MAP_READ staging blit would
get dropped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agofreedreno: Update comments about PIPE_BUFFER shadowing.
Emma Anholt [Tue, 22 Jun 2021 21:55:10 +0000 (14:55 -0700)]
freedreno: Update comments about PIPE_BUFFER shadowing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>

3 years agodocs/release-calendar: add a few more 21.1 releases
Eric Engestrom [Wed, 30 Jun 2021 18:44:28 +0000 (19:44 +0100)]
docs/release-calendar: add a few more 21.1 releases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11660>

3 years agodocs: update calendar and link releases notes for 21.1.4
Eric Engestrom [Wed, 30 Jun 2021 18:38:19 +0000 (19:38 +0100)]
docs: update calendar and link releases notes for 21.1.4

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11660>

3 years agodocs: add release notes for 21.1.4
Eric Engestrom [Wed, 30 Jun 2021 18:02:52 +0000 (19:02 +0100)]
docs: add release notes for 21.1.4

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11660>

3 years agoaco: remove resource flags
Rhys Perry [Fri, 18 Sep 2020 15:24:14 +0000 (16:24 +0100)]
aco: remove resource flags

After disabling SMEM stores, nir_opt_access() now does the same analysis
and we don't need this anymore. Doing it in isel is also too late if we
want to lower descriptor loads in NIR.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11652>

3 years agoi915g: Set up the cube map texture wrap modes.
Emma Anholt [Wed, 30 Jun 2021 04:01:19 +0000 (21:01 -0700)]
i915g: Set up the cube map texture wrap modes.

There are HW limits on what you're allowed to do.  No change on dEQP, but
one less thing for me to worry about with our busted cubes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agoi915g: Add curly braces for normal mesa style (and helps clang-format)
Emma Anholt [Wed, 30 Jun 2021 04:01:47 +0000 (21:01 -0700)]
i915g: Add curly braces for normal mesa style (and helps clang-format)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agoi915g: Delete redundant i915_hw_sampler_views atom.
Emma Anholt [Wed, 30 Jun 2021 03:46:13 +0000 (20:46 -0700)]
i915g: Delete redundant i915_hw_sampler_views atom.

The i915_hw_samplers atom already updated both samplers and maps, since
both samplers and maps depend on parts of both the gallium sampler state
and the sampler view.  Just move the samplers+views atom down to the
bottom of the file for legibility, and delete the views-only one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agoi915g: Fix FS debug dumping for declarations.
Emma Anholt [Wed, 30 Jun 2021 03:30:03 +0000 (20:30 -0700)]
i915g: Fix FS debug dumping for declarations.

Samplers have a type, and non-samplers have a destination writemask.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agoi915g: Add the nice cube map layout comments from i915c.
Emma Anholt [Wed, 30 Jun 2021 02:50:26 +0000 (19:50 -0700)]
i915g: Add the nice cube map layout comments from i915c.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agoi915g: Finish the uint -> uint32_t conversion.
Emma Anholt [Wed, 30 Jun 2021 03:32:08 +0000 (20:32 -0700)]
i915g: Finish the uint -> uint32_t conversion.

My sed job missed a few.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>

3 years agofreedreno/a6xx: Fix framebuffer_barrier crash
Rob Clark [Wed, 30 Jun 2021 16:49:40 +0000 (09:49 -0700)]
freedreno/a6xx: Fix framebuffer_barrier crash

This is emitting cmdstream, it should take the submit lock to (a) ensure
we actually have a batch, and (b) prevent it from being flushed from
under it.  This was overlooked in the conversion.

Fixes: 02298ed1fc6 ("freedreno: Add submit lock")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11658>