From patchwork Sat Feb 15 00:38:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 3655221 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A51F3BF13A for ; Sat, 15 Feb 2014 00:38:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DD252020F for ; Sat, 15 Feb 2014 00:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 41E7820203 for ; Sat, 15 Feb 2014 00:38:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFC53FA686; Fri, 14 Feb 2014 16:38:31 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f49.google.com (mail-qa0-f49.google.com [209.85.216.49]) by gabe.freedesktop.org (Postfix) with ESMTP id B0342FA686; Fri, 14 Feb 2014 16:38:29 -0800 (PST) Received: by mail-qa0-f49.google.com with SMTP id w8so18978636qac.22 for ; Fri, 14 Feb 2014 16:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=eM7Ckj0H/uQvJXGr+fZyH+GF+CqZZ078j/lzOeKlEv4=; b=UbggUpfDfZ//1pg0VFQNYIXw+bnWmluKXok6q6M30gkzGc+ae/WBxvWwEamYyU+L/E C5M/T4QIGoGblZc6OiZYp5h/R2HjOQdhLzwYsZMVFNN36hkayzYtYwoLbrG3E+y24z8X EUK04CMl5xBpOlIo3ZaU4v/TnEyr4VFYfL3J4kgUN1XPrE6nLSDGK7gw083wOhYlNqaK L+ckk6nCKsfxMKAlHgc2q9MWSdaeh+Vav2aLDa1uy3Z4Frx3wJ28ahyx/a6PZW83HrAb 9nJri3HFXKn2CgtyudCLR6t4X5nlYd/JcCJykRI7pxfepL0PzekDkOObYyffAESJ4jbv OgUQ== X-Received: by 10.224.136.195 with SMTP id s3mr18450392qat.95.1392424708265; Fri, 14 Feb 2014 16:38:28 -0800 (PST) Received: from localhost.localdomain (cpe-74-71-29-187.nyc.res.rr.com. [74.71.29.187]) by mx.google.com with ESMTPSA id a5sm20566163qae.2.2014.02.14.16.38.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2014 16:38:27 -0800 (PST) From: Ilia Mirkin To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH] drm/nouveau: split off nvc0 compilation Date: Fri, 14 Feb 2014 19:38:06 -0500 Message-Id: <1392424686-9828-1-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.8.3.2 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 So... I was wondering what the impact of splitting up the card compilation by e.g. generation would be. Depending on the split things would get fairly intertwined, so I thought I'd start small. This just splits NVC0 from everything else. I figure that for the people this matters the most to, NVC0 is the least relevant card -- people with sub-1GB of RAM, older hardware. With my config options and everything compiled, the total size of nouveau.ko is 1343324 bytes (incl symbols), which is split up text data bss dec hex filename 579171 184264 480 763915 ba80b ./drivers/gpu/drm/nouveau/nouveau.ko Turning off nvc0+ gives us 995667 bytes, split up text data bss dec hex filename 472244 59528 480 532252 81f1c ./drivers/gpu/drm/nouveau/nouveau.ko So we lost 100K of text and 130K of data (probably all that pgraph fw), and the remaining 100K must be symbols. (I'm not stripping because nobody in their right mind strips these kernel modules.) The impact to the code is pretty minor. Depending on the situation it's easier to either ifdef out code or to provide stubs for functions. What do people think about this? It shouldn't be too difficult for me to extend this to categories like , or maybe even more fine-grained, esp since nvd0 is when a lot of changes happened. Or maybe less-fine-grained and keep the nvc0/nve0 cards under one option. Feedback appreciated. Not-Signed-off-by: Ilia Mirkin --- drivers/gpu/drm/nouveau/Kconfig | 11 +- drivers/gpu/drm/nouveau/Makefile | 136 +++++++++++----------- drivers/gpu/drm/nouveau/core/engine/device/base.c | 2 + drivers/gpu/drm/nouveau/nouveau_drm.c | 4 +- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 16 +++ 5 files changed, 98 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 7cf787d..927fc38 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -26,9 +26,14 @@ config DRM_NOUVEAU help Choose this option for open-source nVidia support. +if DRM_NOUVEAU + +config DRM_NOUVEAU_NVC0 + bool "NVC0+ (Fermi / Kepler)" + default y + config NOUVEAU_DEBUG int "Maximum debug level" - depends on DRM_NOUVEAU range 0 7 default 5 help @@ -48,7 +53,6 @@ config NOUVEAU_DEBUG config NOUVEAU_DEBUG_DEFAULT int "Default debug level" - depends on DRM_NOUVEAU range 0 7 default 3 help @@ -56,8 +60,9 @@ config NOUVEAU_DEBUG_DEFAULT config DRM_NOUVEAU_BACKLIGHT bool "Support for backlight control" - depends on DRM_NOUVEAU default y help Say Y here if you want to control the backlight of your display (e.g. a laptop panel). + +endif diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index d310c19..a1e8513 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile @@ -25,7 +25,7 @@ nouveau-y += core/core/subdev.o nouveau-y += core/subdev/bar/base.o nouveau-y += core/subdev/bar/nv50.o -nouveau-y += core/subdev/bar/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/bar/nvc0.o nouveau-y += core/subdev/bios/base.o nouveau-y += core/subdev/bios/bit.o nouveau-y += core/subdev/bios/boost.o @@ -53,7 +53,7 @@ nouveau-y += core/subdev/bus/nv04.o nouveau-y += core/subdev/bus/nv31.o nouveau-y += core/subdev/bus/nv50.o nouveau-y += core/subdev/bus/nv94.o -nouveau-y += core/subdev/bus/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/bus/nvc0.o nouveau-y += core/subdev/clock/base.o nouveau-y += core/subdev/clock/nv04.o nouveau-y += core/subdev/clock/nv40.o @@ -61,8 +61,8 @@ nouveau-y += core/subdev/clock/nv50.o nouveau-y += core/subdev/clock/nv84.o nouveau-y += core/subdev/clock/nva3.o nouveau-y += core/subdev/clock/nvaa.o -nouveau-y += core/subdev/clock/nvc0.o -nouveau-y += core/subdev/clock/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/clock/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/clock/nve0.o nouveau-y += core/subdev/clock/pllnv04.o nouveau-y += core/subdev/clock/pllnva3.o nouveau-y += core/subdev/devinit/base.o @@ -76,7 +76,7 @@ nouveau-y += core/subdev/devinit/nv84.o nouveau-y += core/subdev/devinit/nv98.o nouveau-y += core/subdev/devinit/nva3.o nouveau-y += core/subdev/devinit/nvaf.o -nouveau-y += core/subdev/devinit/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/devinit/nvc0.o nouveau-y += core/subdev/fb/base.o nouveau-y += core/subdev/fb/nv04.o nouveau-y += core/subdev/fb/nv10.o @@ -98,8 +98,8 @@ nouveau-y += core/subdev/fb/nv84.o nouveau-y += core/subdev/fb/nva3.o nouveau-y += core/subdev/fb/nvaa.o nouveau-y += core/subdev/fb/nvaf.o -nouveau-y += core/subdev/fb/nvc0.o -nouveau-y += core/subdev/fb/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/fb/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/fb/nve0.o nouveau-y += core/subdev/fb/ramnv04.o nouveau-y += core/subdev/fb/ramnv10.o nouveau-y += core/subdev/fb/ramnv1a.o @@ -112,15 +112,15 @@ nouveau-y += core/subdev/fb/ramnv4e.o nouveau-y += core/subdev/fb/ramnv50.o nouveau-y += core/subdev/fb/ramnva3.o nouveau-y += core/subdev/fb/ramnvaa.o -nouveau-y += core/subdev/fb/ramnvc0.o -nouveau-y += core/subdev/fb/ramnve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/fb/ramnvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/fb/ramnve0.o nouveau-y += core/subdev/fb/sddr3.o nouveau-y += core/subdev/fb/gddr5.o nouveau-y += core/subdev/gpio/base.o nouveau-y += core/subdev/gpio/nv10.o nouveau-y += core/subdev/gpio/nv50.o -nouveau-y += core/subdev/gpio/nvd0.o -nouveau-y += core/subdev/gpio/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/gpio/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/gpio/nve0.o nouveau-y += core/subdev/i2c/base.o nouveau-y += core/subdev/i2c/anx9805.o nouveau-y += core/subdev/i2c/aux.o @@ -129,14 +129,14 @@ nouveau-y += core/subdev/i2c/nv04.o nouveau-y += core/subdev/i2c/nv4e.o nouveau-y += core/subdev/i2c/nv50.o nouveau-y += core/subdev/i2c/nv94.o -nouveau-y += core/subdev/i2c/nvd0.o -nouveau-y += core/subdev/ibus/nvc0.o -nouveau-y += core/subdev/ibus/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/i2c/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/ibus/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/ibus/nve0.o nouveau-y += core/subdev/instmem/base.o nouveau-y += core/subdev/instmem/nv04.o nouveau-y += core/subdev/instmem/nv40.o nouveau-y += core/subdev/instmem/nv50.o -nouveau-y += core/subdev/ltcg/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/ltcg/nvc0.o nouveau-y += core/subdev/mc/base.o nouveau-y += core/subdev/mc/nv04.o nouveau-y += core/subdev/mc/nv40.o @@ -145,17 +145,17 @@ nouveau-y += core/subdev/mc/nv4c.o nouveau-y += core/subdev/mc/nv50.o nouveau-y += core/subdev/mc/nv94.o nouveau-y += core/subdev/mc/nv98.o -nouveau-y += core/subdev/mc/nvc0.o -nouveau-y += core/subdev/mc/nvc3.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/mc/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/mc/nvc3.o nouveau-y += core/subdev/mxm/base.o nouveau-y += core/subdev/mxm/mxms.o nouveau-y += core/subdev/mxm/nv50.o nouveau-y += core/subdev/pwr/base.o nouveau-y += core/subdev/pwr/memx.o nouveau-y += core/subdev/pwr/nva3.o -nouveau-y += core/subdev/pwr/nvc0.o -nouveau-y += core/subdev/pwr/nvd0.o -nouveau-y += core/subdev/pwr/nv108.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/pwr/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/pwr/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/pwr/nv108.o nouveau-y += core/subdev/therm/base.o nouveau-y += core/subdev/therm/fan.o nouveau-y += core/subdev/therm/fannil.o @@ -167,7 +167,7 @@ nouveau-y += core/subdev/therm/nv40.o nouveau-y += core/subdev/therm/nv50.o nouveau-y += core/subdev/therm/nv84.o nouveau-y += core/subdev/therm/nva3.o -nouveau-y += core/subdev/therm/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/therm/nvd0.o nouveau-y += core/subdev/timer/base.o nouveau-y += core/subdev/timer/nv04.o nouveau-y += core/subdev/vm/base.o @@ -175,7 +175,7 @@ nouveau-y += core/subdev/vm/nv04.o nouveau-y += core/subdev/vm/nv41.o nouveau-y += core/subdev/vm/nv44.o nouveau-y += core/subdev/vm/nv50.o -nouveau-y += core/subdev/vm/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/subdev/vm/nvc0.o nouveau-y += core/subdev/volt/base.o nouveau-y += core/subdev/volt/gpio.o nouveau-y += core/subdev/volt/nv40.o @@ -185,15 +185,15 @@ nouveau-y += core/engine/xtensa.o nouveau-y += core/engine/dmaobj/base.o nouveau-y += core/engine/dmaobj/nv04.o nouveau-y += core/engine/dmaobj/nv50.o -nouveau-y += core/engine/dmaobj/nvc0.o -nouveau-y += core/engine/dmaobj/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/dmaobj/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/dmaobj/nvd0.o nouveau-y += core/engine/bsp/nv84.o nouveau-y += core/engine/bsp/nv98.o -nouveau-y += core/engine/bsp/nvc0.o -nouveau-y += core/engine/bsp/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/bsp/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/bsp/nve0.o nouveau-y += core/engine/copy/nva3.o -nouveau-y += core/engine/copy/nvc0.o -nouveau-y += core/engine/copy/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/copy/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/copy/nve0.o nouveau-y += core/engine/crypt/nv84.o nouveau-y += core/engine/crypt/nv98.o nouveau-y += core/engine/device/base.o @@ -204,8 +204,8 @@ nouveau-y += core/engine/device/nv20.o nouveau-y += core/engine/device/nv30.o nouveau-y += core/engine/device/nv40.o nouveau-y += core/engine/device/nv50.o -nouveau-y += core/engine/device/nvc0.o -nouveau-y += core/engine/device/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/device/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/device/nve0.o nouveau-y += core/engine/disp/base.o nouveau-y += core/engine/disp/nv04.o nouveau-y += core/engine/disp/nv50.o @@ -213,20 +213,20 @@ nouveau-y += core/engine/disp/nv84.o nouveau-y += core/engine/disp/nv94.o nouveau-y += core/engine/disp/nva0.o nouveau-y += core/engine/disp/nva3.o -nouveau-y += core/engine/disp/nvd0.o -nouveau-y += core/engine/disp/nve0.o -nouveau-y += core/engine/disp/nvf0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/nvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/nvf0.o nouveau-y += core/engine/disp/dacnv50.o nouveau-y += core/engine/disp/dport.o nouveau-y += core/engine/disp/hdanva3.o -nouveau-y += core/engine/disp/hdanvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/hdanvd0.o nouveau-y += core/engine/disp/hdminv84.o nouveau-y += core/engine/disp/hdminva3.o -nouveau-y += core/engine/disp/hdminvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/hdminvd0.o nouveau-y += core/engine/disp/piornv50.o nouveau-y += core/engine/disp/sornv50.o nouveau-y += core/engine/disp/sornv94.o -nouveau-y += core/engine/disp/sornvd0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/disp/sornvd0.o nouveau-y += core/engine/disp/vga.o nouveau-y += core/engine/fifo/base.o nouveau-y += core/engine/fifo/nv04.o @@ -235,20 +235,20 @@ nouveau-y += core/engine/fifo/nv17.o nouveau-y += core/engine/fifo/nv40.o nouveau-y += core/engine/fifo/nv50.o nouveau-y += core/engine/fifo/nv84.o -nouveau-y += core/engine/fifo/nvc0.o -nouveau-y += core/engine/fifo/nve0.o -nouveau-y += core/engine/fifo/nv108.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/fifo/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/fifo/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/fifo/nv108.o nouveau-y += core/engine/graph/ctxnv40.o nouveau-y += core/engine/graph/ctxnv50.o -nouveau-y += core/engine/graph/ctxnvc0.o -nouveau-y += core/engine/graph/ctxnvc1.o -nouveau-y += core/engine/graph/ctxnvc3.o -nouveau-y += core/engine/graph/ctxnvc8.o -nouveau-y += core/engine/graph/ctxnvd7.o -nouveau-y += core/engine/graph/ctxnvd9.o -nouveau-y += core/engine/graph/ctxnve4.o -nouveau-y += core/engine/graph/ctxnvf0.o -nouveau-y += core/engine/graph/ctxnv108.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvc1.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvc3.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvc8.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvd7.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvd9.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnve4.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnvf0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/ctxnv108.o nouveau-y += core/engine/graph/nv04.o nouveau-y += core/engine/graph/nv10.o nouveau-y += core/engine/graph/nv20.o @@ -259,15 +259,15 @@ nouveau-y += core/engine/graph/nv34.o nouveau-y += core/engine/graph/nv35.o nouveau-y += core/engine/graph/nv40.o nouveau-y += core/engine/graph/nv50.o -nouveau-y += core/engine/graph/nvc0.o -nouveau-y += core/engine/graph/nvc1.o -nouveau-y += core/engine/graph/nvc3.o -nouveau-y += core/engine/graph/nvc8.o -nouveau-y += core/engine/graph/nvd7.o -nouveau-y += core/engine/graph/nvd9.o -nouveau-y += core/engine/graph/nve4.o -nouveau-y += core/engine/graph/nvf0.o -nouveau-y += core/engine/graph/nv108.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvc1.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvc3.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvc8.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvd7.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvd9.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nve4.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nvf0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/graph/nv108.o nouveau-y += core/engine/mpeg/nv31.o nouveau-y += core/engine/mpeg/nv40.o nouveau-y += core/engine/mpeg/nv44.o @@ -279,19 +279,19 @@ nouveau-y += core/engine/perfmon/nv40.o nouveau-y += core/engine/perfmon/nv50.o nouveau-y += core/engine/perfmon/nv84.o nouveau-y += core/engine/perfmon/nva3.o -nouveau-y += core/engine/perfmon/nvc0.o -nouveau-y += core/engine/perfmon/nve0.o -nouveau-y += core/engine/perfmon/nvf0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/perfmon/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/perfmon/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/perfmon/nvf0.o nouveau-y += core/engine/ppp/nv98.o -nouveau-y += core/engine/ppp/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/ppp/nvc0.o nouveau-y += core/engine/software/nv04.o nouveau-y += core/engine/software/nv10.o nouveau-y += core/engine/software/nv50.o -nouveau-y += core/engine/software/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/software/nvc0.o nouveau-y += core/engine/vp/nv84.o nouveau-y += core/engine/vp/nv98.o -nouveau-y += core/engine/vp/nvc0.o -nouveau-y += core/engine/vp/nve0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/vp/nvc0.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += core/engine/vp/nve0.o # drm/core nouveau-y += nouveau_drm.o nouveau_chan.o nouveau_dma.o nouveau_fence.o @@ -299,12 +299,14 @@ nouveau-y += nouveau_vga.o nouveau_agp.o nouveau-y += nouveau_ttm.o nouveau_sgdma.o nouveau_bo.o nouveau_gem.o nouveau-y += nouveau_prime.o nouveau_abi16.o nouveau-y += nv04_fence.o nv10_fence.o nv17_fence.o -nouveau-y += nv50_fence.o nv84_fence.o nvc0_fence.o +nouveau-y += nv50_fence.o nv84_fence.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += nvc0_fence.o # drm/kms nouveau-y += nouveau_bios.o nouveau_fbcon.o nouveau_display.o nouveau-y += nouveau_connector.o nouveau_dp.o -nouveau-y += nv04_fbcon.o nv50_fbcon.o nvc0_fbcon.o +nouveau-y += nv04_fbcon.o nv50_fbcon.o +nouveau-$(CONFIG_DRM_NOUVEAU_NVC0) += nvc0_fbcon.o # drm/kms/nv04:nv50 include $(src)/dispnv04/Makefile @@ -323,4 +325,4 @@ endif nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o -obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o +obj-$(CONFIG_DRM_NOUVEAU) += nouveau.o diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c index dd01c6c..c66953b 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c @@ -205,9 +205,11 @@ nouveau_devobj_ctor(struct nouveau_object *parent, case NV_30: ret = nv30_identify(device); break; case NV_40: ret = nv40_identify(device); break; case NV_50: ret = nv50_identify(device); break; +#ifdef CONFIG_DRM_NOUVEAU_NVC0 case NV_C0: case NV_D0: ret = nvc0_identify(device); break; case NV_E0: ret = nve0_identify(device); break; +#endif default: ret = -EINVAL; break; diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 9c9ce4d..875c6a0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -138,7 +138,7 @@ nouveau_accel_init(struct nouveau_drm *drm) struct nouveau_device *device = nv_device(drm->device); struct nouveau_object *object; u32 arg0, arg1; - int ret; + int ret = -ENODEV; if (nouveau_noaccel || !nouveau_fifo(device) /*XXX*/) return; @@ -150,7 +150,9 @@ nouveau_accel_init(struct nouveau_drm *drm) else if (device->card_type < NV_50) ret = nv17_fence_create(drm); else if (device->chipset < 0x84) ret = nv50_fence_create(drm); else if (device->card_type < NV_C0) ret = nv84_fence_create(drm); +#ifdef CONFIG_DRM_NOUVEAU_NVC0 else ret = nvc0_fence_create(drm); +#endif if (ret) { NV_ERROR(drm, "failed to initialise sync subsystem, %d\n", ret); nouveau_accel_fini(drm); diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h index fdfc0c9..b4ff8d5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h @@ -51,10 +51,26 @@ int nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region); int nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image); int nv50_fbcon_accel_init(struct fb_info *info); +#ifdef CONFIG_DRM_NOUVEAU_NVC0 int nvc0_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect); int nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region); int nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image); int nvc0_fbcon_accel_init(struct fb_info *info); +#else +#define _STUB(name, type) \ +static inline int name(struct fb_info *info, const struct type *t) \ +{ \ + return -ENODEV; \ +} +_STUB(nvc0_fbcon_fillrect, fb_fillrect) +_STUB(nvc0_fbcon_copyarea, fb_copyarea) +_STUB(nvc0_fbcon_imageblit, fb_image) +#undef _STUB +static inline int nvc0_fbcon_accel_init(struct fb_info *info) +{ + return -ENODEV; +} +#endif void nouveau_fbcon_gpu_lockup(struct fb_info *info);