aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2020-05-22 14:55:29 -0700
committerKristian H. Kristensen <[email protected]>2020-05-26 12:46:18 -0700
commit09efdccf4a83c62e632020e8a425eba67de8dc43 (patch)
tree70443f5e68be00806fba237270a0c0c51c7856c5
parentc26317ebd6c42fcd70a63c2a95d04f11f3c15bd5 (diff)
egl/android: Move get_format under HAVE_DRM_GRALLOC guard where it's used
src/egl/drivers/dri2/platform_android.c:159:12: warning: unused function 'get_format' [-Wunused-function] Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
-rw-r--r--src/egl/drivers/dri2/platform_android.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 6f90fd46688..eee336cca93 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -156,26 +156,6 @@ static int get_fourcc(int native)
return -1;
}
-static int get_format(int format)
-{
- switch (format) {
- case HAL_PIXEL_FORMAT_BGRA_8888: return __DRI_IMAGE_FORMAT_ARGB8888;
- case HAL_PIXEL_FORMAT_RGB_565: return __DRI_IMAGE_FORMAT_RGB565;
- case HAL_PIXEL_FORMAT_RGBA_8888: return __DRI_IMAGE_FORMAT_ABGR8888;
- case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
- /*
- * HACK: Hardcode this to RGBX_8888 as per cros_gralloc hack.
- * TODO: Revert this once https://issuetracker.google.com/32077885 is fixed.
- */
- case HAL_PIXEL_FORMAT_RGBX_8888: return __DRI_IMAGE_FORMAT_XBGR8888;
- case HAL_PIXEL_FORMAT_RGBA_FP16: return __DRI_IMAGE_FORMAT_ABGR16161616F;
- case HAL_PIXEL_FORMAT_RGBA_1010102: return __DRI_IMAGE_FORMAT_ABGR2101010;
- default:
- _eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", format);
- }
- return -1;
-}
-
/* returns # of fds, and by reference the actual fds */
static unsigned
get_native_buffer_fds(struct ANativeWindowBuffer *buf, int fds[3])
@@ -960,6 +940,26 @@ droid_create_image_from_prime_fds(_EGLDisplay *disp, _EGLContext *ctx,
}
#ifdef HAVE_DRM_GRALLOC
+static int get_format(int format)
+{
+ switch (format) {
+ case HAL_PIXEL_FORMAT_BGRA_8888: return __DRI_IMAGE_FORMAT_ARGB8888;
+ case HAL_PIXEL_FORMAT_RGB_565: return __DRI_IMAGE_FORMAT_RGB565;
+ case HAL_PIXEL_FORMAT_RGBA_8888: return __DRI_IMAGE_FORMAT_ABGR8888;
+ case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
+ /*
+ * HACK: Hardcode this to RGBX_8888 as per cros_gralloc hack.
+ * TODO: Revert this once https://issuetracker.google.com/32077885 is fixed.
+ */
+ case HAL_PIXEL_FORMAT_RGBX_8888: return __DRI_IMAGE_FORMAT_XBGR8888;
+ case HAL_PIXEL_FORMAT_RGBA_FP16: return __DRI_IMAGE_FORMAT_ABGR16161616F;
+ case HAL_PIXEL_FORMAT_RGBA_1010102: return __DRI_IMAGE_FORMAT_ABGR2101010;
+ default:
+ _eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", format);
+ }
+ return -1;
+}
+
static _EGLImage *
droid_create_image_from_name(_EGLDisplay *disp, _EGLContext *ctx,
struct ANativeWindowBuffer *buf)