You're on the right track to just dump porn. That's so immediate and visual. KNOW that there are other ways to please a woman besides straight intercourse. While you work through this use those other ways. she will not mind if you are intimate with her and sexually please her with hands, toys, mouth.
If you are open to it, you might talk with a therapist experienced in sexual matters, so you can figure out what is going on. There are a lot of possibilities that can cause an erection not to come, from boredom, to performance anxiety, to buried anger, to beliefs about the man's role and the woman's role, and other causes too. Since you can get an erection when you want or initiate the sex, it sounds more like something that happens in your mind when she initiates -- maybe based on the relationship the way it is, or on the idea in your mind of men's roles and women's roles? But it's for you to figure out. Therapists are great, they can really speed up that process of figuring out what's going on. Good luck!