hi,
For primary display, you can configure booting command (bootargs) with 'di1_primary' or 'di0_primary'.
(kernel/arch/arm/mach-mx5/early_setup.c)
For rw.SECOND_DISPLAY_CONNECTED, its behavior likes,
vga as 1st display, hdmi as 2nd display, i tried by MX53 SMD with R10.3.2 (Single video with dual UI).
1. hdmi is NOT connected, UI/Video on 1st display
2. hdmi is connected, UI on 1st display & 2nd display. Video on 2nd display
3. setprop rw.SECOND_DISPLAY_CONNECTED 0
4. UI on 1st display only, video on 1st display
5. setprop rw.SECOND_DISPLAY_CONNECTED 1
6. UI on 1st display & 2nd display. Video on 2nd display
Video can be switch between 1st display & 2nd display, but you may need to modify for UI switch.