diff options
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_screen.h | 36 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 8 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index b6623d1dd71..462b683cd75 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -358,6 +358,42 @@ struct pipe_screen { enum pipe_format format, int max, uint64_t *modifiers, unsigned int *external_only, int *count); + + /** + * Create a memory object from a winsys handle + * + * The underlying memory is most often allocated in by a foregin API. + * Then the underlying memory object is then exported through interfaces + * compatible with EXT_external_resources. + * + * Note: For DRM_API_HANDLE_TYPE_FD handles, the caller retains ownership + * of the fd. + * + * \param handle A handle representing the memory object to import + */ + struct pipe_memory_object *(*memobj_create_from_handle)(struct pipe_screen *screen, + struct winsys_handle *handle, + bool dedicated); + + /** + * Destroy a memory object + * + * \param memobj The memory object to destroy + */ + void (*memobj_destroy)(struct pipe_screen *screen, + struct pipe_memory_object *memobj); + + /** + * Create a texture from a memory object + * + * \param t texture template + * \param memobj The memory object used to back the texture + */ + struct pipe_resource * (*resource_from_memobj)(struct pipe_screen *screen, + const struct pipe_resource *t, + struct pipe_memory_object *memobj, + uint64_t offset); + }; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 15be8cb5d02..86c7751eb18 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -888,6 +888,14 @@ struct pipe_memory_info unsigned nr_device_memory_evictions; /**< # of evictions (monotonic counter) */ }; +/** + * Structure that contains information about external memory + */ +struct pipe_memory_object +{ + bool dedicated; +}; + #ifdef __cplusplus } #endif |