Jamie Mackie has agreed to join Nottingham Forest from Queens Park Rangers on a three-year deal, Sky Sports sources understand.