How to use different resolution in vt(4) for different monitors

Hello everyone.

I use a laptop that has an external display connected to it, my current setup is that for the vt() console driver, the default mode is 1920x1080 so the console has a clearer resolution for the external display:
/boot/loader.conf
Code:
kern.vt.fb.default_mode="1920x1080"

I want to be able to set a different resolution for the laptops internal monitor, I've tried this which does not work at all:
/boot/loader.conf
Code:
kern.vt.fb.modes.vgapci0="800x600"

I am trying to determine the name of the monitor, I got vgapci0 from doing this command which returned:
dmesg | grep drm
Code:
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base 0x7c000000, size 0x4000000
drmn0: successfully loaded firmware image 'i915/bxt_dmc_ver1_07.bin'
drmn0: [drm] Finished loading DMC firmware i915/bxt_dmc_ver1_07.bin (v1.7)
[drm] Initialized i915 1.6.0 20200917 for drmn0 on minor 0
name=drmn0 flags=0x0 stride=7680 bpp=32
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base 0x7c000000, size 0x4000000
drmn0: successfully loaded firmware image 'i915/bxt_dmc_ver1_07.bin'
drmn0: [drm] Finished loading DMC firmware i915/bxt_dmc_ver1_07.bin (v1.7)
[drm] Initialized i915 1.6.0 20200917 for drmn0 on minor 0
name=drmn0 flags=0x0 stride=7680 bpp=32

I don't know if it is the monitor or not, I have no clue what I am doing and just guessing random stuff, I did try to read man pages but I still do not understand how to find monitor names to put in the /boot/loader.conf file to set a resolution for the laptops internal monitor.

I use an Intel laptop with the i915 driver and KMS turned on, which from what I understand makes me able to do stuff like this in the first place.
 
I am trying to determine the name of the monitor, I got vgapci0 from doing this command which returned
vgapci0 is the name of the VGA controller, not the monitor. Look for something like LVDS-1, VGA-1, or HDMI-1. It's not the name of the monitor, it's the name of the connector.

Code:
     To set a 800x600 only on a laptop builtin screen, use the following line
     instead:

           kern.vt.fb.modes.LVDS-1="800x600"

     The connector name was found in dmesg(8):

           info: [drm] Connector LVDS-1: get mode from tunables:
           info: [drm] - kern.vt.fb.modes.LVDS-1
           info: [drm] - kern.vt.fb.default_mode

The latest drm-kmod driver's output appears to have changed since the vt(4) man page was written. I'm honestly not sure where to get it. If you also have X running on the machine it might be easier to check /var/log/Xorg.0.log:
Code:
[    42.399] (II) modeset(0): Output HDMI-2 using initial mode 1920x1080 +0+0
 
vgapci0 is the name of the VGA controller, not the monitor. Look for something like LVDS-1, VGA-1, or HDMI-1. It's not the name of the monitor, it's the name of the connector.

Code:
     To set a 800x600 only on a laptop builtin screen, use the following line
     instead:

           kern.vt.fb.modes.LVDS-1="800x600"

     The connector name was found in dmesg(8):

           info: [drm] Connector LVDS-1: get mode from tunables:
           info: [drm] - kern.vt.fb.modes.LVDS-1
           info: [drm] - kern.vt.fb.default_mode

The latest drm-kmod driver's output appears to have changed since the vt(4) man page was written. I'm honestly not sure where to get it. If you also have X running on the machine it might be easier to check /var/log/Xorg.0.log:
Code:
[    42.399] (II) modeset(0): Output HDMI-2 using initial mode 1920x1080 +0+0
Hi, so I looked at the file you mentioned (/var/log/Xorg.0.log) and the only things I could find in there was eDP-1 (name of the laptops internal display in Xorg) and HDMI-1 (name of the external display in Xorg), so I decided to use them in /boot/loader.conf to see if anything happened.

I also tried to look in dmesg() for any mentions of LVDS-1 or anything else and couldn't find anything.

I changed it to look like this:
/boot/loader.conf
Code:
kern.vt.fb.modes.eDP-1="1366x768"

Which was the name of the monitor in Xorg (or connector?) and this is also the max resolution of the monitor, I kept the default_mode part too, and what happened was I restarted my laptop and the external display wouldn't turn on after the DRM driver loads in (flickers black for a second), only the internal laptop display would turn on (but it did have the proper resolution).

I then thought maybe I need to specify a specific resolution for the external display (which according to Xorg was HDMI-1), so I added a bit and commented out another bit:
Code:
# I commented this bit out which wasn't before --- kern.vt.default_mode="1920x1080"
kern.vt.modes.HDMI-1="1920x1080"

So I then restarted the laptop again, but this time after the DRM driver loads in with the flicker, both screens WERE back on again like at the start but the external display was using the resolution I set for the laptops internal display from what I seen and this is not what I wanted.
 
Back
Top