surfaceflinger

Android native code: Assigning a Surface to a specific display

﹥>﹥吖頭↗ 提交于 2021-01-26 18:21:43
问题 I’m looking for a way to assign a Surface (native window) object to a display so that the buffers submitted to that native window would be rendered to that specific display rather than to the main display. I would like to do that in native code. In Java, it can be done by using the Presentation API. In native code I tried to call SurfaceComposerClient::setDisplaySurface() , passing to it the display's IBinder object (returned by SurfaceComposerClient::getBuiltInDisplay() ), and the

Android 开机动画启动过程详解

断了今生、忘了曾经 提交于 2020-03-22 02:02:24
Android 开机会出现3个画面: 1. Linux 系统启动,出现Linux小企鹅画面(reboot)(Android 1.5及以上版本已经取消加载图片); 2. Android平台启动初始化,出现"A N D R I O D"文字字样画面; 3. Android平台图形系统启动,出现含闪动的ANDROID字样的动画图片(start)。 1、开机图片(Linux小企鹅) (Android 1.5及以上版本已经取消加载图片); Linux Kernel引导启动后,加载该图片。 logo.c中定义nologo,在fb_find_logo(int depth)函数中根据nologo的值判断是否需要加载相应图片。 代码如下: static int nologo; module_param(nologo, bool, 0); MODULE_PARM_DESC(nologo, "Disables startup logo"); /* logo's are marked __initdata. Use __init_refok to tell * modpost that it is intended that this function uses data * marked __initdata. */ const struct linux_logo * __init_refok fb

Android开机动画过程

