From patchwork Fri Aug 4 10:20:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 9880949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9460602B8 for ; Fri, 4 Aug 2017 10:29:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB95228848 for ; Fri, 4 Aug 2017 10:29:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B05302899A; Fri, 4 Aug 2017 10:29:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44C9A28848 for ; Fri, 4 Aug 2017 10:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=WKwgoO94ReofgiZCYCYMxj9Mfd/+h04kFeWI/kSfMcE=; b=JXgTHz5ia72Nv9awwB8/l4lDKj aiDfuSzfTYAHq3nm4hfFDaUpX9g/K61f5eT/YA9rTsQbCBpbDKbOf9HlENL6Gu6ly+yc/utBoUk4u 8DSC+eY2/DN2xkyZ1P2pIZ+OR6bhEmbDqFfFX0PGyxCjuXMvgbFonHWq2838bnjy+FHU2hpMpWbBg MBLubQ5ZZCZQsTqLWeckXD71p5/1ZavGvzLvFgNOndncHdnknOPJgTPDibaCz26DqsTivQbYPcPfm eMrpOQiIp5aWD/mRjjPhVR/UowB22Mxwqpb89H3IbCbvBKbP806gYlXpl2B9j7JqJuY1NseiatR1h YdxU8fIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ddZr2-0001UR-GO; Fri, 04 Aug 2017 10:29:16 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ddZqy-0001Dn-Gf for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2017 10:29:14 +0000 Received: by mail-wr0-x242.google.com with SMTP id y43so2705029wrd.0 for ; Fri, 04 Aug 2017 03:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ljvN5OwVJMTS/oV/Vtbg3wiSdG+YhKDLm16g+jeE4Ec=; b=A1iOqtb2iiRbcJ6T5t+JalYsEJkocVCP/q6BUUeWzh64aZ2FvBqpKLyHyNlXYsZAn0 5QL4zK8cqclSaOtixP96XINgibdrYdC9lf0AuZk8yvCCCT12gkltnhCgT84ckb61evER x22m7cT8xOBfqb7bSeU1HSB1+YUClzmq7L7pk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ljvN5OwVJMTS/oV/Vtbg3wiSdG+YhKDLm16g+jeE4Ec=; b=sEjgyfkYPwIOIk1/Ur/bZDlNlQkUwh9FQfBJm/O01AVoTD3KyfZPklV+vOa/Tw5yU7 Cw8V9Yfh/TFZ0hFlHakmbQXAhS0jHR8Wy7LuiM49/bGquTw2+9ZXYV7ykfG3BqfA54jj 0qQUAyXTB6gRVSTRrKDujH9k54JsbKihu423zdiHtyOU2/NxyxCrJIbdkG4ZxOC7S4Xp HP9wDfMi+Bl/qekRn2ucS5+Z8pTiQMacXrCosxzFfAQs8YcNMPMEeyntiOoa75SDiBoX aCVylHXVEy5EnplybQZjEYFh58R6rzyYN59vBh258C+87NHk6lMyFh9fhkEFMthv23f1 vqUw== X-Gm-Message-State: AIVw111vLCV8i29APwCI1+ZNeUQddZYYTzQqW4YUOFHxnzDBYhwEPx/7 Y5kJdZARDVHEXvKK X-Received: by 10.223.175.212 with SMTP id y20mr1246167wrd.267.1501842117191; Fri, 04 Aug 2017 03:21:57 -0700 (PDT) Received: from localhost.localdomain (uk.sesame.canonical.com. [91.189.88.154]) by smtp.gmail.com with ESMTPSA id g93sm4037467wrd.11.2017.08.04.03.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 03:21:56 -0700 (PDT) From: Daniel Axtens To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] powerpc: replace vga_fixup() with generic code Date: Fri, 4 Aug 2017 20:20:33 +1000 Message-Id: <20170804102033.27731-4-dja@axtens.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170804102033.27731-1-dja@axtens.net> References: <20170804102033.27731-1-dja@axtens.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170804_032912_801364_B4F4DB77 X-CRM114-Status: GOOD ( 14.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gabriele.paoloni@huawei.com, airlied@linux.ie, benh@kernel.crashing.org, Brian King , will.deacon@arm.com, z.liuxinliang@hisilicon.com, bhelgaas@google.com, alex.williamson@redhat.com, catalin.marinas@arm.com, zourongrong@gmail.com, daniel.vetter@intel.com, Daniel Axtens MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, we do a PCI fixup to mark a default card so that Xorg autoconfiguration works. There is a new generic method to do this sort of vga fixup, and it occurs by default. Drop our old method. This method is different: - it will only mark a card as default if a driver is bound - the marking will happen at late_initcall time, or even later if a card is enabled later on (via an ENABLE hook). Currently things are enabled in a FINAL hook. This *does* change behaviour under some circumstances. For example, pseries_le_defconfig doesn't have DRM drivers for many of the qemu GPU models, including the 'standard' vga. So when a VM with that GPU boots, no driver binds the GPU, and it does *not* get marked as default. Previously, it would have been marked as default. As it turns out Xorg (at least Xorg v1.19.3) can still autoconfigure it, as Xorg is smart about OpenFirmware framebuffer devices. If the right GPU driver is available, and the OpenFirmware fb driver is removed, the device *is* marked as a boot GPU. (If the OpenFirmware driver is around, it enables the PCI device but doesn't bind to it, making it ineligible to be the default card. Then, when the right driver is loaded, the enable hook doesn't fire because the card has already been enabled. Fun!) So everything works as intended, I guess. Cc: Brian King Signed-off-by: Daniel Axtens --- This would benefit from some tests on real hardware. --- arch/powerpc/kernel/pci-common.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 6cfaec107374..65cd5bad5ad6 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -1741,18 +1740,3 @@ static void fixup_hide_host_resource_fsl(struct pci_dev *dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); - -static void fixup_vga(struct pci_dev *pdev) -{ - u16 cmd; - - if (vga_default_device()) - return; - - pci_read_config_word(pdev, PCI_COMMAND, &cmd); - if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) - vga_set_default_device(pdev); - -} -DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_DISPLAY_VGA, 8, fixup_vga);