/*
- * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
drv_usage = gbm_convert_flags(usage);
- return drv_is_combination_supported(gbm->drv, format, drv_usage,
- DRM_FORMAT_MOD_NONE);
+ return (drv_get_combination(gbm->drv, format, drv_usage) != NULL);
}
PUBLIC struct gbm_device *gbm_create_device(int fd)
return bo;
}
+PUBLIC 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,
+ uint32_t count)
+{
+ struct gbm_bo *bo;
+
+ bo = gbm_bo_new(gbm, format);
+
+ if (!bo)
+ return NULL;
+
+ bo->bo = drv_bo_create_with_modifiers(gbm->drv,
+ width, height, format,
+ modifiers, count);
+
+ if (!bo->bo) {
+ free(bo);
+ return NULL;
+ }
+
+ return bo;
+}
+
PUBLIC void gbm_bo_destroy(struct gbm_bo *bo)
{
if (bo->destroy_user_data) {