Up to the hardware how it presents this to the driver, up to the driver to expose it to the userspace, up to X11 or the Wayland compositor to figure it out.
Dynamically resizable displays have been a thing for like 2 decades - check out any GUI VM with guest extensions.