MacBook display black after bootup
I have a 2009 MacBook. I was using safari, and the screen went black, brought me to the login screen, turned back off, and went back to the login screen, all in about 3 seconds. I logged in to my profile, and it went back again. So I decided to force reboot it, but when it was done loading, instead of going to the profile login page, the screen went black again.
I do not have an external display to test to see if there is a type of hardware issue with the graphics card, or whatever controls the screen, all I can do myself is do software work.
Any ideas as to the cause are welcome.
MacBook, macOS Sierra (10.12.4), Late 2009 Unibody MacBook