From: Bjorn Helgaas <helgaas@kernel.org>
To: suijingfeng <suijingfeng@loongson.cn>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org,
loongson-kernel@lists.loongnix.cn, "Limonciello,
Mario" <Mario.Limonciello@amd.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent
Date: Mon, 21 Aug 2023 12:33:20 -0500 [thread overview]
Message-ID: <20230821173320.GA362442@bhelgaas> (raw)
In-Reply-To: <9fb7ace8-2f07-17b6-10ce-7116b05b0148@loongson.cn>
On Fri, Aug 18, 2023 at 09:48:46AM +0800, suijingfeng wrote:
> On 2023/8/18 06:08, Bjorn Helgaas wrote:
> > > + if (resource_type(res) != IORESOURCE_MEM)
> > > + continue;
> > > +
> > > + if (!res->start || !res->end)
> > > + continue;
> > > +
> > > + if (res->start <= fb_start && fb_end <= res->end) {
> > > + pdev_boot_vga = pdev;
> > > +
> > > + vgaarb_info(&pdev->dev,
> > > + "BAR %d contains firmware FB\n", i);
> > Print the BAR with %pR and include the framebuffer region from
> > screen_info in the same format.
>
> I do remember that you already told me to do this in V3, sorry for not
> replying to you at V3. Most of the time, what you tell me is right.But here,
> I think I need to explain. Because doing it that way will make the code line
> too long,and it will exceed 80 characters in the column if we print too
> much.
> I believe that the vgaarb_info() at here is already the most compact and
> simplest form. Printing the BAR with %pR is not absolute necessary, because
> we can get the additional information by: $ lspci | grep VGA
>
> $ dmesg | grep 05:00.0
> $ dmesg | grep 0000:03:00.0
> $ dmesg | grep PCI
Fair enough. The BAR info is already there. But I don't think the
screen_info framebuffer data is in the dmesg log anywhere, and I think
that would be useful.
It's fine if dmesg lines or kernel printk lines exceed 80 columns.
> Actually, I only add something that is absolute necessary.
> Printing BAR with %pR and/or Printing the framebuffer region
> is consider to only for *debugging* purpose.
I think printing the framebuffer region is important because it makes
it clear *why* we're selecting the device as the default VGA device.
It's more than just debugging; it helps make the system more
transparent and more understandable.
Bjorn
next prev parent reply other threads:[~2023-08-21 17:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 22:05 Sui Jingfeng
2023-08-17 22:08 ` Bjorn Helgaas
2023-08-18 1:48 ` suijingfeng
2023-08-21 17:33 ` Bjorn Helgaas [this message]
2023-08-22 1:19 ` suijingfeng
2023-08-18 4:09 ` suijingfeng
2023-08-21 17:38 ` Bjorn Helgaas
2023-08-22 2:37 ` suijingfeng
2023-08-18 9:31 ` suijingfeng
2023-08-18 10:20 ` suijingfeng
2023-08-21 6:47 ` suijingfeng
2023-08-19 2:16 ` suijingfeng
2023-08-19 2:18 ` suijingfeng
2023-08-19 2:40 ` suijingfeng
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=20230821173320.GA362442@bhelgaas \
--to=helgaas@kernel.org \
--cc=Mario.Limonciello@amd.com \
--cc=bhelgaas@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=suijingfeng@loongson.cn \
/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
all inboxes | Powered by JetHome®