xrandr: Can't open display?

I'm installing 14.2 on a Latitude 7490 by working my way through the handbook and in section 5.4.4.1 the instructions are to use xrandr to list the supported monitor modes. Yet when I run the command I see this:

$ xrandr
Can't open display

Following instructions earlier in chapter 5 I've installed the i915kms driver from ports. It appears to be installed correctly kldstat shows it is loaded:

$ kldstat | grep i915
4 1 0xffffffff837f9000 1e2228 i915kms.ko

And I see the following bits from dmesg:

drmn0: successfully loaded firmware image 'i915/kbl_dmc_ver1_04.bin'
drmn0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)


[drm] Initialized i915 1.6.0 20201103 for drmn0 on minor 0
VT: Replacing driver "efifb" with new "drmfb".
start FB_INFO:
height=1080 width=1920 depth=32
pbase=0xa0000000 vbase=0xfffff800a0000000
name=drmn0 id=i915drmfb flags=0x0 stride=7680
end FB_INFO

I have also tried defining DISPLAY as :0 and get the error "Can't open display :0" from xrandr.

How am I supposed to get the list of supported modes so I can configure x11 correctly?

Thanks!
B
 
To get the most likely thing out of the way : is X running, or are you doing that on the VT console?
 
[…] by working my way through the handbook and in section 5.4.4.1 the instructions are to use xrandr to list the supported monitor modes. […]
Evidently you are not working your way through the handbook. Right in front of § 5.4.4.1 it says:​
Other resolutions supported by the monitor can be chosen by setting the desired resolution in configuration files, or after the X server has been started with xrandr(1).​
[…] How am I supposed to get the list of supported modes so I can configure x11 correctly?
There are two boxes in said handbook chapter:​
Video cards, monitors, and input devices are automatically detected and do not require any manual configuration. Do not create xorg.conf or run a -configure step unless automatic configuration fails.​
Video cards, monitors, and input devices are automatically detected and do not require any manual configuration. Do not create xorg.conf or run a Xorg -configure step unless automatic configuration fails.​
Did you attempt running startx(1) and it failed? Except on prehistoric hardware you do not need to configure anything up front.​
 
Did you attempt running startx(1) and it failed?​

Yes, exactly. That's why I was going through the parts of the handbook to configure x11. I am not sure what I did before but starting over and clearing out the files I created in the /usr/local/etc/X11/xorg.conf.d directory fixed my problems. I'm able to run startx and get a graphical environment.
 
Back
Top