From 767c5388899aa02de3eadf0c8a2c4906968e1285 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Sat, 5 May 2018 00:42:12 +0000 Subject: [PATCH] Revert "minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 292da5365a373a8e1eed603fc3aa16e3595d8252. Reason for revert: The Android framework uses successful allocation of HAL_PIXEL_FORMAT_RGBA_FP16 to test for wide-gamut capabilities. We don't want to advertise this, so let's revert. android.graphics.cts.BitmapColorSpaceTest#test16bitHardware can pass if the framework falls back to RGBA8888, as is the plan. Original change's description: > minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16 > > This is needed to support the following CTS test: > > android.graphics.cts.BitmapColorSpaceTest#test16bitHardware > > There have been some rumblings about adding 64-bit formats to : > > https://lists.freedesktop.org/archives/intel-gvt-dev/2017-July/001469.html > > However, nothing has landed, so let's just define our own format > for the time being. > > BUG=b:77973662 > TEST=Compile for kevin and kevin-arcnext > Unfortunately, my P setup refuses to work, so let the lab > test. > > Change-Id: I1fea16400ba6632a8ef17105e27bc7799d2af515 > Reviewed-on: https://chromium-review.googlesource.com/1029355 > Commit-Ready: Gurchetan Singh > Tested-by: Gurchetan Singh > Reviewed-by: Gurchetan Singh Bug: b:77973662 Change-Id: I9e4b79b06dd565189a2e783e8453f08af173d84c Reviewed-on: https://chromium-review.googlesource.com/1045805 Commit-Ready: Gurchetan Singh Tested-by: Gurchetan Singh Reviewed-by: Stéphane Marchesin Reviewed-by: Gurchetan Singh --- amdgpu.c | 6 +++--- cros_gralloc/cros_gralloc_helpers.cc | 2 -- cros_gralloc/cros_gralloc_helpers.h | 4 ---- drv.h | 1 - helpers.c | 13 ++----------- i915.c | 10 +++++----- mediatek.c | 6 +++--- rockchip.c | 6 +++--- 8 files changed, 16 insertions(+), 32 deletions(-) diff --git a/amdgpu.c b/amdgpu.c index b01967a..3bf5eb2 100644 --- a/amdgpu.c +++ b/amdgpu.c @@ -33,9 +33,9 @@ struct amdgpu_priv { int drm_version; }; -const static uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, - DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, - DRM_FORMAT_XBGR16161616, DRM_FORMAT_XRGB8888 }; +const static uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XRGB8888 }; const static uint32_t texture_source_formats[] = { DRM_FORMAT_GR88, DRM_FORMAT_R8, DRM_FORMAT_NV21, DRM_FORMAT_NV12, DRM_FORMAT_YVU420_ANDROID }; diff --git a/cros_gralloc/cros_gralloc_helpers.cc b/cros_gralloc/cros_gralloc_helpers.cc index 4c9c68f..c09c2b5 100644 --- a/cros_gralloc/cros_gralloc_helpers.cc +++ b/cros_gralloc/cros_gralloc_helpers.cc @@ -26,8 +26,6 @@ uint32_t cros_gralloc_convert_format(int format) return DRM_FORMAT_RGB888; case HAL_PIXEL_FORMAT_RGBA_8888: return DRM_FORMAT_ABGR8888; - case HAL_PIXEL_FORMAT_RGBA_FP16: - return DRM_FORMAT_XBGR16161616; case HAL_PIXEL_FORMAT_RGBX_8888: return DRM_FORMAT_XBGR8888; case HAL_PIXEL_FORMAT_YCbCr_420_888: diff --git a/cros_gralloc/cros_gralloc_helpers.h b/cros_gralloc/cros_gralloc_helpers.h index 3e160ad..a55eebc 100644 --- a/cros_gralloc/cros_gralloc_helpers.h +++ b/cros_gralloc/cros_gralloc_helpers.h @@ -14,10 +14,6 @@ #include #include -#if ANDROID_VERSION < 0x0900 -#define HAL_PIXEL_FORMAT_RGBA_FP16 0x16 -#endif - constexpr uint32_t cros_gralloc_magic = 0xABCDDCBA; constexpr uint32_t handle_data_size = ((sizeof(struct cros_gralloc_handle) - offsetof(cros_gralloc_handle, fds[0])) / sizeof(int)); diff --git a/drv.h b/drv.h index 876f13a..67d763e 100644 --- a/drv.h +++ b/drv.h @@ -50,7 +50,6 @@ extern "C" { */ #define DRM_FORMAT_NONE fourcc_code('0', '0', '0', '0') -#define DRM_FORMAT_XBGR16161616 fourcc_code('9', '9', '9', '6') #define DRM_FORMAT_YVU420_ANDROID fourcc_code('9', '9', '9', '7') #define DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED fourcc_code('9', '9', '9', '8') #define DRM_FORMAT_FLEX_YCbCr_420_888 fourcc_code('9', '9', '9', '9') diff --git a/helpers.c b/helpers.c index c67787f..eaaa937 100644 --- a/helpers.c +++ b/helpers.c @@ -55,13 +55,6 @@ static const struct planar_layout packed_4bpp_layout = { .bytes_per_pixel = { 4 } }; -static const struct planar_layout packed_8bpp_layout = { - .num_planes = 1, - .horizontal_subsampling = { 1 }, - .vertical_subsampling = { 1 }, - .bytes_per_pixel = { 8 } -}; - static const struct planar_layout biplanar_yuv_420_layout = { .num_planes = 2, .horizontal_subsampling = { 1, 2 }, @@ -144,9 +137,6 @@ static const struct planar_layout *layout_from_format(uint32_t format) case DRM_FORMAT_XRGB8888: return &packed_4bpp_layout; - case DRM_FORMAT_XBGR16161616: - return &packed_8bpp_layout; - default: drv_log("UNKNOWN FORMAT %d\n", format); return NULL; @@ -193,7 +183,8 @@ uint32_t drv_stride_from_format(uint32_t format, uint32_t width, size_t plane) const struct planar_layout *layout = layout_from_format(format); assert(plane < layout->num_planes); - uint32_t plane_width = DIV_ROUND_UP(width, layout->horizontal_subsampling[plane]); + uint32_t plane_width = + DIV_ROUND_UP(width, layout->horizontal_subsampling[plane]); uint32_t stride = plane_width * layout->bytes_per_pixel[plane]; /* diff --git a/i915.c b/i915.c index ff88321..8e1871a 100644 --- a/i915.c +++ b/i915.c @@ -22,11 +22,11 @@ #define I915_CACHELINE_SIZE 64 #define I915_CACHELINE_MASK (I915_CACHELINE_SIZE - 1) -static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB1555, - DRM_FORMAT_ARGB8888, DRM_FORMAT_RGB565, - DRM_FORMAT_XBGR2101010, DRM_FORMAT_XBGR8888, - DRM_FORMAT_XBGR16161616, DRM_FORMAT_XRGB1555, - DRM_FORMAT_XRGB2101010, DRM_FORMAT_XRGB8888 }; +static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB1555, + DRM_FORMAT_ARGB8888, DRM_FORMAT_RGB565, + DRM_FORMAT_XBGR2101010, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XRGB1555, DRM_FORMAT_XRGB2101010, + DRM_FORMAT_XRGB8888 }; static const uint32_t tileable_texture_source_formats[] = { DRM_FORMAT_GR88, DRM_FORMAT_R8, DRM_FORMAT_UYVY, DRM_FORMAT_YUYV }; diff --git a/mediatek.c b/mediatek.c index 379a119..cfb60b3 100644 --- a/mediatek.c +++ b/mediatek.c @@ -23,9 +23,9 @@ struct mediatek_private_map_data { void *gem_addr; }; -static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, - DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, - DRM_FORMAT_XBGR16161616, DRM_FORMAT_XRGB8888 }; +static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XRGB8888 }; static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID }; diff --git a/rockchip.c b/rockchip.c index dfa1324..a0d9141 100644 --- a/rockchip.c +++ b/rockchip.c @@ -23,9 +23,9 @@ struct rockchip_private_map_data { void *gem_addr; }; -static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, - DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, - DRM_FORMAT_XBGR16161616, DRM_FORMAT_XRGB8888 }; +static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XRGB8888 }; static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_NV12, DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID };