Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8620609rwp; Wed, 19 Jul 2023 12:36:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGKHhwCmSOL3M9EUE8w5wy6J+mkrwInSXBxcdCRY3hyUrNZ1YSYvev3MWcAmwFHdwxrxBO X-Received: by 2002:a17:90a:1b64:b0:262:d661:2963 with SMTP id q91-20020a17090a1b6400b00262d6612963mr93297pjq.39.1689795414725; Wed, 19 Jul 2023 12:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689795414; cv=none; d=google.com; s=arc-20160816; b=DYTjxTJSvwxKZsGm8mil52nqlCEYbSNchqBME/fRRcjwH928c9Lbj8C4iAWcNv2eA+ Mf1ouWsMje8eBqBLV9bliJwHRn5i6H5y/I9yV7kb0iEyY+GBYqMv6JDNtgKIIGqaFZ0F 81XruNDFfnTGmrfGg7kdo2I8SwQx8X2c/XQTF5cTyxRR76RgZPfvgLNYXcMRGa3m+GV7 jxwsBMmjjbdkxaERht6AcCZWUVWb1iTII2+f0SjwIDMK6U83FSCa10g4AUgSqXla865d h2lf4U3RKuDnhcNavfcp7aXX8d6i2ALn0AIMsC5SrK/xz7r4pZTky0el1cpfLx2ap5+o Ze/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=3787LPiDxVHpilmF9zFya5JqHZ84/lep1/4k9wVVAeU=; fh=wjOb9BHXKw5TCibMgTimk34iA4vsxe88Y4r/3PdrDmI=; b=fp0rqDpumWOKef/Wcobg+wS+sZ6sclKr+Jc56xIZ8qkYDDouJqZMYfbioKzxyMX/O8 9s5eN9fiCi+wtBFfdZZofkG7icgnKBttakZyOJ0fo0B6gS3wji6Gcs27c3slZFV+wEPG 7B+4kLH4VLrzKq2AYKMjw7uXvsn8ees3YNQYJ3WCh1Pd15q9aWmNMnNa83A2xk7o1VhO VewueH1wRHOa+TRsSKCQBIHyGglsMpFBpjRuYNWBqscwhd2l3BD7cxRTO0Clb2+PJWsS 9i/1GFf07mabLjoSE0RaeDuZ7Q/5HkMEg0ETfTrd+llzPUmiYCa2mwHmoWMkoxxzU18k cP2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eQXfqj+z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cv21-20020a17090afd1500b002640bed79cesi1860332pjb.122.2023.07.19.12.36.42; Wed, 19 Jul 2023 12:36:54 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eQXfqj+z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229476AbjGSTdC (ORCPT + 99 others); Wed, 19 Jul 2023 15:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbjGSTcv (ORCPT ); Wed, 19 Jul 2023 15:32:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB89B1FE6; Wed, 19 Jul 2023 12:32:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9C49261804; Wed, 19 Jul 2023 19:32:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCAE6C433C9; Wed, 19 Jul 2023 19:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689795164; bh=hZI4hitD39aZ+Qdl1lmi9pA61QSLLLHm+XV9ADPTsus=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eQXfqj+zST5V+UqVLxrOjyGA+WFrIALYwsndDf8yb+d/ZcAhNbmKZDq169VZaA9sf 25+bBsBNSvp0yYQUkVL2vtrX8ooa/xyi+l+HGRTJ1LyPinE1QFLpb5R0Cg36sW3qNn YgZrsKi4oHpxkgHsNexLn2gxv7Eeh2OoajZB5APtfPQ+10fXyIgjl2R3+z+WXlvO86 Qn893HS/fbI8ZKTtw08zvDfUMSHa1Fv8E+7oGp9QKbDJfH1c2kWXr4T2FGBMg+JkXS oxjrRjZ46Nr7EXvdUaNgc1xypDfdpbsWW38ebY+nmePmjVTAwUQssX3tnWVYHKKP77 X9BK/nT/OlPNA== Date: Wed, 19 Jul 2023 14:32:41 -0500 From: Bjorn Helgaas To: Sui Jingfeng Cc: David Airlie , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, kvm@vger.kernel.org, linux-fbdev@vger.kernel.org, Sui Jingfeng , linux-pci@vger.kernel.org Subject: Re: [PATCH v3 0/9] PCI/VGA: Improve the default VGA device selection Message-ID: <20230719193241.GA510805@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230711164310.791756-1-sui.jingfeng@linux.dev> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 [+cc linux-pci] On Wed, Jul 12, 2023 at 12:43:01AM +0800, Sui Jingfeng wrote: > From: Sui Jingfeng > > Currently, the default VGA device selection is not perfect. Potential > problems are: > > 1) This function is a no-op on non-x86 architectures. > 2) It does not take the PCI Bar may get relocated into consideration. > 3) It is not effective for the PCI device without a dedicated VRAM Bar. > 4) It is device-agnostic, thus it has to waste the effort to iterate all > of the PCI Bar to find the VRAM aperture. > 5) It has invented lots of methods to determine which one is the default > boot device on a multiple video card coexistence system. But this is > still a policy because it doesn't give the user a choice to override. > > With the observation that device drivers or video aperture helpers may > have better knowledge about which PCI bar contains the firmware FB, > > This patch tries to solve the above problems by introducing a function > callback to the vga_client_register() function interface. DRM device > drivers for the PCI device need to register the is_boot_device() function > callback during the driver loading time. Once the driver binds the device > successfully, VRAARB will call back to the driver. This gives the device > drivers a chance to provide accurate boot device identification. Which in > turn unlock the abitration service to non-x86 architectures. A device > driver can also pass a NULL pointer to keep the original behavior. I skimmed all these patches, but the only one that seems to mention an actual problem being solved, i.e., something that doesn't work for an end user, is "drm/ast: Register as a vga client ..." Maybe "drm/loongson: Add an implement for ..." also solves a problem, but it lacks a commit log, so I don't know what the problem is. In the future, can you please cc: linux-pci with the entire series? In this posting, only the patches that touched drivers/pci/vgaarb.c went to linux-pci, but those aren't enough to make sense of the series as a whole. > video/aperture: Add a helper to detect if an aperture contains > firmware FB > video/aperture: Add a helper for determining if an unmoved aperture > contain FB > PCI/VGA: Switch to aperture_contain_firmware_fb_nonreloc() Since this subject includes the function name (which is nice!), it would also be helpful if the "Add a helper ..." subject included the same function name. > PCI/VGA: Improve the default VGA device selection If you can make this subject any more specific, that would be useful. There's more to say about that patch, so I'll respond there. > drm/amdgpu: Implement the is_primary_gpu callback of > vga_client_register() > drm/radeon: Add an implement for the is_primary_gpu function callback > drm/i915: Add an implement for the is_primary_gpu hook > drm/ast: Register as a vga client to vgaarb by calling > vga_client_register() > drm/loongson: Add an implement for the is_primary_gpu function > callback There's unnecessary variation in the subject lines (and the commit logs) of these patches. If they all do the same thing but in different drivers, it's useful if the patches all *look* the same. You might be able to write these subjects as "Implement .is_primary_gpu() callback" for brevity. Bjorn