From: dakr@redhat.com
To: airlied@linux.ie, daniel@ffwll.ch, christian.koenig@amd.com,
emma@anholt.net
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Danilo Krummrich <dakr@redhat.com>
Subject: [PATCH 09/10] drm/via: use idr_init_base() to initialize dev_priv->object_idr
Date: Fri, 1 Jul 2022 21:02:26 +0200 [thread overview]
Message-ID: <20220701190227.284783-2-dakr@redhat.com> (raw)
In-Reply-To: <20220701190227.284783-1-dakr@redhat.com>
From: Danilo Krummrich <dakr@redhat.com>
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based
IDRs more efficient"), let us set an arbitrary base other than
idr_init(), which uses base 0.
Since, for this IDR, no ID < 1 is ever requested/allocated, using
idr_init_base(&idr, 1) avoids unnecessary tree walks.
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
---
drivers/gpu/drm/via/via_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c
index a9f6b0c11966..c20bb20c0e09 100644
--- a/drivers/gpu/drm/via/via_map.c
+++ b/drivers/gpu/drm/via/via_map.c
@@ -106,7 +106,7 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset)
if (dev_priv == NULL)
return -ENOMEM;
- idr_init(&dev_priv->object_idr);
+ idr_init_base(&dev_priv->object_idr, 1);
dev->dev_private = (void *)dev_priv;
dev_priv->chipset = chipset;
--
2.36.1
next prev parent reply other threads:[~2022-07-01 19:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 18:52 [PATCH 00/10] drm: use idr_init_base() over idr_init() if applicable dakr
2022-07-01 18:52 ` [PATCH 01/10] drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles dakr
2022-07-01 18:52 ` [PATCH 02/10] drm/amdgpu: use idr_init_base() to initialize fpriv->bo_list_handles dakr
2022-07-01 18:52 ` [PATCH 03/10] drm: use idr_init_base() to initialize master->magic_map dakr
2022-07-01 18:52 ` [PATCH 04/10] drm: use idr_init_base() to initialize master->lessee_idr dakr
2022-07-01 18:52 ` [PATCH 05/10] drm: use idr_init_base() to initialize mode_config.object_idr dakr
2022-07-01 18:52 ` [PATCH 06/10] drm: use idr_init_base() to initialize mode_config.tile_idr dakr
2022-07-01 18:53 ` [PATCH 07/10] drm/sis: use idr_init_base() to initialize dev_priv->object_idr dakr
2022-07-01 19:02 ` [PATCH 08/10] drm/v3d: use idr_init_base() to initialize v3d_priv->perfmon.idr dakr
2022-07-01 19:02 ` dakr [this message]
2022-07-01 19:02 ` [PATCH 10/10] drm/todo: remove task for idr_init_base() dakr
2022-07-04 13:09 ` [PATCH 00/10] drm: use idr_init_base() over idr_init() if applicable Christian König
2022-07-12 14:24 ` Danilo Krummrich
2022-07-28 3:56 ` Dave Airlie
2022-07-28 14:41 ` Maxime Ripard
2022-07-28 14:44 ` Maxime Ripard
2022-07-28 14:56 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220701190227.284783-2-dakr@redhat.com \
--to=dakr@redhat.com \
--cc=airlied@linux.ie \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®