Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2048694rdb; Tue, 5 Sep 2023 12:43:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErG0slo62rJ7hns7CciRqQUc9QHNp+sY0urrKOfl77jtzRYiFnSATissugoMVojCcjCFSQ X-Received: by 2002:a17:906:768d:b0:9a5:7f99:be4c with SMTP id o13-20020a170906768d00b009a57f99be4cmr696085ejm.33.1693943026835; Tue, 05 Sep 2023 12:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693943026; cv=none; d=google.com; s=arc-20160816; b=hsRwj2HRl8ZbLlSpLMML4IGlhHzwHq8uLlPUsCTSPKaTjdEytd23O9ZDcLi9eBgwe7 5WlxfZ6HRtV9gSIpEh2NZmSc0hsLO2rkLi+EYKkeHcBOLIRJW0o0EbDOGlPENuwevLGm KlHM0HMyi6MyCmq3PAaygBwONNMQx1p01o4Qr6LJ0oyoOO2na4o8JRYjZJesxmTEbYWY DyWFULmMPUPd4mLWP3REFNk1NAzbwwhhV/pCPR90ouuHBfn20+V+5CNmSRh2Uv/HLN3L lTp6Gj4w0N1092fecqDbI4FxNbKuy4gdYS10WAIwnk1hSuZ7+Uy+o/P+MnOJ4iS1dcpY W3iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=/tCfYPljK7ZFW0lR8FRcfQWHc5Au9Ten+nxvbUu0mcA=; fh=NR99PTNENb9/8j6IdcuYT/Hz7gFuJTcnQ62JDGu3OTU=; b=IJCPQnFWnMbk1bgRnMFDNmpYgFED0zdy0Uja6a48fH83xHlcPlgnFIGB1EogAfjNDl zxs3qxg7UXjXPpnCp1AK4A0a25BrVw8UO7Tj4RGH2acVYn9jcUs5Y+XFgr5wYT6dCYxb PU2x2JdZwUTdWY+ULTMGnY8XzL3PMgE8G214KW0UXKvGc0XiAs4O8v/zJefKv0ul7ezX 5VCTo1ClYi7wX/m1Krk3yiGQglsKwo4J5mLJYQinSUlXK109UGVgBkka8Kq50T9Ud3NP jUm8qyR7M+stfvh/gnpKCXYH+1ct/ves3s7KdHSVHvAO6IVOZGuQ+glKKyMUFqjVfz3F kW7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r5-20020a170906a20500b00988b1c57f15si7725510ejy.272.2023.09.05.12.43.17; Tue, 05 Sep 2023 12:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245291AbjIERLD (ORCPT + 99 others); Tue, 5 Sep 2023 13:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241136AbjIERJB (ORCPT ); Tue, 5 Sep 2023 13:09:01 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60F7712D5C; Tue, 5 Sep 2023 09:41:20 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8CxLOt4Vfdkz7cfAA--.58433S3; Wed, 06 Sep 2023 00:21:12 +0800 (CST) Received: from [0.0.0.0] (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxLCN2VfdkQy9tAA--.47054S3; Wed, 06 Sep 2023 00:21:10 +0800 (CST) Message-ID: Date: Wed, 6 Sep 2023 00:21:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time Content-Language: en-US To: Alex Williamson , Sui Jingfeng Cc: Bjorn Helgaas , nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-pci@vger.kernel.org References: <20230904195724.633404-1-sui.jingfeng@linux.dev> <20230905085243.4b22725e.alex.williamson@redhat.com> From: suijingfeng In-Reply-To: <20230905085243.4b22725e.alex.williamson@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf8CxLCN2VfdkQy9tAA--.47054S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxGryfJr4xZrWrArykZF4DZFc_yoW5ZFykpF WSkFyFyrs5Jr18Cr9Fyws7XFWYqayrJay7Gr1vyr1vv3Z8K34vqFWftr4j93W7Jr1fCa1Y 9r9rKr17AFWDAagCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUPFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAaw2AFwI0_Jrv_JF1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_ JF1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrw CYjI0SjxkI62AI1cAE67vIY487MxkF7I0En4kS14v26r126r1DMxAIw28IcxkI7VAKI48J MxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r1Y6r17MI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1l IxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUc9a9UUUUU X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023/9/5 22:52, Alex Williamson wrote: > On Tue, 5 Sep 2023 03:57:15 +0800 > Sui Jingfeng wrote: > >> From: Sui Jingfeng >> >> On a machine with multiple GPUs, a Linux user has no control over which >> one is primary at boot time. This series tries to solve above mentioned >> problem by introduced the ->be_primary() function stub. The specific >> device drivers can provide an implementation to hook up with this stub by >> calling the vga_client_register() function. >> >> Once the driver bound the device successfully, VGAARB will call back to >> the device driver. To query if the device drivers want to be primary or >> not. Device drivers can just pass NULL if have no such needs. >> >> Please note that: >> >> 1) The ARM64, Loongarch, Mips servers have a lot PCIe slot, and I would >> like to mount at least three video cards. >> >> 2) Typically, those non-86 machines don't have a good UEFI firmware >> support, which doesn't support select primary GPU as firmware stage. >> Even on x86, there are old UEFI firmwares which already made undesired >> decision for you. >> >> 3) This series is attempt to solve the remain problems at the driver level, >> while another series[1] of me is target to solve the majority of the >> problems at device level. >> >> Tested (limited) on x86 with four video card mounted, Intel UHD Graphics >> 630 is the default boot VGA, successfully override by ast2400 with >> ast.modeset=10 append at the kernel cmd line. >> >> $ lspci | grep VGA >> >> 00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] > In all my previous experiments with VGA routing and IGD I found that > IGD can't actually release VGA routing and Intel confirmed the hardware > doesn't have the ability to do so. It will always be primary from a > VGA routing perspective. Was this actually tested with non-UEFI? Yes, I have tested on my aspire e471 notebook (i5 5200U), because that notebook using legacy firmware (also have UEFI, double firmware). But this machine have difficult in install ubuntu under UEFI firmware in the past. So I keep it using the legacy firmware. It have two video card, IGD and nvidia video card(GFORCE 840M). nvidia call its video card as 3D controller (pci->class = 0x030200) I have tested this patch and another patch mention at [1] together. I can tell you that the firmware framebuffer of this notebook using vesafb, not efifb. And the framebuffer size (lfb.size) is very small. This is very strange, but I don't have enough time to look in details. But still works. I'm using and tesing my patch whenever and wherever possible. > I suspect it might only work in UEFI mode where we probably don't > actually have a dependency on VGA routing. This is essentially why > vfio requires UEFI ROMs when assigning GPUs to VMs, VGA routing is too > broken to use on Intel systems with IGD. Thanks, What you tell me here is the side effect come with the VGA-compatible, but I'm focus on the arbitration itself. I think there no need to keep the VGA routing hardware features nowadays except that hardware vendor want keep the backward compatibility and/or comply the PCI VGA compatible spec. > Alex >