2 Chainz kept it cool in court this yesterday morning (Monday) as he gave his plea in a felony drug case.

He was busted at LAX last June for carrying a bottle of lean in his luggage. Accompanied by his lawyer, he pleaded guilty to misdemeanor drug possession and received probation -- no jail time.

But the judge in the case is apparently such a fan that he gave Chainz a gift -- nice little sobriety bracelet.