summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c8
-rw-r--r--src/gbm/backends/dri/gbm_driint.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index d6ac956aef..1a08a35429 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -444,6 +444,7 @@ gbm_dri_surface_get_bo(struct gbm_surface *_surf)
if (bo == NULL)
return NULL;
+ bo->dri_buffer = dri_buffer;
bo->base.base.gbm = _surf->gbm;
bo->base.base.width = _surf->width;
bo->base.base.height = _surf->height;
@@ -465,6 +466,13 @@ gbm_dri_surface_get_bo(struct gbm_surface *_surf)
static void
gbm_dri_surface_release_bo(struct gbm_surface *_surf, struct gbm_bo *_bo)
{
+ struct gbm_dri_surface *surf = gbm_dri_surface(_surf);
+ struct gbm_dri_bo *bo = gbm_dri_bo(_bo);
+
+ if (surf->release_buffer && bo->dri_buffer)
+ surf->release_buffer(surf, bo->dri_buffer, surf->dri_private);
+
+ bo->dri_buffer = NULL;
}
static void
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index 8853251b04..3551be3921 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -72,12 +72,14 @@ struct gbm_dri_bo {
struct gbm_drm_bo base;
__DRIimage *image;
+ __DRIbuffer *dri_buffer;
};
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 *);
void *dri_private;
};