caopengllayer: setting HDR mode on macOS 10.11 may lead to OpenGL context failure
When setting the HDR mode on macOS 10.11, the OpenGL context may become invalid and hence video output fails to render.
Given that proper HDR support with the Display P3 gamut was added in macOS 10.12 only, we should consider setting the mode on that version only and also only if the screen the CALayer is being displayed on is actually capable of rendering Display P3 to avoid unnecessary clamping by the OS. Additionally, keep in mind that the wrapper NSView (or any other view in that NSWIndow instance) needs to explicitly allow HDR OpenGL renderings because otherwise the setting won't have any effect.
We started setting the HDR mode in 9c269836.