gbm: consistently use the same name for BO flags
authorSimon Ser <contact@emersion.fr>
Mon, 30 Aug 2021 13:43:51 +0000 (15:43 +0200)
committerSimon Ser <contact@emersion.fr>
Thu, 30 Sep 2021 22:02:10 +0000 (00:02 +0200)
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>

src/gbm/main/gbm.c
src/gbm/main/gbm.h

index d81931a..ffe8335 100644 (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);
 }
 
 /**
index 2531fb5..6117b35 100644 (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