firmware-open icon indicating copy to clipboard operation
firmware-open copied to clipboard

dGPU is used as boot VGA device

Open crawfxrd opened this issue 2 years ago • 2 comments

  • Model: Any unit with external dGPU ports
  • BIOS version: e5c3632a2ac8
  • OS: Pop!_OS 22.04
  • Kernel: 6.2.7-060207-generic

The dGPU is being used as boot VGA device instead of the iGPU.

Steps to reproduce

  1. Boot system in hybrid graphics mode with external display attached to any dGPU port
  2. Check grep . /sys/devices/pci0000:00/0000:00:{02.0,01.0/0000:01:00.0}/boot_vga

Expected behavior

  • boot_vga is set to the iGPU

Actual behavior

  • boot_vga is set to the dGPU

Additional info

coreboot looks correct:

[DEBUG]  found VGA at PCI: 00:02.0
[DEBUG]  found VGA at PCI: 01:00.0
[DEBUG]  Setting up VGA for PCI: 00:02.0
[DEBUG]  Setting PCI_BRIDGE_CTL_VGA for bridge DOMAIN: 0000
[DEBUG]  Setting PCI_BRIDGE_CTL_VGA for bridge Root Device

linux incorrectly overrides the boot VGA device:

[    0.372557] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.372557] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.372557] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.372557] pci 0000:01:00.0: vgaarb: setting as boot VGA device (overriding previous)
[    0.372557] pci 0000:01:00.0: vgaarb: bridge control possible
[    0.372557] pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.372557] vgaarb: loaded

edk2 creates Graphics Info HOB from the coreboot FB:

Found coreboot video frame buffer information
physical_address: 0x90000000
x_resolution: 0x780
y_resolution: 0x4B0
bits_per_pixel: 0x20
bytes_per_line: 0x1E00
red_mask_size: 0x8
red_mask_pos: 0x10
green_mask_size: 0x8
green_mask_pos: 0x8
blue_mask_size: 0x8
blue_mask_pos: 0x0
reserved_mask_size: 0x8
reserved_mask_pos: 0x18
Created graphics info hob

although GraphicsDeviceInfo HOB is not created:

[GraphicsOutputDxe]: GraphicsDeviceInfo HOB doesn't exist!

GraphicsConsole enumerates the dGPU device first:

Found PCI Display device
...
GraphicsConsole video resolution 2560 x 1440
Graphics Console Started, Mode: 2
...
Found PCI Display device
...
GraphicsConsole video resolution 1920 x 1200
Graphics Console Started, Mode: 2

crawfxrd avatar Jun 22 '23 21:06 crawfxrd

oryp8 is also affected on 4136ef8f2b09.

crawfxrd avatar Jun 22 '23 22:06 crawfxrd

system76/edk2@d3b38ea28a2d is suspicious. This commit was upstreamed in tianocore/edk2@2b4b8013fe45.

crawfxrd avatar Jun 28 '23 03:06 crawfxrd