lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55aa43cf-af3c-57a9-e0ea-6842faa398d9@suse.de>
Date:   Thu, 12 May 2022 09:11:27 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Lyude Paul <lyude@...hat.com>, amd-gfx@...ts.freedesktop.org
Cc:     David Airlie <airlied@...ux.ie>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>,
        Solomon Chiu <solomon.chiu@....com>,
        Kai-Heng Feng <kai.heng.feng@...onical.com>,
        Mario Limonciello <mario.limonciello@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Evan Quan <evan.quan@....com>,
        Christian König <christian.koenig@....com>
Subject: Re: [PATCH] drm/amdgpu: Add 'modeset' module parameter

Hi

Am 11.05.22 um 20:19 schrieb Lyude Paul:
> Many DRM drivers feature a 'modeset' argument, which can be used to
> enable/disable the entire driver (as opposed to passing nomodeset to the
> kernel, which would disable modesetting globally and make it difficult to
> load amdgpu afterwards). Apparently amdgpu is actually missing this
> however, so let's add it!

We have recently consolidated the handling of the modeset parameter in 
the macro drm_module_pci_driver_if_modeset(), [1]  which has a 
deprecation warning in the docs. Only a few older drivers use modeset 
and we don't want to use it further.

Better alternatives are nomodeset or initcall_blacklist=amdgpu_init.

Best regards
Thomas

[1] 
https://cgit.freedesktop.org/drm/drm-tip/tree/include/drm/drm_module.h#n79

> 
> Keep in mind that this currently just lets one enable or disable amdgpu, I
> haven't bothered adding a headless mode like nouveau has - however I'm sure
> someone else can add this if needed.
> 
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index ebd37fb19cdb..24e6fb4517cc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -872,6 +872,15 @@ MODULE_PARM_DESC(smu_pptable_id,
>   	"specify pptable id to be used (-1 = auto(default) value, 0 = use pptable from vbios, > 0 = soft pptable id)");
>   module_param_named(smu_pptable_id, amdgpu_smu_pptable_id, int, 0444);
>   
> +/**
> + * DOC: modeset (int)
> + * Used to enable/disable modesetting for amdgpu exclusively.
> + */
> +bool amdgpu_enable_modeset = true;
> +MODULE_PARM_DESC(modeset,
> +		 "Enable or disable display driver (1 = on (default), 0 = off");
> +module_param_named(modeset, amdgpu_enable_modeset, bool, 0444);
> +
>   /* These devices are not supported by amdgpu.
>    * They are supported by the mach64, r128, radeon drivers
>    */
> @@ -2003,6 +2012,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>   	bool is_fw_fb;
>   	resource_size_t base, size;
>   
> +	if (!amdgpu_enable_modeset) {
> +		DRM_INFO("modeset=0 passed to amdgpu, driver will not be enabled\n");
> +		return -ENODEV;
> +	}
> +
>   	/* skip devices which are owned by radeon */
>   	for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) {
>   		if (amdgpu_unsupported_pciidlist[i] == pdev->device)

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