Display Issues for Early 2011 Macbook Pro
Solution 1:
This is almost certainly a hardware problem. To determine whether it's the screen or the graphics card/motherboard you can plug in an external monitor. If you get the same problem on the external monitor then it's likely a fault with the graphics card/motherboard, if you don't get the same issue on the external screen then there's a problem with your MacBook's display.
Since it's an early 2011 model it should still be in warranty. I'd bring it to an Apple store and have it checked out for repair or replacement. On the plus side, you may get a brand new MacBook out of it.
Solution 2:
It'a an old thread, but right now Apple have repair program for Macbooks 2011-2013 which have video card problems. Details can be found here.
Apple has determined that a small percentage of MacBook Pro systems may exhibit distorted video, no video, or unexpected system restarts. These MacBook Pro systems were sold between February 2011 and December 2013.
Apple or an Apple Authorized Service Provider will repair affected MacBook Pro systems, free of charge.