summaryrefslogtreecommitdiffstats
path: root/src/gbm/main/gbmint.h
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <[email protected]>2012-01-25 16:24:14 +0200
committerKristian Høgsberg <[email protected]>2012-03-28 22:14:34 -0400
commit0d1ef1f57f9011fd2bc3354d60fb19db29af7363 (patch)
tree101590eab7d5ee8654d093393431983974c85ee5 /src/gbm/main/gbmint.h
parent7f16246acef4089570abca76a59580691ec6cf68 (diff)
gbm: Add gbm_surface interface
The idea here is to be able to create an egl window surface from a gbm_surface. This avoids the need for the surfaceless extension and lets the EGL platform handle buffer allocation, while keeping the user in charge of somehow presenting the buffers (using kms page flipping, for example). gbm_surface_lock_front_buffer() locks a surface's front buffer and returns a gbm bo representing it. This bo should later be returned to the gbm surface using gbm_surface_release_buffer().
Diffstat (limited to 'src/gbm/main/gbmint.h')
-rw-r--r--src/gbm/main/gbmint.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h
index 66c4c41cf8e..53d73f40df6 100644
--- a/src/gbm/main/gbmint.h
+++ b/src/gbm/main/gbmint.h
@@ -59,18 +59,27 @@ struct gbm_device {
void (*destroy)(struct gbm_device *gbm);
int (*is_format_supported)(struct gbm_device *gbm,
- enum gbm_bo_format format,
+ uint32_t format,
uint32_t usage);
struct gbm_bo *(*bo_create)(struct gbm_device *gbm,
uint32_t width, uint32_t height,
- enum gbm_bo_format format,
+ uint32_t format,
uint32_t usage);
struct gbm_bo *(*bo_create_from_egl_image)(struct gbm_device *gbm,
void *egl_dpy, void *egl_img,
uint32_t width, uint32_t height,
uint32_t usage);
void (*bo_destroy)(struct gbm_bo *bo);
+
+ struct gbm_surface *(*surface_create)(struct gbm_device *gbm,
+ uint32_t width, uint32_t height,
+ uint32_t format, uint32_t flags);
+ struct gbm_bo *(*surface_lock_front_buffer)(struct gbm_surface *surface);
+ void (*surface_release_buffer)(struct gbm_surface *surface,
+ struct gbm_bo *bo);
+ int (*surface_has_free_buffers)(struct gbm_surface *surface);
+ void (*surface_destroy)(struct gbm_surface *surface);
};
/**
@@ -87,6 +96,14 @@ struct gbm_bo {
union gbm_bo_handle handle;
};
+struct gbm_surface {
+ struct gbm_device *gbm;
+ uint32_t width;
+ uint32_t height;
+ uint32_t format;
+ uint32_t flags;
+};
+
struct gbm_backend {
const char *backend_name;
struct gbm_device *(*create_device)(int fd);