Closed Bug 950112 Opened 11 years ago Closed 11 years ago

Use android::IGraphicBufferAlloc as gralloc allocator for TextureClient on gonk

Categories

(Core :: Graphics: Layers, defect, P4)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: sotaro, Assigned: sotaro)

References

Details

(Keywords: perf, Whiteboard: [c=uniformity p= s=2014.05.09.t u=])

Attachments

(2 files)

+++ This bug was initially created as a clone of Bug #929973 +++ On b2g, gralloc buffer allocation latency is going to become a problem. The latency is consisted from the following. [1] gralloc buffer allocation from kernel [2] gralloc buffer clear(flush) [3] delay of Compositor thread handling [4] single threaded IPC This bug is going to handle [3] and [4].
Summary: Use android::IGraphicBufferAlloc as buffer gralloc allocator for TextureClient on gonk → Use android::IGraphicBufferAlloc as gralloc allocator for TextureClient on gonk
android IPC is multi threaded. Therefore if we use IGraphicBufferAlloc, we could solve [3] and [4] automatically. But IGraphicBufferAlloc allocates buffer out side of gecko ipdl ipc mechanism. A gralloc buffer allocatd by the IGraphicBufferAlloc can not pass ipdl ipc.
Assignee: nobody → sotaro.ikeda.g
IGraphicBufferAlloc is already implemented in JB gonk by Bug 929973. It is already used by nexus-7(flo) camera.
blocking-b2g: --- → madai?
blocking-b2g: madai? → 1.4?
This bug have a 2 intent. -(1) speed up gralloc buffer allocation + Do not use Compositor thread for gralloc allocation. It is used also for transaction and for rendeirng and for apzc. + andriod Binder IPC is multi-threaded ipc. gecko's ipc is single threaded ipc. -(2) Change gralloc buffer allocated by android::BufferQueue/IGraphicBufferAlloc. + BufferQueue allocates gralloc buffers by using IGraphicBufferAlloc. + In ICS, usages of SurfaceTexure(BufferQueue) is limited. But in JB and KK, BufferQueue is changed for general usage and is going to be used more places. B2g implemented the GonkBufferQueue as a modified version of BufferQueue. If we are going to replace BufferQueue by GonkBufferQueue, we need to modify and maintain a lot of gonk code. And these codes might be already modified a lot by partners. And the change decrease buffer allocation performance significantly compared to android. If we can render the gralloc buffers allocated by android::BufferQueue, \ we can save the lot of code change. And can got good performance.
Bug 809888 might be a bug better to be checked.
In Bug 961584, I recognized the following 2 way of gralloc allocation by using Binder IPC. [1] Use android::IGraphicBufferAlloc as gralloc allocator - This works only for gonk since android 4.3(fence support). - ICS can also use this way. But somehow genlock becomes invalid like Bug 961584 Comment 16. Originally allocated gralloc buffers are soon destoryed in b2g. It might affect to the above genlock problem. [2] Create custom gralloc allocator - Create custom allocator as to prevent the above genlock problem. - At least, it seems need to keep alive the Originally allocated gralloc buffers.
Depends on: 939348
This patch works only after android 4.3 (genlock support).
attachment 8364122 [details] [diff] [review] is created based on patches in Bug 939348. Bug 939348's patches are not stable now. Except that attachment 8364122 [details] [diff] [review] seems to works correctly.
This patch is implement to confirm ides [2] in Comment 5. I created patch to fix the problem of [1]. [1] does not work in ICS because of the genlock problem. By this patch, rendering result becomes better than [1] on master hamachi. But still have the genlock problem. It might be necessary to use the originally allocated gralloc buffer for compositor's composition to fix the problem.
Status: NEW → ASSIGNED
Keywords: perf
Whiteboard: [c=uniformity p= s= u=]
gecko's ipc request a lot of thread context swith. If thebes layer's gralloc buffer is allocated via ImageBridgeChild, the following context switches happen. (app's main thread -> ImageBridgeChild's thread ->io thread in content process -> io thread in b2g proces -> Compositor thread(allocate gralloc) -> io thread in content process -> ImageBridgeChild's thread -> app's main thread)
Depends on: 959089
blocking-b2g: 1.4? → ---
Right now I am not actively working for this bug. Therefore change the status to "New".
Status: ASSIGNED → NEW
Bug 959089 is enough for the fix. Set this bug as INVALID.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Priority: -- → P4
Whiteboard: [c=uniformity p= s= u=] → [c=uniformity p= s=2014.05.09.tracking u=]
Whiteboard: [c=uniformity p= s=2014.05.09.tracking u=] → [c=uniformity p= s=2014.05.09.t u=]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: