I dont know (where it comes from) but I know it well.

'done for' also could mean caught...doing something illegal, like by police.