Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dGPU is used as boot VGA device #431

Open
crawfxrd opened this issue Jun 22, 2023 · 2 comments
Open

dGPU is used as boot VGA device #431

crawfxrd opened this issue Jun 22, 2023 · 2 comments

Comments

@crawfxrd
Copy link
Member

crawfxrd commented Jun 22, 2023

  • Model: Any unit with external dGPU ports
  • BIOS version: e5c3632
  • 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 crawfxrd self-assigned this Jun 22, 2023
@crawfxrd
Copy link
Member Author

crawfxrd commented Jun 22, 2023

oryp8 is also affected on 4136ef8.

@crawfxrd
Copy link
Member Author

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

@crawfxrd crawfxrd removed their assignment Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant