r600g: start splitting out common code from eg/r600.