From patchwork Thu Sep 25 09:36:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Moreau X-Patchwork-Id: 4978071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DEC3F9F40A for ; Fri, 26 Sep 2014 01:00:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DD55202C8 for ; Fri, 26 Sep 2014 01:00:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A6D56202BE for ; Fri, 26 Sep 2014 01:00:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBC7F6E74F; Thu, 25 Sep 2014 17:59:45 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by gabe.freedesktop.org (Postfix) with ESMTP id 40FB46E6C0; Thu, 25 Sep 2014 02:36:39 -0700 (PDT) Received: from Normandy.eduroam.u-bordeaux.fr (unknown [147.210.245.180]) (Authenticated sender: pierre.morrow) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 89B424C8029; Thu, 25 Sep 2014 11:36:14 +0200 (CEST) From: Pierre Moreau To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Ben Skeggs Subject: [PATCH 2/2] drm/nouveau: Allow noaccel to be a pci address Date: Thu, 25 Sep 2014 11:36:31 +0200 Message-Id: <1411637791-4274-2-git-send-email-pierre.morrow@free.fr> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411637791-4274-1-git-send-email-pierre.morrow@free.fr> References: <1411637791-4274-1-git-send-email-pierre.morrow@free.fr> X-Mailman-Approved-At: Thu, 25 Sep 2014 17:59:39 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP noaccel option now defaults to null which has no effect, it can still equal 1, which disables acceleration for all cards, or be a pci address and disable acceleration for that card only Signed-off-by: Pierre Moreau --- drivers/gpu/drm/nouveau/nouveau_drm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 244d78f..04bd8f1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -61,9 +61,10 @@ MODULE_PARM_DESC(debug, "debug string to pass to driver core"); static char *nouveau_debug; module_param_named(debug, nouveau_debug, charp, 0400); -MODULE_PARM_DESC(noaccel, "disable kernel/abi16 acceleration"); -static int nouveau_noaccel = 0; -module_param_named(noaccel, nouveau_noaccel, int, 0400); +MODULE_PARM_DESC(noaccel, "disable kernel/abi16 acceleration for all cards," + "or only for the card given its pci bus name"); +static char *nouveau_noaccel; +module_param_named(noaccel, nouveau_noaccel, charp, 0400); MODULE_PARM_DESC(modeset, "enable driver (default: auto, " "0 = disabled, 1 = enabled, 2 = headless)"); @@ -149,8 +150,13 @@ nouveau_accel_init(struct nouveau_drm *drm) u32 sclass[16]; int ret, i; - if (nouveau_noaccel) + if (nouveau_noaccel != NULL && + (!strcmp(nouveau_noaccel, "1") || + !strcmp(nouveau_noaccel, nvkm_device(device)->name))) + { + NV_WARN(drm, "Acceleration disabled for card on bus %s\n", nvkm_device(device)->name); return; + } /* initialise synchronisation routines */ /*XXX: this is crap, but the fence/channel stuff is a little @@ -1039,7 +1045,7 @@ static void nouveau_display_options(void) DRM_DEBUG_DRIVER("... nofbaccel : %d\n", nouveau_nofbaccel); DRM_DEBUG_DRIVER("... config : %s\n", nouveau_config); DRM_DEBUG_DRIVER("... debug : %s\n", nouveau_debug); - DRM_DEBUG_DRIVER("... noaccel : %d\n", nouveau_noaccel); + DRM_DEBUG_DRIVER("... noaccel : %s\n", nouveau_noaccel); DRM_DEBUG_DRIVER("... modeset : %d\n", nouveau_modeset); DRM_DEBUG_DRIVER("... runpm : %d\n", nouveau_runtime_pm); DRM_DEBUG_DRIVER("... vram_pushbuf : %d\n", nouveau_vram_pushbuf);