Layer 之间同步以及如何减少GPU 带宽
2018-01-29 15:46
197 查看
问题:
1) Layer 之间能否进行单独更新,比如其中video 层上面弹出的状态栏场景如何优化;
初步构想每次仅更新video layer或则将video layer 绕过BQ 进行处理。
2)FW 以及GPU对video layer 的常见处理;
3)几个变量的理解;
(1)mCurrentTexture ,nextTextureImage;
(2)BufferItem,BufferQueue,mslots;slot,mqueuedframe,mqueuedItem;
(3)syncForReleaseLocked,updateAndReleaseLocked,releaseBufferLocked,releaseBuffer
(4)
(5)mslots 与mframe 以及mframenumber 的区别
(6)onframavailable 和latchbuffer ,reject,updateteximage,的逻辑。
其中updateteximage;
(7)bufferitem 与mslots的区别
(8)bufferqueueconsumer 与bufferitemconsumer区别;
(9)acquirebuffer的fence 逻辑,fencefd是哪来的;
fence 相关接口定义参见ui/Fence.h
(10)
1) Layer 之间能否进行单独更新,比如其中video 层上面弹出的状态栏场景如何优化;
初步构想每次仅更新video layer或则将video layer 绕过BQ 进行处理。
2)FW 以及GPU对video layer 的常见处理;
3)几个变量的理解;
(1)mCurrentTexture ,nextTextureImage;
(2)BufferItem,BufferQueue,mslots;slot,mqueuedframe,mqueuedItem;
(3)syncForReleaseLocked,updateAndReleaseLocked,releaseBufferLocked,releaseBuffer
(4)
/ acquireBuffer attempts to acquire ownership of the next pending buffer in the BufferQueue. 54 // If no buffer is pending then it returns NO_BUFFER_AVAILABLE. If a buffer is successfully 55 // acquired, the information about the buffer is returned in BufferItem. 56 // 57 // If the buffer returned had previously been acquired then the BufferItem::mGraphicBuffer field 58 // of buffer is set to NULL and it is assumed that the consumer still holds a reference to the 59 // buffer. 60 // 61 // If presentWhen is non-zero, it indicates the time when the buffer will be displayed on 62 // screen. If the buffer's timestamp is farther in the future, the buffer won't be acquired, and 63 // PRESENT_LATER will be returned. The presentation time is in nanoseconds, and the time base 64 // is CLOCK_MONOTONIC. 65 // 66 // If maxFrameNumber is non-zero, it indicates that acquireBuffer should only return a buffer 67 // with a frame number less than or equal to maxFrameNumber. If no such frame is available 68 // (such as when a buffer has been replaced but the consumer has not received the 69 // onFrameReplaced callback), then PRESENT_LATER will be returned. 70 // 71 // Return of NO_ERROR means the operation completed as normal. 72 // 73 // Return of a positive value means the operation could not be completed at this time, but the 74 // user should try again later: 75 // * NO_BUFFER_AVAILABLE - no buffer is pending (nothing queued by producer) 76 // * PRESENT_LATER - the buffer's timestamp is farther in the future 77 // 78 // Return of a negative value means an error has occurred: 79 // * INVALID_OPERATION - too many buffers have been acquired
// Returned by releaseBuffer, after which the consumer must free any references to the 45 // just-released buffer that it might have. 46 STALE_BUFFER_SLOT = 1, 47 // Returned by dequeueBuffer if there are no pending buffers available. 48 NO_BUFFER_AVAILABLE, 49 // Returned by dequeueBuffer if it's too early for the buffer to be acquired. 50 PRESENT_LATER,
(5)mslots 与mframe 以及mframenumber 的区别
(6)onframavailable 和latchbuffer ,reject,updateteximage,的逻辑。
其中updateteximage;
(7)bufferitem 与mslots的区别
(8)bufferqueueconsumer 与bufferitemconsumer区别;
(9)acquirebuffer的fence 逻辑,fencefd是哪来的;
fence 相关接口定义参见ui/Fence.h
status_t Fence::waitForever(const char* logname) { 64 ATRACE_CALL(); 65 if (mFenceFd == -1) { 66 return NO_ERROR; 67 } 68 int warningTimeout = 3000; 69 int err = sync_wait(mFenceFd, warningTimeout); 70 if (err < 0 && errno == ETIME) { 71 ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd, 72 warningTimeout); 73 err = sync_wait(mFenceFd, TIMEOUT_NEVER); 74 } 75 return err < 0 ? -errno : status_t(NO_ERROR); 76 }
struct EglSlot { 465 EglSlot() : mEglFence(EGL_NO_SYNC_KHR) {} 466 467 // mEglImage is the EGLImage created from mGraphicBuffer. 468 sp<EglImage> mEglImage; 469 470 // mFence is the EGL sync object that must signal before the buffer 471 // associated with this buffer slot may be dequeued. It is initialized 472 // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based 473 // on a compile-time option) set to a new sync object in updateTexImage. 474 EGLSyncKHR mEglFence; 475 };
(10)
updateAndReleaseLocked(item, &mPendingRelease),
updateAndReleaseLocked(item),
bindTextureImageLocked()
相关文章推荐
- 如何在github上fork一个项目来贡献代码以及同步原作者的修改
- Post和Get请求之间的区别以及如何避免出现中文乱码
- 如何直接串行电缆以及空调制解调器串行电缆之间的区别?
- 如何正确选择uiimage之间不同的过滤器(gpuimage)
- Svnsync如何实现同步,以及出现的各种问题?
- 如何在 SSAS服务器之间做同步
- java多线程有几种实现方法?线程之间如何同步
- 关于gcc、glibc和binutils模块之间的关系,以及在现有系统上如何升级的总结
- Flask MVVM 开发(vue.js) - ajax如何同步更新地址栏history 以及使用浏览器返回按钮
- 如何减少每次同步数据量
- informatica 数据库之间的多表数据同步(全量/增量)以及variable的使用问题
- Activity之间跳转如何取消动画效果以及如何设置软键盘跳出不压缩界面
- git 本地库的创建以及如何完成服务器仓库的分支的映射和同步
- 使用Base Activity,以及如何在Activity之间传递数据
- 区位码,国标码,内码之间的区别与联系,以及如何转换
- C# 如何捕获键盘按钮和组合键以及KeyPress/KeyDown事件之间的区别 (附KeyChar/KeyCode值)
- 如何在两个SQLSERVER之间数据同步
- 如何在linux下用rsync同步文件以及它的用法和scp的用法
- 关于gcc、glibc和binutils模块之间的关系,以及在现有系统上如何升级的总结
- 硬盘的原理以及SQL Server如何利用硬盘原理减少IO