From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
Maxime Ripard <mripard@kernel.org>,
Jani Nikula <jani.nikula@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
nouveau@lists.freedesktop.org, linux-pci@vger.kernel.org,
kvm@vger.kernel.org, linux-fbdev@vger.kernel.org,
Sui Jingfeng <suijingfeng@loongson.cn>
Subject: [PATCH v1 0/4] PCI/VGA: Improve the default VGA device selection
Date: Fri, 30 Jun 2023 19:02:39 +0800 [thread overview]
Message-ID: <20230630110243.141671-1-sui.jingfeng@linux.dev> (raw)
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 the keep the original behavior.
Sui Jingfeng (4):
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
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 | 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 +++---
11 files changed, 104 insertions(+), 10 deletions(-)
--
2.25.1
next reply other threads:[~2023-06-30 11:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 11:02 Sui Jingfeng [this message]
2023-06-30 11:02 ` [PATCH v1 1/4] video/aperture: Add a helper to detect if an aperture contains firmware FB Sui Jingfeng
2023-06-30 11:02 ` [PATCH v1 2/4] PCI/VGA: Improve the default VGA device selection Sui Jingfeng
2023-06-30 11:02 ` [PATCH v1 3/4] drm/amdgpu: Implement the is_boot_device callback function Sui Jingfeng
2023-06-30 11:02 ` [PATCH v1 4/4] drm/radeon: " Sui Jingfeng
-- strict thread matches above, loose matches on Subject: below --
2023-06-30 10:57 [PATCH v1 0/4] PCI/VGA: Improve the default VGA device selection Sui Jingfeng
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=20230630110243.141671-1-sui.jingfeng@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=suijingfeng@loongson.cn \
--cc=tzimmermann@suse.de \
/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