Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
986b5fc
fix: build with glibc 2.43
maxiicodes Feb 26, 2026
d37dc80
vkr: add a gbm allocation path without assuming minigbm
zzyiwei Mar 12, 2026
efeb207
vkr: add a debug option to force GBM import
zzyiwei Mar 11, 2026
d1e17bc
proxy/server: SOCK_CLOEXEC and MSG_CMSG_CLOEXEC are optional
zzyiwei Mar 11, 2026
21cf02c
ci: Update trace checksums
Mar 3, 2026
6edfc8b
Uprev Mesa to 7fc6af99ea4ef86e96b098dcd29a52d33fdd915f
Feb 25, 2026
cbdff5f
server: add support for building on macOS
osy Nov 29, 2025
f9788a0
vkr: use nanosleep() on macOS
osy Nov 29, 2025
ce062a0
proxy: support SOCK_STREAM sockets
osy Dec 20, 2025
96bc0cf
proxy: detect socket disconnect on SOCK_STREAM
lucaaamaral Mar 9, 2026
04ed113
server: fix kqueue non-blocking mode on macOS
lucaaamaral Mar 7, 2026
5d4ba45
proxy/server: rename is_seqpacket to is_valid with platform checks
lucaaamaral Mar 17, 2026
a09222f
server: udpate docs for main for Linux specifics
zzyiwei Mar 19, 2026
bbe178b
server: supports parsing worker context args
zzyiwei Mar 19, 2026
2bef09b
server: allow cleanly spawn subprocess
zzyiwei Mar 20, 2026
7a6d61a
vkr: roll metal vulkan header
zzyiwei Mar 20, 2026
0c3fa5b
vtest: avoid leaking workers on threadpool fini
zzyiwei Mar 26, 2026
cdcfb72
vtest: threadpool to robustly handle spurious wakeups
zzyiwei Mar 26, 2026
485c018
vkr: handle spurious wakeups in ring notify cnd_wait
zzyiwei Mar 26, 2026
be2b86c
vkr: handle spurious wakeups in ring monitor thread
zzyiwei Mar 26, 2026
79ed6bb
server: posix_spawn worker process for macOS Metal
lucaaamaral Mar 7, 2026
be2ace7
ci: Update trace checksums
Mar 23, 2026
5cfd01b
Uprev Mesa to cc4492204894c0488e96a93f51b546345ae32f88
Mar 23, 2026
4e19e99
renderer: fix cases of wrong cursor orientation
Apr 14, 2026
23d4e31
vrend: free sync thread before fences on init failure
julizhan Apr 17, 2026
d4ffc44
virglrenderer: check for NULL resource before dereferencing it
Apr 21, 2026
85dd6cb
vkr: add macOS Vulkan library loading
lucaaamaral Mar 7, 2026
161e9fd
build: add Objective-C, Metal framework, and helper wrappers for macOS
lucaaamaral Mar 7, 2026
7812c37
vkr: detect and inject Metal extensions on macOS
lucaaamaral Apr 8, 2026
15f1669
proxy: use fstat for SHM fd size validation
lucaaamaral Mar 9, 2026
5488b9c
anon_file: add macOS shm_open() path
lucaaamaral Apr 8, 2026
e526766
vkr: implement Metal shared memory allocation on macOS
lucaaamaral Apr 8, 2026
8263ab2
vkr: assign vkr_allocator.instance when instance creation succeeds
zzyiwei Apr 24, 2026
05e5338
vrend/shader: Don't emit precise/invariant TCS predefined block outputs
gerddie Apr 29, 2026
b52cbef
ci: Update virgl expectations
digetx Apr 29, 2026
1161d28
venus: use __APPLE__ guard for consistency
zzyiwei Apr 27, 2026
3ca4a77
vulkan: add vulkan_beta.h header
osy Nov 29, 2025
a2d0553
vkr: add vkr_allocator_global_proc_table_init helper
zzyiwei Apr 29, 2026
fbc3fe4
vkr: support portability enumeration
osy Nov 29, 2025
f8a0903
vkr: refactor to drop __APPLE__ guard for extension enablement
zzyiwei Apr 29, 2026
51b9a7c
vkr: use portability subset extension if available
osy Nov 29, 2025
3716881
vrend: Ensure sampler view and framebuffer attachment swizzle conditi…
aaron-ruby Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variables:
#
# Pick a pipeline on https://gitlab.freedesktop.org/mesa/mesa/-/pipelines/
#
MESA_PIPELINE_ID: 1610924
MESA_PIPELINE_ID: 1646089

