|
|
|
@ -65,14 +65,25 @@ int vtest_block_read(int fd, void *buf, int size) |
|
|
|
|
return size; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int vtest_create_renderer(int fd) |
|
|
|
|
int vtest_create_renderer(int fd, uint32_t length) |
|
|
|
|
{ |
|
|
|
|
const char *vtestname = "vtestname"; |
|
|
|
|
char *vtestname; |
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
renderer.remote_fd = fd; |
|
|
|
|
|
|
|
|
|
virgl_renderer_init(&renderer, VIRGL_RENDERER_USE_EGL, &vtest_cbs); |
|
|
|
|
|
|
|
|
|
vtestname = malloc(length); |
|
|
|
|
if (!vtestname) |
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
ret = vtest_block_read(renderer.remote_fd, vtestname, length); |
|
|
|
|
if (ret != length) |
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
fprintf(stderr, "string len is %d: %s\n", length, vtestname); |
|
|
|
|
|
|
|
|
|
ret = virgl_renderer_context_create(ctx_id, strlen(vtestname), vtestname); |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|