"Jackass" star Bam Margera was knocked out cold after getting into a fight on the 11th floor of a Texas hotel last week ... TMZ has learned.

Bam tells TMZ ... he was at the SXSW festival late Thursday night, walking through a crowd of a bunch of drunks, "when someone said something rude to me, so I began making fun of a big girl in the group." Bam said, "I called her a sea otter and asked her why she's in Texas. She should be in Alaska laying on an iceberg because she's a beached whale."

Bam says the woman's friend punched him in the face and the two began fighting. Bam fell to the ground and the woman then delivered the knockout blow. Bam was out for 7 minutes.