MESA_PROJECT_PATH: mesa/mesa
S3_JWT_FILE: /s3_jwt
Expand Down Expand Up @@ -59,7 +59,7 @@ include:
# IMPORTANT: Use a recent Mesa Git revision
# The commit ref must be in sync with the pipeline picked above
# It can be found on the pipeline page below the commit message
ref: 2fa85edd75a4dac145ca9fee78dbe56207aa6870
ref: cc4492204894c0488e96a93f51b546345ae32f88
file:
- '/.gitlab-ci/image-tags.yml'

Expand Down
18 changes: 9 additions & 9 deletions .gitlab-ci/expectations/virt/traces-virgl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ traces:
checksum: f8eba0fec6e3e0af9cb09844bc73bdc8
gputest/furmark-v2.trace:
gl-virgl:
checksum: 8b34d61f34f9c98201a8f5947ab4a667
checksum: 9fc8c1c66d1ab89f5c91101daaf5573d
gputest/triangle-v2.trace:
gl-virgl:
checksum: b1a1224b949c3ea133e7d2a06b8d294f
Expand All @@ -18,7 +18,7 @@ traces:
checksum: 7691e87a06e5c8baf9e0c0ca6381775b
0ad/0ad-v2.trace:
gl-virgl:
checksum: 6379222413b517861b70e2550337795e
checksum: 9c91dc2a05e140f8233e7f5f3a4b4f11
gputest/gimark-v2.trace:
gl-virgl:
label: [crash]
Expand All @@ -30,7 +30,7 @@ traces:
checksum: 837b834310e2e6bd784e3202c6c0bed7
gputest/pixmark-volplosion-v2.trace:
gl-virgl:
checksum: d006b8b713db2dc0a968d95dd4ff10b7
checksum: bcaa3938ca6cdc3a6ac0f4da518ff9a9
gputest/plot3d-v2.trace:
gl-virgl:
checksum: c4a35b0635bbe3fd6693c33814ff5059
Expand All @@ -45,7 +45,7 @@ traces:
checksum: fd4fadc9c537e0f10f82c767fc95ff5e
humus/DynamicBranching3-v2.trace:
gl-virgl:
checksum: b96191174fc9487a8b399fad734cd2e7
checksum: 401178849862615598c7962f0d497e20
humus/HDR-v2.trace:
gl-virgl:
checksum: a81ae5282a5d2612f05fc4da2c84e7a0
Expand Down Expand Up @@ -81,10 +81,10 @@ traces:
checksum: 67161dca3527e5769bc02d84bb9a7bce
supertuxkart/supertuxkart-mansion-egl-gles-v2.trace:
gl-virgl:
checksum: 1f3b873a320587256d7392ddc8162ae2
checksum: 0809d2721da25b08f71ab361dac75a7d
xonotic/xonotic-keybench-high-v2.trace:
gl-virgl:
checksum: 2d2f319615062eb7cc10dfa8d7a66333
checksum: dc84733cd92584b50dcb7f6b9e57ccce
valve/counterstrike-v2.trace:
gl-virgl:
checksum: 0d32696d18e2cea024a11c252e059002
Expand All @@ -94,10 +94,10 @@ traces:
label: [skip, flakes]
valve/half-life-2-v2.trace:
gl-virgl:
checksum: 4299337c370be2523421d17cab387778
checksum: f88af44c333473dd37661a3da0708226
valve/portal-2-v2.trace:
gl-virgl:
checksum: 8974f30da49259a3e5f9ff268e366787
checksum: 6a793fde53b7d43e28805cfbd48996fa
supertuxkart/supertuxkart-antediluvian-abyss.rdc:
gl-virgl:
label: [crash]
Expand All @@ -109,7 +109,7 @@ traces:
label: [crash]
godot/Material Testers.x86_64_2020.04.08_13.38_frame799.rdc:
gl-virgl:
checksum: 9855a7ccdab2cd66a59964aba43bf7df
checksum: 7ba4f0c52a719d94b805653d31ce22d7
ror/ror-default.trace:
gl-virgl:
label: [crash]
Expand Down
1 change: 1 addition & 0 deletions .gitlab-ci/expectations/virt/venus-fails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.multiple_interpolation

# uprev Mesa in Virglrenderer
dEQP-VK.sparse_resources.image_block_shapes.2d.g8b8g8r8_422_unorm.samples_1,Fail
dEQP-VK.wsi.direct_drm.swapchain.private_data.image_usage,Crash

2 changes: 2 additions & 0 deletions .gitlab-ci/expectations/virt/virgl-gles-fails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3097,6 +3097,8 @@ KHR-GL30.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singles
KHR-GL30.texture_lod_bias.texture_lod_bias_all,Fail
KHR-GL31.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit,Fail
KHR-GL32.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit,Fail
KHR-GL32.packed_depth_stencil.blit.depth24_stencil8,Fail
KHR-GL32.packed_depth_stencil.blit.depth32f_stencil8,Fail
KHR-GL32.texture_lod_bias.texture_lod_bias_all,Fail
spec@!opengl 1.1@depthstencil-default_fb-blit samples=6,Fail
spec@!opengl 1.1@depthstencil-default_fb-blit samples=8,Fail
Expand Down
27 changes: 24 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.1')
error('When using GCC, version 4.1 or later is required.')
endif

