Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3198553rwe; Mon, 29 Aug 2022 07:28:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR6JlQhaLH4vuQJiSFwVSgh2sNBrcSb+6BfbPU0tkNneOMYzdc0jYTKf3dT1okogc2UxtbTd X-Received: by 2002:aa7:cc05:0:b0:447:8654:7fa9 with SMTP id q5-20020aa7cc05000000b0044786547fa9mr16657755edt.298.1661783330598; Mon, 29 Aug 2022 07:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661783330; cv=none; d=google.com; s=arc-20160816; b=f0pYhrF+hrziSMlIjVA5SBRxiGH/tkQ1Y8trwRWNwiINP2V95A+3Hbxj3hb095B3hA exrVZM+o33StudNRVeakFhDuCnrlBsoGeLO16W8nNY24SUmQRkmK+zM4iirw2jXjYCwz 8M50yLdFROhvavLOwXyCMkJDNBWi/F1We4WubQ/yhYCsYifBU1O2fR0MjvJQAX1IUInq rrbczPM2X6tVrLC3zzsEY/DIX8vYagBeF7tAfCr6BLvcdtN0DHG3Ji9h6fMcva3EAg3W BCaNAMhPryKJkpEgqn5uG9uO70ClNdn60al7JDzNPLvqrqGIb77JYcHMR4AVJ7Xg1HhV R+ig== 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=boJNilqu5rkLXIrZXtZ+13kCjg+IVe8CBRV4aqjI3IQ=; b=U9BaNfckvbOGCxoleOjuCBQGk4fDeYW0rklxlGZIoV6jm350Idg8RGho6jfjQAzCa4 Sqj1aBy/cxcWZQtDmtsa//v2YBBwUq5SiPThHlR2Ii844Jkke2EHAQjjuVTwtSRLpFNh bzngOnqmdm/z1nn5QJvp1/FMQ2VVA6tC5er6inGvWtEIt5p0AdhBJ0cqeIGT1PW6IF64 vPr+s8rceBlvSaYThiqyIVby8FJ3ZiK7y+NdtqghMVDbiSgoFXNAXfqHipy00LZOwDUm tDJWyRfpxZSdJ3Q8KxZSzQWuxC2o2mJiL7qXin5XXLDKY0X+0Tw0Digf9FY/GmSR/RER NNUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kMzNApZW; 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 g22-20020a1709065d1600b00734b66a6d0dsi7446761ejt.3.2022.08.29.07.28.24; Mon, 29 Aug 2022 07:28:50 -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=kMzNApZW; 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 S230175AbiH2NsF (ORCPT + 99 others); Mon, 29 Aug 2022 09:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbiH2NsD (ORCPT ); Mon, 29 Aug 2022 09:48:03 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E5C09413A for ; Mon, 29 Aug 2022 06:48:02 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id p187so10367402oia.9 for ; Mon, 29 Aug 2022 06:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=boJNilqu5rkLXIrZXtZ+13kCjg+IVe8CBRV4aqjI3IQ=; b=kMzNApZWAepG8844yhdKAszbolxRMCr4T+NZX6qZyk4HXX5WGa/xOKJMkyeaYeyGIV gGPctdEYzEMmPH/0QF4SQjImmks2NCtrJJG5iRCh800OcIulJhnhJJvHLT6iPJC99Nsi 4H+N+bZRUg1CWo0PPv4Pl2cjlCxqRxc/r/xp4KB0afY0jL0P1bPvNbODbM2AJCCHArz3 4pyjCGQvX/e/9UPbCK80eF/+dqAmalmZRjQqfIw7F41sHKKheEyu2E24Bs7hVSDOBUYs Fz1KUf8zkHrmHVMTsouCKyTk2BctKRG6UqIYDagyLyA/GUlzp4Ujyf9WbbgErxSwfPB0 uM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=boJNilqu5rkLXIrZXtZ+13kCjg+IVe8CBRV4aqjI3IQ=; b=GoB1YgviAGREybtx/Y0avO6LK8pirAQhyaEF9RYWkjSqVMjsLGLCeAOWhSV7SdXcHi Q+hWa3OxjQWAoX8wdTe0t3YXe426f8cg2wvFuqJFSGZJBQ4laWrZOyG55DieqUq6EoBi nf58RbxuWoItHAQav3uywu2y4MmoMgC5tRlRFBt7A8ydd8pJpcxbhDwCZdt63K8Q8KqC t7P80FtSp7u5UETV8ysljpNc15jziZDC8X8erB89sVF6+tH4STPwy4ldtO7unPSoHiB9 H4bnFQRxg5DUuZVp+/LaZEq8mwjCPXEjK9/dwOFv5jzTYsirWWGL9CJ6gsX0jpF+Oh5o E+uA== X-Gm-Message-State: ACgBeo1b9Edq8E6ok4+u9b5NW9KGCuV2ERxeohZoi06f3rPv+9Wsb0B9 NvWwgsFq5eyDFR1vxJwCMErvjSGmHtUKxSAZ9FSCxuy6 X-Received: by 2002:a05:6808:138e:b0:345:13d1:fd66 with SMTP id c14-20020a056808138e00b0034513d1fd66mr7375330oiw.96.1661780881704; Mon, 29 Aug 2022 06:48:01 -0700 (PDT) MIME-Version: 1.0 References: <20220829123654.4333-1-nizhen@uniontech.com> In-Reply-To: <20220829123654.4333-1-nizhen@uniontech.com> From: Alex Deucher Date: Mon, 29 Aug 2022 09:47:50 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/amdgpu: Add modeset module parameter support To: Zhen Ni Cc: airlied@linux.ie, daniel@ffwll.ch, evan.quan@amd.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 Mon, Aug 29, 2022 at 9:43 AM Zhen Ni wrote: > > Nomodeset kernel parameter is for all graphics cards. Amdgpu cannot > be set separately in some scenarios, such as hybrid graphics(i + a). > Add modeset module parameter for amdgpu to set kernel mode separately. > > Signed-off-by: Zhen Ni amdgpu didn't support this option since it never supported the legacy drm mode that other older drivers did. If you just want the option to keep the driver from loading, you can already do this by blacklisting the driver. E.g., modprobe.blacklist=amdgpu Alex > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index 429fcdf28836..856a70370e3c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -107,6 +107,7 @@ > #define KMS_DRIVER_MINOR 48 > #define KMS_DRIVER_PATCHLEVEL 0 > > +int amdgpu_modeset = -1; > int amdgpu_vram_limit; > int amdgpu_vis_vram_limit; > int amdgpu_gart_size = -1; /* auto */ > @@ -199,6 +200,13 @@ struct amdgpu_watchdog_timer amdgpu_watchdog_timer = { > .period = 0x0, /* default to 0x0 (timeout disable) */ > }; > > +/** > + * DOC: modeset (int) > + * Disable/Enable kernel modesetting (1 = enable, 0 = disable, -1 = auto (default)). > + */ > +MODULE_PARM_DESC(modeset, "Disable/Enable kernel modesetting"); > +module_param_named(modeset, amdgpu_modeset, int, 0400); > + > /** > * DOC: vramlimit (int) > * Restrict the total amount of VRAM in MiB for testing. The default is 0 (Use full VRAM). > @@ -2753,7 +2761,10 @@ static int __init amdgpu_init(void) > { > int r; > > - if (drm_firmware_drivers_only()) > + if (drm_firmware_drivers_only() && amdgpu_modeset == -1) > + amdgpu_modeset = 0; > + > + if (amdgpu_modeset == 0) > return -EINVAL; > > r = amdgpu_sync_init(); > -- > 2.20.1 >