Kevin Hart introduced his latest comedy “Get Hard” at SXSW on Monday night by telling fans to give him their reviews on Twitter. “If you don’t like it,” Hart said with a sarcastic bite, “what I want you to do is go in the middle of the street and kill yourself.” His co-star Will Ferrell added that he wasn’t as involved with social media. “Send me handwritten notes,” Ferrell said. “Hopefully, on nice stationery.”

He might be getting a lot of mail. “Get Hard,” which Warner Bros. opens on March 27 , is packed with gay and racial jokes that had the audience in Austin laughing and cringing at the same time.

At the post-screening Q & A, a member of the audience stepped up to the mic and told director Etan Cohen: “This film seemed racist as f–.” Cohen look stunned as he stumbled for an answer about the film’s numerous jokes about African Americans. “The truth is, that was a delicate balance to find,” Cohen said. “When we were testing the movie, Ferguson was going on. It was hard to modulate … how far to push it.”

“Get Hard” may be the most high-profile comedy ever made about the subject of prison rape. Ferrell plays an L.A. millionaire who’s arrested on embezzlement charges, so he enlists the help of a stranger (Hart), whom he mistakes for a former convict, to help him toughen up and avoid being raped in jail.

What follows is a string of envelope-pushing gags, including a scene where Hart impersonates a Hispanic prisoner named Carlos and rattles off a list of racial stereotypes. In another one of the film’s more controversial moments, Ferrell turns to a white supremacist organization — called the Alliance of Whites — for protection (“I’m a big-time racist,” Ferrell says). That exchange takes place after Hart orders Ferrell to use a racial slur. “Call me the N-word,” Hart says, and he tricks Ferrell to say it by mistake.

The film is just as callous when it comes to gay jokes. As part of his prison-prep routine, Ferrell decides to try to perform oral sex on a guy, and he takes an older gentleman into a bathroom stall. “I’m going to suck your d–,” Ferrell says, but he’s so disgusted by the thought, the scene will feel homophobic to some viewers. Another running joke has Ferrell shove objects up his anus.

At the Q&A, the crowd in Austin didn’t let Cohen (who wasn’t joined by his stars) shrink away that easily. A second member of the audience wanted to know if the comedy was funny or perpetuating stereotypes. “When you do satire, that’s a big problem,” Cohen said. “That’s a dangerous thing. It’s a very small window — that’s what we’re trying to find.”