Commit Graph

142057 Commits

Author SHA1 Message Date
Dave Airlie a907e29a3e crocus: don't update draw parameters unless needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie 1d438c11c8 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>
2021-07-05 14:47:30 +10:00
Dave Airlie f19f3f5496 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>
2021-07-05 14:07:39 +10:00
Dave Airlie 45d9e8bb99 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: dacf8f5f5c ("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>
2021-07-05 14:07:34 +10:00
Dave Airlie 0aab06e6d3 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>
2021-07-05 12:45:13 +10:00
Dave Airlie 32b8d47306 crocus: fix crash on index buffer rebinding.
This was crashing in plasmashell.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11704>
2021-07-05 01:47:32 +00:00
Dave Airlie d41992c241 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>
2021-07-05 06:56:18 +10:00
Dave Airlie c71daec260 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>
2021-07-05 06:56:15 +10:00
Dave Airlie 64f65fe8a8 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>
2021-07-05 06:56:11 +10:00
Thomas H.P. Andersen ffea622604 nir/ifind_msb_rev: fix input check
ifind_msb_rev was introduced in a5747f8ab3.

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: a5747f8ab3 (\"nir: add opcodes for *find_msb_rev and lowering\")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11630>
2021-07-04 12:17:58 +00:00
Dave Airlie 4504fabed6 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>
2021-07-03 23:37:57 -07:00
Icecream95 c246af0dd8 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>
2021-07-03 13:23:29 +00:00
Icecream95 b8a7355c03 pan/mdg: Create a mask of UBOs that need to be uploaded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Icecream95 aa11c0307a pan/bi: Create a mask of UBOs that need to be uploaded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Icecream95 d0e90c336d panfrost: Don't set dirty_mask for constant buffers
It is unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Zoltán Böszörményi f94c796741 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>
2021-07-03 06:34:33 +02:00
Zoltán Böszörményi e309d1a3a3 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>
2021-07-03 06:34:20 +02:00
Kenneth Graunke 469875596a 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>
2021-07-02 23:35:57 +00:00
Emma Anholt c656c5f055 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>
2021-07-02 21:18:07 +00:00
Emma Anholt d0ac174fda 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>
2021-07-02 21:18:07 +00:00
Adam Jackson 9cc4ce16fd 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>
2021-07-02 19:18:42 +00:00
Kenneth Graunke 6e55890b6c 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>
2021-07-02 19:06:01 +00:00
Kenneth Graunke a313bd7845 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>
2021-07-02 19:06:01 +00:00
Kenneth Graunke 803a2a9b3d 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>
2021-07-02 19:06:01 +00:00
Emma Anholt 5c55f59b13 i915g: whitespace fixup from the cube map fix.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>
2021-07-02 15:36:27 +00:00
Emma Anholt 487a493325 i915g: Add support for per-vertex point size.
Closes: #4973
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>
2021-07-02 15:36:27 +00:00
Samuel Pitoiset e58ab64223 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>
2021-07-02 13:23:38 +02:00
Samuel Pitoiset 269795c838 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>
2021-07-02 13:23:36 +02:00
Samuel Pitoiset 0cfeb93751 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>
2021-07-02 13:23:32 +02:00
Samuel Pitoiset 764960e16d 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>
2021-07-02 10:02:02 +00:00
Samuel Pitoiset 9a95aba377 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>
2021-07-02 10:02:02 +00:00
Michel Dänzer 61a2cfc302 Fix up leftover "state_trackers" references to "frontends"
Fixes: d6287a94b6 "gallium: rename 'state tracker' to 'frontend'"
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11676>
2021-07-02 07:35:05 +00:00
Jesse Natalie f8f2c3d835 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>
2021-07-02 04:24:22 +00:00
Mike Blumenkrantz 25ad69968b 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>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz fd633c2444 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>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz 347163aec2 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>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 97da7f635e 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>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 9be640ff21 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>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 46695dd938 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>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz f223ee9004 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>
2021-07-02 03:18:19 +00:00
Mike Blumenkrantz b416b68ef3 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>
2021-07-02 03:10:12 +00:00
Daniel Stone d40f8a2fcb 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: f58e6fee74 ("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>
2021-07-02 01:54:10 +00:00
Mike Blumenkrantz 19cf64aabd 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz f8bd5911ee 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 6acd2e9de3 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz b302ab5167 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 72354df9c4 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz ebbedb1c00 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>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 539bdcd469 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>
2021-07-01 21:13:17 -04:00
Mike Blumenkrantz b432bdc035 zink: add c++ header guards
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:13:06 -04:00