Open Bug 1949102 Opened 1 month ago Updated 3 days ago

Scrolling BMO page(bug 1946657) caused black flickering in whole UI with layer compositor enabled

Categories

(Core :: Graphics: WebRender, defect)

Unspecified
Windows
defect

Tracking

()

People

(Reporter: sotaro, Assigned: sotaro)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

With layer compositor enabled, black flickering appeared during scrolling bug 1946657.

The bug seems similar to Bug 1946651 and Bug 1948882.

See Also: → 1948882
Blocks: 1945683
Summary: Scrolling BMO page(bug 1946657) caused black flickering in whole UI → Scrolling BMO page(bug 1946657) caused black flickering in whole UI with layer compositor enabled

When the flickering happened, DCSwapChain was re-created.

Looked into more.

The workaround of Bug 1946657 did not work for this bug.

During the problem happening, DCSwapChain was re-created and 2 same size frame buffer surfaces was used. One surface was opaque with NativeSurfaceId == 0. Other surface was non opaque with NativeSurfaceId != 0. Using 2 frame buffer surfaces seemed to trigger the problem.

At first, it is better to use only one frame buffer surface like chromium.

chromium supports video overlay and underlay with one frame buffer surface.

To support underlay, frame buffer surface becomes non opaque when video overlay exists.

In UpdateRenderPassFromOverlayData(), "render_pass->has_transparent_background" is set to true. It triggers to set non-opaque. When the surface becomes non-opaque, it continues at least for kNumberOfFramesBeforeDisablingDCLayers(60) frames.

Further, when video overlay is enabled, it tries to use DComp surface instead of swap chain. In UpdateRenderPassFromOverlayData(), "render_pass->needs_synchronous_dcomp_commit" to true. The needs_synchronous_dcomp_commit is set to "requirements.scanout_dcomp_surface" in DirectRenderer::CalculateRenderPassRequirements(). Then "scanout_dcomp_surface" is changed to SHARED_IMAGE_USAGE_SCANOUT_DCOMP_SURFACE in SkiaRenderer::AllocateRenderPassResourceIfNeeded(). But DComp surfaces do not support RGB10A2. Then in this case, DComp surface could not be used.

Actual frame buffer surface allocation is triggered in SkiaRenderer::AllocateRenderPassResourceIfNeeded(). Then the allocation finally end up to DCompImageBackingFactory::CreateSharedImage().

When SHARED_IMAGE_USAGE_SCANOUT_DCOMP_SURFACE is set, DCompSurfaceImageBacking is created. Otherwise, DXGISwapChainImageBacking. is created.

chromium uses overlay when there is no occluders in DCLayerOverlayProcessor::PromoteCandidates().

Underlay is used when there is occluder and underlay is allowed in DCLayerOverlayProcessor::PromoteCandidates().

chromium's DComp overlay seems to support rounded corners. It is handled in DCLayerTree::VisualTree::VisualSubtree::Update().

Chromium seems to have a wip bug to split ui and WebContent to different SwapChain.

https://issues.chromium.org/issues/40150597

If multiple swap chains are used, display timing could be asynchronous between swap chains. It would then seem not good to split into multiple swap chains within content that needs to be synchronized.

If we want to split within content that needs to be synchronized, we need to use DComp Surface instead of swap chain.

This may be fixed when 1951548 lands.

(In reply to Glenn Watson [:gw] from comment #9)

This may be fixed when 1951548 lands.

I applied the patch locally, and the problem was not addressed for me. The flickering happened differently. I am going to check again with latest m-c.

The problem also happened with bug 1951548 fix with latest m-c.

With bug 1951548 fix with latest m-c, while rectangle appeared in addition to flickering.

See Also: → 1951548
See Also: → 1952216

The severity field is not set for this bug.
:gw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gwatson)
Severity: -- → S3
Flags: needinfo?(gwatson)
Depends on: 1952216

With D241772, I still see the flickering. It might be caused by other reasons.

Depends on: 1954621
Attachment #9472357 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: