aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm/main/gbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gbm/main/gbm.c')
-rw-r--r--src/gbm/main/gbm.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index afcca63da3a..7bacd8b86a6 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -369,9 +369,28 @@ gbm_bo_create(struct gbm_device *gbm,
return NULL;
}
- return gbm->bo_create(gbm, width, height, format, usage);
+ return gbm->bo_create(gbm, width, height, format, usage, NULL, 0);
}
+GBM_EXPORT struct gbm_bo *
+gbm_bo_create_with_modifiers(struct gbm_device *gbm,
+ uint32_t width, uint32_t height,
+ uint32_t format,
+ const uint64_t *modifiers,
+ const unsigned int count)
+{
+ if (width == 0 || height == 0) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if ((count && !modifiers) || (modifiers && !count)) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ return gbm->bo_create(gbm, width, height, format, 0, modifiers, count);
+}
/**
* Create a gbm buffer object from an foreign object
*
@@ -477,7 +496,23 @@ gbm_surface_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags)
{
- return gbm->surface_create(gbm, width, height, format, flags);
+ return gbm->surface_create(gbm, width, height, format, flags, NULL, 0);
+}
+
+GBM_EXPORT struct gbm_surface *
+gbm_surface_create_with_modifiers(struct gbm_device *gbm,
+ uint32_t width, uint32_t height,
+ uint32_t format,
+ const uint64_t *modifiers,
+ const unsigned int count)
+{
+ if ((count && !modifiers) || (modifiers && !count)) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ return gbm->surface_create(gbm, width, height, format, 0,
+ modifiers, count);
}
/**