dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/8] PCI/VGA: Introduce is_boot_device function callback to vga_client_register
@ 2023-06-13  3:01 Sui Jingfeng
  2023-06-13  3:01 ` [PATCH v7 1/8] PCI/VGA: Use unsigned type for the io_state variable Sui Jingfeng
                   ` (7 more replies)
  0 siblings, 8 replies; 36+ messages in thread
From: Sui Jingfeng @ 2023-06-13  3:01 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-fbdev, kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	amd-gfx, linux-pci

The vga_is_firmware_default() function is arch-dependent, it's probably
wrong if we simply remove the arch guard. As the VRAM BAR which contains
firmware framebuffer may move, while the lfb_base and lfb_size members of
the screen_info does not change accordingly. In short, it should take the
re-allocation of the PCI BAR into consideration.

With the observation that device drivers or video aperture helpers may
have better knowledge about which PCI bar contains the firmware fb,
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 not suitable to
make such an optimization since it is loaded too early.

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. Also honor
the comment: "Clients have two callback mechanisms they can use"

Sui Jingfeng (8):
  PCI/VGA: Use unsigned type for the io_state variable
  PCI/VGA: Deal only with VGA class devices
  PCI/VGA: Tidy up the code and comment format
  PCI/VGA: Replace full MIT license text with SPDX identifier
  video/aperture: Add a helper to detect if an aperture contains
    firmware FB
  PCI/VGA: Introduce is_boot_device function callback to
    vga_client_register
  drm/amdgpu: Implement the is_boot_device callback function
  drm/radeon: Implement the is_boot_device callback function

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  12 +-
 drivers/gpu/drm/drm_aperture.c             |  16 +++
 drivers/gpu/drm/i915/display/intel_vga.c   |   3 +-
 drivers/gpu/drm/nouveau/nouveau_vga.c      |   2 +-
 drivers/gpu/drm/radeon/radeon_device.c     |  12 +-
 drivers/pci/vgaarb.c                       | 153 +++++++++++++--------
 drivers/vfio/pci/vfio_pci_core.c           |   2 +-
 drivers/video/aperture.c                   |  29 ++++
 include/drm/drm_aperture.h                 |   2 +
 include/linux/aperture.h                   |   7 +
 include/linux/vgaarb.h                     |  35 ++---
 11 files changed, 184 insertions(+), 89 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2023-07-03 17:19 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13  3:01 [PATCH v7 0/8] PCI/VGA: Introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 1/8] PCI/VGA: Use unsigned type for the io_state variable Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices Sui Jingfeng
2023-06-14 10:50   ` Sui Jingfeng
2023-06-15 21:11     ` Alex Deucher
2023-06-16  7:11       ` Sui Jingfeng
2023-06-16 13:41         ` Alex Deucher
2023-06-16 14:22           ` Sui Jingfeng
2023-06-16 14:34             ` Alex Deucher
2023-06-16 15:44               ` Sui Jingfeng
2023-06-18 12:11               ` Sui Jingfeng
2023-06-19  2:17                 ` Sui Jingfeng
2023-06-19  2:23                 ` Sui Jingfeng
2023-06-21  7:33               ` Sui Jingfeng
2023-07-03 17:18               ` Sui Jingfeng
2023-06-19  3:02   ` Maciej W. Rozycki
2023-06-19  3:45     ` Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 3/8] PCI/VGA: Tidy up the code and comment format Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 4/8] PCI/VGA: Replace full MIT license text with SPDX identifier Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 5/8] video/aperture: Add a helper to detect if an aperture contains firmware FB Sui Jingfeng
2023-06-27 14:21   ` Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 6/8] PCI/VGA: Introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-22  5:08   ` Sui Jingfeng
2023-06-29 15:54     ` Bjorn Helgaas
2023-06-29 17:00       ` Sui Jingfeng
2023-06-29 17:44         ` Limonciello, Mario
2023-06-30  2:14           ` suijingfeng
2023-06-30 17:41             ` Bjorn Helgaas
2023-06-30 18:32               ` Jani Nikula
2023-06-30  4:42           ` Sui Jingfeng
2023-06-27 14:35   ` Sui Jingfeng
2023-06-29 14:41   ` Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 7/8] drm/amdgpu: Implement the is_boot_device callback function Sui Jingfeng
2023-06-15  6:51   ` Sui Jingfeng
2023-06-13  3:01 ` [PATCH v7 8/8] drm/radeon: " Sui Jingfeng
2023-06-27 14:20   ` Sui Jingfeng

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).