Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp989694iob; Thu, 12 May 2022 08:48:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/61ydX7XVwIjyJCU1bwsX0E8XuvUT/e0AMdHgUgsBRq27U5+fvCAngUS6Md32vSQpRtuj X-Received: by 2002:a17:907:c1b:b0:6f4:4900:e43d with SMTP id ga27-20020a1709070c1b00b006f44900e43dmr464515ejc.325.1652370525754; Thu, 12 May 2022 08:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652370525; cv=none; d=google.com; s=arc-20160816; b=jTFaXn8/wIf7BsQysFc38Uoxx0qxNR4u0C7o3eJPqlNM0gFzeAygR/f5QxdeznJrd1 fj+xHitZNEylkMpHUDW2kbhJyULrxbIhp0b5/UcNUan/6LeZJkdPGzKqmgttdyG6L9OC X+ephUiFakUUXEcrcnubt6GWfFPFjQoxoBVmJkQ/cHfq6UNuswTslytkpf8yD9RGOnnB 4ObTkksMEjXLAVyw34+IMKJRg3rLK0ITiqYXj95bB7sZDarx56KJtoPEPB+rjR9Bsm7z tUp1rqg50RilwTxhXVN5gKT7iPTNK9kY/zbxSaQpnGGN8ZQF4LO//Ryv4ns3Uz6HqRD/ csaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c24hMS7WpiIOCU2zBlghi9w7iiPETthn8Oys+Y9A4/M=; b=jpYpfbjU7XvFZuJkVki9/ISxA8Pd8f1C16CYvp6YRS8ey6Aw0cG58e2ksyQZjUBhcs qIs6B2JspkIrCH1UxUBNfo7f0cS/eUtELXVv9gJMkb6u+nNkNGs4NkamfGmdRL3AH2p8 ARtywTyKQ/xghwUUQrx89lvs3NWZXVbcIJ7qRLdh4AdY4vBhU7exWwygjayzjLS0NfY2 dYMLTWeiKbZ/9yCkbWHCKnq2ioppl3GjCED6hrZJay1O25F3UU7SASxZTNkxDsjdhyPG S0kXBAOkxpoA0k4awbhz6OqZHQAGDTKab8Nf4LeImPoQU70OqPxcoAk1geRYQZW13sRa FbzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RVrvvjyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020aa7d514000000b0041953d28471si5950104edq.235.2022.05.12.08.48.19; Thu, 12 May 2022 08:48:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RVrvvjyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346355AbiEKSgo (ORCPT + 99 others); Wed, 11 May 2022 14:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346370AbiEKSgi (ORCPT ); Wed, 11 May 2022 14:36:38 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854C02899C for ; Wed, 11 May 2022 11:36:35 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-e93bbb54f9so3819324fac.12 for ; Wed, 11 May 2022 11:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c24hMS7WpiIOCU2zBlghi9w7iiPETthn8Oys+Y9A4/M=; b=RVrvvjyYi6+uwGJshrvP26QBJ/UhS/zOMuVWL2YjmVKpp2xtdtezDiLcExQZmwZHQV ZXtEc4GRUn6P5ti1v/sUPlehQqCSa1c7PaCBjcwcoot1lttaoYfHuQ0Mq3CqGhkymJ90 SCyCD0WPdPWIELtR0H+QJL2DPJ7pymcVe76xHh9JC+qcXmNgHxJ9wMSWPk7bWXMwVuae 59oQ5eHqpVgBQrUs8LofWYBlVup3QkNrZ2JddkjsgLaxOIoJnC2goUXoHxrj6PUQPQh+ 7x2fv+8m1lQmE263riUnFnXz30Fwot93EFqfuM1/C0UsRgygFchQMTFpY6UQ48D2emGE vRcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c24hMS7WpiIOCU2zBlghi9w7iiPETthn8Oys+Y9A4/M=; b=bAOq/gjq0Pq8wr1wLchSfkn76TLwPuJo8ZZRHUkUV4mk/Qm7buHRg5AOVcFP+TmhIh Jd7pVwuu11yoswwLslcPPiSqsTez1mg6sdh6/3R9D6WZuyguTzWBbQhicgMaLlYUrf+u /Guhu0dfMPdaPDWKGA6UbsA46M2SWiTvKss0KCJY8Sbjjs3zWOv+0K8v1iLSabisuBKb PvpDUnqUWstvZ3GDp4UNdeuevuub8g4JrEHd+SXWj/V3hjv83/kQFwz6Sm1Gd/GwCOd9 EKRWZOuA6IpDQBrbM6tXp8h/S4Dxgsr/PR0z2q23cvq5VqqxXcCA9luD5XcZbkrG8nlu tmAw== X-Gm-Message-State: AOAM5321pK3j9dLnbUl+YBrj1wMLWCZ9NwsPF7l/t2lqLWeeqA3Yu39T ne6SOfYpmdqSTI1E2rNFjEa6wkuX/TnghPiFCHo= X-Received: by 2002:a05:6870:311d:b0:de:9b6c:362b with SMTP id v29-20020a056870311d00b000de9b6c362bmr3285781oaa.200.1652294194845; Wed, 11 May 2022 11:36:34 -0700 (PDT) MIME-Version: 1.0 References: <20220511181935.810735-1-lyude@redhat.com> In-Reply-To: <20220511181935.810735-1-lyude@redhat.com> From: Alex Deucher Date: Wed, 11 May 2022 14:36:23 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Add 'modeset' module parameter To: Lyude Paul Cc: amd-gfx list , Andrey Grodzovsky , David Airlie , "Pan, Xinhui" , open list , "open list:DRM DRIVERS" , Solomon Chiu , Kai-Heng Feng , Mario Limonciello , Daniel Vetter , Alex Deucher , Evan Quan , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2022 at 2:20 PM Lyude Paul wrote: > > 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! You can already do that by passing modprobe.blacklist=amdgpu on the kernel command line. I don't think we need another option to do that. > > 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. You can do this as well by passing an IP block mask which disables the display IP, or media IP, etc. Alex > > Signed-off-by: Lyude Paul > --- > 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) > -- > 2.35.1 >