diff options
| -rw-r--r-- | cmds/dumpstate/Android.bp | 1 | ||||
| -rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 7 | ||||
| -rw-r--r-- | cmds/installd/utils.cpp | 2 | ||||
| -rw-r--r-- | include/android/sharedmem.h | 3 | ||||
| -rw-r--r-- | libs/binder/ndk/include_ndk/android/binder_interface_utils.h | 6 | ||||
| -rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 9 | ||||
| -rw-r--r-- | services/surfaceflinger/RenderEngine/ProgramCache.cpp | 14 | ||||
| -rw-r--r-- | vulkan/vkjson/vkjson_instance.cc | 2 |
8 files changed, 25 insertions, 19 deletions
diff --git a/cmds/dumpstate/Android.bp b/cmds/dumpstate/Android.bp index e185cbe94c..9aa10750e1 100644 --- a/cmds/dumpstate/Android.bp +++ b/cmds/dumpstate/Android.bp @@ -121,7 +121,6 @@ cc_binary { "kill", "librank", "logcat", - "logcompressor", "lsmod", "lsof", "netstat", diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 860a68b273..e336232aed 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -775,7 +775,7 @@ binder::Status InstalldNativeService::fixupAppData(const std::unique_ptr<std::st PLOG(WARNING) << "Failed to chmod " << p->fts_path; } } - // Intentional fall through to also set GID + [[fallthrough]]; // also set GID case FTS_F: if (chown(p->fts_path, -1, expected) != 0) { PLOG(WARNING) << "Failed to chown " << p->fts_path; @@ -1412,7 +1412,7 @@ static void collectManualExternalStatsForUser(const std::string& path, struct st && !strcmp(p->fts_parent->fts_parent->fts_parent->fts_name, "Android")) { p->fts_number = 1; } - // Fall through to count the directory + [[fallthrough]]; // to count the directory case FTS_DEFAULT: case FTS_F: case FTS_SL: @@ -1827,13 +1827,14 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std: } } } - // Fall through to always count against total + [[fallthrough]]; // always count against total case FTS_D: // Ignore data belonging to specific apps p->fts_number = p->fts_parent->fts_number; if (p->fts_level == 1 && !strcmp(p->fts_name, "Android")) { p->fts_number = 1; } + [[fallthrough]]; // always count against total case FTS_DEFAULT: case FTS_SL: case FTS_SLNONE: diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp index 1ff45e4845..8672206d17 100644 --- a/cmds/installd/utils.cpp +++ b/cmds/installd/utils.cpp @@ -974,7 +974,7 @@ int prepare_app_cache_dir(const std::string& parent, const char* name, mode_t ta if (chmod(p->fts_path, target_mode) != 0) { PLOG(WARNING) << "Failed to chmod " << p->fts_path; } - // Intentional fall through to also set GID + [[fallthrough]]; // to also set GID case FTS_F: if (chown(p->fts_path, -1, gid) != 0) { PLOG(WARNING) << "Failed to chown " << p->fts_path; diff --git a/include/android/sharedmem.h b/include/android/sharedmem.h index 8c3ff747ce..7f5177bde9 100644 --- a/include/android/sharedmem.h +++ b/include/android/sharedmem.h @@ -94,7 +94,8 @@ size_t ASharedMemory_getSize(int fd) __INTRODUCED_IN(26); * int fd = ASharedMemory_create("memory", 128); * * // By default it has PROT_READ | PROT_WRITE | PROT_EXEC. - * char *buffer = (char *) mmap(NULL, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + * size_t memSize = ASharedMemory_getSize(fd); + * char *buffer = (char *) mmap(NULL, memSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); * * strcpy(buffer, "This is an example."); // trivially initialize content * diff --git a/libs/binder/ndk/include_ndk/android/binder_interface_utils.h b/libs/binder/ndk/include_ndk/android/binder_interface_utils.h index 1a9018aea7..e37c388132 100644 --- a/libs/binder/ndk/include_ndk/android/binder_interface_utils.h +++ b/libs/binder/ndk/include_ndk/android/binder_interface_utils.h @@ -42,8 +42,8 @@ namespace ndk { /** * analog using std::shared_ptr for internally held refcount * - * ref must be called at least one time during the lifetime of this object. The recommended way to construct - * this object is with SharedRefBase::make. + * ref must be called at least one time during the lifetime of this object. The recommended way to + * construct this object is with SharedRefBase::make. */ class SharedRefBase { public: @@ -77,7 +77,7 @@ public: /** * Convenience method for making an object directly with a reference. */ - template<class T, class... Args> + template <class T, class... Args> static std::shared_ptr<T> make(Args&&... args) { T* t = new T(std::forward<Args>(args)...); return t->template ref<T>(); diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index db095a51d9..309fd0a791 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -781,9 +781,12 @@ void DisplayDevice::getBestColorMode(Dataspace dataspace, RenderIntent intent, *outMode = iter->second.colorMode; *outIntent = iter->second.renderIntent; } else { - ALOGE("map unknown (%s)/(%s) to default color mode", - dataspaceDetails(static_cast<android_dataspace_t>(dataspace)).c_str(), - decodeRenderIntent(intent).c_str()); + // this is unexpected on a WCG display + if (hasWideColorGamut()) { + ALOGE("map unknown (%s)/(%s) to default color mode", + dataspaceDetails(static_cast<android_dataspace_t>(dataspace)).c_str(), + decodeRenderIntent(intent).c_str()); + } *outDataspace = Dataspace::UNKNOWN; *outMode = ColorMode::NATIVE; diff --git a/services/surfaceflinger/RenderEngine/ProgramCache.cpp b/services/surfaceflinger/RenderEngine/ProgramCache.cpp index 796901a2bd..46b0f0d72b 100644 --- a/services/surfaceflinger/RenderEngine/ProgramCache.cpp +++ b/services/surfaceflinger/RenderEngine/ProgramCache.cpp @@ -319,7 +319,7 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) { // scale [0.0, maxInLumi] to [0.0, maxOutLumi] if (maxInLumi <= maxOutLumi) { - nits *= maxOutLumi / maxInLumi; + return color * (maxOutLumi / maxInLumi); } else { // three control points const float x0 = 10.0; @@ -340,7 +340,7 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) { if (nits < x0) { // scale [0.0, x0] to [0.0, y0] linearly float slope = y0 / x0; - nits *= slope; + return color * slope; } else if (nits < x1) { // scale [x0, x1] to [y0, y1] linearly float slope = (y1 - y0) / (x1 - x0); @@ -358,7 +358,8 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) { } } - return color * (nits / max(1e-6, color.y)); + // color.y is greater than x0 and is thus non-zero + return color * (nits / color.y); } )__SHADER__"; break; @@ -389,7 +390,7 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) { if (nits <= x0) { // scale [0.0, x0] to [0.0, y0] linearly const float slope = y0 / x0; - nits *= slope; + return color * slope; } else if (nits <= x1) { // scale [x0, x1] to [y0, y1] using a curve float t = (nits - x0) / (x1 - x0); @@ -404,7 +405,8 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) { nits = (1.0 - t) * (1.0 - t) * y2 + 2.0 * (1.0 - t) * t * c3 + t * t * y3; } - return color * (nits / max(1e-6, color.y)); + // color.y is greater than x0 and is thus non-zero + return color * (nits / color.y); } )__SHADER__"; break; @@ -577,7 +579,7 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) { fs << "uniform mat4 inputTransformMatrix;"; fs << R"__SHADER__( highp vec3 InputTransform(const highp vec3 color) { - return vec3(inputTransformMatrix * vec4(color, 1.0)); + return clamp(vec3(inputTransformMatrix * vec4(color, 1.0)), 0.0, 1.0); } )__SHADER__"; } else { diff --git a/vulkan/vkjson/vkjson_instance.cc b/vulkan/vkjson/vkjson_instance.cc index db0450d2c2..4ec442a4ef 100644 --- a/vulkan/vkjson/vkjson_instance.cc +++ b/vulkan/vkjson/vkjson_instance.cc @@ -330,7 +330,7 @@ VkJsonInstance VkJsonGetInstance() { 1, "", 0, - VK_API_VERSION_1_0}; + VK_API_VERSION_1_1}; VkInstanceCreateInfo instance_info = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, nullptr, |