From patchwork Fri Feb 21 07:55:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3694901 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 21A57BF13A for ; Fri, 21 Feb 2014 07:56:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B47F20155 for ; Fri, 21 Feb 2014 07:56:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 68E6B20145 for ; Fri, 21 Feb 2014 07:56:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EBD8FB42D; Thu, 20 Feb 2014 23:55:50 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EEA0FB425 for ; Thu, 20 Feb 2014 23:55:40 -0800 (PST) Received: by mail-bk0-f52.google.com with SMTP id e11so926353bkh.25 for ; Thu, 20 Feb 2014 23:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oN8Uw6UyILl1nYy9ETYfM4VALe12uPejRUUx9muCRMc=; b=vEtsUJPiupwULJCy7TxZtl6WmaC1nKkqGRQq8mVwxD+EQmqPt5kQgEJut59R8IUOMP 3Cvu/mgD/b0u2U8YZ3/JFqlo1zrwGmKHELd0/rFJLXc+0O18JgoU+dVA4D8s1mgds+3J dnPw1lOw1LrlnQcrWdxj8b9KpD5sd0xB61C2iGQVokJwFVhohK2RwJYZLkV6zr4/X4GF SOpr2E91kP+9wxSD4S0XpdwRniKFoNiuZgKhHRrd0KqIkjTiR3ArGzHPx+7z3AWvz5ce RdDxiEyTI/+V1etYmJug7/roDPXX0nNkfXkXJpSfpuDcuE3dql52Vvrau66QTeWyls8A ig8w== X-Received: by 10.205.103.137 with SMTP id di9mr1499739bkc.67.1392969338474; Thu, 20 Feb 2014 23:55:38 -0800 (PST) Received: from localhost (port-15573.pppoe.wtnet.de. [84.46.61.18]) by mx.google.com with ESMTPSA id p5sm6040666bkh.1.2014.02.20.23.55.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2014 23:55:37 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [RFC 05/12] drm: Create primary minor only if mode-setting is supported Date: Fri, 21 Feb 2014 08:55:21 +0100 Message-Id: <1392969328-23133-6-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1392969328-23133-1-git-send-email-thierry.reding@gmail.com> References: <1392969328-23133-1-git-send-email-thierry.reding@gmail.com> 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=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 From: Thierry Reding Non-legacy devices may not always support mode-setting functionality, so create the primary minor conditionally. One setup where this happens is the Tegra K1, where the Tegra DRM driver exposes the display engine via standard KMS IOCTLs, and nouveau drives the Kepler-type GPU that has no display capabilities. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_stub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index fd2f1758366d..839460b774c5 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -564,9 +564,11 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver, goto err_minors; } - ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); - if (ret) - goto err_minors; + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); + if (ret) + goto err_minors; + } if (drm_ht_create(&dev->map_hash, 12)) goto err_minors;