Prevent Screen Tearing out of the Gate on Intel, AMD & Nvidia GPUs?

I am kinda surprised that Linux distros don’t do a better job with this, as I think I often have to configure additional settings for Intel GPUs to avoid screen tearing. This appears to work for me with my Intel CPU/GPUs, but could we detect certain GPUs and apply the proper screen tearing fixes to them from the start?

Can test against this video.

Intel® HD Graphics 500

Section "Module"
    Load "dri3"

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "DRI"   "3"

This is a difficult one. There are a number of areas that impact screen tearing which make packaging nigh on impossible.

  1. Window Manager - some window managers have more screen tearing issues than others - so how should a package cater for this?
  2. Kernel - mesa updates - this area is frequently updated by kernel updates and kernel releases. So a mesa update in a kernel can make things worse or better - so a workaround like you described could make things difficult to diagnose/make things better or worse to understand.
    2.5 worse - when moving to a new release (e.g. 21.10 to 22.04) will involve a biggish jump of mesa / kernel - so a config file manually applied at 21.10 probably will impact (and hang around) after the upgrade.
  3. Apps themselves - some apps have screen tearing themselves - so - for example - vlc may behave better on some scenarios … celluloid better in others. So again what are we trying to target here?
  4. Graphics drivers themselves - do have a direct impact on stuff - so - as the example given - using the older intel driver in a xorg.conf can appear to make things better for you - for others who have a similar but not identical intel card will behave oddly.

All in all - I don’t know of a straightforward answer here.