Mac mini screen off and on after log in
Mac mini 2018, 6 core Intel I7 connected via USB-C port to a Viewsonic monitor. The OS is Big Sur 11.6. I had so far no problem except two days ago, after I logged in, the monitor turns itself off (no signal) and on again. Sometimes it is ok for some time and then starts again. When the log in screen appears after sleep, it does not happen. It happens only after logging in.
I have the hard drive partitioned and Mojave installed on the other partition because of use of some older programs. So I restarted, and on that system it was ok, no off and on of the monitor. I updated the system (security update), since I had not logged in for some time and still ok. Then I logged in back to the other partition with Big Sur and all was fine for the day. However, when I started this morning after computer was asleep, the problem was there again, and this time after logging in to Mojave, the screen was and stayed dark (no signal), although I saw the Mouse icon on the screen. I have no idea, what is going on. I have ClamXV installed, and also check regularly with clean my mac virus detection but so far I never had a virus.
Mac mini, macOS 11.6