Cosmological constraints on the matter equation of state