以pandaboard为例。

linaro1304 release中使用HWC_FRAMEBUFFER, HWC_OVERLAY, 没有使用HWC_FRAMEBUFFER_TARGET. use_sgx = 1. egl_swapbuffer用于在commit的时候将bufer swap到sgx。 egl用于composition. hwc fb_dev的post2将sgx递交显示。composer的版本应该是1.0.

hwc_layer_1_t:

compositionType:composition type. HWC_FRAMEBUFFER/HWC_FRAMEBUFFER_TARGET: use open_gles 做composition. TARGET是compositon的target, 在HWC Composer1.1及以上版本中使用, 就版本的opengl es使用the (dpy, sur) fields in hwc_compositor_device_1_t. HWC_BACKGROUND: backgroundColor, The HWC can toggle this value to HWC_FRAMEBUFFER to indicate it CANNOT handle the background color. HWC_OVERLAY: 使用HWC去composition, 不使用opengl es, 如果有个层设为HWC_FRAMEBUFFER_TARGET, 但所有其他层设为HWC_OVERLAY, 那么这层被忽略。

HWC_FRAMEBUFFER_TARGET:总是被调用者设置

HWC_FRAMEBUFFER:prepare时,调用者在HWC_GEOMETRY_CHANGED flag被设置的情况下, 设置这个。 hwc本身在prepare时设置这个指示由opengl es画进这个layer的framebuffer. 如果设置成HWC_OVERLAY(只能由hwc本身在prepare时设置。), 表示hwc将处理这个layer(不是opengl es)。

buffer_handle_t handle;: handle of buffer to compose. allocated by gralloc. layer的handle变化或者HWC_GEOMETRY_CHANGED未设(连续prepare之间), composer认为buffer未变。

sourceCrop和displayFrame:The sourceCrop is scaled using linear filtering to the displayFrame.

acquireFenceFd:             /* Sync fence object that will be signaled when the buffer's
             * contents are available. May be -1 if the contents are already
             * available. This field is only valid during set(), and should be
             * ignored during prepare(). The set() call must not wait for the
             * fence to be signaled before returning, but the HWC must wait for
             * all buffers to be signaled before reading from them.
             *
             * HWC_FRAMEBUFFER layers will never have an acquire fence, since
             * reads from them are complete before the framebuffer is ready for
             * display.
             *
             * The HWC takes ownership of the acquireFenceFd and is responsible
             * for closing it when no longer needed.
             */-----for overlay

HWC_FRAMEBUFFER layers不需要acquireFenceFd。

hwc_display_contents_1: contents for display frame

//for HWC_DEVICE_VERSION_1_0, opengl es

hwc_display_t dpy;  //EGLDisplay object
    hwc_surface_t sur;  //EGLSurface object

outbuf: the buffer that receives the composed image for
             * virtual displays. Writes to the outbuf must wait until
             * outbufAcquireFenceFd signals

hwLayers: layers

hwc_procs: 提供给上层的几个回调函数。invalidate:  triggers a screen refresh. vsync. hotplug.

hwc_module_t: special hw_module_t for hwc

hwc_composer_device_1: special hw_device_t dor hwc:

prepare:called for each frame before composition and is used by
     * SurfaceFlinger to determine what composition steps the HWC can handle.can be called more than once, the last call prevails. The HWC responds by setting the compositionType field in each layer to
     * either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, OpenGL ES.  in the later case, HWC. Typically this happens (but is not limited to)
     * when a window is added, removed, resized or moved.

* For HWC 1.0, numDisplays will always be one, and displays[0] will be
     * non-NULL.
     *
     * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries
     * for unsupported or disabled/disconnected display types will be NULL.
     *
     * For HWC 1.2 and later, numDisplays will be HWC_NUM_DISPLAY_TYPES or more.
     * The extra entries correspond to enabled virtual displays, and will be
     * non-NULL. In HWC 1.2, support for one virtual display is required, and
     * no more than one will be used. Future HWC versions might require more.

set:

