Commit Graph

148123 Commits

Author SHA1 Message Date
Chia-I Wu 108881cbcc venus: add some trace points
Add trace points for

 - vn_AcquireNextImage2KHR and vn_QueuePresentKHR
 - vn_AcquireImageANDROID and vn_QueueSignalReleaseImageANDROID
 - vn_BeginCommandBuffer and vn_EndCommandBuffer
 - vn_*Wait*
 - vn_Queue*
 - vn_instance_wait_roundtrip
 - shmem allocations and cache miss/skip

v2: fix cache miss/skip trace points (Ryan)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14215>
2021-12-16 19:27:56 +00:00
Michel Zou 631b3fe3e9 meson: correctly detect linker arguments
Fixes: 22673a98 ("meson: Check arguments before adding")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13961>
2021-12-16 17:19:28 +00:00
Emma Anholt 7a22967de3 r300: Remove unused RC_OPCODE_DPH
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt 9312bfb5fb r300: Remove unused RC_OPCODE_SFL
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt 495d119aa9 r300: Remove unused RC_OPCODE_CLAMP.
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt 9ed55c0c15 r300: Remove unused RC_OPCODE_SWZ.
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt a982d0baf3 r300: Remove unused RC_OPCODE_XPD.
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt 2e2b755ecb r300: Remove unused RC_OPCODE_ABS.
Nothing generates it in the backend.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt 7a0c3b1024 r300: Remove support for SCS.
Nothing generates this meta-op in the backend, so we don't need it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Emma Anholt acef6b6bb3 r300: Remove some dead compiler code.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>
2021-12-16 16:57:02 +00:00
Marcin Ślusarz f7e63ec5d8 nir/print: compact printing of intrinsic indices
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>
2021-12-16 09:43:13 +00:00
Marcin Ślusarz d8fa625bb3 nir/print: expand printing of io semantics.gs_streams
gs_streams can be set for at least 2 other intrinsics.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>
2021-12-16 09:43:13 +00:00
Marcin Ślusarz be25db9f0f nir/print: simplify printing of IO semantics
Some of the tested flags are set for other intrinsics and they are
printed only when set, so there's no point in checking exact intrinsic
name or shader stage.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>
2021-12-16 09:43:13 +00:00
Kenneth Graunke 7325179bcb intel/compiler: Use uppercase enum values in brw_ir_performance.cpp
This is by far the more common style in Mesa.  It also gives a cue that
e.g. num_dependency_ids is a fixed definition rather than some kind of
local variable maintaining a count.

While hre, we also rename the enums to have full prefixes to prepare for
a future where we use them in multiple files for future backend work.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14182>
2021-12-16 09:00:57 +00:00
Kenneth Graunke d3f4f23ca3 intel/vec4: Inline emit_texture and move helpers to brw_vec4_nir.cpp
emit_texture() only has one caller, nir_emit_texture().  We may as well
inline that.  Move the associated helper functions for emitting sampler
messages there as well, to keep associated code nearby.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5183
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14191>
2021-12-16 00:09:45 -08:00
Kenneth Graunke 92d194427d intel/vec4: Use nir_texop in emit_texture instead of translating
We eliminated the GLSL IR -> vec4 backend ages ago, so the only caller
uses a nir_texop enum.  Drop a layer of translating.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14191>
2021-12-16 00:09:44 -08:00
Kenneth Graunke 2729a741fc intel/vec4: Use ir_texture_opcode less in emit_texture()
This replaces a bunch of uses of the GLSL IR ir_texture_opcode enum with
the backend opcode, in preparation for removing it altogether.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14191>
2021-12-16 00:09:36 -08:00
Samuel Pitoiset 5ce4017a2b radv,aco: do not disable anisotropy filtering for non-mipmap images
This fixes
dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_*.mag_linear_min_linear.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14171>
2021-12-16 07:20:50 +00:00
Samuel Pitoiset 8a327722d5 ac/nir: add an option to disable anisotropic filtering for single level images
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14171>
2021-12-16 07:20:50 +00:00
Pierre-Eric Pelloux-Prayer 1cb5c1775b glx: fix querying GLX_FBCONFIG_ID for Window
This commit fixes apps using the following sequence:
1. XCreateWindow(dpy) -> win
2. glXCreateContextAttribsARB(dpy, ...) -> ctx
3. glXMakeCurrent(dpy, win, ctx)
4. glXQueryDrawable(dpy, win, GLX_FBCONFIG_ID, ...)

glXQueryDrawable returned 0 (while correctly returning a valid
GLXFCONFIG_ID for other types of drawables).

This commit adds the same dance as driInferDrawableConfig to get
the GLX visual from the Window, and then the GLXFBCONFIG_ID of
this visual.

This fixes:
* piglit: glx-query-drawable --attr=GLX_FBCONFIG_ID --type=WINDOW
* Maya which uses the config ID from step 4 as an input to
glXChooseFBConfig.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14174>
2021-12-16 01:21:36 +00:00
Adam Jackson 6c5b3c6bb5 dri: Remove unused driGetRendererString
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>
2021-12-15 19:43:42 -05:00
Adam Jackson 7cc42a8dd4 dri: Remove unused driUpdateFramebufferSize
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>
2021-12-15 19:43:41 -05:00
Adam Jackson 7e1e3722fb dri: Remove unused driContextSetFlags
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>
2021-12-15 19:43:39 -05:00
Adam Jackson 69aad97788 mesa: Remove unused _mesa_initialize_visual
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14199>
2021-12-15 19:43:28 -05:00
Sagar Ghuge cd38b6e2e8 anv, iris: Implement Wa_14014890652 for DG2
Workaround is to set:

