Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: suijingfeng <suijingfeng@loongson.cn>,
	Sui Jingfeng <sui.jingfeng@linux.dev>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org
Subject: Re: [Intel-gfx] [Nouveau] [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 10:05:27 +0200	[thread overview]
Message-ID: <6035cf27-1506-dda7-e1ca-d83ce5cb5340@suse.de> (raw)
In-Reply-To: <3eced3f5-622f-31a6-f8a0-ff0812be74ff@loongson.cn>


[-- Attachment #1.1: Type: text/plain, Size: 5150 bytes --]

Hi

Am 05.09.23 um 17:59 schrieb suijingfeng:
[...]
>> FYI: per-driver modeset parameters are deprecated and not to be used. 
>> Please don't promote them.
> 
> 
> Well, please wait, I want to explain.
> 
> 
> 
> drm/nouveau already promote it a little bit.
> 
> Despite no code of conduct or specification guiding how the modules 
> parameters should be.
> Noticed that there already have a lot of DRM drivers support the modeset 
> parameters,

Please look at the history and discussion around this parameter. To my 
knowledge, 'modeset' got introduced when modesetting with still done in 
userspace. It was an easy way of disabling the kernel driver if the 
system's Xorg did no yet support kernel mode setting.

Fast forward a few years and all Linux' use kernel modesetting, which 
make the modeset parameters obsolete. We discussed and decided to keep 
them in, because many articles and blog posts refer to them. We didn't 
want to invalidate them. BUT modeset is deprecated and not allowed in 
new code. If you look at existing modeset usage, you will eventually 
come across the comment at [1].

There's 'nomodeset', which disables all native drivers. It's useful for 
debugging or as a quick-fix if the graphics driver breaks. If you want 
to disable a specific driver, please use one of the options for 
blacklisting.

Best regards
Thomas

[1] 
https://elixir.bootlin.com/linux/v6.5/source/include/drm/drm_module.h#L83


> for the modeset parameter, authors of various device driver try to make 
> the usage not
> conflict with others. I believe that this is good thing for Linux users.
> It is probably the responsibility of the drm core maintainers to force 
> various drm
> drivers to reach a minimal consensus. Probably it pains to do so and 
> doesn't pay off.
> But reach a minimal consensus do benefit to Linux users.
> 
> 
>> You can use modprobe.blacklist or initcall_blacklist on the kernel 
>> command line.
>>
> There are some cases where the modprobe.blacklist doesn't works,
> I have come cross several time during the past.
> Because the device selected by the VGAARB is device-level thing,
> it is not the driver's problem.
> 
> Sometimes when VGAARB has a bug, it will select a wrong device as primary.
> And the X server will use this wrong device as primary and completely crash
> there, due to lack a driver. Take my old S3 Graphics as an example:
> 
> $ lspci | grep VGA
> 
>   00:06.1 VGA compatible controller: Loongson Technology LLC DC (Display 
> Controller) (rev 01)
>   03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. 
> [AMD/ATI] Caicos XT [Radeon HD 7470/8470 / R5 235/310 OEM]
>   07:00.0 VGA compatible controller: S3 Graphics Ltd. Device 9070 (rev 01)
>   08:00.0 VGA compatible controller: S3 Graphics Ltd. Device 9070 (rev 01)
> 
> Before apply this patch:
> 
> [    0.361748] pci 0000:00:06.1: vgaarb: setting as boot VGA device
> [    0.361753] pci 0000:00:06.1: vgaarb: VGA device added: 
> decodes=io+mem,owns=io+mem,locks=none
> [    0.361765] pci 0000:03:00.0: vgaarb: VGA device added: 
> decodes=io+mem,owns=none,locks=none
> [    0.361773] pci 0000:07:00.0: vgaarb: VGA device added: 
> decodes=io+mem,owns=none,locks=none
> [    0.361779] pci 0000:08:00.0: vgaarb: VGA device added: 
> decodes=io+mem,owns=none,locks=none
> [    0.361781] vgaarb: loaded
> [    0.367838] pci 0000:00:06.1: Overriding boot device as 1002:6778
> [    0.367841] pci 0000:00:06.1: Overriding boot device as 5333:9070
> [    0.367843] pci 0000:00:06.1: Overriding boot device as 5333:9070
> 
> 
> For known reason, one of my system select the S3 Graphics as primary GPU.
> But this S3 Graphics not even have a decent drm upstream driver yet.
> Under such a case, I begin to believe that only the device who has a
> driver deserve the primary.
> 
> Under such a condition, I want to reboot and enter the graphic environment
> with other working video cards. Either platform integrated and discrete 
> GPU.
> This don't means I should compromise by un-mount the S3 graphics card from
> the motherboard, this also don't means that I should update my BIOS 
> setting.
> As sometimes, the BIOS is more worse.
> 
> With this series applied, all I need to do is to reboot the computer and
> pass a command line. By force override another video card (who has a
> decent driver support) as primary, I'm able to do the debugging under
> graphic environment. I would like to examine what's wrong with the vgaarb
> on a specific platform under X server graphic environment.
> 
> Probably try compile a driver for this card and see it works, simply reboot
> without the need to change anything. It is so efficient. So this is 
> probably
> the second usage of my patch. It hand the right of control back to the
> graphic developer.
> 
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-09-06  8:05 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 19:57 [Intel-gfx] [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 ` [Intel-gfx] [RFC, drm-misc-next v4 1/9] " Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [RFC, drm-misc-next v4 2/9] drm/nouveau: Implement .be_primary() callback Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [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 ` [Intel-gfx] [RFC, drm-misc-next v4 4/9] drm/amdgpu: " Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [RFC, drm-misc-next v4 5/9] drm/i915: " Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [RFC, drm-misc-next v4 6/9] drm/loongson: " Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [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 ` [Intel-gfx] [RFC, drm-misc-next v4 8/9] drm/hibmc: " Sui Jingfeng
2023-09-04 19:57 ` [Intel-gfx] [RFC, drm-misc-next v4 9/9] drm/gma500: " Sui Jingfeng
2023-09-04 20:36 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for PCI/VGA: Allowing the user to select the primary video adapter at boot time Patchwork
2023-09-04 20:54 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-04 22:14 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-05 10:38 ` [Intel-gfx] [RFC, drm-misc-next v4 0/9] " 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 ` [Intel-gfx] [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 [this message]
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 ` [Intel-gfx] " Alex Williamson
2023-09-05 16:21   ` suijingfeng
2023-09-05 16:39     ` Alex Williamson
2023-09-06  3:51   ` Sui Jingfeng
2023-09-06 19:29     ` Alex Williamson
2023-09-06  0:52 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for PCI/VGA: Allowing the user to select the primary video adapter at boot time (rev2) Patchwork

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=6035cf27-1506-dda7-e1ca-d83ce5cb5340@suse.de \
    --to=tzimmermann@suse.de \
    --cc=Alexander.Deucher@amd.com \
    --cc=Christian.Koenig@amd.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=sui.jingfeng@linux.dev \
    --cc=suijingfeng@loongson.cn \
    /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