From patchwork Wed Jul 20 13:28:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 126ABC43334 for ; Wed, 20 Jul 2022 13:28:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC7A28B1AD; Wed, 20 Jul 2022 13:28:39 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 507888B219 for ; Wed, 20 Jul 2022 13:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+f2U5Jo1TdZSY11r/ueBE+7GgJruty1MjYryFBsUD7o=; b=YRJqxRa7z507ulCpkXTQOQrXCwY2iZFRZ1W4z1dz2CnMYAya2sus376GWg7xyuWa7NkTrE b09yM2HX4DRfw2PJXxIwrxcoW0PbVux2aXuAAXcR5Mr7NAuwXY5Y9LtCdDUnR+Wap8j/vs CZKbXoXRPal9468jlGKIMkhXUokk8C4= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-64-TjxiZZJYMiGvxbtbgDfDyQ-1; Wed, 20 Jul 2022 09:28:36 -0400 X-MC-Unique: TjxiZZJYMiGvxbtbgDfDyQ-1 Received: by mail-ej1-f69.google.com with SMTP id nb10-20020a1709071c8a00b006e8f89863ceso4078434ejc.18 for ; Wed, 20 Jul 2022 06:28:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+f2U5Jo1TdZSY11r/ueBE+7GgJruty1MjYryFBsUD7o=; b=i/f3sc5H+25XvV70hSHTbdapGfZbR8YxaveW8qxWTQm1Ork77LAU5qsJ9edUzc8rtm Xf3hX2IVyNM+M2QiTqOBCwc2iC1lsq9tHV4W33hhHrZjW5AnX22QrRQFH3AI5zzbTW6E KtRNWpQ4lhBLwPofY3gZsucBJ+VxzTMe9B+ZUNqUYvbNp59W0sGLfUNNWh0e6zmfvCd2 VTo6kT1J8hpQZKm1Y+ovtwGjs4zLPEpNK3HCdsSNbeNMuq4jEveVEx3huZXPa0iKAvDw tzPucxwOLJYu8cWSi9ETQNm8R8KV6bIsf4+w1S1pVhLc/bNXLTHncDk/+GUGfgR7hwp3 U2dA== X-Gm-Message-State: AJIora/JuKhtbetLbaxryg4LQKKbFDOoNZw0Y+F5JBnCIspYL7vxVn8D F+oNW+k4iSFl4TC6OgIV/CiG9UMoWTm4Pa9y2Nl4mKI46BmeQTHbPnU1UzpFUFUEfYF3GiH6CEo nmIKL1gfxIwPeJpNaDAfSRgLFOGta X-Received: by 2002:aa7:df83:0:b0:43a:4b96:f126 with SMTP id b3-20020aa7df83000000b0043a4b96f126mr4357272edy.309.1658323714995; Wed, 20 Jul 2022 06:28:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vLFazpLitgbJcdGubIMhTG6WFsmdCd40ex9BK/SES/RtLtw9an98NNGQ71I0eglmrGe8zNyw== X-Received: by 2002:aa7:df83:0:b0:43a:4b96:f126 with SMTP id b3-20020aa7df83000000b0043a4b96f126mr4357256edy.309.1658323714847; Wed, 20 Jul 2022 06:28:34 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:34 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 01/10] drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles Date: Wed, 20 Jul 2022 15:28:21 +0200 Message-Id: <20220720132830.193747-2-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo Krummrich Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 7dc92ef36b2b..cc87c3809a8d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -841,7 +841,7 @@ void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr, mgr->adev = adev; mutex_init(&mgr->lock); - idr_init(&mgr->ctx_handles); + idr_init_base(&mgr->ctx_handles, 1); for (i = 0; i < AMDGPU_HW_IP_NUM; ++i) atomic64_set(&mgr->time_spend[i], 0); From patchwork Wed Jul 20 13:28:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48E17C433EF for ; Wed, 20 Jul 2022 13:29:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5E8B8B438; Wed, 20 Jul 2022 13:28:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E47FD8B3A2 for ; Wed, 20 Jul 2022 13:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g0aUb76AKpcqinp04UULk4k3wJtOXAh9lLl0DFNwwBk=; b=KwKaohK1F7H4PEgQlfw0vKlmaZWE0nqDiQ+HBL1DLeer2i8qLS4WSP9AC8igI0/zsP2JKN UlMQEYNpuotXdMPA/QSX5ljn4682SljP6R9wPE4z2gxim6t4ehgeUBozJqepaLOb5x75uk WR1GUNoRO5Rg7sLsi7J09y0aQ13w7Uo= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-389-X1uUU8QtO6eohqAVhZbn5w-1; Wed, 20 Jul 2022 09:28:38 -0400 X-MC-Unique: X1uUU8QtO6eohqAVhZbn5w-1 Received: by mail-ej1-f70.google.com with SMTP id x2-20020a1709065ac200b006d9b316257fso4045503ejs.12 for ; Wed, 20 Jul 2022 06:28:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g0aUb76AKpcqinp04UULk4k3wJtOXAh9lLl0DFNwwBk=; b=JNFcoDdSnhnbFOrAfBn42hTPSiHCidGHZYU7I7Rocb+21IxY7ePCZtG4SXRzWSoSTz vHuHQqH2NNtbU38uJWBbx/sM1aQGc4sEYzl1SH5+ouCDpl31nw3XJcD9JIUQBigJU9aA 2MdhBx6eyFN6gneusv8p2JZ1LDCetT1XYunnxeMY0FWJBSVpAuNQRAPrEJWU3VgfIUHg x0mszu4WOTZxl2SdIK6+19/qyJA558l4o9d6VL78kNDl9zbMESrj4iVln6wYUN0BTvKx AhXoFA/NkVv7GIgkV7XyN23NM6dOJjL+aUO4otwJ7AV4T/ilfqUhxF08adMd79k4nlX9 9fSw== X-Gm-Message-State: AJIora8TqPtWX/GxlMzg/x5zTkj41spfOmFibJVkYaEV2302pw6DRIT5 ODObb0YDr/urzOnYw1k4K92u86Sp51oV0Ji7jDzA+zhDDRz8HnJQaSd2d/GN7TbH4FrYV82QCpZ nFi1cDJl1skjBmNKxqTNXxH+tnteu X-Received: by 2002:a05:6402:4007:b0:43a:7de8:2802 with SMTP id d7-20020a056402400700b0043a7de82802mr50665919eda.13.1658323716139; Wed, 20 Jul 2022 06:28:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vd+mjGZZnD1P3oypeeTfNuxLWMjp+6F8sRSDwHasiOupx08H4bDmLgynZ4GDTntTb+QIUyRQ== X-Received: by 2002:a05:6402:4007:b0:43a:7de8:2802 with SMTP id d7-20020a056402400700b0043a7de82802mr50665895eda.13.1658323715953; Wed, 20 Jul 2022 06:28:35 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:35 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 02/10] drm/amdgpu: use idr_init_base() to initialize fpriv->bo_list_handles Date: Wed, 20 Jul 2022 15:28:22 +0200 Message-Id: <20220720132830.193747-3-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 6de63ea6687e..103927c48d05 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -1148,7 +1148,7 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) } mutex_init(&fpriv->bo_list_lock); - idr_init(&fpriv->bo_list_handles); + idr_init_base(&fpriv->bo_list_handles, 1); amdgpu_ctx_mgr_init(&fpriv->ctx_mgr, adev); From patchwork Wed Jul 20 13:28:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DF81C43334 for ; Wed, 20 Jul 2022 13:28:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB0E88B3A4; Wed, 20 Jul 2022 13:28:44 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E19558B39D for ; Wed, 20 Jul 2022 13:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gkqfIGU1jFp3Ya/5fwJtXiMW+j3VZbkqa61u3PfPfGg=; b=hoPkCNbcHMQzr2U69upI6iZctOnJhEM36zeE95M4qzlxF580Jnq3AHcI+JqlOGKnbJFE7A 2P36eg0SN8JowwOeAmPiggDTAv6uVm4BlRX0zIHQIJV1KK0vluGRFFfMAGKz4ZZd11T+RY r1JMx6w4i8uTUBuJurlR/hTP3OfPg1c= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-qc0RHQjxOzO0TwgoquUSYw-1; Wed, 20 Jul 2022 09:28:38 -0400 X-MC-Unique: qc0RHQjxOzO0TwgoquUSYw-1 Received: by mail-ed1-f71.google.com with SMTP id n8-20020a05640205c800b00434fb0c150cso12051298edx.19 for ; Wed, 20 Jul 2022 06:28:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gkqfIGU1jFp3Ya/5fwJtXiMW+j3VZbkqa61u3PfPfGg=; b=CDtEH0IEnsW/YTowtQDj6enUy9yoUw+DqYHaufZ1MHYzW+5PZAXpRJyx+PMkuICPDx s9iw/b98JRtMSLxPwSu1085M1nZYdCC9Ap6Q7jV2oVxjHvo21fTBqU1Ent2UM0hmsEfR j4qYfr2xwTIjf7Xj+Ln/Q7u4qHaGoDS0rBovUgv/E2KO0uEtPhZzArSuriTqg7TwQbaT o4D55kAdLSxVIw+l90qaY5mfsyhkIquBEb1S0Iox5tV+ibmW4LWiXeymoLCO+mM7SDSE H93pfH/F5+5sxtcq/Qdpf5I2NId9gVwFQW5FNQXibEKNO26zKFZ2evYPywlbMn8V5gfn 6QyQ== X-Gm-Message-State: AJIora8acskwkTZ+pH39CMuwKEU3Cj9xQ07FsFgccS4CuQY1zpR/sxEP LQuLda6Ek3a2XW2ul+A4GHOzuwvhFmOE8KHhHqFpzpCIJJl82U9C4UrFOZOJ4/apKQmL06dGEkU eIpBeGs8Vd5ze8C4ruwH2XFF0sLsT X-Received: by 2002:a05:6402:378f:b0:43a:d3f5:79f2 with SMTP id et15-20020a056402378f00b0043ad3f579f2mr51775757edb.338.1658323717204; Wed, 20 Jul 2022 06:28:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3fSyGyUhItvWNAfzBrVUs5sXM+vSZQoJwXk+V++H1tUF1Sa+Sg+abJ9GPTpm2/Ve6F4StiQ== X-Received: by 2002:a05:6402:378f:b0:43a:d3f5:79f2 with SMTP id et15-20020a056402378f00b0043ad3f579f2mr51775750edb.338.1658323717069; Wed, 20 Jul 2022 06:28:37 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:36 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 03/10] drm: use idr_init_base() to initialize master->magic_map Date: Wed, 20 Jul 2022 15:28:23 +0200 Message-Id: <20220720132830.193747-4-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- drivers/gpu/drm/drm_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 6e433d465f41..63395bebaa6b 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -140,7 +140,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) kref_init(&master->refcount); drm_master_legacy_init(master); - idr_init(&master->magic_map); + idr_init_base(&master->magic_map, 1); master->dev = dev; /* initialize the tree of output resource lessees */ From patchwork Wed Jul 20 13:28:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B8BEC433EF for ; Wed, 20 Jul 2022 13:29:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F17F38B404; Wed, 20 Jul 2022 13:28:56 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 94FB18B39D for ; Wed, 20 Jul 2022 13:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D5ddLIULHU4lCGQd0NSPYCIu5p1tGKAtdnoOfURMriM=; b=c1M2DmaX8lEV+hHA8wtN1LbIcfg+/d7vKSkD3MG6z60ety/dMe3CQipmSd/6jjs+IgtAuf FEZeQ1ZeiuZLTlZndgA9Gz7XE5DQwGf9D6Bfcff5MGUmQrUhEy8IjTqJV3UxyrqdIc6vgY tVb8/V0pUitNh94xDo5f4OmIxPSLanU= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-T85jZHK9POGbIp9xhc91bg-1; Wed, 20 Jul 2022 09:28:39 -0400 X-MC-Unique: T85jZHK9POGbIp9xhc91bg-1 Received: by mail-ej1-f72.google.com with SMTP id sb15-20020a1709076d8f00b0072b692d938cso4045551ejc.10 for ; Wed, 20 Jul 2022 06:28:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D5ddLIULHU4lCGQd0NSPYCIu5p1tGKAtdnoOfURMriM=; b=basUyHaQcjm2Dfe4qiVv1d1PyV1ySAlD6GYe0T/vPnH1wn3o0EXfwuBBkF5ZMK9/T4 IMISd1AZGACWd+md8quRpGhYONcgR+KtlGxxr1x2nAI9lwZaurVCrLlWa3iiaEdP1LVO kMGzCAQ2pt35MYUU/5BvdnloWUvsTVL96FcMJMyktL+1huJDOFgDgnAAeJNKaZ1uadlm D2z9hUw9jJsP1CaVWs8fgmnHsvZBAruiXcl+pBWUS4smJU6L3dR6J3vISIoDTeRnNWDF mcTm23uzfyAiUv3U/ZYQgfWE/wGPQro+yFJsV+7gC/gCfP8VH+FlJ4zZiVpiDrzduop+ +Gww== X-Gm-Message-State: AJIora+Rycw4N0m34McaiTFxntP9gxQbPfERNtxVGPDYO2hJVSVHrWmP 6kv5ZpWKbLH8xjAjGXFmOijF22BYaIfcIeLsBWU4KmYRk+W4y4M0jbt0tGVNqhb7wM7bgofWPKf LfqhyxkDwlnitV4R/agEKSLaIpIhy X-Received: by 2002:a17:906:844d:b0:72b:307d:fb52 with SMTP id e13-20020a170906844d00b0072b307dfb52mr36174061ejy.182.1658323718290; Wed, 20 Jul 2022 06:28:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sY/1Zm6BfoPARI1YbiV4ibajD1bahl1m6CRJ1x477gp7Vj0dinJMpAeZDF8tcyy5jgf5+z8Q== X-Received: by 2002:a17:906:844d:b0:72b:307d:fb52 with SMTP id e13-20020a170906844d00b0072b307dfb52mr36174049ejy.182.1658323718132; Wed, 20 Jul 2022 06:28:38 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:37 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 04/10] drm: use idr_init_base() to initialize master->lessee_idr Date: Wed, 20 Jul 2022 15:28:24 +0200 Message-Id: <20220720132830.193747-5-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- drivers/gpu/drm/drm_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 63395bebaa6b..cf92a9ae8034 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -147,7 +147,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) INIT_LIST_HEAD(&master->lessees); INIT_LIST_HEAD(&master->lessee_list); idr_init(&master->leases); - idr_init(&master->lessee_idr); + idr_init_base(&master->lessee_idr, 1); return master; } From patchwork Wed Jul 20 13:28:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E40BCC433EF for ; Wed, 20 Jul 2022 13:28:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C53F88B3BC; Wed, 20 Jul 2022 13:28:44 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 314968B3A3 for ; Wed, 20 Jul 2022 13:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1+PcLE/VWZKE0O75uq+LhMOqrtDlyMvhqIp9miCLrKk=; b=iPoZodHAclOfTcXZlndh+c8nSlQrPsBKFSJIv9KUsQ0at3xMacFEBUB1kb6x5WQb8hvZB6 McMr8ZQGzbzXLCuJXtKJ/QyZ9KaqmVPXAZBArEYVL140jimCoG1SRSZ26AbO4BbD8piAvy IFIzSElzNYuuirsDHgn0S2W4UZSyljk= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-570-qL3h1g5ENRKEg9uEOS56UA-1; Wed, 20 Jul 2022 09:28:40 -0400 X-MC-Unique: qL3h1g5ENRKEg9uEOS56UA-1 Received: by mail-ed1-f70.google.com with SMTP id w13-20020a05640234cd00b0043a991fb3f3so12027696edc.3 for ; Wed, 20 Jul 2022 06:28:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1+PcLE/VWZKE0O75uq+LhMOqrtDlyMvhqIp9miCLrKk=; b=BuAiAtbbEJhT0o6pUTOXofdtBm/4zz5kS0GFrPvpezyJp3TDO8zTFLVOxagZRX+gXL 0vU1W0NYzX+qyzMIfs/+6NLKsEwgiaznSPNzf6JeZpzIXDzr1pDp0vpnApRBZq9Sypbx XWwQOlWd4GzT48AZ+ZjsPq7xPxbPGWzf3Y4ChrTFuo2FgiM+tjJm3/Oj0/3KQqfmMTt7 5j7xWpxw3lnY74/2FZChslDYQ36RrPbttGSbfLjTGBd69ZlDpmnu/nMILYaahektBtqs TMe94GoHXAi6iwP+Rc6tcAUPNeAZZR0zvJmQ8RCiiarV/TIBhu8ARr8QRpQ7KaT7MLGf YRLg== X-Gm-Message-State: AJIora/GegzYY++tyHVtC9sA2WsOStIMKXhUbSb0mqQ5w07KC0Jj5TyX SK3KglzEInSszoIfS06ON3zHF14F4YzrDlemCYU4Y4d6+TtKdRiXhajzW68k5OJG+aOXnocFFO5 LtFiJMMY8G9EG8GWSMhCm0PU4YxaS X-Received: by 2002:aa7:c9d3:0:b0:43a:67b9:6eea with SMTP id i19-20020aa7c9d3000000b0043a67b96eeamr49930814edt.94.1658323719488; Wed, 20 Jul 2022 06:28:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vEyOQrCfAYTR3roW2kvuyG5vM8MOGEzRZ+5S4xhOeQcoo4SnmiDYQWkH0qb2zNTJLilpgqgg== X-Received: by 2002:aa7:c9d3:0:b0:43a:67b9:6eea with SMTP id i19-20020aa7c9d3000000b0043a67b96eeamr49930796edt.94.1658323719350; Wed, 20 Jul 2022 06:28:39 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:39 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 05/10] drm: use idr_init_base() to initialize mode_config.object_idr Date: Wed, 20 Jul 2022 15:28:25 +0200 Message-Id: <20220720132830.193747-6-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- drivers/gpu/drm/drm_mode_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 37b4b9f0e468..e2a295a4ee0b 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -411,7 +411,7 @@ int drmm_mode_config_init(struct drm_device *dev) INIT_LIST_HEAD(&dev->mode_config.property_blob_list); INIT_LIST_HEAD(&dev->mode_config.plane_list); INIT_LIST_HEAD(&dev->mode_config.privobj_list); - idr_init(&dev->mode_config.object_idr); + idr_init_base(&dev->mode_config.object_idr, 1); idr_init(&dev->mode_config.tile_idr); ida_init(&dev->mode_config.connector_ida); spin_lock_init(&dev->mode_config.connector_list_lock); From patchwork Wed Jul 20 13:28:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06AB5C433EF for ; Wed, 20 Jul 2022 13:29:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F5388B41E; Wed, 20 Jul 2022 13:28:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 532448B3A4 for ; Wed, 20 Jul 2022 13:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9VV2A0xt4iWoClogWKWNXWu4TrFupjD6pG6MWFdRlyI=; b=FnAnwwwzxQ8UhK8XKpBB0Gwvlqbm4M5jNT0XZC9TGi287Pw72gQ+pxg/Jv0o8DkAdglP0T icSJtE0S3j6a0SKUH0yDRfXURuDAuwoug06kyGOGYVdWhg/YWVDJPZyB0rZWLgSs3YBhBT ne+gi4WfKZpWHwbngbai9rmZdJaunGE= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-82HkAMhqPoOQeIZfEADKYw-1; Wed, 20 Jul 2022 09:28:42 -0400 X-MC-Unique: 82HkAMhqPoOQeIZfEADKYw-1 Received: by mail-ed1-f69.google.com with SMTP id t5-20020a056402524500b0043a923324b2so12242750edd.22 for ; Wed, 20 Jul 2022 06:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9VV2A0xt4iWoClogWKWNXWu4TrFupjD6pG6MWFdRlyI=; b=bdB2szIoEcOGqV0C3Sfcl31SjrzYhzt4e6xx6nuxqAOisPB1H1FLMhibFnxVy0G4Gb /xzdYumxBNjiPORQ1Dyk2eW4jIpTCoCk67vBmnWa8VBFUEAUhZs67dy1RrJ28aE3cGAK 8sKy4nOrB3BKX858gUt9MLGBDUVlOepB4O2TNJ5l1l0Fr/Au9Vsv9IvckrU/GJsU0wI4 9KXaTjeosEIhzS7YEWlVte39cXIzBXr4L/7k0bnbSkypVEfRZGCWOTv/fBNishgp2STW QelTDG/8Y79HecRlcn3iBsR6degDsXGy+XIQaxgIslZ8XdOSNZeDeVEob/+sUk3o9X4F Du+Q== X-Gm-Message-State: AJIora/EynAxWW2bo+/4FcvgAC/NYX8byv7kRpf94AsazoZI3eQ8djBf zXKs0uy7NDSJ03bMYUPjFi0zg//InItHbhZCLsMiOhuBK7Wsd9XRd4ryBuotQakOXEPDSkHJXtN STDY3+YOTKVtFIh8ucTPabrRcWaRM X-Received: by 2002:a17:907:3f07:b0:72b:54b2:f57f with SMTP id hq7-20020a1709073f0700b0072b54b2f57fmr34761345ejc.502.1658323720507; Wed, 20 Jul 2022 06:28:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uo8j6q388d7B1LrZ24MTAZEsBiw/LrA6Unb/g8/2liHXECnlfsKgcPxbProCFsFD4KKLtndQ== X-Received: by 2002:a17:907:3f07:b0:72b:54b2:f57f with SMTP id hq7-20020a1709073f0700b0072b54b2f57fmr34761333ejc.502.1658323720343; Wed, 20 Jul 2022 06:28:40 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:40 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 06/10] drm: use idr_init_base() to initialize mode_config.tile_idr Date: Wed, 20 Jul 2022 15:28:26 +0200 Message-Id: <20220720132830.193747-7-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- drivers/gpu/drm/drm_mode_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index e2a295a4ee0b..3d1c1ade5a25 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -412,7 +412,7 @@ int drmm_mode_config_init(struct drm_device *dev) INIT_LIST_HEAD(&dev->mode_config.plane_list); INIT_LIST_HEAD(&dev->mode_config.privobj_list); idr_init_base(&dev->mode_config.object_idr, 1); - idr_init(&dev->mode_config.tile_idr); + idr_init_base(&dev->mode_config.tile_idr, 1); ida_init(&dev->mode_config.connector_ida); spin_lock_init(&dev->mode_config.connector_list_lock); From patchwork Wed Jul 20 13:28:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97BCBC43334 for ; Wed, 20 Jul 2022 13:29:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A4338B42F; Wed, 20 Jul 2022 13:28:56 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id BACC58B3BA for ; Wed, 20 Jul 2022 13:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rk9AhtZmor412ab1pdm8kQawl+ZyAY1dgO0bYINvs54=; b=Q7RAPYOLrf8ZAVEjqHTOSb+kqfoWHpomEYS5MPOusV6JyjVz36TFHp5U0m8eAz9KHczu4q b35pRjn79r2TSeW+bjy8cf8Xtrv5zPhti1Od2XRbQGxn71c+qVLxzSWbD6RZ7sr1B7T2E3 g9AAcXTTbDnRlre65VKZxxmLAUoQfqE= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-564-tIRCQOFNN827Ou-xI_DrSQ-1; Wed, 20 Jul 2022 09:28:42 -0400 X-MC-Unique: tIRCQOFNN827Ou-xI_DrSQ-1 Received: by mail-ed1-f69.google.com with SMTP id b15-20020a056402278f00b0043acaf76f8dso12235405ede.21 for ; Wed, 20 Jul 2022 06:28:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rk9AhtZmor412ab1pdm8kQawl+ZyAY1dgO0bYINvs54=; b=h80r5rU/kdNsmtY8SpkBM+JiK9A62ZtpGyTH8rWXuZ/XKVHGnYGyyzpRCK8PZ8U3iM zqBetIwffiC3fx/inF+3VJrXmnuUYN1JWQbkYwmerP2J0JNtefN486Kzykc0eIKkFro0 UAF0RfAGIWTo5vF+IfjedL3UYswl5KCWsLnQV+HAyIdNlrSLyp6IfYTo6rCIdWaVVuai +cIxTeghiz0WUkTOfnjUGNicEJwcZBHdO4NVFJa2O8sC9eg/cmkluZzd0+mheZFeuQBf UY4SKIEh7FF67hbF3bh8N/6zF0WDReQhDMypo5Bt4WdmIIvYYYxynRcVf9h5b1wH3l2i qwJg== X-Gm-Message-State: AJIora9/Y0+7hGpoST/kZ2AIMw+jmTqkvkBd2/Us0i6yBkygpuJXWnW8 FKf4Zd+udsBIstQFo78jUji3TwKw/21fDcLOeHrjxkXL0UK6P9IaHnhTOicvwLG8QDjhBdmtjiw jgjGp9guSiDTeEKtvft27BArrWHpK X-Received: by 2002:a17:907:72d2:b0:72b:d238:4e81 with SMTP id du18-20020a17090772d200b0072bd2384e81mr34316147ejc.104.1658323721573; Wed, 20 Jul 2022 06:28:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1thris3Hs7kI1+V5PiU8wpgCAuZjyMTOSv7gtwkI3GRkFHOAUXOMZoByN9Z0aScoROqDsYNwA== X-Received: by 2002:a17:907:72d2:b0:72b:d238:4e81 with SMTP id du18-20020a17090772d200b0072bd2384e81mr34316128ejc.104.1658323721356; Wed, 20 Jul 2022 06:28:41 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:41 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 07/10] drm/sis: use idr_init_base() to initialize dev_priv->object_idr Date: Wed, 20 Jul 2022 15:28:27 +0200 Message-Id: <20220720132830.193747-8-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- drivers/gpu/drm/sis/sis_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c index e35e719cf315..6173020a9bf5 100644 --- a/drivers/gpu/drm/sis/sis_drv.c +++ b/drivers/gpu/drm/sis/sis_drv.c @@ -50,7 +50,7 @@ static int sis_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; From patchwork Wed Jul 20 13:28:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D269C43334 for ; Wed, 20 Jul 2022 13:29:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6804F8B42B; Wed, 20 Jul 2022 13:28:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 905DF8B3CF for ; Wed, 20 Jul 2022 13:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SAU7g0XmtNHmK1D83ahVz2l+EzcgZOJWEbwKcBBevW4=; b=HjcqYtLRY0SERqxxqO6PSxuhkRE8TDQptXL0hyH6NOHr+st6gfwbxyu0xB2UpM3R60zCLC 9FhCXOLBgp4kRcRU8yoQC9rUK4J7YmrlZTyBGUCzqp6qwamSzflkSTPKcF0mv8bfiTNQIY YdGr1TgC7LVYI1GmDc/V3cmkH8qxXDg= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-vpOTzHesO220lcYWhd2qDw-1; Wed, 20 Jul 2022 09:28:44 -0400 X-MC-Unique: vpOTzHesO220lcYWhd2qDw-1 Received: by mail-ej1-f71.google.com with SMTP id gt38-20020a1709072da600b0072f21d7d12dso2174305ejc.7 for ; Wed, 20 Jul 2022 06:28:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SAU7g0XmtNHmK1D83ahVz2l+EzcgZOJWEbwKcBBevW4=; b=yXH4Mhvw3/mDpKRCb5qJ9XpfU3y5LfsZ+VqJWVy7R2L1VWAghVzFJKcIXJs17SMxWF CqBkls7B1eM/Vdq0n5iV/PQqzvcJwiChBWolBIXxd47nmP/63Ygs7GbTK/HdLrvbA89G 2PrlE3AbTlQA3y+FS3OQZObqI5Rulk2UBwyQ11XhjyBMQx9SXNUCNcmo0/9eEc4rBzw6 pk05L6K5zpr0UAE6JXKK2owP1az+uCHEaTDCNmMTC7Dj2aRDwOrw8//g9S2xbS1yBArw A6bA8oZ4noe3iN7uffz4SyNuEcYtSxy+mlk76y+nWBOWwDSq8lTOG1BIGuFZIZCZv6tr BKxA== X-Gm-Message-State: AJIora+Ufr88IvbGkWPN0ofbDUbYcArRWBTda9y6MskdHdNfzd0J+pce QDbC4aai7r4C2EO8LYkiMuTeOqJkVnkqcPMmHp+aMyx3id1kYvFzfuRVzIAxzvNPBu0wFwNwiMj ryz7yPOyQuO4ufhS1yDbC+0+adTLF X-Received: by 2002:aa7:c6d5:0:b0:43b:a52b:2e9d with SMTP id b21-20020aa7c6d5000000b0043ba52b2e9dmr7641383eds.55.1658323723285; Wed, 20 Jul 2022 06:28:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+XJVzPyzWCIWUNCHkW1104cuBpXxWzX9K7AQTSOhaTvyBzI9SqYq7cbAFcGCNK4j3Viv8mQ== X-Received: by 2002:aa7:c6d5:0:b0:43b:a52b:2e9d with SMTP id b21-20020aa7c6d5000000b0043ba52b2e9dmr7641368eds.55.1658323723147; Wed, 20 Jul 2022 06:28:43 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:42 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 08/10] drm/v3d: use idr_init_base() to initialize v3d_priv->perfmon.idr Date: Wed, 20 Jul 2022 15:28:28 +0200 Message-Id: <20220720132830.193747-9-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König Reviewed-by: Melissa Wen --- drivers/gpu/drm/v3d/v3d_perfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/v3d/v3d_perfmon.c b/drivers/gpu/drm/v3d/v3d_perfmon.c index f6a88abccc7d..48aaaa972c49 100644 --- a/drivers/gpu/drm/v3d/v3d_perfmon.c +++ b/drivers/gpu/drm/v3d/v3d_perfmon.c @@ -95,7 +95,7 @@ struct v3d_perfmon *v3d_perfmon_find(struct v3d_file_priv *v3d_priv, int id) void v3d_perfmon_open_file(struct v3d_file_priv *v3d_priv) { mutex_init(&v3d_priv->perfmon.lock); - idr_init(&v3d_priv->perfmon.idr); + idr_init_base(&v3d_priv->perfmon.idr, 1); } static int v3d_perfmon_idr_del(int id, void *elem, void *data) From patchwork Wed Jul 20 13:28:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 257BAC43334 for ; Wed, 20 Jul 2022 13:28:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15CC38B410; Wed, 20 Jul 2022 13:28:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 986868B3B0 for ; Wed, 20 Jul 2022 13:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HT8NZrD1nNwbS5gwsuj1LsW1Zo8PIy3JRlNd/+istdc=; b=e58dSLquHj45axAkherFpVfxxB5Ff6q1Etx9OcUme9ltpzt6OtY6kf9VTKwGTqyAeO6E1+ NiD2u7ctt+B8V6TR14YE675WBRI110RWCsqkDcP+nNi0cu0oWThsjQZoMfKprl+ZPs/zW8 ciMD68peWAnYrg0rw/7mvubLlEe1myg= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-3gDlVkPtN-WP0kBIRNgGzA-1; Wed, 20 Jul 2022 09:28:45 -0400 X-MC-Unique: 3gDlVkPtN-WP0kBIRNgGzA-1 Received: by mail-ej1-f70.google.com with SMTP id s4-20020a170906500400b006feaccb3a0eso4080796ejj.11 for ; Wed, 20 Jul 2022 06:28:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HT8NZrD1nNwbS5gwsuj1LsW1Zo8PIy3JRlNd/+istdc=; b=vlj9L8m3PB84/ZMbtHnAs8RS86y5Q92Q9P0pNilB+bWeBxFzdbjSaS9ocvIAzyj0MF SARST6EvK8+SvnxN6WupmolYiPGAsFBSjSoRYYGCdD2s6stS28E/MMsU0NRXqoRA+wCg KiaLNtMxXKPBoWMwkb60jkeqbvGrWswlyD3m4D2GGGQ+/UmfgBffsh2kzkMZH9jCaL0c hN4y+UBJZVd0gN9w2RRCB+tZwzRttyiRcpix+ijXJ/QiEQ7it3O0lhXPg4g2gH2wsH2k wq2MKgkziFFGu0V0IIZ/jiFH7SZ4aAcU/NjD4tLOGpKyzj1Ao6VszE87YnypbrQK0X7f RGPw== X-Gm-Message-State: AJIora8FhGxUNF358Tp6TAEzUpmV6dz5M+etAGvUYzfvQq2zR0SIuY/y bqzfiVkt5wYvSA1r2jLOSsOCqX8qOX5xdQ/8dbou9aEfQ+AClYEDdWv1gnHxltyc3mT6f785Ocy gEGxY+P2tWTakPYsvcWetQN4noRM5 X-Received: by 2002:a05:6402:448b:b0:43b:5ec6:8863 with SMTP id er11-20020a056402448b00b0043b5ec68863mr23093206edb.377.1658323724422; Wed, 20 Jul 2022 06:28:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sL0huhxDNzivABMSLHJOkvQvPhq+NEIJUtv2pSgx9lvIUBoWWPk+tq72bF8qSorQ5UBbg3qw== X-Received: by 2002:a05:6402:448b:b0:43b:5ec6:8863 with SMTP id er11-20020a056402448b00b0043b5ec68863mr23093183edb.377.1658323724236; Wed, 20 Jul 2022 06:28:44 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:43 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 09/10] drm/via: use idr_init_base() to initialize dev_priv->object_idr Date: Wed, 20 Jul 2022 15:28:29 +0200 Message-Id: <20220720132830.193747-10-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Christian König --- 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; From patchwork Wed Jul 20 13:28:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 12923991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A5A7C433EF for ; Wed, 20 Jul 2022 13:29:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95E8E8B43E; Wed, 20 Jul 2022 13:28:58 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E03178B3FF for ; Wed, 20 Jul 2022 13:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C1+/TuaGVCtg6aZ6ugNH+AX/gcs1Sy7JNQEZshG7+6s=; b=VLtxWQWE85Kt1PBMZdRLZH1i4XO1w8FG4zEGhJIaDbchqhUKh5cBQ706ncziJXhTp6BQ4T 6TJYq6JxzxylG3K2OWm7DueArQnjZhZqxMd3UoX3iqtJl/+pM/cQWK40c9ELaRqTa4LAX/ ew8Z8cPutiQBj73hBrG9k5XY26HhzIM= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-120-IUXUoa_9MmCxnysD1Okyfg-1; Wed, 20 Jul 2022 09:28:46 -0400 X-MC-Unique: IUXUoa_9MmCxnysD1Okyfg-1 Received: by mail-ed1-f72.google.com with SMTP id f9-20020a056402354900b0043a902b7452so11979540edd.13 for ; Wed, 20 Jul 2022 06:28:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C1+/TuaGVCtg6aZ6ugNH+AX/gcs1Sy7JNQEZshG7+6s=; b=ggy4K0fluR1ZC++/bQqiXcAYihdhCGJlA0MCw/mbVoJN6t75SGUMODetteJOoy5RIt cHdrfLy/gQhedxo7FUddGCdwMhIOyl9d6ccJ1AVN3+fjjyGFJS3iIa+hogivUBQwNBki 5WKjotwSCAytY9NmU+gsr4S9Dio5F1TmkD8iFYTrwVAjFgXjJr0W578RMV8o1pnSSL9X 4a0Y2rIAFQDtZ3Ix4byRBPvUorNHT6b9U2wCVw3AbLQs9GjSQ33qVCpfWgRLDj/xjZEU /OqVmtS1F2rQtFc1JhqPdhym77ix1rm6AznNWyNFHdU/SXilmFVO2BnrzygsO8sAF4jo DbGg== X-Gm-Message-State: AJIora+FzDbVQHeVx4Ie4blkYMvjNB+blkHgYWi8F3UN6ug6Dnj2HBPP BWv3sFi51OddIQcKg8G39AIfmL5aMGJVxzs5kGumiLu6bRMZm9VqJK486tnBZd8R6wj14vJZf1K 12deEvPJKh2JWjYOBR4MiDlyv5WXq X-Received: by 2002:a05:6402:370c:b0:435:cb14:9aa8 with SMTP id ek12-20020a056402370c00b00435cb149aa8mr50011224edb.35.1658323725634; Wed, 20 Jul 2022 06:28:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v6VDktN4Zp0svFCntEPMgCQyXq13LyGGTZPFEFlsUVznoeu82FYaWBUuOCXg43IcOly3Xphw== X-Received: by 2002:a05:6402:370c:b0:435:cb14:9aa8 with SMTP id ek12-20020a056402370c00b00435cb149aa8mr50011210edb.35.1658323725500; Wed, 20 Jul 2022 06:28:45 -0700 (PDT) Received: from pollux.redhat.com ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id x7-20020a05640225c700b0043ac761db43sm12220687edb.55.2022.07.20.06.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:28:44 -0700 (PDT) From: Danilo Krummrich To: airlied@linux.ie, daniel@ffwll.ch, mripard@kernel.org, christian.koenig@amd.com, emma@anholt.net Subject: [PATCH RESEND 10/10] drm/todo: remove task for idr_init_base() Date: Wed, 20 Jul 2022 15:28:30 +0200 Message-Id: <20220720132830.193747-11-dakr@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720132830.193747-1-dakr@redhat.com> References: <20220720132830.193747-1-dakr@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dakr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" All IDRs in the DRM core and drivers which are applicable for using idr_init_base() over idr_init() should be set up to use a proper base in order to avoid unnecessary tree walks. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- Documentation/gpu/todo.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 10bfb50908d1..de226ccc2c54 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -322,18 +322,6 @@ Contact: Daniel Vetter, Noralf Tronnes Level: Advanced -idr_init_base() ---------------- - -DRM core&drivers uses a lot of idr (integer lookup directories) for mapping -userspace IDs to internal objects, and in most places ID=0 means NULL and hence -is never used. Switching to idr_init_base() for these would make the idr more -efficient. - -Contact: Daniel Vetter - -Level: Starter - struct drm_gem_object_funcs ---------------------------