From: Sui Jingfeng <15330273260@189.cn>
To: Bjorn Helgaas <helgaas@kernel.org>,
Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>,
Karol Herbst <kherbst@redhat.com>,
nouveau@lists.freedesktop.org,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
dri-devel@lists.freedesktop.org,
YiPeng Chai <YiPeng.Chai@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
David Airlie <airlied@gmail.com>,
Ville Syrjala <ville.syrjala@linux.intel.com>,
Yi Liu <yi.l.liu@intel.com>,
kvm@vger.kernel.org, amd-gfx@lists.freedesktop.org,
Jason Gunthorpe <jgg@ziepe.ca>, Ben Skeggs <bskeggs@redhat.com>,
linux-pci@vger.kernel.org,
Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
Kevin Tian <kevin.tian@intel.com>,
Lijo Lazar <lijo.lazar@amd.com>, Daniel Vetter <daniel@ffwll.ch>,
Bokun Zhang <Bokun.Zhang@amd.com>,
intel-gfx@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
loongson-kernel@lists.loongnix.cn,
Alex Williamson <alex.williamson@redhat.com>,
Abhishek Sahu <abhsahu@nvidia.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Yishai Hadas <yishaih@nvidia.com>, Li Yi <liyi@loongson.cn>,
Pan Xinhui <Xinhui.Pan@amd.com>,
linux-kernel@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Cornelia Huck <cohuck@redhat.com>,
Alex Deucher <alexander.deucher@amd.com>,
Christian Konig <christian.koenig@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [Intel-gfx] [PATCH v3 4/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register
Date: Sat, 10 Jun 2023 01:43:39 +0800 [thread overview]
Message-ID: <2cf50ad0-e4fa-17a3-3e22-7fd8d4a316ed@189.cn> (raw)
In-Reply-To: <20230609164850.GA1251187@bhelgaas>
On 2023/6/10 00:48, Bjorn Helgaas wrote:
> On Fri, Jun 09, 2023 at 10:27:39AM +0800, Sui Jingfeng wrote:
>> On 2023/6/9 03:19, Bjorn Helgaas wrote:
>>> On Thu, Jun 08, 2023 at 07:43:22PM +0800, Sui Jingfeng wrote:
>>>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>>>
>>>> The vga_is_firmware_default() function is arch-dependent, which doesn't
>>>> sound right. At least, it also works on the Mips and LoongArch platforms.
>>>> Tested with the drm/amdgpu and drm/radeon drivers. However, it's difficult
>>>> to enumerate all arch-driver combinations. I'm wrong if there is only one
>>>> exception.
>>>>
>>>> With the observation that device drivers typically have better knowledge
>>>> about which PCI bar contains the firmware framebuffer, which could avoid
>>>> the need to iterate all of the PCI BARs.
>>>>
>>>> But as a PCI function at pci/vgaarb.c, vga_is_firmware_default() is
>>>> probably not suitable to make such an optimization for a specific device.
>>>>
>>>> There are PCI display controllers that don't have a dedicated VRAM bar,
>>>> this function will lose its effectiveness in such a case. Luckily, the
>>>> device driver can provide an accurate workaround.
>>>>
>>>> Therefore, this patch introduces a callback that allows the device driver
>>>> to tell the VGAARB if the device is the default boot device. This patch
>>>> only intends to introduce the mechanism, while the implementation is left
>>>> to the device driver authors. Also honor the comment: "Clients have two
>>>> callback mechanisms they can use"
>>> s/bar/BAR/ (several)
>>>
>>> Nothing here uses the callback. I don't want to merge this until we
>>> have a user.
>> This is chicken and egg question.
>>
>> If you could help get this merge first, I will show you the first user.
>>
>>> I'm not sure why the device driver should know whether its device is
>>> the default boot device.
>> It's not that the device driver should know,
>>
>> but it's about that the device driver has the right to override.
>>
>> Device driver may have better approach to identify the default boot
>> device.
> The way we usually handle this is to include the new callback in the
> same series as the first user of it. That has two benefits:
> (1) everybody can review the whole picture and possibly suggest
> different approaches, and (2) when we merge the infrastructure,
> we also merge a user of it at the same time, so the whole thing can be
> tested and we don't end up with unused code.
OK, acceptable
I will try to prepare the user code of this callback and respin the patch.
I may resend it with another patch set in the future, this series
already drop it,
see v5[1]
[1] https://patchwork.freedesktop.org/series/119134/
> Bjorn
prev parent reply other threads:[~2023-06-09 17:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 11:43 [PATCH v3 0/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-08 11:43 ` [PATCH v3 1/4] PCI/VGA: tidy up the code and comment format Sui Jingfeng
2023-06-08 19:07 ` [Intel-gfx] " Bjorn Helgaas
2023-06-09 1:54 ` Sui Jingfeng
2023-06-08 11:43 ` [PATCH v3 2/4] PCI/VGA: Use unsigned type for the io_state variable Sui Jingfeng
2023-06-08 11:43 ` [PATCH v3 3/4] PCI/VGA: only deal with VGA class devices Sui Jingfeng
2023-06-08 19:12 ` [Intel-gfx] " Bjorn Helgaas
2023-06-09 2:11 ` Sui Jingfeng
2023-06-09 12:22 ` Sui Jingfeng
2023-06-08 11:43 ` [PATCH v3 4/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-08 19:19 ` [Intel-gfx] " Bjorn Helgaas
2023-06-09 2:27 ` Sui Jingfeng
2023-06-09 16:48 ` Bjorn Helgaas
2023-06-09 17:43 ` Sui Jingfeng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cf50ad0-e4fa-17a3-3e22-7fd8d4a316ed@189.cn \
--to=15330273260@189.cn \
--cc=Amaranath.Somalapuram@amd.com \
--cc=Bokun.Zhang@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=abhsahu@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex.williamson@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrey.grodzovsky@amd.com \
--cc=bhelgaas@google.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=cohuck@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=helgaas@kernel.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jgg@ziepe.ca \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kevin.tian@intel.com \
--cc=kherbst@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liyi@loongson.cn \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mario.limonciello@amd.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=suijingfeng@loongson.cn \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
--cc=yi.l.liu@intel.com \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).