New issue
Advanced search Search tips

Issue 804430 link

Starred by 7 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Chrome windows flashes black when full redraw forced

Project Member Reported by ccameron@chromium.org, Jan 22 2018

Issue description

To reproduce, apply the following innocuous patch at the bottom of the description.

It just says "redraw everything", and should have no visible effect.

When applied on my Windows 10 build (about:gpu attached), I get horrible black flickering all the time.

This is the root problem behind  issue 796828  (a full redraw is forced when the output color space changes).

This suggests something terrible is going on.
 
flash.mp4
269 KB View Download
The patch in quesiton:

diff --git a/components/viz/service/display/direct_renderer.cc b/components/viz/service/display/direct_renderer.cc
index 9d022c6b43..3fdd2f9e1c 100644
--- a/components/viz/service/display/direct_renderer.cc
+++ b/components/viz/service/display/direct_renderer.cc
@@ -318,6 +318,8 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
     current_frame()->root_damage_rect = gfx::Rect(device_viewport_size);
   }

+  current_frame()->root_damage_rect = gfx::Rect(device_viewport_size);
+
   // We can skip all drawing if the damage rect is now empty.
   bool skip_drawing_root_render_pass =
       current_frame()->root_damage_rect.IsEmpty() && allow_empty_swap_;

about:gpu for the afflicted machine:

