Screen flicker/artifacts on Plasma Wayland

After recent upgrade my screen started flickering occasionally. I am not sure what exactly changed, but I definitely upgraded a kernel and most likely Plasma too. First I noticed the issue on F38, so I upgraded to F39 in hope it will disappear but it stayed. However, it definitely didn’t occur before 7.11.2023.

As for the issue, the internal screen flickers every minute or so. It seems that some artefacts are displayed for a frame or two. See the enclosed screenshot and video (made from a phone, since when recording screen it doesn’t appear). When I have an external display connected the internal screen still flickers but the external does not.

My hardware: Dell XPS 13 9360
CPU: Intel i7-7500U with Intel® HD Graphics 620
Internal screen is 3K
External screen is HPU28K 4K

Any ideas what could be wrong?

Video: plasma_flicker.mkv - Google Drive

It turned out to be because of a Plasma widget that was getting screen brightness via DDC (GitHub - davidhi7/ddcci-plasmoid: KDE Plasma widget to adjust the brightness of multiple external monitors). My internal display doesn’t handle that well and flickers. Since the widget was doing this periodically the flickering was also periodical.