What would you do?

Lots of food for thought here.

As far as what the OP’s D should do if it happens again, I’d suggest looking at him with a smile/laugh and saying, “Hey, [hisname], I thought you knew my name is Jane.” (insert actual name)

That leaves him with two options: he can either smile/laugh back, which enables him to retreat with dignity intact, or he can escalate in a manner that will make him look like he really, really cares about his bad grades. I strongly doubt that is what he wants to do.

Yes, he is being a jerk. But he’s probably acting from a place of pain. Unless he’s on track to be a professional player, I’m sure he knows that his prospects are not as good as those of a white girl with good grades who in his view may be more or less slumming in this class.