The display priority is fixed in the firmware, so as James says, it's not normally possible.
You might be able to do it with his multiple framebuffer beta firmware (see https://www.raspberrypi.org/forums/view ... 3&t=216399
Failing that, the only way to do it currently (AFAIK) is to reboot the PI to switch the screen priority (since the DSI screen is only initialised at boot)
I have a script for PINN which will allow you to detect both the DSI and HDMI screens and set a preference if they are both detected. It relies on detecting the screens, setting the config.txt parameters appropriately, and then rebooting if the wrong mode is currently selected.
You can find it at https://sourceforge.net/projects/pinn/f ... rce=navbar
You will need to delete config.hyp3 and config.hyp4 and modify pinn_init.sh to remove references to hyp3 and hyp4 to just leave the options for dsi and hdmi. Also change 'rebootp' to 'sudo reboot'. Then make sure pinn_init.sh is run on boot (probably change the name to something more appropriate).
It should work in Raspbian, but I've not tried it. You might have to adapt it from the buildroot shell syntax (ash) to raspbian's (bash).