with_host_windows = host_machine.system() == 'windows'
with_host_darwin = host_machine.system() == 'darwin'

warnings = [
'-Werror=enum-int-mismatch',
'-Werror=implicit-function-declaration',
Expand All @@ -79,9 +82,6 @@ add_project_arguments(cc.get_supported_arguments(flags), language : 'c')

prog_python = import('python').find_installation('python3')

with_host_windows = host_machine.system() == 'windows'
with_host_darwin = host_machine.system() == 'darwin'

not_found = dependency('', required: false)
gbm_dep = not_found
thread_dep = dependency('threads')
Expand Down Expand Up @@ -349,6 +349,13 @@ with_venus = get_option('venus')
with_render_server = with_venus
with_render_server_worker = get_option('render-server-worker')
render_server_install_dir = get_option('prefix') / get_option('libexecdir')
if with_venus and with_host_darwin
add_languages('objc', required: true)
objcc = meson.get_compiler('objc')
add_project_arguments(objcc.get_supported_arguments(warnings), language : 'objc')
add_project_arguments(objcc.get_supported_arguments(flags), language : 'objc')
endif

if with_venus
venus_dep = []
if get_option('vulkan-dload')
Expand All @@ -365,6 +372,16 @@ if with_venus
epoll_dep = []
endif

if with_host_darwin
venus_dep += declare_dependency(
compile_args : ['-DVK_USE_PLATFORM_METAL_EXT', '-DVK_ENABLE_BETA_EXTENSIONS'],
dependencies : [
dependency('appleframeworks', modules: ['Metal'], required: true),
dependency('appleframeworks', modules: ['Foundation'], required: true),
],
)
endif

conf_data.set('ENABLE_VENUS', 1)
conf_data.set('ENABLE_RENDER_SERVER', 1)
conf_data.set('RENDER_SERVER_EXEC_PATH',
Expand Down Expand Up @@ -418,6 +435,10 @@ configure_file(input : 'config.h.meson',

add_project_arguments('-imacros', meson.current_build_dir() / 'config.h', language : 'c')
add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
if with_venus and with_host_darwin
add_project_arguments('-imacros', meson.current_build_dir() / 'config.h', language : 'objc')
add_project_arguments('-DHAVE_CONFIG_H=1', language : 'objc')
endif

inc_configuration = include_directories(['.', 'src'])

Expand Down
11 changes: 7 additions & 4 deletions server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
* up a socket pair, with one end owned by the worker and the other end sent
* to and owned by the client process.
*
* A worker can be a subprocess forked from the server process, or a thread
* created by the server process. When a worker is a subprocess, the
* subprocess returns from render_server_main and enters render_context_main.
*
* When a worker is a thread, the thread enters render_context_main directly
* from its start function. In this case, render_context_main must be
* thread-safe.
*
* When a worker is a process,
* - On Linux, it's a subprocess forked from the server process. It returns
* from render_server_main and enters render_context_main.
* - On macOS, the worker is posix_spawn'd with --worker-context-* args.
* render_server_main parses these, skips the server loop, and returns
* with ctx_args.valid set for render_context_main.
*/
int
main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion server/render_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ render_client_create_context(struct render_client *client,
if (rec->worker)
ctx_fd = -1; /* ownership transferred */
#else
rec->worker = render_worker_create(srv->worker_jail, NULL, NULL, 0);
rec->worker = render_worker_create(srv->worker_jail, NULL,
&ctx_args, sizeof(ctx_args));
#endif
if (!rec->worker) {
render_log("failed to create a context worker");
Expand Down
13 changes: 13 additions & 0 deletions server/render_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,17 @@ union render_context_op_request {
struct render_context_op_submit_fence_request submit_fence;
};

#ifdef __APPLE__
/**
* When we do not have SOCK_SEQPACKET support, we need to manage framing.
* This will be sent as the header of each packet when necessary.
*/
struct render_context_socket_header {
union {
uint32_t length;
uint8_t b[sizeof(uint32_t)];
};
};
#endif /* __APPLE__ */

#endif /* RENDER_PROTOCOL_H */
63 changes: 61 additions & 2 deletions server/render_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <unistd.h>

#include "render_client.h"
#include "render_context.h"
#include "render_worker.h"

#define RENDER_SERVER_MAX_WORKER_COUNT 256
Expand Down Expand Up @@ -61,6 +62,9 @@ render_server_poll(UNUSED struct render_server *srv,
static bool
render_server_run(struct render_server *srv)
{
if (srv->state == RENDER_SERVER_STATE_SUBPROCESS)
return true;

struct render_client *client = srv->client;

struct pollfd poll_fds[RENDER_SERVER_POLL_COUNT];
Expand Down Expand Up @@ -105,6 +109,10 @@ render_server_parse_options(struct render_server *srv, int argc, char **argv)
OPT_WORKER_SECCOMP_BPF,
OPT_WORKER_SECCOMP_MINIJAIL_POLICY,
OPT_WORKER_SECCOMP_MINIJAIL_LOG,
OPT_WORKER_CONTEXT_INIT_FLAGS,
OPT_WORKER_CONTEXT_ID,
OPT_WORKER_CONTEXT_NAME,
OPT_WORKER_CONTEXT_FD,
OPT_COUNT,
};
static const struct option options[] = {
Expand All @@ -114,6 +122,11 @@ render_server_parse_options(struct render_server *srv, int argc, char **argv)
OPT_WORKER_SECCOMP_MINIJAIL_POLICY },
{ "worker-seccomp-minijail-log", no_argument, NULL,
OPT_WORKER_SECCOMP_MINIJAIL_LOG },
{ "worker-context-init-flags", required_argument, NULL,
OPT_WORKER_CONTEXT_INIT_FLAGS },
{ "worker-context-id", required_argument, NULL, OPT_WORKER_CONTEXT_ID },
{ "worker-context-name", required_argument, NULL, OPT_WORKER_CONTEXT_NAME },
{ "worker-context-fd", required_argument, NULL, OPT_WORKER_CONTEXT_FD },
{ NULL, 0, NULL, 0 }
};
static_assert(OPT_COUNT <= 'z', "");
Expand All @@ -136,6 +149,19 @@ render_server_parse_options(struct render_server *srv, int argc, char **argv)
case OPT_WORKER_SECCOMP_MINIJAIL_LOG:
srv->worker_seccomp_minijail_log = true;
break;
case OPT_WORKER_CONTEXT_INIT_FLAGS:
srv->context_args->init_flags = atoi(optarg);
break;
case OPT_WORKER_CONTEXT_ID:
srv->context_args->ctx_id = atoi(optarg);
break;
case OPT_WORKER_CONTEXT_NAME:
snprintf(srv->context_args->ctx_name, sizeof(srv->context_args->ctx_name), "%s",
optarg);
break;
case OPT_WORKER_CONTEXT_FD:
srv->context_args->ctx_fd = atoi(optarg);
break;
default:
render_log("unknown option specified");
return false;
Expand All @@ -148,12 +174,35 @@ render_server_parse_options(struct render_server *srv, int argc, char **argv)
return false;
}

if (srv->client_fd < 0 || !render_socket_is_seqpacket(srv->client_fd)) {
render_log("no valid client fd specified");
if (srv->client_fd < 0 && srv->context_args->ctx_fd < 0) {
render_log("no socket fd specified");
return false;
}

if (srv->client_fd >= 0 && srv->context_args->ctx_fd >= 0) {
render_log("multiple socket fds specified");
goto fail;
}

if (srv->client_fd >= 0 && !render_socket_is_valid(srv->client_fd)) {
render_log("client fd is invalid");
goto fail;
}

if (srv->context_args->ctx_fd >= 0 &&
!render_socket_is_valid(srv->context_args->ctx_fd)) {
render_log("context fd is invalid");
goto fail;
}

return true;

fail:
if (srv->client_fd >= 0)
close(srv->client_fd);
if (srv->context_args->ctx_fd >= 0)
close(srv->context_args->ctx_fd);
return false;
}

static bool
Expand All @@ -162,6 +211,9 @@ render_server_init(struct render_server *srv,
char **argv,
struct render_context_args *ctx_args)
{
memset(ctx_args, 0, sizeof(*ctx_args));
ctx_args->ctx_fd = -1;

memset(srv, 0, sizeof(*srv));
srv->state = RENDER_SERVER_STATE_RUN;
srv->context_args = ctx_args;
Expand All @@ -170,6 +222,13 @@ render_server_init(struct render_server *srv,
if (!render_server_parse_options(srv, argc, argv))
return false;

if (srv->context_args->ctx_fd >= 0) {
assert(srv->client_fd < 0);
srv->context_args->valid = true;
srv->state = RENDER_SERVER_STATE_SUBPROCESS;
return true;
}

enum render_worker_jail_seccomp_filter seccomp_filter =
RENDER_WORKER_JAIL_SECCOMP_NONE;
const char *seccomp_path = NULL;
Expand Down
Loading