aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2018-12-12 10:08:06 -0800
committerGurchetan Singh <[email protected]>2019-04-18 15:38:58 -0700
commit9a638bc7c2626e757321655068169b0cd588d88b (patch)
treeff336d731e6736098c8085afd4023ecf87985ec5 /src/gallium/winsys
parent9881733e328e3b9cb15bdfa9105fd33001cd7182 (diff)
virgl/vtest: plumb support for shared memory
Signed-off-by: Gurchetan Singh <[email protected]> Reviewed-By: Gert Wollny <[email protected]> Reviewed-By: Piotr Rak <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c9
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c3
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h4
3 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
index 5baeaf4c952..71c10d9c523 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
@@ -278,7 +278,8 @@ static int virgl_vtest_send_resource_create2(struct virgl_vtest_winsys *vws,
uint32_t array_size,
uint32_t last_level,
uint32_t nr_samples,
- uint32_t size)
+ uint32_t size,
+ int *out_fd)
{
uint32_t res_create_buf[VCMD_RES_CREATE2_SIZE], vtest_hdr[VTEST_HDR_SIZE];
@@ -299,6 +300,7 @@ static int virgl_vtest_send_resource_create2(struct virgl_vtest_winsys *vws,
virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr));
virgl_block_write(vws->sock_fd, &res_create_buf, sizeof(res_create_buf));
+ *out_fd = -1;
return 0;
}
@@ -314,7 +316,8 @@ int virgl_vtest_send_resource_create(struct virgl_vtest_winsys *vws,
uint32_t array_size,
uint32_t last_level,
uint32_t nr_samples,
- uint32_t size)
+ uint32_t size,
+ int *out_fd)
{
uint32_t res_create_buf[VCMD_RES_CREATE_SIZE], vtest_hdr[VTEST_HDR_SIZE];
@@ -322,7 +325,7 @@ int virgl_vtest_send_resource_create(struct virgl_vtest_winsys *vws,
return virgl_vtest_send_resource_create2(vws, handle, target, format,
bind, width, height, depth,
array_size, last_level,
- nr_samples, size);
+ nr_samples, size, out_fd);
vtest_hdr[VTEST_CMD_LEN] = VCMD_RES_CREATE_SIZE;
vtest_hdr[VTEST_CMD_ID] = VCMD_RESOURCE_CREATE;
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
index 681c0c25e6b..2952189dfb7 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
@@ -231,6 +231,7 @@ virgl_vtest_winsys_resource_create(struct virgl_winsys *vws,
struct virgl_vtest_winsys *vtws = virgl_vtest_winsys(vws);
struct virgl_hw_res *res;
static int handle = 1;
+ int fd = -1;
res = CALLOC_STRUCT(virgl_hw_res);
if (!res)
@@ -256,7 +257,7 @@ virgl_vtest_winsys_resource_create(struct virgl_winsys *vws,
res->size = size;
virgl_vtest_send_resource_create(vtws, handle, target, format, bind,
width, height, depth, array_size,
- last_level, nr_samples, size);
+ last_level, nr_samples, size, &fd);
res->res_handle = handle++;
pipe_reference_init(&res->reference, 1);
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
index 012aa1c98b1..f5d8eb26e7c 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
@@ -73,7 +73,6 @@ struct virgl_hw_res {
uint32_t bind;
boolean cacheable;
int64_t start, end;
-
};
struct virgl_vtest_cmd_buf {
@@ -122,7 +121,8 @@ int virgl_vtest_send_resource_create(struct virgl_vtest_winsys *vws,
uint32_t array_size,
uint32_t last_level,
uint32_t nr_samples,
- uint32_t size);
+ uint32_t size,
+ int *out_fd);
int virgl_vtest_send_resource_unref(struct virgl_vtest_winsys *vws,
uint32_t handle);