Mike Blumenkrantz [Sun, 11 Apr 2021 13:49:49 +0000 (09:49 -0400)]
gallium: rename pipe_draw_start_count -> pipe_draw_start_count_bias
and add an index_bias member
no functional changes yet, just the rename and unused struct member
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
Timothy Arceri [Tue, 27 Apr 2021 04:01:08 +0000 (14:01 +1000)]
mesa: fix glShaderSource() error handling
Section 7.1 (SHADER OBJECTS) of the OpenGL 4.6 spec says:
"An INVALID_VALUE error is generated if count is negative."
However a count of 0 is not an error. Previously it would cause a
GL_OUT_OF_MEMORY error.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10477>
Michael Tang [Thu, 29 Apr 2021 20:10:55 +0000 (13:10 -0700)]
microsoft/compiler: Maintain sorting of resource type in the context
This change moves the SRVs associated with read-only SSBOs to be emitted
before any other UAV. We do this because the validator expects resources
to be emitted in a specific order, as noted by `emit_module`.
Previously, we emitted SSBOs as SRVs (read-only) or UAVs (read-write)
after other UAVs.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10514>
Jose Maria Casanova Crespo [Thu, 29 Apr 2021 16:47:53 +0000 (18:47 +0200)]
v3d: DRM_FORMAT_MOD_BROADCOM_SAND128 only available for NV12 format.
We were exposing as available DRM_FORMAT_MOD_BROADCOM_SAND128 for
any format.
Fixes:
95c4f0f91098 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
Jose Maria Casanova Crespo [Thu, 29 Apr 2021 16:37:25 +0000 (18:37 +0200)]
v3d: YUV formats at query_dmabuf_modifiers are external_only
This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"
Fixes:
95c4f0f91098 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
Jose Maria Casanova Crespo [Thu, 29 Apr 2021 16:15:27 +0000 (18:15 +0200)]
v3d: YUV formats at is_dmabuf_modifier_supported are external_only
This fixes Issue https://github.com/Igalia/meta-webkit/issues/185
"Issue Raspberry 4-64 + Mesa VC4 driver + Gstreamer = red Label on video"
Fixes:
6ee10ab3de86 "gallium: Add pipe_screen::is_dmabuf_modifier_supported"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10524>
Pierre-Eric Pelloux-Prayer [Thu, 29 Apr 2021 11:46:33 +0000 (13:46 +0200)]
glx: init __GLXvendorInfo to NULL
Since
01ba8a8d02b the dd variable isn't necessarly initialized,
so the compiler complains:
warning: ‘dd’ may be used uninitialized in this function
Initialize dd to NULL to fix this.
Fixes:
01ba8a8d02b ("glx: Implement GLX_EXT_no_config_context")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Wed, 28 Apr 2021 22:54:06 +0000 (18:54 -0400)]
glx: Remove some dead declarations from glxclient.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Fri, 23 Apr 2021 15:32:17 +0000 (11:32 -0400)]
glx: s/Display */struct glx_display */ over internal API
We'd like to avoid __glXInitialize as much as possible since it involves
taking a global lock. This means converting internal APIs to operate as
much as possible in terms of something other than a Display *, since if
that's all you have then you're forced to call __glXInitialize to get to
the glx_display.
The contortions in DRI2 displease me, but DRI2 displeases me, so.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Fri, 23 Apr 2021 05:17:00 +0000 (01:17 -0400)]
glx: Move server GLX vendor and version strings to glx_screen
These can in fact vary between screens.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Fri, 23 Apr 2021 04:55:46 +0000 (00:55 -0400)]
glx: Simplify some overuse of GetGLXScreenConfigs
If you call this on your current display and screen you're just going to
look up the same value we already stored in your context when we created
it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Fri, 23 Apr 2021 04:42:35 +0000 (00:42 -0400)]
glx: Stash a copy of the XExtCodes in the glx_display
Instead of a pointer into xlib's state for it. Mostly because it lets us
remove our copy of majorOpcode from the display without taking another
pointer indirection.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Thu, 22 Apr 2021 22:39:41 +0000 (18:39 -0400)]
glx: Remove unused opcode argument to __glX{Get,QueryServer}String
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Thu, 22 Apr 2021 22:18:44 +0000 (18:18 -0400)]
glx: Remove warn-once-ery around GLX 1.3 functions
Like, yes, this is an app bug, but we kinda emulate 1.3 anyway already
and are moving further in that direction, and at this point the app is
not going to get fixed. Just hush.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Thu, 22 Apr 2021 20:46:44 +0000 (16:46 -0400)]
glx: Simplify glXIsDirect
This answer is cached for us at context creation, we never really need
to generate protocol here.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Thu, 22 Apr 2021 18:44:26 +0000 (14:44 -0400)]
glx: Stop force-enabling extensions "implied" by GLX 1.3
1.3 has been ubiquitous since xserver 1.2 in early 2007, and has always
been supported with DRI2.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Adam Jackson [Thu, 22 Apr 2021 17:10:44 +0000 (13:10 -0400)]
glx: Stop pretending the GLX major number isn't 1
Clarify the comments and logic accordingly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10418>
Yiwei Zhang [Wed, 28 Apr 2021 23:03:10 +0000 (23:03 +0000)]
venus: handle wsi image queue ownership transfer for Android
1. pre-allocate command pools at device creation if anb enabled
2. force VK_SHARING_MODE_CONCURRENT for wsi image if necessary
3. pre-allocate and record command buffers at android wsi image creation
4. transfer in the ownership at vkAcquireImageANDROID
5. transfer out the ownership at vkQueueSignalReleaseImageANDROID
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/10335>
Yiwei Zhang [Tue, 20 Apr 2021 23:01:23 +0000 (23:01 +0000)]
venus: handle VK_IMAGE_LAYOUT_PRESENT_SRC_KHR transfer
Whenver VK_IMAGE_LAYOUT_PRESENT_SRC_KHR is used, replace it with
VK_IMAGE_LAYOUT_GENERAL as required for proper layout and ownership
transfer for external memory backed swapchain images.
This will be Android only until common WSI is fixed.
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/10335>
Yiwei Zhang [Mon, 19 Apr 2021 22:19:50 +0000 (22:19 +0000)]
venus: enable VK_EXT_queue_family_foreign
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/10335>
Yiwei Zhang [Tue, 27 Apr 2021 20:36:36 +0000 (20:36 +0000)]
venus: update venus-protocol headers
Advertise VK_EXT_queue_family_foreign
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/10335>
Mike Blumenkrantz [Thu, 29 Apr 2021 12:07:21 +0000 (08:07 -0400)]
docs: mark off GL_ARB_shader_clock for zink
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10521>
Rhys Perry [Fri, 23 Apr 2021 12:10:42 +0000 (13:10 +0100)]
radv: fix possible use-after-free when inserting GS copy shader from cache
If we give radv_pipeline_cache_insert_shaders() a variant which was
retrived from the cache, it will free it.
I haven't encountered this issue, but it seems possible.
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/10433>
Rhys Perry [Fri, 23 Apr 2021 12:03:01 +0000 (13:03 +0100)]
radv: fix use-after-free upon GS copy shader cache hits
If radv_pipeline_cache_insert_shaders() finds a GS copy shader in the
cache, it will free the variant in gs_variants and replace it with the one
in the cache.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
Rhys Perry [Fri, 23 Apr 2021 11:49:33 +0000 (12:49 +0100)]
vulkan: fix use-after-free in vk_common_DestroyDebugReportCallbackEXT
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes:
bd1705a4808 ("vulkan: Make vk_debug_report_callback derive from vk_object_base")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
Samuel Pitoiset [Tue, 27 Apr 2021 15:01:45 +0000 (17:01 +0200)]
radv: fix computation of the number of user SGPRS for NGG GS state
The NGG GS state uses one user SGPR.
Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10485>
Mike Blumenkrantz [Thu, 29 Apr 2021 11:57:48 +0000 (07:57 -0400)]
zink: hook up EXT_image_drm_format_modifier
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
Mike Blumenkrantz [Mon, 5 Apr 2021 16:00:42 +0000 (12:00 -0400)]
zink: hook up VK_EXT_shader_subgroup_ballot
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
Mike Blumenkrantz [Sat, 3 Apr 2021 14:32:31 +0000 (10:32 -0400)]
zink: hook up VK_EXT_conservative_rasterization
just the ext bits
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
Mike Blumenkrantz [Fri, 2 Apr 2021 19:15:45 +0000 (15:15 -0400)]
zink: hook up VK_EXT_sample_locations
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10520>
Pierre-Eric Pelloux-Prayer [Fri, 16 Apr 2021 07:42:46 +0000 (09:42 +0200)]
driconf: add workaround for Golf With Friends
The game has a shader that uses texture functions that rely on implicit
derivatives after a discard.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4547
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10278>
Juan A. Suarez Romero [Tue, 27 Apr 2021 10:08:50 +0000 (12:08 +0200)]
util/hash_table: do not leak u64 struct key
For non 64bit devices the key stored in hash_table_u64 is wrapped in
hash_key_u64 structure, which is never free.
This commit fixes this issue by just removing the user-defined
`delete_function` parameter in hash_table_u64_{destroy,clear} (which
nobody is using) and using instead a delete function to free this
structure.
Fixes:
608257cf82f ("i965: Fix INTEL_DEBUG=bat")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10480>
Juan A. Suarez Romero [Thu, 15 Apr 2021 08:53:41 +0000 (10:53 +0200)]
v3dv: check dest bitsize in color blit
Otherwise, if src_bit_size > 0 and dst_bit_size == 0, we end up doing a
bad shift in `1 << (dst_bit_size - 1)`, as `dst_bit_size - 1` is a
negative value (in this case would be MAX_UINT32).
Fixes CID#1468134 "Bad bit shift operation (BAD_SHIFT)":
"large_shift: In expression 1 << dst_bit_size - 1U, left shifting by
more than 31 bits has undefined behavior. The shift amount,
dst_bit_size - 1U, is
4294967295."
v2:
- Use an assertion instead (Iago)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10251>
Juan A. Suarez Romero [Fri, 23 Apr 2021 08:24:57 +0000 (10:24 +0200)]
v3dv: rename VC5 to V3D
As we are not using anymore references to the old VC5, let's rename
definitions from VC5 to V3D in the Vulkan driver.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
Juan A. Suarez Romero [Fri, 23 Apr 2021 08:03:22 +0000 (10:03 +0200)]
broadcom/simulator: change references to VC5
We are referring the driver as V3D instead old VC5; so let's update the
references.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
Juan A. Suarez Romero [Fri, 23 Apr 2021 07:57:54 +0000 (09:57 +0200)]
broadcom/qpu: rename from VC5 to V3D
Get rid of old references to VC5.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
Juan A. Suarez Romero [Wed, 21 Apr 2021 16:43:14 +0000 (18:43 +0200)]
v3d: rename VC5 enums and definitions
As the driver was renamed in the past from VC5 to V3D, let's rename also
the definitions and enumerations to keep it consistent across the code.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
Juan A. Suarez Romero [Wed, 21 Apr 2021 16:12:46 +0000 (18:12 +0200)]
v3d: rename header include guards
Long time ago VC5 was renamed to V3D, but the include guards `VC5_FOO_H`
were not.
In order to keep consistency, let's rename these guards from `VC5_FOO_H`
to `V3D_FOO_H`.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
Caio Marcelo de Oliveira Filho [Thu, 4 Mar 2021 06:49:00 +0000 (22:49 -0800)]
spirv: Don't replicate patch bool in vtn_variable
When we originally added patch variable handling to spirv_to_nir, we
were splitting I/O block variables in spirv_to_nir, so we weren't
guaranteed to have a nir_variable early enough in processing.
Since
b0c643d8f57 ("spirv: Use NIR per-member splitting"), we've been
using NIR per-member splitting where we have a nir_variable which has
a separate nir_variable_data per member. With this, we can drop
vtn_variable::patch and use the patch boolean on the nir_variable
instead.
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/10469>
Vinson Lee [Thu, 22 Apr 2021 02:17:15 +0000 (19:17 -0700)]
clover: Add constructor for constant_argument.
Fix defects reported by Coverity Scan.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize st.
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/10399>
Jason Ekstrand [Thu, 29 Apr 2021 04:16:03 +0000 (23:16 -0500)]
intel/isl: There are seven aux states
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10515>
Mike Blumenkrantz [Tue, 23 Mar 2021 17:37:30 +0000 (13:37 -0400)]
zink: use first-created shader variant as the default
it's not really expected that most apps are going to be switching variants
all the time, so having the "default" one be more dynamic allows skipping
shader lookups more frequently
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10513>
Mike Blumenkrantz [Sat, 23 Jan 2021 16:02:59 +0000 (11:02 -0500)]
zink: add fastpath for getting default shader variants
no need for hashing or lookups if this is the default variant
also have an alt variant for vertex stages to account for streamout and
halfz lowering
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10513>
Mike Blumenkrantz [Tue, 23 Mar 2021 14:51:38 +0000 (10:51 -0400)]
zink: create entrypoints for descriptor variables with spirv 1.5
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
Mike Blumenkrantz [Tue, 23 Mar 2021 14:50:53 +0000 (10:50 -0400)]
zink: generate spirv 1.5 from ntv when using vk >= 1.2
this has an ntv option so further tuning here should be easy enough
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
Mike Blumenkrantz [Mon, 5 Apr 2021 13:54:43 +0000 (09:54 -0400)]
zink: export PIPE_CAP_TGSI_CLOCK
ARB_shader_clock
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
Mike Blumenkrantz [Mon, 5 Apr 2021 13:54:31 +0000 (09:54 -0400)]
zink: support nir_intrinsic_shader_clock
simple const unop
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
Mike Blumenkrantz [Mon, 5 Apr 2021 13:54:05 +0000 (09:54 -0400)]
zink: add spirv builder for unops with a const operand
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
Mike Blumenkrantz [Mon, 5 Apr 2021 13:53:44 +0000 (09:53 -0400)]
zink: add conversion util for nir_scope -> SpvScope
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
Mike Blumenkrantz [Mon, 5 Apr 2021 13:53:29 +0000 (09:53 -0400)]
zink: hook up VK_KHR_shader_clock
more extensions wooo
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
Ian Romanick [Tue, 27 Apr 2021 19:27:31 +0000 (12:27 -0700)]
ci: Uprev piglit to
b3a9fa345 ("framework/replay: Quote resource names before signing")
The PIGLIT_BUILD_CL_TESTS related changes were shamelessly stolen from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6441/diffs?commit_id=
5742be00e6b493b5289ed8120eb06f10d341ea3a.
v2: Remove glslang-tools from arm_build.sh. Suggested by Michel.
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10492>
Chia-I Wu [Wed, 21 Apr 2021 20:14:21 +0000 (13:14 -0700)]
venus: enable external memory support
This enables VK_KHR_external_memory_fd and
VK_EXT_external_memory_dma_buf support.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Wed, 21 Apr 2021 19:43:33 +0000 (12:43 -0700)]
venus: rework external memory capability queries
The idea is to allow the renderer to use a completely different external
memory handle type (e.g., OPAQUE_WIN32!?) than the driver (always
OPAQUE_FD and DMA_BUF). It hides the mismatch by doing translations in
vkGetPhysicalDevice*.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Wed, 21 Apr 2021 00:27:46 +0000 (17:27 -0700)]
venus: update venus-protocol for external memory
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 07:12:27 +0000 (00:12 -0700)]
venus: make sure gem_handle and vn_renderer_bo are 1:1
When two vn_renderer_bo's share the same gem_handle, destroying one of
them would invalidate the other.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 04:07:27 +0000 (21:07 -0700)]
venus: use sparse array to manage vn_renderer_bo
It should be faster. More importantly, we want to use it to keep track
of all BOs for correct dmabuf import.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 03:59:36 +0000 (20:59 -0700)]
venus: move some common members to vn_renderer_bo
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 17:36:55 +0000 (10:36 -0700)]
venus: merge bo create and init ops
There is no good reason to seprate them. I also plan to adopt
util_sparse_array, which requires the kernel BO to be created first (to
use its gem_handle/res_id as the key).
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 22:30:38 +0000 (15:30 -0700)]
venus: move vn_renderer_bo_ops to vn_renderer
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 16:40:10 +0000 (09:40 -0700)]
venus: pass vn_renderer in vn_renderer_bo functions
We will move vn_renderer_bo_ops to vn_renderer in the following commit.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 17:15:53 +0000 (10:15 -0700)]
venus: add dev->renderer pointer
dev->instance->renderer is slower to type and to follow.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 20:33:59 +0000 (13:33 -0700)]
venus: use vn_renderer_shmem
vn_renderer_bo_create_cpu becomes unused and is removed.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 20:33:55 +0000 (13:33 -0700)]
venus: add vn_renderer_shmem
CPU BOs and GPU BOs are used different enough that it makes sense to
treat them as different objects. This commit adds vn_renderer_shmem to
represent CPU BOs.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Fri, 23 Apr 2021 06:21:31 +0000 (23:21 -0700)]
venus: rename VN_CS_ENCODER_INITIALIZER
Rename it to VN_CS_ENCODER_INITIALIZER_LOCAL to make it clear that it is
only for local variables.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 18:21:24 +0000 (11:21 -0700)]
venus: update venus-protocol headers to use accessors
Switch to the newly added vn_instance_submit_command accessors.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Chia-I Wu [Thu, 22 Apr 2021 17:55:59 +0000 (10:55 -0700)]
venus: provide accessors for vn_instance_submit_command
This will allow us to change vn_instance_submit_command without
regenerating the headers.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10437>
Dylan Baker [Wed, 28 Apr 2021 16:34:33 +0000 (09:34 -0700)]
docs: update calendar for 21.1.0-rc3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
Dylan Baker [Wed, 28 Apr 2021 16:34:32 +0000 (09:34 -0700)]
docs: update calendar for 21.1.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
Dylan Baker [Wed, 28 Apr 2021 16:34:30 +0000 (09:34 -0700)]
docs: update calendar for 21.1.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
Rob Clark [Wed, 28 Apr 2021 15:37:59 +0000 (08:37 -0700)]
freedreno/ci: Skip texsubmimage cube_map_array
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Wed, 28 Apr 2021 14:19:13 +0000 (07:19 -0700)]
freedreno/ci: Disable counterstrike trace on a306 for now
The combination of removing bottlenecks in userspace (userspace fences,
etc) and slow GPU results in hitting full ringbuffer on a306. Haven't
figured out a reasonable way to work around that in userspace until a
kernel fix is in place, so disable this one for now.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Tue, 20 Apr 2021 15:57:54 +0000 (08:57 -0700)]
freedreno/drm: Assume explicit fences if in_fence_fd
If we ever see explicit fencing used, then we can disable implicit
fencing, even for internal or unfenced batches.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 19 Apr 2021 22:20:15 +0000 (15:20 -0700)]
freedreno/drm: Async submit support
Move the submit ioctl to it's own thread to unblock the driver thread
and let it move on to the next frame.
Note that I did experiment with doing the append_bo() parts
synchronously on the theory that we should be more likely to hit the
fast path if we did that part of submit merging before the bo was
potentially re-used in the next batch/submit. It helped some things
by a couple percent, but hurt more things.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 23:17:17 +0000 (16:17 -0700)]
freedreno/drm: pipe should hold reference to device
A more direct solution would be for bo's to have a reference to the
device. But bo's are ref/unrefd more frequently.
This avoids async submits unrefing a bo after the device handle-
table is freed.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 15:02:49 +0000 (08:02 -0700)]
freedreno/drm: fd_submit should hold ref to fd_pipe
Also, move this into the base class, no reason for it to be in backend.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 19:56:58 +0000 (12:56 -0700)]
freedreno: Avoid flushing deferred submits for u_trace
This is a bit ugly, but with userspace fences and deferred submits it is
better to poll until the timestamp buffer is ready. Otherwise we could
be triggering deferred submits to flush sooner than they normally would,
changing the behavior of what we are trying to measure.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 19:51:02 +0000 (12:51 -0700)]
freedreno/drm/sp: Implement deferred submit merging
For submits flushed with (a) no required fence, and (b) no externally
visible effects (ie. imported/exported bo), we can defer flushing the
submit and merge it into a later submit.
This is a bit more work in userspace, but it cuts down the number of
submit ioctls. And a common case is that later submits overlap in the
bo's used (for example, blit upload to a buffer, which is then used in
the following draw pass), so it reduces the net amount of work needed
to be done in the kernel to handle the submit ioctl.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/19
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 19:09:42 +0000 (12:09 -0700)]
freedreno/drm/sp: Split submit prep and finish
For deferred submits, we still need to do the prep steps immediately,
but the ioctl construction can be deferred.. prepare for that by
splitting the prep out.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 18:37:06 +0000 (11:37 -0700)]
freedreno/drm: Add pipe tracking for deferred submits
Now that we have some bo state tracking for userspace fences, we can
build on this to add a way for the pipe implementation to defer a submit
flush in order to merge submits into a single ioctl.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 19 Apr 2021 20:03:21 +0000 (13:03 -0700)]
freedreno: Re-work fd_submit fence interface
Move everything into a struct assocated with the pipe_fence_handle, so
that the drm layer can fill in the seqn/fd fences directly.
This will give us a comvenient place to insert a util_queue_fence in the
next commit.
While we're at it, extract the uint32_t fence (previously called
'timestamp' in place, a kgsl legacy) into a struct that encapsulates
both the kernel fence and the userspace fence.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 18:23:27 +0000 (11:23 -0700)]
freedreno/drm: Reference count submits
To merge submits, we'll need drm to internally hold an extra reference
to the submit.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Wed, 21 Apr 2021 20:45:57 +0000 (13:45 -0700)]
freedreno: Drop unused create_fence() arg
It was always zero.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 19 Apr 2021 18:43:02 +0000 (11:43 -0700)]
freedreno: Move fence struct to header
Just a bit of code-motion to prep for later patches.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sun, 18 Apr 2021 22:29:32 +0000 (15:29 -0700)]
freedreno: last_fence optimization for TC async flushes
Without deferred flushes, we would track the last_fence any time when
there had be no rendering/etc since the last flush, to avoid creating
empty batches simply for the purpose of getting a fence. We can do the
same thing with deferred flushes, where the fence is created from the
frontend thread before we know what will be flushed, by repopulating
the pre-created fence.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 17 Apr 2021 18:15:50 +0000 (11:15 -0700)]
freedreno/batch: Don't create fences for every batch
We only need fences for batches flushed via pctx->flush(). This will
serve as a useful signal about submits that can be merged.
v2. disable this optimization pre-a6xx until I can debug issues that
submit merging exposes
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 26 Apr 2021 20:39:04 +0000 (13:39 -0700)]
freedreno/drm: Inline the fence-table
In the common case, a bo will have no more than a single fence attached.
We can inline the storage to avoid a separate allocation in this case.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Wed, 21 Apr 2021 16:37:05 +0000 (09:37 -0700)]
freedreno/drm: Userspace fences
Add a per-fd_pipe fence "timeline" so we can detect cases where we don't
need to call into the kernel to determine if a fd_bo is still busy.
This reuses table_lock, rather than introducing a per-bo lock to protect
fence state updates because (a) the common / hotpath pattern is to
update fences on a lot of objects, but checking the fence state of a
single object is less common, and (b) because we already hold the table
lock in common spots where we need to check the bo's fence state (ie.
allocations from the bo-cache).
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 20:30:35 +0000 (13:30 -0700)]
freedreno/drm: Add locked version fd_{bo,pipe}_del()
This will be needed in the next patch, so we can reuse the bo table_lock
for fence related locking.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 18:25:11 +0000 (11:25 -0700)]
freedreno/drm: Move the growable array helper
We'll need this to track userspace fences attached to a fd_bo.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 22:17:37 +0000 (15:17 -0700)]
freedreno/drm: Add FD_BO_PREP_FLUSH
There are a couple cases where we want to use _NOSYNC, but at the same
time we want to ensure that rendering related to a bo is actually
flushed.
This doesn't do anything yet, but when we start deferring/merging
submits we'll need a way to trigger anything deferred to flush.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 22:11:46 +0000 (15:11 -0700)]
freedreno/drm: Cleanup bo cpu_prep flags
Also add some STATIC_ASSERT()
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 18:09:56 +0000 (11:09 -0700)]
freedreno/drm: Cleanup bo allocation flags
Most of them were actually unused. The memory type (KMEM vs SMI) only
applied to very old a2xx era devices that had a small/fast stacked
memory (SMI) vs normal memory (KMEM). And the cache flags are ignored
(ie. everything is writecombine), but we can add new cache flags later
when they actually do something.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Wed, 21 Apr 2021 16:22:14 +0000 (09:22 -0700)]
freedreno/drm: Move submit->primary to base class
Gets rid of a bit of duplication between the two current
implementations, and will be needed in next patch.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 19 Apr 2021 18:07:15 +0000 (11:07 -0700)]
freedreno: Allow resource shadowing for TC
TC_TRANSFER_MAP_NO_INVALIDATE just means we can't invalidate. It
doesn't preclude the resource shadow path.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Mon, 19 Apr 2021 18:05:57 +0000 (11:05 -0700)]
freedreno: Add a couple debug traces
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Thu, 22 Apr 2021 02:28:31 +0000 (19:28 -0700)]
freedreno: Make sure we actually flush if we need a fence
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Fri, 23 Apr 2021 23:47:47 +0000 (16:47 -0700)]
freedreno: Avoid staging blits with stencil on older gens
This avoids infinite recursion with fallback to
util_resource_copy_region()
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Rob Clark [Sat, 24 Apr 2021 20:11:48 +0000 (13:11 -0700)]
freedreno: Small indent fix
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
Juan A. Suarez Romero [Wed, 28 Apr 2021 14:19:33 +0000 (16:19 +0200)]
ci/broadcom: update expected results
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10501>
Rohan Garg [Mon, 22 Jun 2020 15:24:36 +0000 (17:24 +0200)]
docs: mark external memory and semaphore extensions done for i965
Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Eleni Maria Stea <estea@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5594>