From patchwork Fri Feb 21 07:55:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3694851 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 705829F1EE for ; Fri, 21 Feb 2014 07:55:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 790B620145 for ; Fri, 21 Feb 2014 07:55:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8528920142 for ; Fri, 21 Feb 2014 07:55:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37F57FA610; Thu, 20 Feb 2014 23:55:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 16A0FFA610 for ; Thu, 20 Feb 2014 23:55:32 -0800 (PST) Received: by mail-bk0-f49.google.com with SMTP id na10so98447bkb.8 for ; Thu, 20 Feb 2014 23:55:31 -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=ksHHFVabdQunL2TYY3pmpnqJgOYQM1ciodcapXX7Rcs=; b=Jr0Bpm/yLxkPNBt3DiVjPqBsPXHr7OGw/altOuZjjDypP+1rMqUFhvl63KR9qKnGK4 nMfiJ8DQ6jCMRAhyI496uY9fFwWYRweX+usRkdZQxUBF6/ml44yXmKe7OrkdTEWXnkDG jw9lBDUoA+XmiAovDiEk+k0etZ4GvKHpgGjPJLXAVEzxSM6yFlebSAX/H/3TuBonwXNS 4AB78olyG0TJaOrvNTbFvImhy2uM4D7RyHH4jZPOWKAxa7S6r/iQlHri2wMGDYwF4uG1 +YcQZKmdJ7twRGaxuRw5seLl5AZOBFzfB3WAuqk3xlWXIELqEasrr2gM3B6lH6uit05z kLdg== X-Received: by 10.204.78.9 with SMTP id i9mr1574581bkk.40.1392969331929; Thu, 20 Feb 2014 23:55:31 -0800 (PST) Received: from localhost (port-15573.pppoe.wtnet.de. [84.46.61.18]) by mx.google.com with ESMTPSA id p5sm6043553bkh.1.2014.02.20.23.55.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2014 23:55:31 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [RFC 01/12] drm: Rename DRM_MINOR_LEGACY to DRM_MINOR_PRIMARY Date: Fri, 21 Feb 2014 08:55:17 +0100 Message-Id: <1392969328-23133-2-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 The term "legacy" is overloaded in the context of DRM. DRM_MINOR_LEGACY doesn't accurately describe the use of the minor. The associated minor is the primary minor for a device, as reflected by the .primary field of struct drm_device. For consistency, rename the enumeration value to DRM_MINOR_PRIMARY. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_stub.c | 16 ++++++++-------- drivers/gpu/drm/drm_sysfs.c | 4 ++-- include/drm/drmP.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 2567ecb5c574..fd2f1758366d 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -319,7 +319,7 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, unsigned int type) { switch (type) { - case DRM_MINOR_LEGACY: + case DRM_MINOR_PRIMARY: return &dev->primary; case DRM_MINOR_RENDER: return &dev->render; @@ -493,7 +493,7 @@ EXPORT_SYMBOL(drm_put_dev); void drm_unplug_dev(struct drm_device *dev) { /* for a USB device */ - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); @@ -564,7 +564,7 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver, goto err_minors; } - ret = drm_minor_alloc(dev, DRM_MINOR_LEGACY); + ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); if (ret) goto err_minors; @@ -592,7 +592,7 @@ err_ctxbitmap: err_ht: drm_ht_remove(&dev->map_hash); err_minors: - drm_minor_free(dev, DRM_MINOR_LEGACY); + drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_CONTROL); drm_minor_free_base(dev); @@ -618,7 +618,7 @@ static void drm_dev_free(struct drm_device *dev) drm_ctxbitmap_cleanup(dev); drm_ht_remove(&dev->map_hash); - drm_minor_free(dev, DRM_MINOR_LEGACY); + drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_CONTROL); drm_minor_free_base(dev); @@ -692,7 +692,7 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) if (ret) goto err_minors; - ret = drm_minor_register(dev, DRM_MINOR_LEGACY); + ret = drm_minor_register(dev, DRM_MINOR_PRIMARY); if (ret) goto err_minors; @@ -718,7 +718,7 @@ err_unload: if (dev->driver->unload) dev->driver->unload(dev); err_minors: - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); out_unlock: @@ -752,7 +752,7 @@ void drm_dev_unregister(struct drm_device *dev) list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) drm_rmmap(dev, r_list->map); - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); } diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 9be02d9a78e8..c3f3d0b6a8fe 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -43,7 +43,7 @@ static int __drm_class_suspend(struct device *dev, pm_message_t state) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && + if (drm_minor->type == DRM_MINOR_PRIMARY && !drm_core_check_feature(drm_dev, DRIVER_MODESET) && drm_dev->driver->suspend) return drm_dev->driver->suspend(drm_dev, state); @@ -84,7 +84,7 @@ static int drm_class_resume(struct device *dev) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && + if (drm_minor->type == DRM_MINOR_PRIMARY && !drm_core_check_feature(drm_dev, DRIVER_MODESET) && drm_dev->driver->resume) return drm_dev->driver->resume(drm_dev); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index e5f6732f4757..92604c435ecc 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1010,7 +1010,7 @@ struct drm_driver { }; enum drm_minor_type { - DRM_MINOR_LEGACY, + DRM_MINOR_PRIMARY, DRM_MINOR_CONTROL, DRM_MINOR_RENDER, DRM_MINOR_CNT,