used in place of eglSwapBuffers(), and assumes the same
     * functionality, except it also commits the work list atomically with
     * the actual eglSwapBuffers().(http://www.2cto.com/kf/201210/160882.html)

* A display with zero layers indicates that the entire composition has
     * been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)()
     * behaves just like eglSwapBuffers().

eventControl:

Enables or disables h/w composer events for a display. HWC_EVENT_VSYNC

blank:

Blanks or unblanks a display's screen.

query:

Used to retrieve information about the h/w composer

registerProcs:

registers callbacks that the h/w composer HAL can
     * later use(sync, invalidate, hotplug)

getDisplayConfigs:

returns handles for the configurations available
     * on the connected display.

getDisplayAttributes:

returns attributes for a specific config of a
     * connected display. The config parameter is one of the config handles
     * returned by getDisplayConfigs.

setParameter:

makes the hardware composer aware of the system state. vendor spec

omap4_hwc_device_open:

调用gralloc module, 得到fb dev

初始化hwc_dev的一些函数指针

open dsscomp_fd: ----主要作用:omap4_hwc_set_best_hdmi_mode中query display, DSSCIOC_SETUP_DISPLAY

open  hdmi_fb_fd(fb1)----主要作用, hotplug时unblank

open fb_fd(fb0)---主要作用就是vsync

map fb0的帧buffer地址给 img_mem_ptr

open pipe  pipe_fds

创建omap4_hwc_hdmi_thread线程

handle_hotplug:得到hdmi等的状态等, 并invalidate给上层。

omap4_hwc_event_control:

向fb0驱动写OMAPFB_ENABLEVSYNC ioctrl命令

omap4_hwc_query:仅支持query HWC_VSYNC_PERIOD

omap4_hwc_hdmi_thread:

poll用法:http://blog.csdn.net/qq69696698/article/details/7473517

pipe_fds等待pipe[0],更新timeout时间

等待uevent, for vsync, hotplug(invalidate), 并通知上层

prepare会检查layer是用sgx还是dss进行composer.并进行一些设置。 未详读。

