I personally think this CAN affect things. We are so visual. If that direct stimulation plus direct masturbation becomes the norm, it's harder with the more subtle experience with a partner. I'd cold turkey for a bit on the porn and cut back on masturbation and see if this doesn't help. Also look for stress triggers in the rest of your life. If it is still a no go, talk to your doctor. Don't be embarrassed, it happen at some point for almost every man.
Good advice from GR. Also, since you have spontaneous morning elections & no prblm getting hard otherwise, you can be assured you do not have a physical prblm. This sounds like ‘performance anxiety’ which is pretty common & has happened to a lot of us. The wurst thing we can do when this happens is to obsess about it - then, the more we think about it & worry that it’s gonna happen again, the more likely it will! I suggest being upfront with your partner, just tell her you need to take things a little slow, don’t rush into things. Get comfortable being together, you can pleasure each other manually, orally, etc. a few times, then later when you’re 100% comfortable w/ each other, move on to penetration. Try this, it might help...
As you get hard in the mornings, your body is functioning well and you don't have any health problems. You might be suffering from stress and that could be caused by thousands of reasons. The best long-term treatment for you would be trying to be relaxed and keep your mind free of any stressful thoughts.
However, in order to have a better sexual relationship, you can get Sildenafil pills right before having sex; they might help.