add create_buffer_from_prime_fd operation

This commit is contained in:
Vincent Wei
2019-11-19 09:41:13 +08:00
parent add133abd4
commit 8832f051a8
+13 -2
View File
@@ -186,7 +186,7 @@ typedef struct _DriDriverOps {
* with the specified pixel format, width, and height. If succeed,
* a valid DriSurfaceBuffer object will be returned; NULL on error.
*
* \note The driver must implement this operation.
* \note This operation can be NULL.
*/
DriSurfaceBuffer* (* create_buffer_from_handle) (DriDriver *driver,
uint32_t handle, unsigned long size, uint32_t drm_format,
@@ -197,12 +197,23 @@ typedef struct _DriDriverOps {
* with the specified pixel format, width, and height. If succeed,
* a valid DriSurfaceBuffer object will be returned; NULL on error.
*
* \note The driver must implement this operation.
* \note This operation can be NULL.
*/
DriSurfaceBuffer* (* create_buffer_from_name) (DriDriver *driver,
uint32_t name, uint32_t drm_format,
unsigned int width, unsigned int height, unsigned int pitch);
/**
* This operation creates a buffer for the given PRIME file descriptor
* with the specified pixel format, width, height, and pitch. If succeed,
* a valid DriSurfaceBuffer object will be returned; NULL on error.
*
* \note This operation can be NULL.
*/
DriSurfaceBuffer* (* create_buffer_from_prime_fd) (DriDriver *driver,
int prime_fd, unsigned long size, uint32_t drm_format,
unsigned int width, unsigned int height, unsigned int pitch);
/**
* This operation maps the buffer into the current process's virtual memory
* space, and returns the virtual address. If failed, it returns NULL.