dm: Move device display into its own function