gbm: consistently use the same name for BO flags

We were sometimes using "usage", sometimes using "flags". Let's
just use "flags" everywhere (since the enum is named gbm_bo_flags).

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3197>
This commit is contained in:
Simon Ser 2021-08-30 15:43:51 +02:00
parent 85c38d192f
commit 76d64d2a3e
2 changed files with 11 additions and 11 deletions

View File

@ -70,7 +70,7 @@ gbm_device_get_backend_name(struct gbm_device *gbm)
*
* \param gbm The created buffer manager
* \param format The format to test
* \param usage A bitmask of the usages to test the format against
* \param flags A bitmask of the usages to test the format against
* \return 1 if the format is supported otherwise 0
*
* \sa enum gbm_bo_flags for the list of flags that the format can be
@ -80,9 +80,9 @@ gbm_device_get_backend_name(struct gbm_device *gbm)
*/
GBM_EXPORT int
gbm_device_is_format_supported(struct gbm_device *gbm,
uint32_t format, uint32_t usage)
uint32_t format, uint32_t flags)
{
return gbm->v0.is_format_supported(gbm, format, usage);
return gbm->v0.is_format_supported(gbm, format, flags);
}
/** Get the number of planes that are required for a given format+modifier
@ -469,7 +469,7 @@ gbm_bo_destroy(struct gbm_bo *bo)
* \param height The height for the buffer
* \param format The format to use for the buffer, from GBM_FORMAT_* or
* GBM_BO_FORMAT_* tokens
* \param usage The union of the usage flags for this buffer
* \param flags The union of the usage flags for this buffer
*
* \return A newly allocated buffer that should be freed with gbm_bo_destroy()
* when no longer needed. If an error occurs during allocation %NULL will be
@ -480,14 +480,14 @@ gbm_bo_destroy(struct gbm_bo *bo)
GBM_EXPORT struct gbm_bo *
gbm_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t usage)
uint32_t format, uint32_t flags)
{
if (width == 0 || height == 0) {
errno = EINVAL;
return NULL;
}
return gbm->v0.bo_create(gbm, width, height, format, usage, NULL, 0);
return gbm->v0.bo_create(gbm, width, height, format, flags, NULL, 0);
}
GBM_EXPORT struct gbm_bo *
@ -529,7 +529,7 @@ gbm_bo_create_with_modifiers(struct gbm_device *gbm,
* \param gbm The gbm device returned from gbm_create_device()
* \param type The type of object we're importing
* \param buffer Pointer to the external object
* \param usage The union of the usage flags for this buffer
* \param flags The union of the usage flags for this buffer
*
* \return A newly allocated buffer object that should be freed with
* gbm_bo_destroy() when no longer needed. On error, %NULL is returned
@ -539,9 +539,9 @@ gbm_bo_create_with_modifiers(struct gbm_device *gbm,
*/
GBM_EXPORT struct gbm_bo *
gbm_bo_import(struct gbm_device *gbm,
uint32_t type, void *buffer, uint32_t usage)
uint32_t type, void *buffer, uint32_t flags)
{
return gbm->v0.bo_import(gbm, type, buffer, usage);
return gbm->v0.bo_import(gbm, type, buffer, flags);
}
/**

View File

@ -257,7 +257,7 @@ gbm_device_get_backend_name(struct gbm_device *gbm);
int
gbm_device_is_format_supported(struct gbm_device *gbm,
uint32_t format, uint32_t usage);
uint32_t format, uint32_t flags);
int
gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm,
@ -309,7 +309,7 @@ struct gbm_import_fd_modifier_data {
struct gbm_bo *
gbm_bo_import(struct gbm_device *gbm, uint32_t type,
void *buffer, uint32_t usage);
void *buffer, uint32_t flags);
/**
* Flags to indicate the type of mapping for the buffer - these are