Closed Bug 909204 Opened 11 years ago Closed 1 year ago

Display Composition FPS while using HwcComposer2D

Categories

(Core :: Graphics, defect)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: u459114, Unassigned)

References

Details

Attachments

(2 files, 6 obsolete files)

FPS sprite display only when GLComposer be chosen.
Summary: Disable Composition FPS while using HWComposer → Display Composition FPS while using HWComposer
Let me take this issue
Assignee: nobody → cku
I think we should display the following information on the screen for all compositor back-end with minimum performance impact
1. FPS
2. Composed Layer number
3. Optional - CPU usage
Here is my proposal of generate FPS sprite:
1. (FPS bitmap) Generate bitmap for each FPS. For exp, "FPS: 20" and "FPS: 21" will be two disinct bitmap. Keep these image in memory persistly. As a result, generate these bitmap is one-time event.
2. (FPS bitmap map) Use hash value of each bitmap(Hash("FPS:20")) as index to find out existed FPS bitmap. 
3. Always render FPS bitmap on the deepest layer(backgound layer).
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
1. Just a work flow draft.
2. HwcComposer2D::DrawFPS is the entry point of FPS drawing
   a. Find a suitable layer.
   b. draw FPS image direct into the content of that layer.
Next step
1. Render "0-9" stretch into a graphic buffer by opengl: do it in FPSCounter
2. Map number glyph into layer image according to current FPS.
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
Attachment #804340 - Attachment is obsolete: true
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
Attachment #804395 - Attachment is obsolete: true
Bug 915342 shows the fill ratio for GL composition.

We can also show the number of composed layer.
It might be helpful to check unnecessary layer.
Is there any way we can integrate this with bug 874781?  I know I keep saying I'm going to get back to and finish that up; I will try doing so tomorrow or Monday.
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
WIP
Attachment #804416 - Attachment is obsolete: true
(In reply to Vladimir Vukicevic [:vlad] [:vladv] from comment #10)
> Is there any way we can integrate this with bug 874781?  I know I keep
> saying I'm going to get back to and finish that up; I will try doing so
> tomorrow or Monday.
Sure. Basically, I will finish the logic of drawing FPS in HWC. 
I didn't use GL to draw FPS in HWC, instead, I blit FPS image into a suitable layer directly.
The reason for this approach is
1. Needless to add another FPS layer: adding a layer in generic HWC is not good.
2. Decouple with GLComposer

Make this bug depend on 874781
Depends on: 874781
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
Validate the size of drawing layer.
Attachment #805229 - Attachment is obsolete: true
Attached patch WIP_Draw_FPS_in_HWC (obsolete) — Splinter Review
Attachment #805246 - Attachment is obsolete: true
Peter/ Morris, any suggestion?
Flags: needinfo?(pchang)
Flags: needinfo?(mtseng)
TODO:
1. Rework base on bug 874781
2. Comment
3. Layer selection algorithm
   Currently, I search from back to front, get the first suitable layer, and then draw image onto left-top side of that layer. Simple/effective, but may not work if that layer is cover by another layer, FPS sprite will not be visible.
Update layer selection algorithm
Attachment #805247 - Attachment is obsolete: true
Summary: Display Composition FPS while using HWComposer → Display Composition FPS while using HwcComposer23
Summary: Display Composition FPS while using HwcComposer23 → Display Composition FPS while using HwcComposer2D
TODO
1. Draw FPS in hwcLayer.sourceCrop boundary
2. Enable FPS drawing from LayerManager.
Check the preferences "layers.acceleration.draw-fps" to trigger this function?
Read preference setting from device /data/locat/tmp/gfx_debug

Check CompositorDebugPropWatcher::OnFileCanReadWithoutBlocking() function
Flags: needinfo?(pchang)
Flags: needinfo?(pchang)
Assignee: cku → boris.chiou
Status: NEW → ASSIGNED
Flags: needinfo?(mtseng)
Assignee: boris.chiou → hshih

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: bignose1007+bugzilla → nobody
Status: ASSIGNED → NEW
Severity: normal → S3

Closing old B2G bugs

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: