summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-10 02:23:24 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-10 02:23:24 +0000
commit50b25fabc5c1773da32ac6bed1085601f9109a8c (patch)
treeb2e02233017f8fa087bf664fe6af4f06117d08b3
parent8721fee81bd07219b3920761c496e33642ce0bcb (diff)
parentf9cd2d476921a03f8c131dfcfd79382a638747bd (diff)
Snap for 9586404 from f9cd2d476921a03f8c131dfcfd79382a638747bd to udc-release
Change-Id: I9a3d75fb2e2ddcac05a0dd576af9dfeabafedc52
-rw-r--r--gralloc4/src/Android.bp4
-rw-r--r--gralloc4/src/core/Android.bp6
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp3
-rw-r--r--gralloc4/src/core/mali_gralloc_formats.cpp36
-rw-r--r--gralloc4/src/mali_gralloc_formats.h3
5 files changed, 10 insertions, 42 deletions
diff --git a/gralloc4/src/Android.bp b/gralloc4/src/Android.bp
index 11514e1..3511d12 100644
--- a/gralloc4/src/Android.bp
+++ b/gralloc4/src/Android.bp
@@ -55,10 +55,6 @@ cc_library_shared {
cflags: [
"-DGRALLOC_LIBRARY_BUILD=1",
"-Wthread-safety",
- /* Minimum buffer dimensions in pixels when buffer will use AFBC */
- /* TODO: set this via BoardConfig */
- "-DGRALLOC_DISP_W=0",
- "-DGRALLOC_DISP_H=0",
],
static_libs: [
"libgralloc_capabilities",
diff --git a/gralloc4/src/core/Android.bp b/gralloc4/src/core/Android.bp
index a3c81c2..b2e5ca3 100644
--- a/gralloc4/src/core/Android.bp
+++ b/gralloc4/src/core/Android.bp
@@ -40,12 +40,6 @@ arm_gralloc_core_cc_defaults {
defaults: [
"arm_gralloc_defaults",
],
- cflags: [
- /* Minimum buffer dimensions in pixels when buffer will use AFBC */
- /* TODO: set this via BoardConfig */
- "-DGRALLOC_DISP_W=0",
- "-DGRALLOC_DISP_H=0",
- ],
soong_config_variables: {
gralloc_ion_sync_on_lock: {
cflags: [
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
index 49fbb2c..f76bcf9 100644
--- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
+++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
@@ -1023,8 +1023,7 @@ int mali_gralloc_derive_format_and_size(buffer_descriptor_t * const bufDescripto
*/
bufDescriptor->alloc_format = mali_gralloc_select_format(bufDescriptor->hal_format,
bufDescriptor->format_type,
- usage,
- bufDescriptor->width * bufDescriptor->height);
+ usage);
if (bufDescriptor->alloc_format == MALI_GRALLOC_FORMAT_INTERNAL_UNDEFINED)
{
MALI_GRALLOC_LOGE("ERROR: Unrecognized and/or unsupported format (%s 0x%" PRIx64 ") and usage (%s 0x%" PRIx64 ")",
diff --git a/gralloc4/src/core/mali_gralloc_formats.cpp b/gralloc4/src/core/mali_gralloc_formats.cpp
index b9f78e2..1baaada 100644
--- a/gralloc4/src/core/mali_gralloc_formats.cpp
+++ b/gralloc4/src/core/mali_gralloc_formats.cpp
@@ -892,7 +892,6 @@ static uint64_t get_afbc_format(const uint32_t base_format,
* @param consumers [in] Consumers (flags).
* @param producer_active_caps [out] Active producer capabilities (flags).
* @param consumer_active_caps [out] Active consumer capabilities (flags).
- * @param buffer_size [in] Buffer resolution (w x h, in pixels).
*
* @return none.
*/
@@ -900,8 +899,7 @@ static void get_active_caps(const format_info_t format,
const uint16_t producers,
const uint16_t consumers,
uint64_t * const producer_active_caps,
- uint64_t * const consumer_active_caps,
- const int buffer_size)
+ uint64_t * const consumer_active_caps)
{
const uint64_t producer_caps = (producer_active_caps) ? *producer_active_caps : 0;
const uint64_t consumer_caps = (consumer_active_caps) ? *consumer_active_caps : 0;
@@ -956,24 +954,6 @@ static void get_active_caps(const format_info_t format,
}
}
- bool afbc_allowed = false;
- afbc_allowed = buffer_size > (192 * 192);
-
- if (consumers & MALI_GRALLOC_CONSUMER_DPU)
- {
- /* TODO: make this into an option in BoardConfig */
-#if GRALLOC_DISP_W != 0 && GRALLOC_DISP_H != 0
-#define GRALLOC_AFBC_MIN_SIZE 40
- /* Disable AFBC based on buffer dimensions */
- afbc_allowed = ((buffer_size * 100) / (GRALLOC_DISP_W * GRALLOC_DISP_H)) >= GRALLOC_AFBC_MIN_SIZE;
-#endif
- }
-
- if (!afbc_allowed)
- {
- consumer_mask &= ~MALI_GRALLOC_FORMAT_CAPABILITY_AFBCENABLE_MASK;
- }
-
if (producer_active_caps)
{
*producer_active_caps &= producer_mask;
@@ -1043,8 +1023,7 @@ bool get_supported_format(const uint32_t base_format,
consumer_nodpu_caps = get_consumer_caps(consumers_nodpu);
get_active_caps(formats[fmt_idx],
producers, consumers_nodpu,
- NULL, &consumer_nodpu_caps,
- 0 /* N/A without DPU consumer */);
+ NULL, &consumer_nodpu_caps);
fmt_supported->f_flags = is_format_supported(fmt_idx,
ip_fmt_idx,
@@ -1472,6 +1451,10 @@ uint32_t get_base_format(const uint64_t req_format,
{
base_format = HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B;
}
+ else if (usage & (GRALLOC_USAGE_HW_VIDEO_ENCODER | GRALLOC_USAGE_HW_VIDEO_DECODER))
+ {
+ base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN;
+ }
}
/* Obtain a valid base format, optionally mapped to internal. Flex formats
@@ -1489,7 +1472,6 @@ uint32_t get_base_format(const uint64_t req_format,
* @param req_format [in] Format (base + optional modifiers) requested by client.
* @param type [in] Format type (public usage or internal).
* @param usage [in] Buffer usage.
- * @param buffer_size [in] Buffer resolution (w x h, in pixels).
*
* @return alloc_format, format to be used in allocation;
* MALI_GRALLOC_FORMAT_INTERNAL_UNDEFINED, where no suitable
@@ -1497,8 +1479,7 @@ uint32_t get_base_format(const uint64_t req_format,
*/
uint64_t mali_gralloc_select_format(const uint64_t req_format,
const mali_gralloc_format_type type,
- const uint64_t usage,
- const int buffer_size)
+ const uint64_t usage)
{
uint64_t alloc_format = MALI_GRALLOC_FORMAT_INTERNAL_UNDEFINED;
@@ -1582,8 +1563,7 @@ uint64_t mali_gralloc_select_format(const uint64_t req_format,
get_active_caps(formats[req_fmt_idx],
producers, consumers,
- &producer_active_caps, &consumer_active_caps,
- buffer_size);
+ &producer_active_caps, &consumer_active_caps);
MALI_GRALLOC_LOGV("Producer caps (active): 0x%" PRIx64 ", Consumer caps (active): 0x%" PRIx64,
producer_active_caps, consumer_active_caps);
diff --git a/gralloc4/src/mali_gralloc_formats.h b/gralloc4/src/mali_gralloc_formats.h
index 246cae6..0d16a50 100644
--- a/gralloc4/src/mali_gralloc_formats.h
+++ b/gralloc4/src/mali_gralloc_formats.h
@@ -364,8 +364,7 @@ void mali_gralloc_adjust_dimensions(const uint64_t internal_format,
uint64_t mali_gralloc_select_format(const uint64_t req_format,
const mali_gralloc_format_type type,
- const uint64_t usage,
- const int buffer_size);
+ const uint64_t usage);
bool is_subsampled_yuv(const uint32_t base_format);
#endif