NetBSD Problem Report #55743

From reinoud@diablo.13thmonkey.org  Wed Oct 21 19:46:02 2020
Return-Path: <reinoud@diablo.13thmonkey.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E89491A923E
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 21 Oct 2020 19:46:02 +0000 (UTC)
Message-Id: <20201021194600.98DC5C138CC@diablo.13thmonkey.org>
Date: Wed, 21 Oct 2020 21:46:00 +0200 (CEST)
From: reinoud@13thmonkey.org
Reply-To: reinoud@13thmonkey.org
To: gnats-bugs@NetBSD.org
Subject: There is no support for VGA arbiter thus no multi PCI card support (with possible fix)
X-Send-Pr-Version: 3.95

>Number:         55743
>Category:       xsrc
>Synopsis:       There is no support for VGA arbiter thus no multi PCI card support (with possible fix)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 21 19:50:00 +0000 2020
>Last-Modified:  Thu Oct 22 17:10:01 +0000 2020
>Originator:     Reinoud Zandijk
>Release:        NetBSD 9.0_STABLE
>Organization:
NetBSD

>Environment:


System: NetBSD diablo.13thmonkey.org 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #0: Sun Oct 4 18:24:07 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
Starting X on a dual video card setup gives strange results. In this setup I
have two (different) plugged in PCI cards:

radeon0 at pci2 dev 0 function 0: vendor 1002 product 68f9 (rev. 0x00)
radeon1 at pci9 dev 0 function 0: vendor 1002 product 68e1 (rev. 0x00)

radeondrmkmsfb0 at radeon1
wsdisplay0 at radeondrmkmsfb0 kbdmux 1: console (default, vt100 emulation), using wskbd0

radeondrmkmsfb1 at radeon0
wsdisplay1 at radeondrmkmsfb1 kbdmux 1

The BIOS and the start of the kernel uses radeon0 and when drmkms kicks in,
the display switches to radeon1. I have no idea why they are enumerated the
other way around when attaching their radeondrmkmsfb's. I haven't been able to
get a wscons tty on wsdisplay1 yet but thats another PR I guess.

When starting X, the log explicitly tells:
[ 13277.496] (--) PCI: (2@2:0:0) 1002:68f9:1682:3030 rev 0, Mem @ 0xb0000000/268435456, 0xfb9c0000/131072, I/O @ 0x00009000/256, BIOS @ 0x????????/131072
[ 13277.496] (--) PCI:*(9@9:0:0) 1002:68e1:1787:3000 rev 0, Mem @ 0xd0000000/268435456, 0xfbec0000/131072, I/O @ 0x0000e000/256, BIOS @ 0x????????/131072
....
[ 13277.638] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support

And thus all other cards seem to be ignored. The /dev/dri/card0 and
/dev/dri/card1 devices are opened multiple times and queried and the
enumeration in X also goes well so I think it bombs out on this.


>How-To-Repeat:

Plug two PCI (or PCI-e or whatever) graphic cards in one machine and start X.

>Fix:


The current code in xsrc/external/mit/libpciaccess/dist/src has no NetBSD
specific code to deal with this and uses the generic code that opens an non
existing device and thus fails reporting the error but there is OpenBSD code
for the vgaarbiter that implements it. Needed code could be ported from the
OpenBSD implementation.

>Audit-Trail:
From: Reinoud Zandijk <reinoud@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/55743: There is no support for VGA arbiter thus no multi
 PCI card support (with possible fix)
Date: Wed, 21 Oct 2020 22:58:54 +0200

 The current companion code in OpenBSD is in OpenBSD's dev/pci/pci.c ioctl()
 code and is on quick read nothing more than maintaining a lock for each VGA
 class device and mapping/unmapping its IO and MEM range mapping in the PCI
 configuration space.

From: Michael <macallan@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/55743: There is no support for VGA arbiter thus no multi
 PCI card support (with possible fix)
Date: Thu, 22 Oct 2020 13:05:37 -0400

 Hello,

 > [ 13277.638] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
 > 
 > And thus all other cards seem to be ignored. The /dev/dri/card0 and
 > /dev/dri/card1 devices are opened multiple times and queried and the
 > enumeration in X also goes well so I think it bombs out on this.
 > 
 > 	
 > >How-To-Repeat:  
 > 	
 > Plug two PCI (or PCI-e or whatever) graphic cards in one machine and start X.

 IIRC this is for the fixed VGA IO registers only, which would overlap.
 I have used multiple PCI VGAs on non-x86 hardware ( which tends to
 leave those disabled and just use the BARs ) since ~forever, without
 the arbiter.
 I seriously doubt that there's a lot graphics hardware made in this
 century which depends on the fixed VGA registers, or even has them
 enabled on powerup.

 We should probably drop the arbiter requirement and just let X
 configure whatever it finds.

 have fun
 Michael

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.