vkr: enable supports_blob_id_0 only with VIRGL_RENDERER_RENDER_SERVER

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Chia-I Wu 3 years ago
parent b8362ae7c1
commit 0fdccc2a44
  1. 9
      src/venus/vkr_context.c
  2. 5
      src/venus/vkr_renderer.c
  3. 4
      src/venus/vkr_renderer.h
  4. 2
      src/virglrenderer.c

@ -527,13 +527,6 @@ vkr_context_attach_resource_locked(struct virgl_context *base, struct virgl_reso
}
}
/* TODO When in multi-process mode, we cannot share a virgl_resource as-is
* to another process. The resource must have a valid fd, and only the fd
* and the iov can be sent the other process.
*
* For vrend-to-vkr sharing, we can get the fd from pipe_resource.
*/
att->resource = res;
list_inithead(&att->memories);
@ -700,8 +693,6 @@ vkr_context_create(size_t debug_len, const char *debug_name)
{
struct vkr_context *ctx;
/* TODO inject a proxy context when multi-process */
ctx = calloc(1, sizeof(*ctx));
if (!ctx)
return NULL;

@ -29,7 +29,8 @@ vkr_get_capset(void *capset)
vn_info_extension_spec_version("VK_EXT_command_serialization");
c->vk_mesa_venus_protocol_spec_version =
vn_info_extension_spec_version("VK_MESA_venus_protocol");
c->supports_blob_id_0 = true;
/* TODO always true once Mesa resolves its performance issue */
c->supports_blob_id_0 = (bool)(vkr_renderer_flags & VKR_RENDERER_RENDER_SERVER);
}
return sizeof(*c);
@ -38,8 +39,6 @@ vkr_get_capset(void *capset)
int
vkr_renderer_init(uint32_t flags)
{
/* TODO VKR_RENDERER_MULTI_PROCESS hint */
if ((vkr_renderer_flags & VKR_RENDERER_ASYNC_FENCE_CB) &&
!(vkr_renderer_flags & VKR_RENDERER_THREAD_SYNC))
return -EINVAL;

@ -15,8 +15,8 @@
#include "virgl_util.h"
#define VKR_RENDERER_THREAD_SYNC (1u << 0)
#define VKR_RENDERER_MULTI_PROCESS (1u << 1)
#define VKR_RENDERER_ASYNC_FENCE_CB (1u << 2)
#define VKR_RENDERER_ASYNC_FENCE_CB (1u << 1)
#define VKR_RENDERER_RENDER_SERVER (1u << 2)
struct virgl_context;

@ -706,6 +706,8 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
vkr_flags |= VKR_RENDERER_THREAD_SYNC;
if (flags & VIRGL_RENDERER_ASYNC_FENCE_CB)
vkr_flags |= VKR_RENDERER_ASYNC_FENCE_CB;
if (flags & VIRGL_RENDERER_RENDER_SERVER)
vkr_flags |= VKR_RENDERER_RENDER_SERVER;
ret = vkr_renderer_init(vkr_flags);
if (ret)

Loading…
Cancel
Save