Screen flicker on Intel Iris Graphics 6100 when vsync is off

Originator:tobias.hahn
Number:rdar://32293782 Date Originated:2017-05-19
Status:Open Resolved:
Product:macOS + SDK Product Version:10.11-10.12
Classification:Serious Bug Reproducible:Always
 
Area:
Graphics & Imaging

Summary:
Running an app that uses an OpenGL context with vertical sync disabled (NSOpenGLCPSwapInterval set to 0) causes flickering and graphics corruption across the whole screen when the window is overlayed by other windows on MacBooks with an Intel Iris Graphics 6100.

Steps to Reproduce:
1. Get a MacBook Pro with an Intel Iris Graphics 6100, e.g. a Retina 13" Early 2015 (MacBookPro12,1).
2. Compile and run the attached file with
$ clang -framework AppKit -framework OpenGL -o windowFlicker windowFlicker.m && ./windowFlicker 
3. Open Xcode and choose "File > New > Project...". (Make sure that the Xcode and windowFlicker windows overlap.)
4. Continuously scroll up and down in the "Choose a template for your new project:"-sheet.

Alternatively instead of 3.+4., try
3. Enable System Preferences > Dock > Magnification.
4. Ensure that the Dock and the windowFlicker window overlap.
5. Continuously move the from one end of the Dock to the other and back.

Expected Results:
Smooth scrolling without artefacts

Observed Results:
The screen flickers. Black regions flash for a split second across large parts of Xcode's main window. The Dock is flickering non-stop. Large scale graphics corruption across the whole screen occasionally.

Version:
The problem is reproducible on the latest versions of Mac OS X 10.11 and macOS 10.12. This machine:
Mac OS X 10.11.6

Notes:
The bug seems to be triggered by frequent draw calls that are not synchronised to the screen's vertical refresh rate. Setting NSOpenGLCPSwapInterval to 1 in the attached example is a workaround (in which case the calls to glFinish will just block). It seems that the bug is somewhere in the window compositor or the OpenGL driver for this chip since it's only reproducible if there are a combination of vsync enabled and disabled windows visible on the screen. 

The problem seems to get worse if there are semi-transparent windows overlaying the windowFlicker window, or when moving windows around the screen. The problem is not related to Xcode or the Dock and can be triggered with lots of different applications. Scrolling a text file in the Atom text editor while windowFlicker is running produces similarly severe graphics glitches.

Configuration:
The problem only occurs on MacBook Pros with an Intel Iris Graphics 6100 chip on 10.11 and 10.12. It is not reproducible on machines with other Graphics chips or OSs. The machine I am using to reproduce is an Early 2015 Retina MacBook Pro 13" (MacBookPro12,1).

Comments

Thank you very much for your report, I have tried and I have the same problem

By jorge.aviles.m at May 25, 2017, 9:39 p.m. (reply...)

Source to the windowFlicker application

https://gist.github.com/anonymous/533c3f1d5a553b007e859b79341128db

By tobias.hahn at May 19, 2017, 2:33 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!