The idpui:displayName tag in the IDP's taglib support has more sources for an SP's display name than just the mdui element. This is useful when metadata contains a serviceName tag or you want to populate the element with the SP's hostname if no display name is set. Specifics here: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPassLoginPage#IdPAuthUserPassLoginPage-ServiceProviderName
This would be a useful addition to the $uiName variable made available in Velocity.