From patchwork Wed Jul 19 02:15:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 9850341 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 3F9D5602A7 for ; Wed, 19 Jul 2017 02:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 281542858F for ; Wed, 19 Jul 2017 02:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CCEC285A8; Wed, 19 Jul 2017 02:17:28 +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 autolearn=ham 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 967E52858F for ; Wed, 19 Jul 2017 02:17:27 +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=gIkWmv9zAMkz9k6XEpvjEEniOSW1y6IAOFwsy2l4kak=; b=mtqikwps+XIJy3pKyhIvMOvT3E Wa7UwNYxbscnBhvlM2WDJhqfhe38270Cw8NhWmiXRyeV/zU7yGrCnCekWfAN758fygSUPqNBLu6hZ LKFVKUF+2wBeA1lgIgYkcXgf3MDIhqU+w+lF0+deAlJL82QJTtYlVZUZhbZ4dwln7H09zia2wYGeC QhyKYMMcVFxQyscd9g3USG54EeDcgSeU77v2LCwRBCMmMxWxrXakpZ4zkVHngDKNtBqElHLRWiND1 cLhc+UD58ajw8/3ih8bszzFiAQ+nsoUjPlXWgTGg/UQOOklwbFED1mksJrExDs773J5gIHxec4kDl +39fmGwA==; 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 1dXeYF-0006pR-4x; Wed, 19 Jul 2017 02:17:23 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXeXc-0005zU-5L for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2017 02:16:53 +0000 Received: by mail-pf0-x242.google.com with SMTP id q85so4668412pfq.2 for ; Tue, 18 Jul 2017 19:16:24 -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=w7WqZ5TEw3lTRbu3/EsP9LrHt8iDEGEswgneeWe37sY=; b=CIavxBdyDde6532uwo+aCYYBQ2k4it+8YhKnTYsV8B+IME5amXtOa7il1KoyPISdEn 9qufTRGM+nUn+l67GOYv4PJDyOJ8pY6VsQB4DMk/NAp2K6UB4IpDfdcFQTD4YSRhKo1s s8YGAHDY/B17vrqIoaAf2nYHMnW0V5tSxBrrM= 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=w7WqZ5TEw3lTRbu3/EsP9LrHt8iDEGEswgneeWe37sY=; b=WHOGSF62cfrpmK7pNfgLs7Rw80+Mac9H55b4OqKSyryRPGTdxXWVidpzBWGqK3a8PT c4j/El88fIzxSUVepo8NFgWFKRF3xS8bGdLJW5Bb3XsqJLQnvQ8aen2xmQBM+PWjlyvW JuCmOt7OF8raZtTvovNU4+yol+yWSLqd+4oPRvtUeku/2uQKvcnIg08f6vqkwS7g6oAx FiwoW922gcLpngRev3fkIbqORpJxnHAJReQgxhLsFMr9/URae50VbeNwga1PtWludXCM Cv+WJplgTxVDyhD2IJrFhaXT6HdjUr5PvPoYeOci3NFQE477lsOF4V6mZQlJEqi9LQvR 1kBA== X-Gm-Message-State: AIVw110gW22Jj5kjStQ2gtMcsLE0axqSbGGVWSNl3Ldvquwuq5wYcRRB e3AdrLdWaMGMnc+z X-Received: by 10.99.98.71 with SMTP id w68mr663733pgb.100.1500430584095; Tue, 18 Jul 2017 19:16:24 -0700 (PDT) Received: from localhost.localdomain (203-59-51-51.dyn.iinet.net.au. [203.59.51.51]) by smtp.gmail.com with ESMTPSA id d70sm8732241pfg.132.2017.07.18.19.16.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 19:16:23 -0700 (PDT) From: Daniel Axtens To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/4] powerpc: replace vga_fixup() with generic code Date: Wed, 19 Jul 2017 12:15:15 +1000 Message-Id: <20170719021516.24718-4-dja@axtens.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170719021516.24718-1-dja@axtens.net> References: <20170719021516.24718-1-dja@axtens.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170718_191644_759812_6801D02D X-CRM114-Status: GOOD ( 12.39 ) 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. Code-wise, it is identical, however instead of firing at the FIXUP_FINAL stage it fires at the FIXUP_ENABLE stage. This means a card will not be marked as default unless a driver enables it. Cc: Brian King Signed-off-by: Daniel Axtens --- Tested with xeyes on qemu TCG, which does use this code path. --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/pci-common.c | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 36f858c37ca7..c28b8eb1dce1 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -140,6 +140,7 @@ config PPC select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if PPC64 select ARCH_WANT_IPC_PARSE_VERSION + select ARCH_WANT_VGA_ARB_FALLBACK select ARCH_WEAK_RELEASE_ACQUIRE select BINFMT_ELF select BUILDTIME_EXTABLE_SORT diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index c95fdda3a2dc..7b093a4fa85d 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1741,18 +1741,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);