st/dri: Refactor init code a bit