summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-20build: Update version info for bugfix releasevirglrenderer-0.9.10.9.1branch-0.9.1Gert Wollny1-3/+3
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-19vrend: move new added field to the end.Lepton Wu1-1/+1
This field was introduced 2 months ago and it breaks virgl compatibility between guest/host. Switch the new added field to the end. We will still have compatibility issue but the "bug window" is much smaller. Fixes: 7e7a4e7 ("vrend: Introudce VIRGL_CAP_V2_VIDEO_MEMORY to query video memory") Signed-off-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-16vkr: use virgl_resource_export_fd to get fd and typeYiwei Zhang1-2/+6
The resource can be pipe_resource in our use cases. Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-04-14vkr: implement dma_buf fd import and properties queryYiwei Zhang1-0/+99
Translate the below: VkImportMemoryResourceInfoMESA -> VkImportMemoryFdInfoKHR vkGetMemoryResourcePropertiesMESA -> vkGetMemoryFdPropertiesKHR Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-04-14vkr: update venus-protocol headersYiwei Zhang36-27914/+28447
Add support for external memory fd properties query and import - vkGetMemoryResourcePropertiesMESA - VkImportMemoryResourceInfoMESA - VkMemoryResourcePropertiesMESA This is a huge commit because it also includes the change which splits the headers by handle types. Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-04-14vrend: Also check GL_EXT_texture_view for feat_texture_viewGert Wollny1-1/+1
Closes #209 Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Robert Wetzel <robert.wetzel@opensynergy.com>
2021-04-14vrend: Replace glTexParameterf() with glTexParameteri() for ↵Robert Wetzel1-2/+2
GL_TEXTURE_MIN/MAG_FILTER. GL_TEXTURE_MIN/MAG_FILTER expects an enum value, to be set with glTexParameteri() (integer value) instead of glTexParameterf() (float value). Closes #212 Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-13vrend: Move dereferencing of VBOs from destroy_context to destroy_sub_context.Robert Wetzel1-9/+15
A vrend_context structure contains a current vrend_sub_context, which in turn keeps references on various resources like textures, VBOs, index buffers, etc. which are used for actual drawing operations. Certain actions can change the current sub-context in use. There is a split of what resources are cleaned up directly as part of a context destruction and which are handled by the sub-context destruction. VBOs, while referenced by sub-contexts, are cleaned up by the context. To do that, it uses the at the time of destruction current sub-context to access these. As a result, only the VBOs in the active sub-context are cleaned up; every other sub-context referenced by the context will keep references to the VBOs used. The responsibility of VBO dereferencing is moved to the destruction of the sub-context, so all VBOs, not just the one from the current sub-context, are dereferenced during the destruction of a context. Closes #198 Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-13vrend: Fix changing shader without marking the compute shader as dirtychenjiangnan1-0/+1
Signed-off-by: chenjiangnan <chen.jiangnan@zlingsmart.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-12vrend: fix a warning with GLESChia-I Wu1-28/+28
Fix [DEBUG:rutabaga_gfx/src/virgl_renderer.rs:104] GL_IMPLEMENTATION_COLOR_READ_FORMAT is not expected native format 0x80e1 != imp 0x0 with crosvm introduced by commit d9aad06ba224 (vrend: Create frame buffer object in do_readpixels). We can do the warning check only after an fb with read buffer is bound. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: enable protocol v3 supportChia-I Wu1-0/+5
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: add venus renderer supportChia-I Wu1-0/+21
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: add VCMD_SUBMIT_CMD2Chia-I Wu4-7/+789
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: rename fence functions and variablesChia-I Wu4-17/+17
Make it clear that they are implicit between submit_cmd and resource_busy_wait. implicit_fence_submitted is (fence_id - 1) so this change is slightly more than renaming. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: fence is not needed for resource creationChia-I Wu1-10/+2
There is never a need to wait for the GPU works (if any) involved in resource creation. A client commonly does VCMD_SUBMIT_CMD VCMD_RESOURCE_CREATE2(dummy) ... VCMD_RESOURCE_BUSY_WAIT(dummy) only because VCMD_RESOURCE_BUSY_WAIT needs a resource. We don't need a fence for resource creation. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: tidy up vtest_resource_busy_wait a bitChia-I Wu1-17/+11
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: make vtest_renderer_create_fence internalChia-I Wu4-19/+22
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: add vtest_resource_busy_wait_nop for fuzzerChia-I Wu3-5/+32
Let VTEST_FUZZER_FENCES control whether VCMD_RESOURCE_BUSY_WAIT waits or not. Fences are always created. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: add VCMD_RESOURCE_CREATE_BLOBChia-I Wu4-2/+131
It gives clients access to virgl_renderer_resource_create_blob and virgl_renderer_resource_export_blob. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: --multi-clients requires version 3Chia-I Wu2-1/+7
Protocol version 3 uses server-generated, rather than client-generated, resource ids. Without that, clients could pick conflicting resource ids. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: pass multi_clients to vtest_rendererChia-I Wu4-4/+13
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: use server-generated res ids since version 3Chia-I Wu2-7/+30
VCMD_RESOURCE_CREATE and VCMD_RESOURCE_CREATE2 use and return server-generated ids since version 3. The client id must be 0. This makes the commands work more like linux's DRM_IOCTL_VIRTGPU_RESOURCE_CREATE. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vtest: assign vtest_resource unique server-generated idChia-I Wu1-20/+68
This paves the way for a protcol change where the server will generate resource ids. This also improves our error handling by switching from FREE to vtest_unref_resource. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05virgl: add VIRGL_RENDERER_NO_VIRGLChia-I Wu3-14/+34
It disables vrend renderer. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05virgl: add support for venus rendererChia-I Wu6-7/+80
Add VIRGL_RENDERER_VENUS and the related bits. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vkr: add experimental venus rendererChia-I Wu3-0/+4129
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vkr: add vkr_ringChia-I Wu3-0/+363
In addition to virgl_renderer_submit_cmd, vkr_ring can also be used to submit commands. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vkr: add a command stream parserChia-I Wu4-0/+696
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vkr: add generated venus protocol headersChia-I Wu12-0/+46007
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05vkr: prepare meson for venus rendererChia-I Wu4-0/+24
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05gallium: optimize util_hash_table_u64 for 64-bit buildsChia-I Wu1-0/+39
On 64-bit builds, we can store uint64_t keys in pointers directly and there is no need to malloc/free. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05gallium: add util_hash_table_u64Chia-I Wu2-0/+116
util_hash_table_u64 is a wrapper to util_hash_table with uint64_t keys. This is similar to hash_table_u64 in mesa. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-05gallium: copy xxhash.h from MesaChia-I Wu2-0/+1445
Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-04-01meson: bump version numbervirglrenderer-0.9.00.9.0Gert Wollny1-3/+3
v2: Update SO version
2021-04-01p_config: remove code to detect architecture now done by mesonLeo1-27/+0
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Acked-by: Rohan Garg <rohan.garg@collabora.com>
2021-04-01meson: use meson to create PIPE_ARCH_<ARCH>Leo1-0/+7
v2: Remove use of system() (Gert) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Acked-by: Rohan Garg <rohan.garg@collabora.com>
2021-04-01pipe: use meson's config.h to get PIPE_ARCH_<ENDIANESS>_ENDIANLeo3-49/+12
v2: - Add root build dir and src to include path (Gert) - fix gallium includes (Gert) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Acked-by: Rohan Garg <rohan.garg@collabora.com>
2021-04-01meson: set PIPE_ARCH_<ENDIANESS>_ENDIAN via mesonLeo2-0/+30
v2: - remove unused debug_enabled (Gert) - use cpu_family() instead of system() Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Acked-by: Rohan Garg <rohan.garg@collabora.com>
2021-03-30formats: Fix typos in astc format handling.Lepton Wu1-1/+2
This fixes regression in various astc format related dEQP tests. Fixes: 51d4d37 ("formats:add astc 2d compressed format support") Signed-off-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-03-23vrend: silence warnings when compiling with egl disabledGert Wollny2-0/+16
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-03-15virgl: add support for EGL device selectionDominik Behr8-4/+223
and init flag for preferring discrete GPU. Modify GBM selection to prefer integrated GPU for display. Report "different GPU" back to client to enable drawable shadowing. Allocate linear GBM buffers to make them shareable between different devices. Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-15vrend: BGRX between texture and EGL image is not copy compatibleDominik Behr3-6/+33
When virglrenderer creates VIRGL_FORMAT_B8G8R8X8_UNORM texture, it uses internal format GL_BGRA_EXT. When Mesa imports dma_buf VIRGL_FORMAT_B8G8R8X8_UNORM/DRM|GBM_FORMAT_XRGB8888 it uses internal format GL_RGB8. These formats are not copy compatible. Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-12vrend: fix fence polling without sync threadChia-I Wu1-9/+11
This was regressed by commit 3a2a537c (vrend: hook up per-context fencing internally), bisected by Gert. When there is no sync thread, vrend_renderer_check_fences checks fences on vrend_state.fence_list for signaled ones and call ctx->fence_retire on them. Because fences belonging to the same context are ordered, as an optimization, we ideally want to call ctx->fence_retire only on the last fence of those belonging to the same context. (Note we are close to that but not quite because we want to avoid complex changes until virgl starts using per-context fencing, if ever) The issue is in need_fence_retire_signal_locked. It has this check if (fence->fences.next == &vrend_state.fence_list) return true; which says that, if the fence is the last one in vrend_state.fence_list, call ctx->fence_retire (because it must be the last fence of some context). The check is incorrect because not all fences on the list have signaled when the sync thread is not used. It will fail when there are also unsignaled fences on the list. To fix the issue, we contruct a list of signaled fences first before calling need_fence_retire_signal_locked. We could merge the paths with and without sync thread further because the non-sync-thread path just needs this extra step to construct a list of signaled fences. But we will save that for future and focus on fixing the performance regression. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-11virgl: check buffer size to ensure no unsigned wraparound happensGert Wollny2-2/+6
Make sure that the passed buffer size is not negative and that evaluating the buffer size in bytes doesn't overflow. With that we make sure that the buf_offset in the decoding loop can't wrap around when it is updated. v2: - move check to virgl_renderer_submit_cmd (Chia-I) - remove the size conversion on both ends v3: - keep conversion to size in bytes (Chia-I) - explicitely convert to uint32_t to silence a warning Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2021-03-10perf: update mesa configuration flags to silence warningsGert Wollny1-12/+12
"true" and "false" are now "enabled" and "disabled" Thanks Rohan Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-10shader: lazy host shader variant compilationRyan Neph1-29/+43
Avoids compiling shader variants in the host driver if they will never be used for rendering. Wait to register shaders with the host GL driver until after shader dependencies have been resolved and the selected set of variants is known to be used for rendering. The cost of this workaround is taht TGSI to GLSL conversion is still performed for every variant (observed to happen twice for every vertex/fragment shader in some cases), but this is expected to be much cheaper than calling out to the host driver to compile unused variants. Workaround for #180. Signed-off-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-10shader: resolve shader dependencies before program linkingRyan Neph1-0/+16
Shader programs are submitted for linking in the host driver twice as frequently as for native applications due to circular shader dependencies, immediate TGSI conversion, and explicit shader variant selection ordering at draw-time. Circular dependencies are resolved by re-running shader variant selection twice before emitting calling glUseProgram() in the host. The cost of this workaround is that GLSL is still emitted to the host driver for compilation into intermediate/native instructions even for unused shader variants, but the extraneous linking has been eliminated. Workaround for #180. v2: changed shader select order on second pass; only select frag shader once. Signed-off-by: Ryan Neph <ryanneph@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2021-03-09vrend: check external blob use before using glBufferStorageGurchetan Singh1-1/+1
Reviewed-by: Ryan Neph <ryanneph@google.com>
2021-03-09vrend: Emit string markers that begin with BEGIN: and END: as tracing scopeGert Wollny1-0/+12
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
2021-03-09tracing: Add macros to emit begin and end markers seperatelyGert Wollny1-0/+8
This is useful when one wants to trace events like frame begin and end Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Rohan Garg <rohan.garg@collabora.com>