r600g: consolidate the same piece of cut-n-paste code into a function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
3 files changed