Skip to content
  • Jian-Hong Pan's avatar
    xfree86: Detect the primary device by checking outputs · 836ddc79
    Jian-Hong Pan authored
    Originally, X server detects/sets the primary device by:
    1. The "PrimaryGPU" option in extra X configuration
    2. pci_device_is_boot_vga() for PCI devices
    3. Set the first (0 index) device as the primary device, if it is not
       found yet.
    
    However, the other display controllers like Amlogic's meson cannot be
    detected as the primary device by pci_device_is_boot_vga(). Thus, it has
    to set the extra X configuration for the "PrimaryGPU" option.
    Otherwise, X server will set the first (0 index) device as the primary
    device. But it may not the correct one, because it has no output.
    
    This patch adds a new way to set the primary device by detecting the
    output device. It reuses the probe_hw() and related functions in
    modesettings driver. So, it also moves them to output.c/.h as the new
    source/header files to make the code more maintainable.
    
    Buglink: xorg/xserver#1023
    
    
    Signed-off-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
    836ddc79