diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c index 5c722add96a..2d646e0e515 100644 --- a/src/gbm/main/gbm.c +++ b/src/gbm/main/gbm.c @@ -498,7 +498,7 @@ gbm_bo_create_with_modifiers(struct gbm_device *gbm, const unsigned int count) { return gbm_bo_create_with_modifiers2(gbm, width, height, format, modifiers, - count, 0); + count, GBM_BO_USE_SCANOUT); } GBM_EXPORT struct gbm_bo * @@ -649,7 +649,8 @@ gbm_surface_create_with_modifiers(struct gbm_device *gbm, const unsigned int count) { return gbm_surface_create_with_modifiers2(gbm, width, height, format, - modifiers, count, 0); + modifiers, count, + GBM_BO_USE_SCANOUT); } GBM_EXPORT struct gbm_surface * diff --git a/src/gbm/main/gbm_abi_check.c b/src/gbm/main/gbm_abi_check.c index f1137be7baf..feca0998d9d 100644 --- a/src/gbm/main/gbm_abi_check.c +++ b/src/gbm/main/gbm_abi_check.c @@ -46,8 +46,13 @@ * -Add a new block of checks in main() */ -/* From: 49a7331cb02 - James Jones - gbm: Version the backend interface */ -#define GBM_BACKEND_ABI_VERSION_abi0 0 +/* + * From: Simon Ser - "gbm: assume USE_SCANOUT in create_with_modifiers" + * + * Note: ABI 1 is identical to ABI 0, except gbm_device_v0.bo_create can + * provide both modifiers and usage. + */ +#define GBM_BACKEND_ABI_VERSION_abi0 1 struct gbm_device_v0_abi0 { const struct gbm_backend_desc *backend_desc; uint32_t backend_version; diff --git a/src/gbm/main/gbm_backend_abi.h b/src/gbm/main/gbm_backend_abi.h index 962ee74f003..222ce3404cb 100644 --- a/src/gbm/main/gbm_backend_abi.h +++ b/src/gbm/main/gbm_backend_abi.h @@ -72,7 +72,7 @@ struct gbm_backend_desc; * Core ABI version: 4 * ABI version of a buffer object created by a device from the backend: 4 */ -#define GBM_BACKEND_ABI_VERSION 0 +#define GBM_BACKEND_ABI_VERSION 1 /** * GBM device interface corresponding to GBM_BACKEND_ABI_VERSION = 0 @@ -113,6 +113,10 @@ struct gbm_device_v0 { uint32_t format, uint64_t modifier); + /** + * Since version 1, usage is properly populated when modifiers are + * supplied. Version 0 always set usage to 0 in this case. + */ struct gbm_bo *(*bo_create)(struct gbm_device *gbm, uint32_t width, uint32_t height, uint32_t format, @@ -137,6 +141,10 @@ struct gbm_device_v0 { uint64_t (*bo_get_modifier)(struct gbm_bo *bo); void (*bo_destroy)(struct gbm_bo *bo); + /** + * Since version 1, flags are properly populated when modifiers are + * supplied. Version 0 always set flags to 0 in this case. + */ struct gbm_surface *(*surface_create)(struct gbm_device *gbm, uint32_t width, uint32_t height, uint32_t format, uint32_t flags,