summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2024-10-17 15:24:47 +0000
committer Alec Mouri <alecmouri@google.com> 2024-11-11 17:49:04 +0000
commit94cd7bf910db555b6cc550d61d1e715b5b242d5f (patch)
tree93f11813fc9a0c3f9602579365203aaabcf9c3fa
parente23f11cc12bc88c25c29cba6b8e44bf4938ab6a8 (diff)
Add DISPLAY_BT2020 dataspace
This already exists in AIDL, and will exist in the SDK Bug: 355264141 Flag: EXEMPT NDK can't be flagged! Test: builds Change-Id: I32fd0e9d5c58363393d5217211d1f5fe9e14f86b
-rw-r--r--libs/nativewindow/ANativeWindow.cpp2
-rw-r--r--libs/nativewindow/include/android/data_space.h7
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index ac3a832168..5ce4076476 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -222,6 +222,8 @@ int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpa
static_cast<int>(HAL_DATASPACE_BT2020_ITU_HLG));
static_assert(static_cast<int>(ADATASPACE_DEPTH) == static_cast<int>(HAL_DATASPACE_DEPTH));
static_assert(static_cast<int>(ADATASPACE_DYNAMIC_DEPTH) == static_cast<int>(HAL_DATASPACE_DYNAMIC_DEPTH));
+ static_assert(static_cast<int>(ADATASPACE_DISPLAY_BT2020) ==
+ static_cast<int>(HAL_DATASPACE_DISPLAY_BT2020));
if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
return -EINVAL;
diff --git a/libs/nativewindow/include/android/data_space.h b/libs/nativewindow/include/android/data_space.h
index 8056d9ac4f..295a307c3c 100644
--- a/libs/nativewindow/include/android/data_space.h
+++ b/libs/nativewindow/include/android/data_space.h
@@ -578,6 +578,13 @@ enum ADataSpace : int32_t {
*/
ADATASPACE_BT2020_ITU_HLG = 302383104, // ADATASPACE_STANDARD_BT2020 | ADATASPACE_TRANSFER_HLG |
// ADATASPACE_RANGE_LIMITED
+ /**
+ * sRGB-encoded BT. 2020
+ *
+ * Uses full range, sRGB transfer and BT2020 standard.
+ */
+ ADATASPACE_DISPLAY_BT2020 = 142999552, // ADATASPACE_STANDARD_BT2020 | ADATASPACE_TRANSFER_SRGB
+ // | ADATASPACE_RANGE_FULL
/**
* Depth