What part of the graphics chain rotates computer displays when in portrait mode?
On typical GPUs today it's option B: monitor rotation is done by the video output hardware ("display engine") during scan-out. In addition to rotating/flipping, the display engine can also scale the image within certain limits, do simple color/gamma correction, and even composite multiple image layers ("planes") together, all dynamically during scan-out.