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: 1528669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4H99N23V2fz9sRK for ; Thu, 16 Sep 2021 18:33:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235087AbhIPIe5 (ORCPT ); Thu, 16 Sep 2021 04:34:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235069AbhIPIe5 (ORCPT ); Thu, 16 Sep 2021 04:34:57 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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); + } } /*