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: 9850333 X-Patchwork-Delegate: bhelgaas@google.com 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 56E18602A7 for ; Wed, 19 Jul 2017 02:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F1E828585 for ; Wed, 19 Jul 2017 02:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33E8E2859E; Wed, 19 Jul 2017 02:16:26 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBF0F28585 for ; Wed, 19 Jul 2017 02:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332AbdGSCQZ (ORCPT ); Tue, 18 Jul 2017 22:16:25 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34645 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdGSCQY (ORCPT ); Tue, 18 Jul 2017 22:16:24 -0400 Received: by mail-pf0-f195.google.com with SMTP id o88so4674016pfk.1 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=XtP1vYSrBZx+5ZK/ozqk6BJWwbv9Q8KtBkncH4qlaCIYfD94io48BUFd3MjB28xqS0 USZanKxwSeLvUbWl+wAUz2ILdioEYChjzenrlDC3PDZQEIDq8jpMWcybBo/JtrOmHzv+ cPfOG6Q+fYGGS0FqrfEVmU9VCYIJ308y7Z2yOIZKMKqBvmA51nSvelgDVBbO7nfUq4P9 OeRYwWGAFEng2vIjrx4lytj7hD4xjMgUATaPnAwvFRhCf5hFXpMNgQfJe2uE24Kb5mc2 MAB6Xf7o6gRNjNn/OZkGwwgjZ5vzfro/hh0sN5vADv21zAd6vkC6RkZNgOJpfEzLpeh7 4EVw== X-Gm-Message-State: AIVw11304BX3a9pm0iHz0zx4F2Mz5/vgBLmxbGYLcWDkLN4iH+zNCtsZ 4GayXmaT5x5SXzg3gvi+3w== 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 Cc: benh@kernel.crashing.org, z.liuxinliang@hisilicon.com, zourongrong@gmail.com, catalin.marinas@arm.com, will.deacon@arm.com, gabriele.paoloni@huawei.com, bhelgaas@google.com, airlied@linux.ie, daniel.vetter@intel.com, alex.williamson@redhat.com, Daniel Axtens , Brian King 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> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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);