Based on Isaak I. Aleksandrov's patch https://gitlab.com/snippets/1986228 with small tweaks for compat with other drivers than 440.82