vtest: hook up cmd submit

macos/master
Dave Airlie 10 years ago
parent 437c841b7e
commit f8a2c57692
  1. 1
      vtest/vtest.h
  2. 19
      vtest/vtest_renderer.c
  3. 3
      vtest/vtest_server.c

@ -7,5 +7,6 @@ int vtest_send_caps(void);
int vtest_create_resource(void);
int vtest_resource_unref(void);
int vtest_submit_cmd(uint32_t length_dw);
#endif

@ -93,3 +93,22 @@ int vtest_resource_unref(void)
virgl_renderer_resource_unref(handle);
return 0;
}
int vtest_submit_cmd(uint32_t length_dw)
{
uint32_t *cbuf;
int ret;
cbuf = malloc(length_dw * 4);
if (!cbuf)
return -1;
ret = read(renderer.remote_fd, cbuf, length_dw * 4);
if (ret != length_dw * 4)
return -1;
virgl_renderer_submit_cmd(cbuf, ctx_id, length_dw);
free(cbuf);
return 0;
}

@ -105,6 +105,9 @@ again:
case VCMD_RESOURCE_UNREF:
vtest_resource_unref();
break;
case VCMD_SUBMIT_CMD:
vtest_submit_cmd(header[0]);
break;
default:
break;
}

Loading…
Cancel
Save