From patchwork Thu Sep 16 08:29:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 12498227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2A17C433F5 for ; Thu, 16 Sep 2021 08:33:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80D8261244 for ; Thu, 16 Sep 2021 08:33:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 80D8261244 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEC1E6EB0C; Thu, 16 Sep 2021 08:33:38 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4ABA46EB11 for ; Thu, 16 Sep 2021 08:33:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 04CB861242; Thu, 16 Sep 2021 08:33:34 +0000 (UTC) From: Huacai Chen To: David Airlie , Daniel Vetter , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, Xuefeng Li , Huacai Chen , Huacai Chen Subject: [PATCH V6 05/12] PCI/VGA: Prefer VGA device belongs to integrated GPU Date: Thu, 16 Sep 2021 16:29:34 +0800 Message-Id: <20210916082941.3421838-6-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210916082941.3421838-1-chenhuacai@loongson.cn> References: <20210916082941.3421838-1-chenhuacai@loongson.cn> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" This patch is the third step of the rework: A VGA device belongs to integrated GPU is more preferred than those not belong to. Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/vgaarb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 1ffc3decc9cb..1daf2a011f83 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -605,6 +605,11 @@ static void vga_arb_update_default_device(struct vga_device *vgadev) vgaarb_info(dev, "overriding boot VGA device\n"); vga_set_default_device(pdev); } + + if (vga_arb_integrated_gpu(dev) && vgadev->pdev != vga_default_device()) { + vgaarb_info(dev, "overriding boot VGA device\n"); + vga_set_default_device(pdev); + } } /*