aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri/gbm_driint.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/backends/dri/gbm_driint.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/backends/dri/gbm_driint.h')
-rw-r--r--src/gbm/backends/dri/gbm_driint.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index d801a081375..514b5a620c1 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -61,6 +61,15 @@ struct gbm_dri_bo {
__DRIimage *image;
};
+struct gbm_dri_surface {
+ struct gbm_surface base;
+
+ __DRIbuffer *(*get_front_buffer)(struct gbm_dri_surface *, void *);
+ void (*release_buffer)(struct gbm_dri_surface *, __DRIbuffer *, void *);
+ int (*has_free_buffers)(void *);
+ void *dri_private;
+};
+
static inline struct gbm_dri_device *
gbm_dri_device(struct gbm_device *gbm)
{
@@ -73,6 +82,12 @@ gbm_dri_bo(struct gbm_bo *bo)
return (struct gbm_dri_bo *) bo;
}
+static inline struct gbm_dri_surface *
+gbm_dri_surface(struct gbm_surface *surface)
+{
+ return (struct gbm_dri_surface *) surface;
+}
+
char *
dri_fd_get_driver_name(int fd);