On Tue, Oct 03, 2017 at 11:15:33PM +0000, Andrew Daugherity wrote:
> I tested this diff in combination with your "Implement machine gop command"
> diff on a Dell PowerEdge R230 and a VirtualBox VM (EFI enabled).  No
> regressions, however 'machine gop' doesn't work quite how I expected it to
> -- it seems the video mode set with it only applies to the bootloader, and
> once the kernel loads, it sets a different mode (possibly a bad one).  I
> was hoping the kernel would use the mode I just set.
Thanks a lot for testing! I'm working on the kernel part.

> Sometimes the 800x600 and 640x480 modes either have parts of the screen cut
> off, or show a blank screen (but the resolution does change).  Not a huge
> deal, since the default 1024x768 mode works fine; also, the FreeBSD loader
> has the same issue.
This is probably due to buggy firmware implementations. I've seen such
behaviour on many (all?) boards.

> It seems that the 'machine video' setting (e.g. 80x25, 100x31, etc.) is
> independent of 'machine gop', and they can trample each other: changing the
> "gop" mode does not resize the "video" mode, but changing the "video" mode
> always resets the "gop" mode to 1024x768.
I cannot reproduce this on a DELL Latitiude E5550, setting modes for
both protocols works fine without one breaking or resetting the other.
I'll test other boards when possible.

        boot> machine video
        Mode 0: 80 x 25
        Mode 1: 80 x 50
        Mode 2: 100 x 31
        Mode 3: 240 x 56
        
        Current Mode = 2
        boot> machine gop
        Mode 0: 1280 x 1024 (stride = 1280)
        Mode 1: 1024 x 768 (stride = 1024)
        Mode 2: 640 x 480 (stride = 640)
        Mode 3: 800 x 600 (stride = 800)
        Mode 4: 1920 x 1080 (stride = 1920)
        
        Current Mode = 3
        boot> machine video 3
        Current Mode = 3
        boot> machine gop 4
        Current Mode = 4


> Here are the available modes in VirtualBox:
> ====
> >> OpenBSD/amd64 BOOTX64 3.35
> boot> machine video
> Mode 0: 80 x 25
> Mode 2: 100 x 31
> Mode 3: 128 x 40
> 
> Current Mode = 2
> boot> machine gop
> Mode 0: 640 x 480 (stride = 640)
> Mode 1: 800 x 600 (stride = 800)
> Mode 2: 1024 x 768 (stride = 1024)
> Mode 3: 1280 x 1024 (stride = 1280)
> Mode 4: 1440 x 900 (stride = 1440)
> Mode 5: 1920 x 1200 (stride = 1920)
> 
> Current Mode = 2
> ====
> All of them work properly, with the caveats described above.  Once the
> kernel loads, it switches to 1920x1200 with a windowboxed 100x31 console.
Same windowboxed behaviour here on all tested machines.

> The Dell R230 only has video mode 0 (80x25); the gop modes listed vary
> depending on whether the BIOS setting "Load Legacy Video Option ROM" is
> enabled.  With it enabled, it only lists modes 0-2, defaulting to 2
> (1024x768).  With it disabled, there are additional modes for 1280x960 and
> 1280x1024 (our rackmount KVM monitor is 1280x1024 native, but specifies a
> preferred mode of 1024x768 in its EDID).
> 
> All these modes work properly in the bootloader (640x480 & 800x600 have the
> same issues as VirtualBox, but everything else is fine), but once the
> OpenBSD kernel loads, it sets the resolution to 1024x768, and scrambles the
> video output (regardless of gop mode) as mentioned at [1][2] if the legacy
> video ROM is disabled. Since that posting, the spontaneous reboot has been
> fixed, and serial console support was added to the EFI bootloader, so I was
> able to install OpenBSD in EFI mode, and recently randomly discovered that
> toggling this BIOS setting "fixes" the OpenBSD console.
> 
> This setting is described in the manual [3, p. 44] as:
> Load Legacy Video Option ROM
> -----------------------------
> “Enables you to determine whether the system BIOS loads the legacy video
> (INT 10H) option ROM from the video controller. Selecting[sic] Enabled [if]
> the operating system does not support UEFI video output standards. This
> field is available only for UEFI boot mode. You cannot set the option to
> Enabled if UEFI Secure Boot mode is enabled."
> 
> With it enabled, the kernel sets a 1024x768 mode (100x31 letterboxed) and
> displays mostly correctly (some stray garbage on the leftmost 2 pixels).
> With it disabled (the default), video is scrambled to a thin purple line
> and efifb(4) is listed as not configured; X still works in either case.
> FreeBSD & Linux consoles are fine even with the legacy video ROM disabled.
> I've included the dmesgs for both cases.
Sounds like FreeBSD and Linux fall back to the old Universal Graphics
Adapter Protocal, which still relies on VGA. We only support GOP, which
is the hardware independent successor of UGA.

> Thanks,
> 
> Andrew
> 
> [1] https://marc.info/?l=openbsd-misc&m=146343624320665&w=2
> [2] https://marc.info/?l=openbsd-misc&m=148723613906289&w=2
> [3] http://topics-cdn.dell.com/pdf/poweredge-r230_owner's%20manual_en-us.pdf

Reply via email to