Skip to content
  • Böszörményi Zoltán's avatar
    Don't hardcode screen 0 in GPU assignments to screens · 2145851e
    Böszörményi Zoltán authored
    
    
    When there is explicit configuration, it's better to use
    confScreen->screennum instead of hardcoded 0.
    
    When there is no configuration (default case) the screen number is
    still 0 so it doesn't change behaviour.
    
    But at least for a case when the Intel device is backed by the
    intel driver and using a screen description like this below,
    both providers are correctly assigned to :0.2.
    
      Section "Screen"
            Identifier      "SCREEN2"
            Option          "AutoServerLayout" "on"
            Device          "UDL"
            GPUDevice       "Intel2"
            Monitor         "Monitor-DVI-I-1"
            SubSection      "Display"
                    Modes   "1024x768"
                    Depth   24
            EndSubSection
      EndSection
    
      Section "ServerLayout"
            Identifier      "LAYOUT"
            Option          "AutoServerLayout" "on"
            Screen          0 "SCREEN"
            Screen          1 "SCREEN1" RightOf "SCREEN"
            Screen          2 "SCREEN2" RightOf "SCREEN1"
      EndSection
    
      # DISPLAY=:0.2 xrandr --listproviders
      Providers: number : 2
      Provider 0: id: 0xd2 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
      Provider 1: id: 0xfd cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 0 name:Intel
    
    Signed-off-by: default avatarZoltán Böszörményi <zboszor@gmail.com>
    2145851e