半城伤御伤魂 提交于 2020-03-19 04:58:34
Android开机动画过程 2011-03-24 22:05:21 标签: Android 开机动画 移动开发 Android 开机会出现3个画面: 1. Linux 系统启动,出现Linux小企鹅画面(reboot)(Android 1.5及以上版本已经取消加载图片); 2. Android平台启动初始化,出现"A N D R I O D"文字字样画面; 3. Android平台图形系统启动,出现含闪动的ANDROID字样的动画图片(start)。 1、开机图片(Linux小企鹅) (Android 1.5及以上版本已经取消加载图片); Linux Kernel引导启动后,加载该图片。 logo.c中定义nologo,在fb_find_logo(int depth)函数中根据nologo的值判断是否需要加载相应图片。 代码如下: static int nologo; module_param(nologo, bool, 0); MODULE_PARM_DESC(nologo, "Disables startup logo"); /* logo's are marked __initdata. Use __init_refok to tell * modpost that it is intended that this function uses data * marked _

android P SurfaceFlinger---图层创建过程

我怕爱的太早我们不能终老 提交于 2020-02-26 14:38:25
由上节的内容可知,SurfaceComposerClient是应用程序与surfaceflinger之间的通信桥梁,不过SurfaceComposerClient只是一个封装,实质是通过内部的ISurfaceComposerClient来执行的,ISurfaceComposerClient对应的服务端实现是Client。 SurfaceComposerClient.h sp<ISurfaceComposerClient> mClient; SurfaceComposerClient.cpp void SurfaceComposerClient::onFirstRef() { sp<ISurfaceComposer> sf(ComposerService::getComposerService()); if (sf != nullptr && mStatus == NO_INIT) { sp<ISurfaceComposerClient> conn; conn = sf->createConnection(); if (conn != nullptr) { mClient = conn; mStatus = NO_ERROR; } } } ISurfaceComposer.cpp class BpSurfaceComposer : public BpInterface

Systrace output not showing graphics/surfaceflinger events

旧街凉风 提交于 2020-01-06 03:53:08
问题 I am able to run systrace but i am not able to see the traces for SurfaceFlinger. GPU, bufferQueues, etc. I gave the following command: systrace.py --time=10 -o mynewtrace.html sched gfx view wm hal video workq Its only giving output for CPU0, workqueues, irqs, kworker etc. Any particular tracers we have to enable while compiling kernel? Am I missing anything else? Thank You! 回答1: Got the solution. The trace_marker file was not set to writeable for user space processes. After setting it using

Android Framework 分析

喜夏-厌秋 提交于 2020-01-04 05:36:34
Android Framework 分析 (一) 目录树 /framework/base/api /framework/base/awt /framework/base/build /framework/base/camera 关于 camera 的 HAL 接口库。最终生成 native 共享库 libcamera.so , 编译时根据是否定义 USE_CAMERA_STUB 来决定系统是否有 Camera 硬件支持。若没有实际的 Camera 硬件,则编译时会和虚拟 camera 静态库( libcamerastub.a, 由 camerahardwarestub.cpp,fakecamera 生成)链接生成 libcamera.so 。 /framework/base/cmds 关于 android 系统启动时用到的 command 等 /framework/base/cmds/am /framework/base/cmds/app_process 可执行文件 app_process ,该文件可以根据输入参数决定是 Zygote 启动(参考 init.rc 中的语句 service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server ) . 该执行程式会链接

android rendering using CPU but not GPU?

試著忘記壹切 提交于 2019-12-30 05:13:06
问题 It's really weird that in systrace tool when I saw the execution of drawing command and window composition by surfaceflinger, this is running on CPU but not on GPU. But as per google talk by Romain Guy, they told that this composition and execution of drawing commands are executed on GPU. My device having GPU, even then they are using CPU core. I think if CPU cores are free then it uses CPU core otherwise it uses GPU. 回答1: There's three ways to do surface composition: Using "overlay" planes.

Android 9.0 SurfaceFlinger---configureRpcThreadpool

我是研究僧i 提交于 2019-12-25 07:31:10
目录 surfaceflinger启动 configureRpcThreadpool 当前进程fd中hwbinder框架的初始化 setThreadPoolConfiguration surfaceflinger启动 surfaceflinger可执行文件由main_surfaceflinger.cpp 文件独立编译而成,主要负责搭建进程启动环境。 \frameworks\native\services\surfaceflinger\main_surfaceflinger.cpp int main(int, char**) { signal(SIGPIPE, SIG_IGN); //当对端(客户端/服务端)的socket关闭时,防止进程退出。 //hidl service启动时要设置binder的线程池 hardware::configureRpcThreadpool(1 /* maxThreads */, //用于设置 当前进程用于 hwbinder 通信的最大线程数: false /* callerWillJoin */); configureRpcThreadpool 设置用于 hwbinder 通信的线程数 configureRpcThreadpool 用于设置 当前进程用于 hwbinder 通信的最大线程数: \system\libhidl\transport

How to make sense of dumpsys SurfaceFlinger

廉价感情. 提交于 2019-12-18 12:36:45
问题 Is there any documentation on the output of the adb command "dumpsys SurfaceFlinger"? In particular, I'd like to understand what is the difference between an HWC or GLES layer type, and what does numHwLayers mean? Here is the section of dumpsys SurfaceFlinger I'm talking about: mDebugForceFakeVSync=0 Display[0] : 768x1280, xdpi=319.790009, ydpi=318.744995, refresh=16666667 numHwLayers=5, flags=00000000 type | handle | hints | flags | tr | blend | format | source crop | frame name ------------

Understanding necessity of Android VSYNC signals

做~自己de王妃 提交于 2019-12-18 10:29:36
问题 I'm trying to get a better understanding of the Android display subsystem, but one item that's still confusing to me is how VSYNC signals are handled, and why so many exist in the first place. Android is designed to use VSYNC at its core, but there are multiple VSYNC signals that it employs. Via https://source.android.com/devices/graphics/implement.html in the "VSYNC Offset" section, there is a flow diagram which diagrams three VSYNC signals: HW_VSYNC_0, VSYNC, and SF-VSYNC. I understand that