|
|
@ -189,6 +189,32 @@ int testvirgl_create_backed_simple_2d_res(struct virgl_resource *res, |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int testvirgl_create_backed_simple_1d_res(struct virgl_resource *res, |
|
|
|
|
|
|
|
int handle) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct virgl_renderer_resource_create_args args; |
|
|
|
|
|
|
|
uint32_t backing_size; |
|
|
|
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testvirgl_init_simple_1d_resource(&args, handle); |
|
|
|
|
|
|
|
ret = virgl_renderer_resource_create(&args, NULL, 0); |
|
|
|
|
|
|
|
ck_assert_int_eq(ret, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res->handle = handle; |
|
|
|
|
|
|
|
res->base.target = args.target; |
|
|
|
|
|
|
|
res->base.format = args.format; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
backing_size = args.width * util_format_get_blocksize(res->base.format); |
|
|
|
|
|
|
|
res->iovs = malloc(sizeof(struct iovec)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res->iovs[0].iov_base = malloc(backing_size); |
|
|
|
|
|
|
|
res->iovs[0].iov_len = backing_size; |
|
|
|
|
|
|
|
res->niovs = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virgl_renderer_resource_attach_iov(res->handle, res->iovs, res->niovs); |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void testvirgl_destroy_backed_res(struct virgl_resource *res) |
|
|
|
void testvirgl_destroy_backed_res(struct virgl_resource *res) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct iovec *iovs; |
|
|
|
struct iovec *iovs; |
|
|
|