Listen to Wiz Khalifa on iHeartRadio

(TMZ) - El Paso cops are investigating a breach in jailhouse security ... they want to know how in the world Wiz Khalifa managed to sneak a selfie while he was in lockup, reports TMZ.

TMZ broke the story ... Khalifa was busted early Sunday at an airport security checkpoint for trying to carry weed on a plane.  He was hauled off to jail ... where he took a selfie and tweeted it out.

TMZ reports police have launched an investigation because inmates are NOT allowed to take pics in the jail with their phones.  Cops want to know if Khalifa was left unsupervised or if one of the jailers facilitated the pic.