Taking this from John King Fairbank's China: A New History and editorializing a little, I would say that in both cases it was marginal in sense of acting mostly at the periphery, but where it did so it was very significant in that it served at least one vital function.
In the case of the Ming dynasty, it is difficult to overstate the importance of the fact that its founder, Zhu Yuanzhang, was an illiterate peasant who only learned to read and became educated after being taken in by Buddhist priests.
However, the Hongwu Emperor (as he dubbed himself) was very much a Confucian ideologue (in addition to being a paranoid autocrat à la Stalin), and while it wouldn't be right to say that he persecuted Buddhism in any sense, the focus of his tenure was on the creation of an autarkic agricultural state for which a particular interpretation of Confucianism was both motive and means.
The Qing dynasty pursued a policy of keeping the Mongols divided and pacified; in this, Buddhism played a role. As JKF puts it, "...the Yellow Lamaist sect of Tibetan Buddhism [...] had spread among the Mongols and oriented them toward Lhasa."
That makes sense: ever since the Xianbei had invaded invaded at the end of the Han dynasty, outsiders in China had viewed Buddhism as sort of the "official Chinese non-Chinese religion." As JKF explains, "Non-Chinese invaders of North China, in the fourth century and after, accepted Buddhism partly because, like themselves, it came from outside the old order that they were taking over."
The bottom line though is that Buddhism never really recovered from the persecution at the end of the Tang dynasty. It continued ever after to be culturally influential, but it never regained its status as a powerful, semi-independent institution.