The first one is correct. "Did you take your dinner?"
When making questions (and negations) in past tense, you need to use the auxiliary verb "to do", which is then in past tense, and the main verb is in bare infinitive form (form of infinitive without "to").
So you have: "It went well.", but "Did it go well?"
He did it.
Did he do it?
He didn't do it.