From patchwork Fri Mar 30 20:45:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10318309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D41160212 for ; Fri, 30 Mar 2018 20:45:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D26F2A6A4 for ; Fri, 30 Mar 2018 20:45:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31AE62A6A9; Fri, 30 Mar 2018 20:45:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED27B2A6A4 for ; Fri, 30 Mar 2018 20:45:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F1D66E43B; Fri, 30 Mar 2018 20:45:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id E90896E1A4; Fri, 30 Mar 2018 20:45:16 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3E10CAE55; Fri, 30 Mar 2018 20:45:15 +0000 (UTC) From: Takashi Iwai To: Alex Deucher Subject: [PATCH 2/2] drm/amdgpu: Add modeset module option Date: Fri, 30 Mar 2018 22:45:12 +0200 Message-Id: <20180330204512.16863-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330204512.16863-1-tiwai@suse.de> References: <20180330204512.16863-1-tiwai@suse.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , dri-devel@lists.freedesktop.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , amd-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Takashi Iwai Reviewed-by: Dave Airlie --- 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)