From 644553d06fbbaa802e89d39e5546e0241f82870a Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 22 Jan 2021 16:26:56 -0800 Subject: JNI wrapper for FpsListener. Hidden api for exposing the fps counter to WM Shell, so that the fps for a task can be reported. Bug: 174956756 Test: E2E integration with SurfaceFlinger for angry birds Change-Id: I9818aded2755ad07fd3abf3f616e8e6940bad268 --- core/jni/AndroidRuntime.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/jni/AndroidRuntime.cpp') diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 8879111bc2f5..d35ea4bb6508 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -119,6 +119,7 @@ extern int register_android_view_InputApplicationHandle(JNIEnv* env); extern int register_android_view_InputWindowHandle(JNIEnv* env); extern int register_android_view_Surface(JNIEnv* env); extern int register_android_view_SurfaceControl(JNIEnv* env); +extern int register_android_view_SurfaceControlFpsListener(JNIEnv* env); extern int register_android_view_SurfaceSession(JNIEnv* env); extern int register_android_view_CompositionSamplingListener(JNIEnv* env); extern int register_android_view_TextureView(JNIEnv* env); @@ -1486,6 +1487,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_view_InputWindowHandle), REG_JNI(register_android_view_Surface), REG_JNI(register_android_view_SurfaceControl), + REG_JNI(register_android_view_SurfaceControlFpsListener), REG_JNI(register_android_view_SurfaceSession), REG_JNI(register_android_view_CompositionSamplingListener), REG_JNI(register_android_view_TextureView), -- cgit v1.2.3 From ab80824153f8bf23c7e7118a8f956026edabd45a Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Mon, 28 Dec 2020 16:03:32 -0800 Subject: Camera2: Add jpeg encoding support for all camera extensions Enable consistent Jpeg output support for all present camera extensions. Extensions with exclusive YUV_420 support will include an extra SW encoding pass before the processed results can be queued back to the client surface. Bug: 179818844 Test: Camera CTS Change-Id: I461e54024f150925ca1a5a57ff7b327712ce0e96 --- core/jni/AndroidRuntime.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/jni/AndroidRuntime.cpp') diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 8879111bc2f5..14d139300681 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -74,6 +74,7 @@ extern int register_android_opengl_jni_GLES32(JNIEnv* env); extern int register_android_hardware_Camera(JNIEnv *env); extern int register_android_hardware_camera2_CameraMetadata(JNIEnv *env); extern int register_android_hardware_camera2_DngCreator(JNIEnv *env); +extern int register_android_hardware_camera2_impl_CameraExtensionJpegProcessor(JNIEnv* env); extern int register_android_hardware_camera2_utils_SurfaceUtils(JNIEnv* env); extern int register_android_hardware_display_DisplayManagerGlobal(JNIEnv* env); extern int register_android_hardware_HardwareBuffer(JNIEnv *env); @@ -1532,6 +1533,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_hardware_Camera), REG_JNI(register_android_hardware_camera2_CameraMetadata), REG_JNI(register_android_hardware_camera2_DngCreator), + REG_JNI(register_android_hardware_camera2_impl_CameraExtensionJpegProcessor), REG_JNI(register_android_hardware_camera2_utils_SurfaceUtils), REG_JNI(register_android_hardware_display_DisplayManagerGlobal), REG_JNI(register_android_hardware_HardwareBuffer), -- cgit v1.2.3 From 69d44b0bfd5d4a6721ab3dccf537a147af7b6d1d Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Mon, 9 Nov 2020 18:21:29 -0800 Subject: Add zygote native fork loop Do not return to Java mode between consecutive fork operations. This greatly reduces the Zygote overhead, since we no longer need to stop and restart Java daemons. By not switching back to Java mode, and being careful about what memory we touch between forks, we also keep the Zygote heaps much more stable, facilitating page sharing between the zygote and all its children. Under normal operation we should no longer allocate any memory in the zygote between forks. That applies to both the Java and C++ heap. This makes the zygote behave much more like the mental model many of us had assumed: It has nearly constant memory contents, which are copy-on-right cloned at each fork. This does not apply to the initial system server and webzygote forks, that are currently still handled differently. This includes 1. Add ZygoteCommandBuffer, and switch the argument parsing code to use it. This slightly reduces allocation and enables (3). 2. Support process specialization in the child, even when the arguments are already know, Leverages existing Usap code. 3. Add support for forking multiple child processes directly to the ZygoteCommandBuffer data structure. This directly uses the buffer internals, and avoids returning to Java so long as it can handle the zygote commands it sees. FUNCTIONALITY CHANGE: We now limit the total size of the zygote command, rather than the number of arguments. Initial performance observations: [ These are not perfect, since I'm comparing to numbers before I started. There may have been other moving parts, but they should be minor. ] System-server-observed launch latency: [Not the best metric, but easy to measure. In particular, this does not represent a significant reduction in application launch time.] Based on measuring the last 10 launches in a lightly used cf AOSP instance, the system server latency from requesting an app launch to response with the pid (which does not require the child to execute anything) went from an average of about 10.7(25) msecs to 6.8(9) and 7.9(16) in two tries with the CL. (The parenthetical numbers are maxima from among the 10; the variance appears to have decreased appreciably.) Dirty pages: The number of private dirty pages in the zygote itself appears to have decreased from about 4000 to about 2200. The number of dalvik-main private dirty pages went from about 1500 to nearly zero. Initially ART benchmarking service claim -1.88% in PSS. But this is not consistently repeatable. Drive-by fix: Call setAllowNetworkingForProcess on usap / native loop path. Bug: 159631815 Bug: 174211442 Test: Boots AOSP Change-Id: I90d2e381bada1b6c9857666d5e87372b6a4c1a70 --- core/jni/AndroidRuntime.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/jni/AndroidRuntime.cpp') diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 3198cb1b8140..c01f741862b1 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -193,6 +193,7 @@ extern int register_com_android_internal_os_FuseAppLoop(JNIEnv* env); extern int register_com_android_internal_os_KernelCpuUidBpfMapReader(JNIEnv *env); extern int register_com_android_internal_os_KernelSingleUidTimeReader(JNIEnv *env); extern int register_com_android_internal_os_Zygote(JNIEnv *env); +extern int register_com_android_internal_os_ZygoteCommandBuffer(JNIEnv *env); extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env); extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env); @@ -1524,6 +1525,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_com_android_internal_net_NetworkUtilsInternal), REG_JNI(register_com_android_internal_os_ClassLoaderFactory), REG_JNI(register_com_android_internal_os_Zygote), + REG_JNI(register_com_android_internal_os_ZygoteCommandBuffer), REG_JNI(register_com_android_internal_os_ZygoteInit), REG_JNI(register_com_android_internal_util_VirtualRefBasePtr), REG_JNI(register_android_hardware_Camera), -- cgit v1.2.3