Graphics Feature Status
Canvas: Hardware accelerated
CheckerImaging: Enabled
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Software only. Hardware acceleration disabled
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
clear_uniforms_before_first_program_use
decode_encode_srgb_for_generatemipmap
disable_delayed_copy_nv12
disable_discard_framebuffer
disable_framebuffer_cmaa
exit_on_context_lost
force_cube_complete
scalarize_vec_and_mat_constructor_args
texsubimage_faster_than_teximage
Problems Detected
Some drivers are unable to reset the D3D device in the GPU process sandbox
Applied Workarounds: exit_on_context_lost
TexSubImage is faster for full uploads on ANGLE
Applied Workarounds: texsubimage_faster_than_teximage
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
ANGLE crash on glReadPixels from incomplete cube map texture: 518889
Applied Workarounds: force_cube_complete
Framebuffer discarding can hurt performance on non-tilers: 570897
Applied Workarounds: disable_discard_framebuffer
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Decode and Encode before generateMipmap for srgb format textures on Windows: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Delayed copy NV12 displays incorrect colors on NVIDIA drivers.: 728670
Applied Workarounds: disable_delayed_copy_nv12
Native GpuMemoryBuffers have been disabled, either via about:flags or command line.
Disabled Features: native_gpu_memory_buffers
Version Information
Data exported	2018-01-22T19:29:14.718Z
Chrome version	Chrome/66.0.3326.0
Operating system	Windows NT 10.0.15063
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/49e494a85ddc4ccb03e120b0d16dea4507495e22/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/49e494a85ddc4ccb03e120b0d16dea4507495e22/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	342b83d49c4d
2D graphics backend	Skia/66 16d0ad06b46841c78cce816406574314fab95c13-
Command Line	"out\Debug\chrome.exe" --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	343
In-process GPU	false
Passthrough Command Decoder	true
Direct Composition	true
Supports overlays	false
Sandboxed	false
GPU0	VENDOR = 0x10de, DEVICE= 0x1c81 *ACTIVE*
Optimus	false
Optimus	false
AMD switchable	false
Desktop compositing	Aero Glass
Diagonal Monitor Size of \\.\DISPLAY1	24.0"
Diagonal Monitor Size of \\.\DISPLAY2	72.2"
Driver vendor	NVIDIA
Driver version	22.21.13.8541
Driver date	8-21-2017
Pixel shader version	5.0
Vertex shader version	5.0
Max. MSAA samples	8
Machine model name	
Machine model version	
GL_VENDOR	Google Inc.
GL_RENDERER	ANGLE (NVIDIA GeForce GTX 1050 Direct3D11 vs_5_0 ps_5_0)
GL_VERSION	OpenGL ES 2.0 (ANGLE 2.1.0.342b83d49c4d)
GL_EXTENSIONS	GL_ANGLE_client_arrays GL_ANGLE_depth_texture GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_lossy_etc_decode GL_ANGLE_pack_reverse_row_order GL_ANGLE_program_cache_control GL_ANGLE_request_extension GL_ANGLE_robust_client_memory GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_CHROMIUM_bind_generates_resource GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_color_buffer_float_rgb GL_CHROMIUM_color_buffer_float_rgba GL_CHROMIUM_copy_compressed_texture GL_CHROMIUM_copy_texture GL_CHROMIUM_sync_query GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers GL_EXT_frag_depth GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_shader_texture_lod GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc_srgb GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_storage GL_EXT_unpack_subimage GL_KHR_debug GL_NV_EGL_stream_consumer_external GL_NV_fence GL_NV_pack_subimage GL_NV_pixel_buffer_object GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth32 GL_OES_element_index_uint GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Window system binding vendor	Google Inc. (adapter LUID: 00000000000177e4)
Window system binding version	1.4 (ANGLE 2.1.0.342b83d49c4d)
Window system binding extensions	EGL_EXT_create_context_robustness EGL_ANGLE_d3d_share_handle_client_buffer EGL_ANGLE_d3d_texture_client_buffer EGL_ANGLE_surface_d3d_texture_2d_share_handle EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_ANGLE_direct_composition EGL_NV_post_sub_buffer EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_ANGLE_stream_producer_d3d_texture EGL_ANGLE_create_context_webgl_compatibility EGL_CHROMIUM_create_context_bind_generates_resource EGL_CHROMIUM_sync_control EGL_EXT_pixel_format_float EGL_KHR_surfaceless_context EGL_ANGLE_display_texture_share_group EGL_ANGLE_create_context_client_arrays EGL_ANGLE_program_cache_control EGL_ANGLE_robust_resource_initialization
Direct rendering	Yes
Reset notification strategy	0x8252
GPU process crash count	0
Compositor Information
Tile Update Mode	One-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	Software only
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	GPU_READ, SCANOUT
RGBA_8888	GPU_READ, SCANOUT
BGRX_8888	Software only
BGRX_1010102	Software only
BGRA_8888	Software only
RGBA_F16	Software only
YVU_420	Software only
YUV_420_BIPLANAR	Software only
UYVY_422	Software only
Display(s) Information
Info	Display[2779098405] bounds=0,0 3840x2160, workarea=0,0 3840x2120, scale=1, external
Color space information	{primaries:[[0.6735,0.1657,0.1250,],[0.2790,0.6754,0.0456,],[-0.0019,0.0300,0.7969,],], transfer:0.0000*x + 0.0000 if x < 0.0000 else (1.0000*x + 0.0000)**2.4000 + 0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Info	Display[2528732444] bounds=-1920,731 1920x1200, workarea=-1920,731 1920x1160, scale=1, external
Color space information	{primaries:[[0.2053,0.1492,0.6097,],[0.6257,0.0632,0.3111,],[0.0609,0.7446,0.0195,],], transfer:0.0000*x + 0.0000 if x < 0.0000 else (1.0000*x + 0.0000)**2.2000 + 0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2304 pixels
Decode h264 main	up to 4096x2304 pixels
Decode h264 high	up to 4096x2304 pixels
Decode vp8	up to 4096x2304 pixels
Decode vp9 profile0	up to 4096x2304 pixels
Decode vp9 profile1	up to 4096x2304 pixels
Decode vp9 profile2	up to 4096x2304 pixels
Decode vp9 profile3	up to 4096x2304 pixels
Encode h264 baseline	up to 3840x2176 pixels and/or 30.000 fps
Encode h264 main	up to 3840x2176 pixels and/or 30.000 fps
Encode h264 high	up to 3840x2176 pixels and/or 30.000 fps
Diagnostics
0
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	12
dwHeight	1200
dwRefreshRate	59
dwWHQLLevel	0
dwWidth	1920
iAdapter	1
lDriverSize	893272
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	GeForce GTX 1050
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Integrated RAMDAC
szDDIVersionEnglish	12
szDDIVersionLocalized	12
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	
szDescription	NVIDIA GeForce GTX 1050
szDeviceId	0x1C81
szDeviceIdentifier	{D7B71E3E-5FC1-11CF-AF7A-5D411BC2DB35}
szDeviceName	\\.\DISPLAY1
szDisplayMemoryEnglish	4095 MB
szDisplayMemoryLocalized	4095 MB
szDisplayModeEnglish	1920 x 1200 (32 bit) (59Hz)
szDisplayModeLocalized	1920 x 1200 (32 bit) (59Hz)
szDriverAssemblyVersion	22.21.13.8541
szDriverAttributes	Final Retail
szDriverDateEnglish	8/20/2017 4:00:00 PM
szDriverDateLocalized	8/20/2017 16:00:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 2.2
szDriverModelLocalized	WDDM 2.2
szDriverName	C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll
szDriverNodeStrongName	oem3.inf:0f066de3900d3b82:Section094:22.21.13.8541:pci\ven_10de&dev_1c81
szDriverSignDate	Unknown
szDriverVersion	22.21.0013.8541
szKeyDeviceID	Enum\PCI\VEN_10DE&DEV_1C81&SUBSYS_61503842&REV_A1
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{CC40089A-DBDE-4DE2-BAD6-E6208F884F7F}\0000
szManufacturer	NVIDIA
szMiniVdd	unknown
szMiniVddDateEnglish	Unknown
szMiniVddDateLocalized	unknown
szMonitorMaxRes	Unknown
szMonitorName	Generic PnP Monitor
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00D12001
szRegHelpText	Unknown
szRevision	Unknown
szRevisionId	0x00A1
szSubSysId	0x61503842
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	unknown
szVendorId	0x10DE
1
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	12
dwHeight	2160
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	3840
iAdapter	0
lDriverSize	893272
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	GeForce GTX 1050
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Integrated RAMDAC
szDDIVersionEnglish	12
szDDIVersionLocalized	12
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	
szDescription	NVIDIA GeForce GTX 1050
szDeviceId	0x1C81
szDeviceIdentifier	{D7B71E3E-5FC1-11CF-AF7A-5D411BC2DB35}
szDeviceName	\\.\DISPLAY2
szDisplayMemoryEnglish	4095 MB
szDisplayMemoryLocalized	4095 MB
szDisplayModeEnglish	3840 x 2160 (32 bit) (60Hz)
szDisplayModeLocalized	3840 x 2160 (32 bit) (60Hz)
szDriverAssemblyVersion	22.21.13.8541
szDriverAttributes	Final Retail
szDriverDateEnglish	8/20/2017 4:00:00 PM
szDriverDateLocalized	8/20/2017 16:00:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 2.2
szDriverModelLocalized	WDDM 2.2
szDriverName	C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_ce1961376673184c\nvldumdx.dll
szDriverNodeStrongName	oem3.inf:0f066de3900d3b82:Section094:22.21.13.8541:pci\ven_10de&dev_1c81
szDriverSignDate	Unknown
szDriverVersion	22.21.0013.8541
szKeyDeviceID	Enum\PCI\VEN_10DE&DEV_1C81&SUBSYS_61503842&REV_A1
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{CC40089A-DBDE-4DE2-BAD6-E6208F884F7F}\0001
szManufacturer	NVIDIA
szMiniVdd	unknown
szMiniVddDateEnglish	Unknown
szMiniVddDateLocalized	unknown
szMonitorMaxRes	Unknown
szMonitorName	Generic PnP Monitor
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00D12001
szRegHelpText	Unknown
szRevision	Unknown
szRevisionId	0x00A1
szSubSysId	0x61503842
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	unknown
szVendorId	0x10DE
Log Messages
[5656:18864:0122/112900.845:WARNING:angle_platform_impl.cc(59)] : initializeD3DDevice(800): Failed creating Debug D3D11 device - falling back to release runtime.
[1136:35376:0122/112907.732:WARNING:angle_platform_impl.cc(59)] : initializeD3DDevice(800): Failed creating Debug D3D11 device - falling back to release runtime.
GpuProcessHostUIShim: The GPU process exited normally. Everything is okay.

Comment 3 by piman@chromium.org, Jan 22 2018

Cc: sunn...@chromium.org

Comment 4 by piman@chromium.org, Jan 22 2018

Cc: danakj@chromium.org
Cc: weiliangc@chromium.org
Wei pointed me to SurfaceAggregator::aggregate_only_damaged_, which skips adding quads for un-damaged regions, so we explicitly draw black for those quads.

The issue, in particular, is that we will change the root damage rect when we reshape over here

https://cs.chromium.org/chromium/src/components/viz/service/display/direct_renderer.cc?rcl=8f4849d7239a4f98a2d817f1f87070c118aeb0c1&l=248

Perhaps the easy solution is to call something to arrange the reshape before calling Aggregate.
Owner: ccameron@chromium.org
Status: Assigned (was: Available)
Cc: manoranj...@chromium.org sc00335...@techmahindra.com ranjitkan@chromium.org abdulsyed@chromium.org kkaluri@chromium.org vamshi.k...@techmahindra.com gov...@chromium.org krajshree@chromium.org vmp...@chromium.org
 Issue 796828  has been merged into this issue.
Cc: -krajshree@chromium.org -abdulsyed@chromium.org -gov...@chromium.org -manoranj...@chromium.org -kkaluri@chromium.org -sc00335...@techmahindra.com -vamshi.k...@techmahindra.com -ranjitkan@chromium.org
Actually, I'll do a separate workaround for the sub-bug (cause I'll want to merge it aggressively).

Comment 9 by sadrul@chromium.org, Feb 26 2018

gpu triage: ping on idle p1 bug.
Labels: -Pri-1 Pri-3
Dropping to P3

Wei and I were discussing the option of moving all overlay processing to much earlier in the pipeline, like, re-shuffling things to right after surface aggregation (so we take the CompositorFrame and then produce a new Overlay-ified-CompositorFrame). That ... solves a different problem ... but it moves where we might mess with damage rects to somewhere else where we might be able to later say "oh ... we messed with the damage rects, we need to re-aggregate".

I thot we aggregate everything regardless of damage, and then just cull during drawing based on the damage, is that wrong? Are you thinking of changing that? 
My understanding was that aggregate_only_damaged_ skipped non-damaged areas (but it may be that that just culls the draw list after the fact -- I haven't looked at the details).
We do that as we aggregate.

If we have partial swap, we set the aggregate_only_damaged_ during constructor of SurfaceAggregator. Then as we go through each compositor frame and copying all the quads, we skip copying the quads if damage doesn't intersect with quad.
Oh I see, thanks.

It seems okay to me: Moving things to overlays should only shrink the damage rects, if mutating them at all, so in the worst case we have too many things aggregated. But if we had things aggregated inside that damage area, we shouldn't have shrank the rect cuz not everything in that area became an overlay.

Is that correct?

Sign in to add a comment