vtest: pass multi_clients to vtest_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>
macos/master
Chia-I Wu 4 years ago
parent 05da5edabb
commit c0c079f19d
  1. 4
      vtest/vtest.h
  2. 2
      vtest/vtest_fuzzer.c
  3. 7
      vtest/vtest_renderer.c
  4. 4
      vtest/vtest_server.c

@ -42,7 +42,9 @@ struct vtest_input {
int (*read)(struct vtest_input *input, void *buf, int size);
};
int vtest_init_renderer(int ctx_flags, const char *render_device);
int vtest_init_renderer(bool multi_clients,
int ctx_flags,
const char *render_device);
void vtest_cleanup_renderer(void);
int vtest_create_context(struct vtest_input *input, int out_fd,

@ -105,7 +105,7 @@ static void vtest_fuzzer_run_renderer(int out_fd, struct vtest_input *input,
break;
}
ret = vtest_init_renderer(ctx_flags, NULL);
ret = vtest_init_renderer(false, ctx_flags, NULL);
if (ret >= 0) {
ret = vtest_create_context(input, out_fd, header[0], &context);
}

@ -75,6 +75,7 @@ struct vtest_context {
struct vtest_renderer {
const char *rendernode_name;
bool multi_clients;
uint32_t max_length;
@ -291,7 +292,9 @@ int vtest_buf_read(struct vtest_input *input, void *buf, int size)
return size;
}
int vtest_init_renderer(int ctx_flags, const char *render_device)
int vtest_init_renderer(bool multi_clients,
int ctx_flags,
const char *render_device)
{
int ret;
@ -307,6 +310,8 @@ int vtest_init_renderer(int ctx_flags, const char *render_device)
return -1;
}
renderer.multi_clients = multi_clients;
return 0;
}

@ -559,7 +559,9 @@ static void vtest_server_run(void)
/* init renderer after the first active client is added */
is_empty = LIST_IS_EMPTY(&server.active_clients);
if (was_empty && !is_empty) {
int ret = vtest_init_renderer(server.ctx_flags, server.render_device);
int ret = vtest_init_renderer(server.multi_clients,
server.ctx_flags,
server.render_device);
if (ret) {
vtest_server_inactivate_clients();
run = false;

Loading…
Cancel
Save