3DSTATE_VFG::GranularityThresholdDisable = 1
3DSTATE_VFG::DistributionGranularity = BATCH
3DSTATE_VF::GeometryDistributionEnable = 1

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>
2021-12-16 00:00:23 +00:00
Anuj Phogat 40b66a4499 anv, iris: Add Wa_22011440098 for DG2
Rework:
 * Jordan: Set MOCS after
   7b78b2fcac ("intel/genxml: Assert that all MOCS fields are non-zero on Gfx7+")

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>
2021-12-16 00:00:22 +00:00
Anuj Phogat 17a1df79ba anv, iris: Add Wa_16011773973 for DG2
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14212>
2021-12-16 00:00:22 +00:00
Caio Oliveira b1156f23a2 Revert "nir: disable a NIR test due to undebuggable & locally unreproducible CI failures"
This reverts commit 6eb3fe2d4f.  The root cause was
a bug in Meson when using the new gtest protocol and a test failed before producing
the XML file expected by it.  This was fixed in later versions of Meson, so
we've bumped the required meson version to use that feature.  The failure should
now be properly identified, so re-enabling the NIR test.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>
2021-12-15 23:28:09 +00:00
Caio Oliveira 49c356a335 meson: Bump version required for gtest protocol
The feature was added in 0.55 but there was a bug when tests
crashed (and no XML file was generated) that was only fixed in 0.59.2.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14204>
2021-12-15 23:28:09 +00:00
Caio Oliveira dcc7b19cae nir: Initialize nir_register::divergent
Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14205>
2021-12-15 22:39:06 +00:00
Emma Anholt 3ffd6f3fa6 nir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.
This flag is used by the nv50, r600, and svga backends for instruction
exactness.  It was easier to plumb it in as an override in tgsi_ureg than
to make all of ALU instruction emit do it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14201>
2021-12-15 21:58:04 +00:00
Ian Romanick af4d277ccc mesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 5f14e98780 mesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 61a3e68767 mesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional
v2: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, and GL_ONE_MINUS_SRC_ALPHA
should always be supported now. Noticed by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 7649ab1f03 mesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional
Cheatsheet:

_mesa_has_ARB_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGL_COMPAT and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).

_mesa_has_OES_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGLES and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGLES).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick c11641ab24 mesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 2ca13abcce intel/fs: Use HF as destination type for F32TOF16 in fquantize2f16
Having an integer destination type instead of a float destination type
confuses the SWSB code.  This causes problems on some Intel GPUs.  Fix
this by using the correct type in the destination of the F32TOF16
opcode.

Gfx7 doesn't have the HF type, so continue to emit W on that platform.
The assertions in brw_F32TO16 (brw_eu_emit.c) are updated to reflect
this.  In scalar mode, UD is never emitted as a destination type for
this opcode, so remove it from the allowed types in the assertion.

I also condidered doing something like de55fd358f ("intel/fs/xehp:
Teach SWSB pass about the exec pipeline of
FS_OPCODE_PACK_HALF_2x16_SPLIT."), but Curro recommended that just using
the correct types is a better fix.  I agree.

v2: Add missing changes to fs_generator::generate_pack_half_2x16_split.
I'm not sure how I (and the Intel CI) missed that the first time. :(

v3: Fix copy-and-paste issue in the v2 fix. Noticed by Tapani.

Reviewed-by: Francisco Jerez <currojerez@riseup.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14181>
2021-12-15 20:03:51 +00:00
Chia-I Wu 9c81de7df2 venus: cache shmems
Shmems are allocated internally and are only for CPU access.  They can
be easily cached.

Venus have 4 sources of shmem allocations

 - the ring buffer
 - the reply stream
 - the indirection submission upload cs
 - one cs for each vn_command_buffer

The first one is allocated only once.  The other three reallocate
occasionally.  The frequencies depend on the workloads.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 7bec2a0b23 venus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer
It suballocates from a shmem pool owned by vn_instance.  The goals are
to speed up shmem allocations for VkCommandBuffer and to reduce the
number of BOs.  Both are crucial when shmems are HOST3D BOs, because
they require roundtrips to the renderer to allocate and they take up KVM
memslots.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 487926aa86 venus: add vn_cs_encoder_storage_type
It generalizes cs->indirect.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 1fe8f0fea0 venus: use vn_renderer_shmem_pool for reply shmems
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 35c430e75a venus: add vn_renderer_shmem_pool
It provides shmem suballocations.  It is designed to be used with
short-lived shmems.  A long-lived shmem can hold on to some large
allocation while only using a likely small region of the large
allocation.

v2: cleanups suggested by Yiwei

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com> (v1)
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 511fb6b8e9 venus: add vn_renderer_util.[ch]
Move helpers built on top of vn_renderer.h to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Dave Airlie ee283c49b7 mesa: inline mesa_initialize_buffer_object.
This has no other users now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 131efc204d mesa/st: remove st_cb_bufferobjects*
this has all been merged into mesa now

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 8c1472bc84 mesa/bufferobj: move invalidate buffer to optional feature
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie a79f5d9016 mesa/st: rename access flag to transfer flag function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie fdd31298d3 bufferobj: cleanup subdata copies
This moves the common dst min/max invalidation and renames
to be a bit more consistent

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 955ddc02e4 bufferobj: inline page commitment
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 55bb6cc8e1 bufferobj: inline buffer clearing
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00