I think the occasional flickering issue was originated from bug in the AppleIntelKBLGraphics*.kext.
In detail, the flickering arises some specific situation:
Kabylake CPU, integrated GPU, DP, 4K single monitor, HiDPI setting.
Solution: Spoof to Skylake GPU and use Skylake driver ...