From a43d286ef7ff65087b1f051d071b829ca7b02073 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 28 Mar 2014 10:17:11 -0700 Subject: gbm: Add import from fd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new import type that lets us create a gbm bo from a DMA-BUF file descriptor. Signed-off-by: Kristian Høgsberg --- src/gbm/main/gbm.c | 1 + src/gbm/main/gbm.h | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src/gbm/main') diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c index ad5208ca136..6179e5b830d 100644 --- a/src/gbm/main/gbm.c +++ b/src/gbm/main/gbm.c @@ -362,6 +362,7 @@ gbm_bo_create(struct gbm_device *gbm, * * GBM_BO_IMPORT_WL_BUFFER * GBM_BO_IMPORT_EGL_IMAGE + * GBM_BO_IMPORT_FD * * The the gbm bo shares the underlying pixels but its life-time is * independent of the foreign object. diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h index 9e0c7705ea8..92d472a0762 100644 --- a/src/gbm/main/gbm.h +++ b/src/gbm/main/gbm.h @@ -232,6 +232,15 @@ gbm_bo_create(struct gbm_device *gbm, #define GBM_BO_IMPORT_WL_BUFFER 0x5501 #define GBM_BO_IMPORT_EGL_IMAGE 0x5502 +#define GBM_BO_IMPORT_FD 0x5503 + +struct gbm_import_fd_data { + int fd; + uint32_t width; + uint32_t height; + uint32_t stride; + uint32_t format; +}; struct gbm_bo * gbm_bo_import(struct gbm_device *gbm, uint32_t type, -- cgit v1.2.3