linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] PCI/VGA: Improve the default VGA device selection
@ 2023-07-02 18:27 Sui Jingfeng
  2023-07-02 18:27 ` [PATCH v2 1/6] video/aperture: Add a helper to detect if an aperture contains firmware FB Sui Jingfeng
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sui Jingfeng @ 2023-07-02 18:27 UTC (permalink / raw)
  To: Alex Deucher, David Airlie, Daniel Vetter, Thomas Zimmermann,
	Maxime Ripard, Jani Nikula, Lyude Paul, Bjorn Helgaas,
	Mario Limonciello
  Cc: dri-devel, amd-gfx, linux-kernel, intel-gfx, nouveau, linux-pci,
	kvm, linux-fbdev, Sui Jingfeng

From: Sui Jingfeng <suijingfeng@loongson.cn>

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.

This series is applied on the drm-tip branch (with a cleanup patch set[1]
applied beforehand)

[1] https://patchwork.freedesktop.org/series/120053/

v2:
	* Add a simple implemment for drm/i915 and drm/ast
	* Pick up all tags (Mario)

Sui Jingfeng (6):
  video/aperture: Add a helper to detect if an aperture contains
    firmware FB
  PCI/VGA: Improve the default VGA device selection
  drm/amdgpu: Implement the is_boot_device callback function
  drm/radeon: Implement the is_boot_device callback function
  drm/i915: Implement the is_boot_device callback function
  drm/ast: Register as a vga client to vgaarb by calling
    vga_client_register()

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++++++-
 drivers/gpu/drm/ast/ast_drv.c              | 29 ++++++++++++++++++++
 drivers/gpu/drm/drm_aperture.c             | 16 +++++++++++
 drivers/gpu/drm/i915/display/intel_vga.c   | 32 ++++++++++++++++++++--
 drivers/gpu/drm/nouveau/nouveau_vga.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_device.c     | 12 +++++++-
 drivers/pci/vgaarb.c                       | 21 +++++++++++++-
 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                     |  8 ++++--
 12 files changed, 162 insertions(+), 10 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2023-07-02 18:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-02 18:27 [PATCH v2 0/6] PCI/VGA: Improve the default VGA device selection Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 1/6] video/aperture: Add a helper to detect if an aperture contains firmware FB Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 2/6] PCI/VGA: Improve the default VGA device selection Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 3/6] drm/amdgpu: Implement the is_boot_device callback function Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 4/6] drm/radeon: " Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 5/6] drm/i915: " Sui Jingfeng
2023-07-02 18:27 ` [PATCH v2 6/6] drm/ast: Register as a vga client to vgaarb by calling vga_client_register() 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).