aboutsummaryrefslogtreecommitdiff
path: root/src/virgl_resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/virgl_resource.h')
-rw-r--r--src/virgl_resource.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/virgl_resource.h b/src/virgl_resource.h
index 15efa8fa..42983cdc 100644
--- a/src/virgl_resource.h
+++ b/src/virgl_resource.h
@@ -44,6 +44,16 @@ enum virgl_resource_fd_type {
* and imported into a vrend_decode_ctx to create a vrend_resource.
*
* It is also possible to create a virgl_resource from a context object.
+ *
+ * The underlying storage of a virgl_resource is provided by a pipe_resource
+ * and/or a fd. When it is provided by a pipe_resource, the virgl_resource is
+ * said to be typed because pipe_resource also provides the type information.
+ *
+ * Conventional resources are always typed. Blob resources by definition do
+ * not have nor need type information, but those created from vrend_decode_ctx
+ * objects are typed. That should be considered a convenience rather than
+ * something to be relied upon. Contexts must not assume that every resource is
+ * typed when interop is expected.
*/
struct virgl_resource {
uint32_t res_id;
@@ -56,6 +66,8 @@ struct virgl_resource {
const struct iovec *iov;
int iov_count;
+ uint32_t map_info;
+
void *private_data;
};
@@ -84,20 +96,20 @@ virgl_resource_table_cleanup(void);
void
virgl_resource_table_reset(void);
-int
+struct virgl_resource *
virgl_resource_create_from_pipe(uint32_t res_id,
struct pipe_resource *pres,
const struct iovec *iov,
int iov_count);
-int
+struct virgl_resource *
virgl_resource_create_from_fd(uint32_t res_id,
enum virgl_resource_fd_type fd_type,
int fd,
const struct iovec *iov,
int iov_count);
-int
+struct virgl_resource *
virgl_resource_create_from_iov(uint32_t res_id,
const struct iovec *iov,
int iov_count);