From mboxrd@z Thu Jan 1 00:00:00 1970 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 97128ECAAD3 for ; Fri, 9 Sep 2022 09:12:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7D3E10EC3C; Fri, 9 Sep 2022 09:12:31 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0F8D10EC33; Fri, 9 Sep 2022 09:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662714748; x=1694250748; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=ogXyDOcm5bJOWuBdHt58YtNNfTWYwG/DSrqBktK432k=; b=YVlmJyvlZPHAy/lb9vSZNiau/Tj193/CIkK9hHNV3Qmy9HilWW3/NF8k Fiqn+81/kIFHGGeOncCf6yaCHibCztqBlWBBd1tqxbCs1V93JcUEFQK0h pGCQ17OyYE5yqm5M0Df5optSGO8W9jJrpUpR1mwzsxZ0Z8dLUYY87PNIO zUiRmRFaPcL8vw9q9qVJCV6Wg+EoWQ+KEEoTRwev3QeGl0u0VF6sAh+cw 8Rin7mHQ3aR0jInla42Umy6J42AbC177whITWCO90tSDL284EThkScrtg SShsAKPe+3yw6oOML+UfoLWaA7kJHzhNDi8UtxnksML6VudLTBOz4PKNa w==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="298772530" X-IronPort-AV: E=Sophos;i="5.93,302,1654585200"; d="scan'208";a="298772530" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2022 02:12:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,302,1654585200"; d="scan'208";a="566304165" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 09 Sep 2022 02:12:27 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 9 Sep 2022 02:12:27 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 9 Sep 2022 02:12:26 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Fri, 9 Sep 2022 02:12:26 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.48) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Fri, 9 Sep 2022 02:12:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nOoYMh5qGBheCSjzHsq9eMGcjsUjy1GWaExKZvuTHbvy5Ndw+2lVpOYCHeuyDe6+cdyXNzogOAJr/U+BJ0a3LpAAKzsAjNDx3TbPoLQnp3ynX3P2WBiFvtKJ3kdfFlfD3VIx3MkQE21+6Ry0KMWkQ93fo1J6If9QS0Bluc2U/AiPkF1SYtEOQCQzBqvKCcY2YEMWa61mX8n2G6UqehsLYS7cmYa1Jv/mACpUlc/p+KT8s9lq0mF0zhxi6xRU9Lm4hlZMUpd7kQLabjcRnECkkz15nI8Bqbvv9K5Ip4Vvs9dvjaYr+AA7IPI9nFIkz2hDVhhpHJdF2Ga1ifqArW0O9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4njoIhDw43m2wIUCul67NVye4uyVjs2lj+3+sacttoo=; b=GvdYXN2zC0N54/Tr+zIPl8BDBfJhASm0CuUHeHGcifXpiBdlSTnhOJznIi7tfJgosFcQPUGKDf0U319fOXW2Dgah7oMBnUyhgZLCUxlUj5dGJ8xUs0VGAKOmQYs7H0jIm0yGYxH0aY2totwWb5jdzQMn1gcJOsroexeHwZYPIjx+ivvFhQH0O6fEeuWduGHlHLlRj/p/s76o3i9ZEk3sZk6hN7H/VAKmppmTuFlSQRAQ6/zlysyJt63w0lJoh/RKINhbgpDBhORrlArSKx9SWTH7PNyBANIUmv+nF9AUEBAVDQdKusXa2p1Kencui1InzNrni+wXhDOGCe7tWMhQdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) by DM6PR11MB4739.namprd11.prod.outlook.com (2603:10b6:5:2a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19; Fri, 9 Sep 2022 09:12:25 +0000 Received: from MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::7ce8:1e4e:20d4:6bd4]) by MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::7ce8:1e4e:20d4:6bd4%9]) with mapi id 15.20.5588.016; Fri, 9 Sep 2022 09:12:25 +0000 Date: Fri, 9 Sep 2022 05:12:19 -0400 From: Rodrigo Vivi To: Mauro Carvalho Chehab Subject: Re: [PATCH v3 35/37] drm/i915: add descriptions for some RPM macros at intel_gt_pm.h Message-ID: References: <997567dcc2b5942afde093d92d0666948e66d83a.1662708705.git.mchehab@kernel.org> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <997567dcc2b5942afde093d92d0666948e66d83a.1662708705.git.mchehab@kernel.org> X-ClientProxiedBy: BYAPR07CA0093.namprd07.prod.outlook.com (2603:10b6:a03:12b::34) To MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81aa988b-b97c-4110-2e95-08da924368e9 X-MS-TrafficTypeDiagnostic: DM6PR11MB4739:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ITjYuAViaVDaOEQTZV38ae3DdVyFVWIsdq66koUL8ve8y5357vRWfvT7FFP0DwY+tSx46jt706JPzaURQhSFmxxwVQMvBjcUFN2AbmbOdek/I2ZQsYE1qw4/sFNGvty4t79HI+HDWScD41lNAg+ICw3QUkZvt/FVhKi3SX5bRy38LEtGanFLRIKO9uzrox9aNiizjcfvR6jkYiob6PCl4Bkai+yTCXnweoJwHzHX7sA/KrqHERadxq7f1c7MLst116ziyqfTOBVxHu2xXQeRZhZSZ4pOQJ9qoUDOTRm67Pvh/eZ9KuD6zXQNNUxZqBpewwA/3zB0/SIyW7PL6rA9RbD5W1f8uM0d0NqI54fsj2gw/4GArth9zsWiHVVyXTsVQESpxDuH/oT0U9fU0zCKud6H6KL2sB1RBzbi8Mo5gIdoXOryGCoVoFN9RsF9JoMeGml/QiS8ZfZaJNbLh6499k+Dlk8c+uFpRIHp/PqEHv3gcQHR6tVdsrRBhTESbbVY/rPt6/Yos8uoF4cNzp2qIbgpKAgE4JzlhNrqAfk1ley2eE4hsX5bbokcRZA9wXAMHXzY+tw2TT6MYiJkgr8erNeAyU2BUPYG1pB0xo5rF6ITZxR1Ik+c5YK01k7B/sosfGNlaL+Boo4AK+MwPaCfI6Ply9CVI0Hru4L2BLbJlwe24yJat4c1k7RjY8bO2EzNBrbB2kZQ83nK1xfDV5bBd2p34ZzA42Sa7ob+7m0mOGftrKEedMJ+V4gUH27NoQO5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN0PR11MB6059.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(366004)(39860400002)(396003)(376002)(346002)(44832011)(7416002)(2906002)(8936002)(6506007)(6512007)(5660300002)(83380400001)(26005)(86362001)(2616005)(186003)(38100700002)(82960400001)(8676002)(41300700001)(36756003)(66476007)(478600001)(66946007)(966005)(4326008)(66556008)(54906003)(316002)(6916009)(6666004)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iuOfEnRVLLw4cgIjFWTRf7weAlQ3qMKF3swmJ8AbRwzDgyA1QC6JNElNEhOl?= =?us-ascii?Q?jqeQkav1h93ElIDnDN91p+tyBFuJa6lZWxBCKxN417t1UY6WWOSLA+jqgsUV?= =?us-ascii?Q?st8U0Z9k3DivXcHixilOE2WLo9RvhFuTB6qJozz9sJiBJG7YSeTUh3csxeKx?= =?us-ascii?Q?0RmPECd/jCq3QzexwLElUlJCrPkTcoLLa9l+2LyDtJCByJMTZ/fqj/E5ZbPn?= =?us-ascii?Q?EaTUmlkbKo+Ac3ctm2EOKtG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us-ascii?Q?OskYYwkfuEtMYs1AWLq3gSMpFDLsVtfQnXkecLB4Rc8gniaQ3W7Ou8CuBBx9?= =?us-ascii?Q?ewsWdJF2e8B0FQHChklB1V+OcJqSN3PzZqaaHh/PJ0hhNwJeOMK2Kcz8eSu6?= =?us-ascii?Q?2gFtL5tc0ZueiT67pGw4i6EH/8QJaDAhOuUnG2XZU453DiK4vFzJZcgFhwHN?= =?us-ascii?Q?Kld9/ndidlrsbZPO9sS5kblHh5fAGzvrg19vVl984FkBU94d1TRIB3XG3cyH?= =?us-ascii?Q?xXLPKNQ+jvUmgQIanL45YLT1baRC8QWG3RqQ2QOMQGI5MyrlOdllHPVGcslG?= =?us-ascii?Q?YjDGH4U9DsW8iWp+su+af0wLKGjWztGD0/0WW+K4bKa4z2ZKvDX2LnX7bCsx?= =?us-ascii?Q?xLGKmckKacktJFCPepX/yv50zIrhLVwXDUEpdC9/yTfsL4FxCurqEJBMWtYk?= =?us-ascii?Q?sUUeCkIhiLfc2TQx1WCgTDfEA//3tCQKbh5sk3T0OlTCE42dZs5YXR2AYlEb?= =?us-ascii?Q?Og=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 81aa988b-b97c-4110-2e95-08da924368e9 X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6059.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 09:12:25.0516 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9QybCaNtF+aBeRPeJauywu/p72W2OZ7OwlieX4WXIRzoLpANG2UGviYR2ef8YgKIyo3GpRObUdGv6JMZTHN0MA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4739 X-OriginatorOrg: intel.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: Matthew Brost , Tvrtko Ursulin , Thomas Zimmermann , Jonathan Corbet , David Airlie , intel-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Wilson , Andi Shyti , John Harrison Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Sep 09, 2022 at 09:34:42AM +0200, Mauro Carvalho Chehab wrote: > The intel_gt_pm.h file contains some convenient macros to be used > in GT code in order to get/put runtime PM references and for > checking them. > > Add descriptions based on the ones at intel_wakeref.h and > intel_runtime_pm.c. > > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Rodrigo Vivi > --- > > To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. > See [PATCH v3 00/37] at: https://lore.kernel.org/all/cover.1662708705.git.mchehab@kernel.org/ > > Documentation/gpu/i915.rst | 2 ++ > drivers/gpu/drm/i915/gt/intel_gt_pm.h | 51 +++++++++++++++++++++++++++ > 2 files changed, 53 insertions(+) > > diff --git a/Documentation/gpu/i915.rst b/Documentation/gpu/i915.rst > index 7f5cd01ed398..59c532fe0332 100644 > --- a/Documentation/gpu/i915.rst > +++ b/Documentation/gpu/i915.rst > @@ -446,6 +446,8 @@ Graphics Translation Tables > Other GT functionality > ---------------------- > > +.. kernel-doc:: drivers/gpu/drm/i915/gt/intel_gt_pm.h > + > .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_context.h > > .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_gsc.h > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.h b/drivers/gpu/drm/i915/gt/intel_gt_pm.h > index 6c9a46452364..7847e15d102e 100644 > --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.h > +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.h > @@ -11,21 +11,57 @@ > #include "intel_gt_types.h" > #include "intel_wakeref.h" > > +/** > + * intel_gt_pm_is_awake: Query whether the runtime PM is awake held > + * > + * @gt: pointer to the graphics engine > + * > + * Returns: true if a runtime pm reference is currently held and the GT is > + * awake. > + */ > static inline bool intel_gt_pm_is_awake(const struct intel_gt *gt) > { > return intel_wakeref_is_active(>->wakeref); > } > > +/** > + * intel_gt_pm_get: grab a runtime PM reference ensuring that GT is powered up > + * @gt: pointer to the graphics engine > + * > + * Any runtime pm reference obtained by this function must have a symmetric > + * call to intel_gt_pm_put() to release the reference again. > + * > + * Note that this is allowed to fail, in which case the runtime-pm wakeref > + * will be released and the acquisition unwound. > + */ > static inline void intel_gt_pm_get(struct intel_gt *gt) > { > intel_wakeref_get(>->wakeref); > } > > +/** > + * __intel_gt_pm_get: Acquire the runtime PM reference again > + * @gt: pointer to the graphics engine which contains the wakeref > + * > + * Increment the PM reference counter, only valid if it is already held by > + * the caller. > + * > + * See intel_gt_pm_get(). > + */ > static inline void __intel_gt_pm_get(struct intel_gt *gt) > { > __intel_wakeref_get(>->wakeref); > } > > +/** > + * intel_gt_pm_get_if_awake: Acquire the runtime PM reference if active > + * @gt: pointer to the graphics engine which contains the PM reference > + * > + * Acquire a hold on the PM reference, but only if the GT is already > + * active. > + * > + * Returns: true if the wakeref was acquired, false otherwise. > + */ > static inline bool intel_gt_pm_get_if_awake(struct intel_gt *gt) > { > return intel_wakeref_get_if_active(>->wakeref); > @@ -36,6 +72,14 @@ static inline void intel_gt_pm_might_get(struct intel_gt *gt) > intel_wakeref_might_get(>->wakeref); > } > > +/** > + * intel_gt_pm_put: Release the runtime PM reference > + * @gt: pointer to the graphics engine which contains the PM reference > + * > + * Release our hold on the runtime PM for GT. > + * > + * It might power down the GT right away if this is the last reference. > + */ > static inline void intel_gt_pm_put(struct intel_gt *gt) > { > intel_wakeref_put(>->wakeref); > @@ -51,6 +95,13 @@ static inline void intel_gt_pm_might_put(struct intel_gt *gt) > intel_wakeref_might_put(>->wakeref); > } > > +/** > + * with_intel_gt_pm - get a GT reference ensuring that GT is powered up, > + * run some code and then put the reference away. > + * > + * @gt: pointer to the gt > + * @tmp: pointer to a temporary wakeref. > + */ > #define with_intel_gt_pm(gt, tmp) \ > for (tmp = 1, intel_gt_pm_get(gt); tmp; \ > intel_gt_pm_put(gt), tmp = 0) > -- > 2.37.3 >