Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-21 Thread suijingfeng
Hi, On 2023/8/22 01:38, Bjorn Helgaas wrote: On Fri, Aug 18, 2023 at 12:09:29PM +0800, suijingfeng wrote: On 2023/8/18 06:08, Bjorn Helgaas wrote: On Wed, Aug 16, 2023 at 06:05:27AM +0800, Sui Jingfeng wrote: Currently, the vga_is_firmware_default() function only works on x86 and ia64, it is

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-21 Thread suijingfeng
Hi, On 2023/8/22 01:33, Bjorn Helgaas wrote: 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) +

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-21 Thread Bjorn Helgaas
On Fri, Aug 18, 2023 at 12:09:29PM +0800, suijingfeng wrote: > On 2023/8/18 06:08, Bjorn Helgaas wrote: > > On Wed, Aug 16, 2023 at 06:05:27AM +0800, Sui Jingfeng wrote: > > > Currently, the vga_is_firmware_default() function only works on x86 and > > > ia64, it is a no-op on ARM, ARM64, PPC,

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-21 Thread Bjorn Helgaas
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; > > > + > > >

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-21 Thread suijingfeng
Hi, On 2023/8/18 18:20, suijingfeng wrote: 1) The "weird" logic completely overrides whatever decision VGAARB ever made. It seems to say that the decision ever made by VGAARB is useless. Well, I think VGAARB shouldn't endure this; VGAARB has to be small. VGAARB have to be smart! The

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-18 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: I guess the point here is that: - 03:00.0 BAR 0 is [mem 0xe005000-0xe005fff] - screen_info says the framebuffer is [mem 0xe005000-0xe005fff] (or part of it) - Therefore, we want 03:00.0 to be the default VGA -

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-18 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: + +/* + * Identify the PCI VGA device that contains the firmware framebuffer + */ +static void pci_boot_vga_finder(struct pci_dev *pdev) +{ + resource_size_t fb_start; + resource_size_t fb_end; + unsigned int i; + + /* Already

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-18 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: Please note that before apply this patch, vgaarb can not select the right boot vga due to weird logic introduced with the commit 57fc7323a8e7c ("LoongArch: Add PCI controller support") If we need this reference to 57fc7323a8e7c, we need more

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-18 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: Please note that before apply this patch, vgaarb can not select the right boot vga due to weird logic introduced with the commit 57fc7323a8e7c ("LoongArch: Add PCI controller support") If we need this reference to 57fc7323a8e7c, we need more

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-18 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: This patch makes the vga_is_firmware_default() function works on whatever arch that has UEFI GOP support. But we make it available only on platforms where PCI resource relocation happens. if the provided method proves to be effective and reliable,

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-17 Thread suijingfeng
Hi, On 2023/8/18 06:08, Bjorn Helgaas wrote: On Wed, Aug 16, 2023 at 06:05:27AM +0800, Sui Jingfeng wrote: Currently, the vga_is_firmware_default() function only works on x86 and ia64, it is a no-op on ARM, ARM64, PPC, RISC-V, etc. This patch completes the implementation for the rest of the

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-17 Thread suijingfeng
Hi, 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) { +

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-17 Thread Bjorn Helgaas
On Wed, Aug 16, 2023 at 06:05:27AM +0800, Sui Jingfeng wrote: > Currently, the vga_is_firmware_default() function only works on x86 and > ia64, it is a no-op on ARM, ARM64, PPC, RISC-V, etc. This patch completes > the implementation for the rest of the architectures. The added code tries > to

[PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-15 Thread Sui Jingfeng
Currently, the vga_is_firmware_default() function only works on x86 and ia64, it is a no-op on ARM, ARM64, PPC, RISC-V, etc. This patch completes the implementation for the rest of the architectures. The added code tries to identify the PCI(e) VGA device that owns the firmware framebuffer before