linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Sui Jingfeng <suijingfeng@loongson.cn>,
	nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org, linux-pci@vger.kernel.org,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Jani Nikula <jani.nikula@linux.intel.com>
Subject: Re: [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time
Date: Wed, 6 Sep 2023 11:51:59 +0800	[thread overview]
Message-ID: <a6337007-b6fa-2ce9-d0cd-46465b540205@linux.dev> (raw)
In-Reply-To: <20230905085243.4b22725e.alex.williamson@redhat.com>

Hi,


On 2023/9/5 22:52, Alex Williamson wrote:
> On Tue,  5 Sep 2023 03:57:15 +0800
> Sui Jingfeng <sui.jingfeng@linux.dev> wrote:
>
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> On a machine with multiple GPUs, a Linux user has no control over which
>> one is primary at boot time. This series tries to solve above mentioned
>> problem by introduced the ->be_primary() function stub. The specific
>> device drivers can provide an implementation to hook up with this stub by
>> calling the vga_client_register() function.
>>
>> Once the driver bound the device successfully, VGAARB will call back to
>> the device driver. To query if the device drivers want to be primary or
>> not. Device drivers can just pass NULL if have no such needs.
>>
>> Please note that:
>>
>> 1) The ARM64, Loongarch, Mips servers have a lot PCIe slot, and I would
>>     like to mount at least three video cards.
>>
>> 2) Typically, those non-86 machines don't have a good UEFI firmware
>>     support, which doesn't support select primary GPU as firmware stage.
>>     Even on x86, there are old UEFI firmwares which already made undesired
>>     decision for you.
>>
>> 3) This series is attempt to solve the remain problems at the driver level,
>>     while another series[1] of me is target to solve the majority of the
>>     problems at device level.
>>
>> Tested (limited) on x86 with four video card mounted, Intel UHD Graphics
>> 630 is the default boot VGA, successfully override by ast2400 with
>> ast.modeset=10 append at the kernel cmd line.
>>
>> $ lspci | grep VGA
>>
>>   00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
> In all my previous experiments with VGA routing and IGD I found that
> IGD can't actually release VGA routing and Intel confirmed the hardware
> doesn't have the ability to do so.

Which model of the IGD you are using? even for the IGD in Atom D2550,
the legacy 128KB VGA memory range can be tuned to be mapped to IGD
or to the DMI Interface. See the 1.7.3.2 section of the N2000 datasheet[1].

If a specific model of Intel has a bug in the VGA routing hardware logic unit,
I would like to ignore it. Or switch to the UEFI firmware on such hardware.

It is the hardware engineer's responsibility, I will not worry about it.
Thanks for you tell this.

[1] https://www.intel.com/content/dam/doc/datasheet/atom-d2000-n2000-vol-2-datasheet.pdf


>   It will always be primary from a
> VGA routing perspective.  Was this actually tested with non-UEFI?


As you already said, the generous Intel already have confirmed that the hardware defect.
So probably this is a good chance to switch to UEFI to solve the problem. Then, no
testing for legacy is needed.


> I suspect it might only work in UEFI mode where we probably don't
> actually have a dependency on VGA routing.  This is essentially why
> vfio requires UEFI ROMs when assigning GPUs to VMs, VGA routing is too
> broken to use on Intel systems with IGD.  Thanks,

Thanks for you tell me this.

To be honest, I have only tested my patch on machines with UEFI firmware.
Since UEFI because the main stream, but if this patch is really useful for
majority machine, I'm satisfied. The results is not too bad.

Thanks.

> Alex
>

  parent reply	other threads:[~2023-09-06  3:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 19:57 [RFC,drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 1/9] " Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 2/9] drm/nouveau: Implement .be_primary() callback Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 3/9] drm/radeon: " Sui Jingfeng
2023-09-05  5:50   ` Christian König
2023-09-05 17:24     ` suijingfeng
2023-09-06 16:00       ` Alex Deucher
2023-09-07  1:40         ` Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 4/9] drm/amdgpu: " Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 5/9] drm/i915: " Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 6/9] drm/loongson: " Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 7/9] drm/ast: Register as a VGA client by calling vga_client_register() Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 8/9] drm/hibmc: " Sui Jingfeng
2023-09-04 19:57 ` [RFC,drm-misc-next v4 9/9] drm/gma500: " Sui Jingfeng
2023-09-05 10:38 ` [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time Jani Nikula
2023-09-05 13:28   ` Christian König
2023-09-05 14:28     ` Sui Jingfeng
2023-09-06  6:47       ` Christian König
2023-09-05 10:45 ` [Nouveau] " Thomas Zimmermann
2023-09-05 13:30   ` suijingfeng
2023-09-05 15:05     ` Thomas Zimmermann
2023-09-06  2:14       ` suijingfeng
2023-09-06  7:00         ` Thomas Zimmermann
2023-09-06  2:34       ` suijingfeng
2023-09-06  7:18         ` Thomas Zimmermann
2023-09-06  3:08       ` suijingfeng
2023-09-06  7:46         ` Thomas Zimmermann
2023-09-06  4:14       ` Sui Jingfeng
2023-09-06  6:45     ` Christian König
2023-09-06  9:08       ` suijingfeng
2023-09-06  9:40         ` Christian König
2023-09-07  2:30           ` Sui Jingfeng
2023-09-07  9:08             ` Christian König
2023-09-07 12:32               ` suijingfeng
2023-09-07 12:43                 ` Christian König
2023-09-07 15:26                   ` suijingfeng
2023-09-07 15:32                     ` Christian König
2023-09-07 16:33               ` suijingfeng
2023-09-08  6:59                 ` Christian König
2023-09-06 10:31       ` Sui Jingfeng
2023-09-06 10:50         ` Christian König
2023-09-05 10:49 ` Thomas Zimmermann
2023-09-05 15:59   ` suijingfeng
2023-09-06  8:05     ` Thomas Zimmermann
2023-09-06  9:48       ` suijingfeng
2023-09-06 11:06         ` Thomas Zimmermann
2023-09-07  9:43         ` Jani Nikula
2023-09-05 14:52 ` Alex Williamson
2023-09-05 16:21   ` suijingfeng
2023-09-05 16:39     ` Alex Williamson
2023-09-06  3:51   ` Sui Jingfeng [this message]
2023-09-06 19:29     ` Alex Williamson

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=a6337007-b6fa-2ce9-d0cd-46465b540205@linux.dev \
    --to=sui.jingfeng@linux.dev \
    --cc=Christian.Koenig@amd.com \
    --cc=alex.williamson@redhat.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhelgaas@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.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;
as well as URLs for NNTP newsgroup(s).