gbm: Move gbm_format_canonicalize() to the core.
authorEric Anholt <eric@anholt.net>
Thu, 8 Nov 2018 17:57:32 +0000 (09:57 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 12 Nov 2018 23:20:23 +0000 (15:20 -0800)
I want it for the format name debugging code.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
src/gbm/backends/dri/gbm_dri.c
src/gbm/main/gbm.c
src/gbm/main/gbmint.h

index 35ec3a1c3a2a1911cf4043229cf7aa7a26f0c091..f32c0cd9885f201b8f148d9f0cd2f7ca6544a753 100644 (file)
@@ -594,22 +594,6 @@ static const struct gbm_dri_visual gbm_dri_visuals_table[] = {
    },
 };
 
    },
 };
 
-/* The two GBM_BO_FORMAT_[XA]RGB8888 formats alias the GBM_FORMAT_*
- * formats of the same name. We want to accept them whenever someone
- * has a GBM format, but never return them to the user. */
-static int
-gbm_format_canonicalize(uint32_t gbm_format)
-{
-   switch (gbm_format) {
-   case GBM_BO_FORMAT_XRGB8888:
-      return GBM_FORMAT_XRGB8888;
-   case GBM_BO_FORMAT_ARGB8888:
-      return GBM_FORMAT_ARGB8888;
-   default:
-      return gbm_format;
-   }
-}
-
 static int
 gbm_format_to_dri_format(uint32_t gbm_format)
 {
 static int
 gbm_format_to_dri_format(uint32_t gbm_format)
 {
index 0bf2922bacdd408035049111cf30a464d3dfc010..d301661b48ee4330cb965aff3fa105b709df44c3 100644 (file)
@@ -695,3 +695,19 @@ gbm_surface_has_free_buffers(struct gbm_surface *surf)
 {
    return surf->gbm->surface_has_free_buffers(surf);
 }
 {
    return surf->gbm->surface_has_free_buffers(surf);
 }
+
+/* The two GBM_BO_FORMAT_[XA]RGB8888 formats alias the GBM_FORMAT_*
+ * formats of the same name. We want to accept them whenever someone
+ * has a GBM format, but never return them to the user. */
+uint32_t
+gbm_format_canonicalize(uint32_t gbm_format)
+{
+   switch (gbm_format) {
+   case GBM_BO_FORMAT_XRGB8888:
+      return GBM_FORMAT_XRGB8888;
+   case GBM_BO_FORMAT_ARGB8888:
+      return GBM_FORMAT_ARGB8888;
+   default:
+      return gbm_format;
+   }
+}
index 9220a4ae87da8e9bd485498cb38ec6a53a08c754..192577431e2550b6738c04cf12f1dd4880e115a9 100644 (file)
@@ -133,4 +133,7 @@ struct gbm_backend {
    struct gbm_device *(*create_device)(int fd);
 };
 
    struct gbm_device *(*create_device)(int fd);
 };
 
+uint32_t
+gbm_format_canonicalize(uint32_t gbm_format);
+
 #endif
 #endif