[PATCH 2/2] drm/amdgpu: Add modeset module option

Christian König christian.koenig at amd.com
Sun Apr 1 17:39:12 UTC 2018


Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> amdgpu driver lacks of modeset module option other drm drivers provide
> for enforcing or disabling the driver load.  Interestingly, the
> amdgpu_mode variable declaration is already found in the header file,
> but the actual implementation seems to have been forgotten.
>
> This patch adds the missing piece.

NAK, modesetting is mandatory for amdgpu and we should probably remove 
the option to disable it from other DRM drivers without UMS support as 
well (pretty much all of them now).

If you want to prevent a driver from loading I think the correct way to 
do so is to give modprobe.blacklist=amdgpu on the kernel commandline.

That would remove the possibility to prevent the driver from loading 
when it is compiled in, but I don't see much of a problem with that.

Christian.

>
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index e55792d3cd12..029d95ecd26b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -78,6 +78,7 @@
>   #define KMS_DRIVER_MINOR	23
>   #define KMS_DRIVER_PATCHLEVEL	0
>   
> +int amdgpu_modeset = -1;
>   int amdgpu_vram_limit = 0;
>   int amdgpu_vis_vram_limit = 0;
>   int amdgpu_gart_size = -1; /* auto */
> @@ -130,6 +131,9 @@ int amdgpu_lbpw = -1;
>   int amdgpu_compute_multipipe = -1;
>   int amdgpu_gpu_recovery = -1; /* auto */
>   
> +MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
> +module_param_named(modeset, amdgpu_modeset, int, 0400);
> +
>   MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
>   module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
>   
> @@ -905,10 +909,12 @@ static int __init amdgpu_init(void)
>   {
>   	int r;
>   
> -	if (vgacon_text_force()) {
> +	if (vgacon_text_force() && amdgpu_modeset == -1) {
>   		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
>   		return -EINVAL;
>   	}
> +	if (amdgpu_modeset == 0)
> +		return -EINVAL;
>   
>   	r = amdgpu_sync_init();
>   	if (r)



More information about the amd-gfx mailing list