From patchwork Sun Sep 13 22:01:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 7170961 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B7B2BEEC1 for ; Sun, 13 Sep 2015 22:02:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 364922066C for ; Sun, 13 Sep 2015 22:02:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9621F20665 for ; Sun, 13 Sep 2015 22:02:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 633C972093; Sun, 13 Sep 2015 15:02:08 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp-1b.atlantis.sk (smtp-1b.atlantis.sk [80.94.52.26]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2EB76E658; Sun, 13 Sep 2015 15:02:06 -0700 (PDT) Received: from [192.168.0.2] (188-167-69-119.dynamic.chello.sk [188.167.69.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-1b.atlantis.sk (Postfix) with ESMTPSA id CADEC8055A61; Mon, 14 Sep 2015 00:02:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rainbow-software.org; s=atlsmtp; t=1442181723; bh=Q74V4KWfud9ESYuiVO6CPDEy2ATCxvtQRTniVC+YjPs=; h=From:To:Subject:Date:Cc:References:In-Reply-To; b=T9ipMk7vc4pKvDFYX5oGOFTBLRX43/UEKM/ZVXrbO2qP434bGNv0JzUNIdDlXBT8a VYwoIlHaek1vZrOOpFmroDxNyajFIcw4H8yfbG2NkM+RI+wtft+UWbGbMvcWBXaN5S DY4C7FeM0iEjmUvrWuxxusfzUVlZfMvmWiZyNSw4= From: Ondrej Zary To: Ilia Mirkin Subject: Re: AGP cards in PCI mode (fake slots like AGPro, AGP Express, AGI, AGX, XGP) Date: Mon, 14 Sep 2015 00:01:55 +0200 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) References: <201509132057.30674.linux@rainbow-software.org> In-Reply-To: X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201509140001.55580.linux@rainbow-software.org> Cc: "nouveau@lists.freedesktop.org" , Kernel development list , "dri-devel@lists.freedesktop.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sunday 13 September 2015 21:12:25 Ilia Mirkin wrote: > On Sun, Sep 13, 2015 at 2:57 PM, Ondrej Zary wrote: > > Hello, > > I have a PC Chips A31G board with AGPro slot and found that nouveau does > > not work properly with it. Console works but reverts to software mode, > > X11 hangs with mouse cursor only. > > > > The slot is physically AGP 1.5V but is wired to PCI bus as the chipset > > (SiS 761) does not support AGP cards. To further complicate things, the > > chipset has AGP capability - but only for the integrated video. You can > > see that in the lspci output below - the AGP card is on bus 0 and SiS > > card on bus 1 (AGP bus behind the AGP bridge). The SiS card is not used > > (can be disabled in BIOS but it does not improve things - as the AGP > > capability of the host bridge remains active). > > I believe we can handle it with a blacklist. If the chipset just > doesn't support AGP at all, we should just set agpmode=0 irrespective > of the card plugged in, right? > > Shouldn't the agpgart know about this and not even allow any setting > at all? This is where we get the idea to set 8x AGP from. See > drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c for details. The chipset does not support AGP slot but supports AGP for the integrated video. So it shouldn't be completely disabled. > The alternative is to add to nvkm_device_agp_quirks, and just add > something that matches just the host bridge vendor/device, ignoring > the chip. Something like this? diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c index 814cb51..385a90f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c @@ -35,6 +35,8 @@ static const struct nvkm_device_agp_quirk nvkm_device_agp_quirks[] = { /* VIA Apollo PRO133x / GeForce FX 5600 Ultra - fdo#20341 */ { PCI_VENDOR_ID_VIA, 0x0691, PCI_VENDOR_ID_NVIDIA, 0x0311, 2 }, + /* SiS 761 does not support AGP cards, use PCI mode */ + { PCI_VENDOR_ID_SI, 0x0761, PCI_ANY_ID, PCI_ANY_ID, 0 }, {}, }; @@ -137,8 +139,10 @@ nvkm_agp_ctor(struct nvkm_pci *pci) while (quirk->hostbridge_vendor) { if (info.device->vendor == quirk->hostbridge_vendor && info.device->device == quirk->hostbridge_device && - pci->pdev->vendor == quirk->chip_vendor && - pci->pdev->device == quirk->chip_device) { + (quirk->chip_vendor == (u16)PCI_ANY_ID || + pci->pdev->vendor == quirk->chip_vendor) && + (quirk->chip_device == (u16)PCI_ANY_ID || + pci->pdev->device == quirk->chip_device)) { nvkm_info(subdev, "forcing default agp mode to %dX, " "use NvAGP= to override\n", quirk->mode);