It gives clients access to virgl_renderer_context_create_with_flags.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
Comparing to VCMD_GET_{CAPS,CAPS2}, it allows any capset id/version
to be queried.
This is similar to linux's DRM_IOCTL_VIRTGPU_GET_CAPS.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
There is no parameter defined yet, but the command can be used to query
optional features. It also allows new features to be introduced without
bumping up the protocol version.
This is similar to linux's DRM_IOCTL_VIRTGPU_GETPARAM.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
Move virgl_renderer_context_create call from vtest_create_context to
the new vtest_lazy_init_context. This defers context initialization
until the first command after VCMD_CREATE_RENDERER.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
This commit moves input/out_fd into vtest_context to allow multiple
clients, where each client is represented by a vtest_context and has
its own vtest_input.
Note that clients must know and trust each other, especially when it
comes to resources. There is no conflict or ownership check in
vtest_create_resource or vtest_resource_unref respectively yet.
There is also no resource sharing support yet.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>
A vtest_renderer is still global, but it can now have multiple
vtest_contexts. vtest_create_renderer is replaced by
vtest_init_renderer
vtest_create_context
vtest_set_current_context
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>
Fixes:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
In systems with more then one graphics card the rendernode is currently
picked based on the order in which they are listed in /dev/dri. Add an
command line option and a environment variable to make it possible to
specify the render node explicitely.
Fixes#135
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Allow input to be changed from reading from a socket.
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This means we can change them a bit more easily, for instance... from
command-line arguments!
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Turns out some files managed to have a mix between 2, 3, 4 and tabs for
indenting. The only way to really fix this was to do just a single commit
that fixes all of them.
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
run_renderer now uses an array to get the corresponding function
pointer for a command.
Some vtest_* function headers had to be uniformized.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Nathan Gauer <nathan@gauer.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
With the main aim of making vtest's usage of virglrenderer more similar
to that of QEMU, this patch sets a backing store to each resource and
reads from or writes to at each transfer operation.
v2: - Instead of adding a callback on resource destruction, free the
iovec when we unref a resource as we know that we won't be doing
anything else with it. (Dave Airlie)
v3: - Store pointers to iovecs in the global to also release them
v4: - Add new commands for resource creation and transfers, to be used
when protocol version >= 1.
v5: - Replaced the global array of iovecs with a hash table because some
es31 tests create thousands of resources and reach any sane limit.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit negotiates a common protocol version with the clients,
allowing for backwards compatibility on both sides.
v2: - Negotiate the version in a new command, so the client can probe
for its existence and stay compatible with older servers. (Dave
Airlie)
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
As we don't have yet a proper way of negotiating a common protocol
version to use between clients and the server, we introduce a command
without reply arguments that allows us to figure out if the server is
new enough to handle negotiation of the protocol version.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
I've come up with a workaround on the mesa side that should be
backwards compatible with old vtests and vice-versa.
It involves sending both caps 2 and 1 queries back to back,
and taking the first response an indication of what to expect,
v1.1: Check max_size is > 0 before mallocing
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
This is useful to do some quite accurate comparative
benchmarks/profiling, and to run fuzzers, such as american fuzzy lop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
The idea is to have a unix socket and possible shmem protocol
between a renderering server and local gallium sw driver.
This could be used to validate virgl without qemu with piglit.