dri3: Move up fourcc utility function