Technology from motorsport will be used to give BMW performance engines a lifeline, and a path through the next wave of tough European emissions regulations.