The sentence, "The examination has been cancelled. You needn't have done all the revison, after all."means that the student didn't have to do the revision, but he has done that. Can "need't have done" be changed into "didn't need to have done", by all means, "didn't need to have done" seems grammatical-corret.
In my dialect, need may pattern as an auxiliary, giving forms such as
You need not do it.
He needn't have gone.
It may also take do support:
You don't need to do it.
He didn't need to go/have gone.
and it nearly always does so for questions:
Do you need to go?
(Need you go? is grammatical but old fashioned for me, and I probably wouldn't say it.)
I believe that in some dialects of English, the auxiliary patterning (need not) is obsolete, and people will always say don't need to.