>set调用fb_dev的post2进行composer. 如果使用SGX, 先调用eglSwapBuffers swap。(奇怪, 前面说dpy, sur是个egl用的, 这个时候应该是HWC_FRAMEBUFFER. 那么

>从代码中, 不管是framebuffer还是overlay, 都调用post2. 是否使用sgx, 只影响是否使用opengl es, 不是用来区分dss还是sgx的吗? 在三星的hwc中的set里, 调用

>exynos_v4l2_s_ctrl进行更新。 明了很多。

如果所有层能由dss render, 那么use_sgx=0, 在hwc->set中不会调用eglswapbuffer. linaro1304中不是都能dss render。所以不会在这里调用swap. dpy/sur来自egl. LAYER类型是HWC_FRAMEBUFER. 估计如果所有都能被dss处理, 那么也就不需要egl了。 这里还是要的。

surfaceflinger的displaydevice的swapbuffer在有virtual_display, frametarget且hasGlesComposition时(有frametarget但没有hasGlesComposition, 不调用), 调用egl的swap。 无virtual display, 无frametarget, 在hwc中调用swap.

从surfaceflinger的hwcomposer知。hwcomposer1.1及以上版本不用fb dev.而以下版本则fb dev, hw composer都使用(在surfaceflinger这层)。1.1及以上有framebuffertarget(这里是从surfaceflinger的角度看的。 并不代表hwcomposer的用法(指fb dev), framebuffer各版本的hwc都有的。 在surfaceflinger层,framebuffer你的函数是要被注册进open es的, 在hwcomposer层, 也指明framebuffer用于opengl es composition的)。

android hwcomposer相关推荐

  1. Android图形合成和显示系统---基于高通MSM8k MDP4平台

    介绍了Android SurfaceFlinger层次以下的图形合成和显示系统,主要基于高通MSM8k MDP4x平台. 做为Android Display专题.SurfaceFlinger的详细介绍 ...

  2. android应用程序fps meter[帧数显示]的分析 —— SurfaceFlinger被注入统计代码(3)

    上节已经详细说了下注入过程,最后寄生进程在宿主进程中下了个蛋,这下完的蛋有什么作用呢?接下来再具体分析一下. lib0的感染过程分析 对于本例注入的so动态库,首先看一下so的符号: $ readel ...

  3. android应用程序fps meter[帧数显示]的分析 —— 浅谈root的风险 (3)

    上节已经详细说了下注入过程,最后寄生进程在宿主进程中下了个蛋,这下完的蛋有什么作用呢?接下来再具体分析一下. lib0的感染过程分析 对于本例注入的so动态库,首先看一下so的符号: $ readel ...

  4. I.MX6 Surfaceflinger 机制

    /***************************************************************************** I.MX6 Surfaceflinger ...

  5. java修改图形属性_开发者选项 Disable HW overlays - 分析

    1.Disable HW overlays 1../packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java s ...

  6. 开发者选项 Disable HW overlays

    android 4.2.2 取得flags位,并mTransactionFlags把相应的位清零. uint32_t SurfaceFlinger::getTransactionFlags(uint3 ...

  7. LWN 翻译:Atomic Mode Setting 设计简介(上)

    !!!声明!!! 本文章转自:何小龙 链接:https://blog.csdn.net/hexiaolong2009/article/details/87392266 转载只是为了学习备份. 译者注 ...

  8. Android图形系统之HWComposer

    Android图形系统之HWComposer 1.HWC 1.1 HWC作用 1.2 Overlay 1.3HWC实现 1.4 HWC功能 1.5 HWC效率 1.6 Compose方式 2.Fenc ...

  9. Android界面性能调优手册

    2019独角兽企业重金招聘Python工程师标准>>> 界面是 Android 应用中直接影响用户体验最关键的部分.如果代码实现得不好,界面容易发生卡顿且导致应用占用大量内存.我司这 ...

最新文章

  1. 【学术相关】你只看到了200万年薪的招聘,看不到被困校园的几十万博士
  2. c语言:宏里面参数不加括号容易出错,在使用时尽量加括号及举例
  3. -bash: ulimit: pipe size: cannot modify limit: Invalid argument
  4. Tomcat服务器的安装及配置
  5. Android 获取设备ID,手机厂商,运营商,联网方式,获取系统语言,获取时区
  6. 【tyvj】【dp】回文词(IOI2000)
  7. java求解一给定数字的二进制表达中的1的个数
  8. cmake编译错误,将警告视为错误的解决方法
  9. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cy.pj.goods.dao
  10. 无人机、手持全景设备、单反制作全景的基础流程,及全景成果与地图融合
  11. 攻防世界 Pwn 进阶 第一页
  12. kettle/Pentaho工具之阻塞数据直到步骤都完成
  13. 【字符集】字符集和编码知识【转】
  14. RocketMQTemplate基本使用
  15. 【Unity3DRPG入门学习笔记第六卷】SetCursor 设置鼠标指针
  16. 2017年本科毕业设计分享_matlab窗口程序
  17. 蓝桥杯 九宫重排 java_【蓝桥杯】历届试题 九宫重排
  18. 目标客户画像_什么是客户画像
  19. Fedora 12详细安装设置Compiz+Emerald+AWN实现特效
  20. 技术日新月异,发展迅速,如何不断扩展视野

热门文章

  1. Matlab_CVX包的安装
  2. 寻找你的热情(1)——检查自己所处的位置
  3. rest php,prest
  4. Linux删除文件之后磁盘空间没有被释放
  5. 【高德地图API】从头德国高中生JS API(三)覆盖物——大喊|折线|多边形|信息表|聚合marker|点蚀图|照片覆盖...
  6. Idrac卡偶尔不可用处理办法
  7. 【BZOJ4370】【IOI2015】horses 数据结构 平衡树+线段树
  8. TOPSIS和熵权法的应用(Matlab实现,包括数据预处理)
  9. 计算机中的信息表示教学计划,人教版小学五年级信息技术教学计划(小编推荐)...
  10. spring restTemplate的坑----会对String类型的url中的特殊字符进行转义