Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp28772imd; Wed, 31 Oct 2018 14:05:36 -0700 (PDT) X-Google-Smtp-Source: AJdET5ebri/QXfia86xqShr10NGC4CCxbmBT/xS379vcKY+RWJf44XpjgccBPud2chulB1HJck4p X-Received: by 2002:a63:9b11:: with SMTP id r17mr4664243pgd.416.1541019936054; Wed, 31 Oct 2018 14:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541019936; cv=none; d=google.com; s=arc-20160816; b=gp0Qtzk3iRf0ubmGQvU/3KsHPBR5JMcwPqY0lA0MDiWJ9K0fiZVpxCgMLPbWpfmnU0 J3mrNwKmPmfgJDcvrF3lTRl/T4aC/xHUZ+7ZALhCv/wsfDlzgJ25b0iQVequasvV8JqB iYtFTzIj3KSj89N9dZn9xpKy7cD60HrH0DLM/4mZ28cQnNbV3gSIRv+phzNeSjClW35F 2BNgqg0uwctQbeYvd9XJWv7rQvJJlG4kczHTP4+XCA4fbVP9WSX4wOkjktriTP5GoXzh SE2t+BzkS/NOej+JpLnIT6m3ShQj9QPmY27SsSK4S1pPSjCksHzwePtmuIb5b1D7c/9G G14g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=TGBG0+q0004OSJdo24umPSBol05pC3pZcQWWjsiJsMg=; b=OdRz0h51x5qHd/6MaSeGxgntvN6sZTf5zwaSafNNQEl3Tu/eOvwFfCC25xJH2AHKaE Y69HcOTu8ZADjRnpxAy00XeOI6oe2kGavJ4X8vF0xTB8RnzlXNucWQQi/kXafwQhtn33 pOEqUVjWeZSb4Nfca/ywprwbU4uP27aQchFc1p6CDwpmFIqI4E17WE34NELIDxKeeQmB QdM1KGZihNIYReU6UrZAuDiSmW0B8YIfW9V6I7DB+jKcv9J7xeYjBzJn0G/PUQjg78E3 M8gD7k1dgRv6zmJjJBx+gs36sn/JwJvc5RVXZ8Ej2JPJaZSrM639SrUjSfqQQc4PJAe4 hUzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19-v6si6843007pgb.196.2018.10.31.14.05.18; Wed, 31 Oct 2018 14:05:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbeKAGCl (ORCPT + 99 others); Thu, 1 Nov 2018 02:02:41 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:47440 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729909AbeKAGCl (ORCPT ); Thu, 1 Nov 2018 02:02:41 -0400 X-IronPort-AV: E=Sophos;i="5.54,449,1534802400"; d="scan'208";a="353685568" Received: from 89-157-201-244.rev.numericable.fr (HELO hadrien) ([89.157.201.244]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2018 22:02:53 +0100 Date: Wed, 31 Oct 2018 22:02:53 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Shayenne da Luz Moura cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] drm: Rename crtc_idr as object_idr to KMS cleanups In-Reply-To: <20181031205737.cingeaqget7hkbs6@smtp.gmail.com> Message-ID: References: <20181031205737.cingeaqget7hkbs6@smtp.gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Oct 2018, Shayenne da Luz Moura wrote: > Rename 'drm_mode_config.crtc_idr' as 'drm_mode_config.object_idr', > as proposed in the task description in TODO list for KMS cleanups. Is object_idr a field that already exists? If so, "Rename" is not the best choice of words. It should be something like "use the object_idr field instead of the crtc_idr field" and then explain why. "task description in TODO list for KMS cleanups" isn't very helpful to understand why the change should be made. julia > > Signed-off-by: Shayenne da Luz Moura > --- > drivers/gpu/drm/drm_lease.c | 6 +++--- > drivers/gpu/drm/drm_mode_config.c | 4 ++-- > drivers/gpu/drm/drm_mode_object.c | 8 ++++---- > 3 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c > index f4702f23c11d..4f8de2217049 100644 > --- a/drivers/gpu/drm/drm_lease.c > +++ b/drivers/gpu/drm/drm_lease.c > @@ -222,7 +222,7 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr > > idr_for_each_entry(leases, entry, object) { > error = 0; > - if (!idr_find(&dev->mode_config.crtc_idr, object)) > + if (!idr_find(&dev->mode_config.object_idr, object)) > error = -ENOENT; > else if (!_drm_lease_held_master(lessor, object)) > error = -EACCES; > @@ -438,7 +438,7 @@ static int fill_object_idr(struct drm_device *dev, > /* > * We're using an IDR to hold the set of leased > * objects, but we don't need to point at the object's > - * data structure from the lease as the main crtc_idr > + * data structure from the lease as the main object_idr > * will be used to actually find that. Instead, all we > * really want is a 'leased/not-leased' result, for > * which any non-NULL pointer will work fine. > @@ -679,7 +679,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, > > if (lessee->lessor == NULL) > /* owner can use all objects */ > - object_idr = &lessee->dev->mode_config.crtc_idr; > + object_idr = &lessee->dev->mode_config.object_idr; > else > /* lessee can only use allowed object */ > object_idr = &lessee->leases; > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c > index ee80788f2c40..ab553b6465e2 100644 > --- a/drivers/gpu/drm/drm_mode_config.c > +++ b/drivers/gpu/drm/drm_mode_config.c > @@ -381,7 +381,7 @@ void drm_mode_config_init(struct drm_device *dev) > INIT_LIST_HEAD(&dev->mode_config.property_list); > INIT_LIST_HEAD(&dev->mode_config.property_blob_list); > INIT_LIST_HEAD(&dev->mode_config.plane_list); > - idr_init(&dev->mode_config.crtc_idr); > + idr_init(&dev->mode_config.object_idr); > idr_init(&dev->mode_config.tile_idr); > ida_init(&dev->mode_config.connector_ida); > spin_lock_init(&dev->mode_config.connector_list_lock); > @@ -484,7 +484,7 @@ void drm_mode_config_cleanup(struct drm_device *dev) > > ida_destroy(&dev->mode_config.connector_ida); > idr_destroy(&dev->mode_config.tile_idr); > - idr_destroy(&dev->mode_config.crtc_idr); > + idr_destroy(&dev->mode_config.object_idr); > drm_modeset_lock_fini(&dev->mode_config.connection_mutex); > } > EXPORT_SYMBOL(drm_mode_config_cleanup); > diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c > index cd9bc0ce9be0..bb1dd46496cd 100644 > --- a/drivers/gpu/drm/drm_mode_object.c > +++ b/drivers/gpu/drm/drm_mode_object.c > @@ -38,7 +38,7 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj, > int ret; > > mutex_lock(&dev->mode_config.idr_mutex); > - ret = idr_alloc(&dev->mode_config.crtc_idr, register_obj ? obj : NULL, > + ret = idr_alloc(&dev->mode_config.object_idr, register_obj ? obj : NULL, > 1, 0, GFP_KERNEL); > if (ret >= 0) { > /* > @@ -79,7 +79,7 @@ void drm_mode_object_register(struct drm_device *dev, > struct drm_mode_object *obj) > { > mutex_lock(&dev->mode_config.idr_mutex); > - idr_replace(&dev->mode_config.crtc_idr, obj, obj->id); > + idr_replace(&dev->mode_config.object_idr, obj, obj->id); > mutex_unlock(&dev->mode_config.idr_mutex); > } > > @@ -99,7 +99,7 @@ void drm_mode_object_unregister(struct drm_device *dev, > { > mutex_lock(&dev->mode_config.idr_mutex); > if (object->id) { > - idr_remove(&dev->mode_config.crtc_idr, object->id); > + idr_remove(&dev->mode_config.object_idr, object->id); > object->id = 0; > } > mutex_unlock(&dev->mode_config.idr_mutex); > @@ -131,7 +131,7 @@ struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, > struct drm_mode_object *obj = NULL; > > mutex_lock(&dev->mode_config.idr_mutex); > - obj = idr_find(&dev->mode_config.crtc_idr, id); > + obj = idr_find(&dev->mode_config.object_idr, id); > if (obj && type != DRM_MODE_OBJECT_ANY && obj->type != type) > obj = NULL; > if (obj && obj->id != id) > -- > 2.19.1 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181031205737.cingeaqget7hkbs6%40smtp.gmail.com. > For more options, visit https://groups.google.com/d/optout. >