Ubuntu screen flickering

For the last few weeks, I was occasionally experiencing screen flickering. It was randomly blinking black. Initially, I thought it was my laptop. This kind of problem looks like hardware malfunction at first glance. I have Dell XPS 7590 (Ubuntu 22.04), which had undergone repair last year. I had some problems with the display, so I thought it might be the case.

Last week, the flickering became a burden. It began to happen very often and was irritating. I googled it, and it turned out, that it's an Ubuntu problem. Here's what I've done.

  1. Open file /etc/default/grub.

  2. Find GRUB_CMDLINE_LINUX_DEFAULT key and add i915.enable_dc=0 intel_idle.max_cstate=2 i915.enable_psr=0.

    Full line after the changes:

     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_dc=0 intel_idle.max_cstate=2 i915.enable_psr=0"
    
  3. Run update-grub (I'm not sure if this step is necessary).

  4. Reboot and the flickering is gone.

To be honest, I've no idea what these entries do, but I'm happy that problem is solved :).