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 8C614C433F5 for ; Tue, 22 Mar 2022 18:58:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F406510E1A0; Tue, 22 Mar 2022 18:58:01 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9695810E1A0 for ; Tue, 22 Mar 2022 18:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647975481; x=1679511481; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=coBrDEgLe+g/KfH6XmIn5UJ0bbwT1bNZ5TifhzCy5eI=; b=Fkd6iCOzaLACTfdU+Nm3Xp4+LAVPgiBDX4/onOrahIOMyrU6/8zWgPz6 E+MpDZ4ZNF2xpSvswC29j1Sl3kCBKQrzl5hQ729EpcX8gCdNoXBy2g9MB Wq/+YCU6I6hZeEyysiBWxf82M+sdg2c4vBCg2TXmGUXK9rKGj6R+RiqV7 e0ZoLtTxrVOtxB+gSxR8kP/b882nG79hdq9FSH/JksAz6P6QLoBzKk5l/ WvYx/frMhQPn/w7pCCZRg+7u7YtjiWDXPdp8XgI8EcFC4OyesdTIs2qrA zGDNI9f6rjyLijBbshTLhGPDiK3SfqwaU6XCMARIQaw77YNV99AIkGy4H g==; X-IronPort-AV: E=McAfee;i="6200,9189,10294"; a="282759525" X-IronPort-AV: E=Sophos;i="5.90,202,1643702400"; d="scan'208";a="282759525" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 11:58:01 -0700 X-IronPort-AV: E=Sophos;i="5.90,202,1643702400"; d="scan'208";a="717078050" Received: from adixit-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.227.103]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 11:58:00 -0700 Date: Tue, 22 Mar 2022 11:55:29 -0700 Message-ID: <87ils5lsv2.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Lucas De Marchi In-Reply-To: <20220321181746.lg2rafbfvilfvfop@ldmartin-desk2> References: <20220321175604.58987-1-ashutosh.dixit@intel.com> <20220321181746.lg2rafbfvilfvfop@ldmartin-desk2> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH] drm/i915/rps: Centralize computation of freq caps X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, 21 Mar 2022 11:17:46 -0700, Lucas De Marchi wrote: > > On Mon, Mar 21, 2022 at 10:56:04AM -0700, Ashutosh Dixit wrote: > > diff --git a/drivers/gpu/drm/i915/gt/intel_rps_types.h b/drivers/gpu/drm/i915/gt/intel_rps_types.h > > index 3941d8551f52..5990df35b393 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_rps_types.h > > +++ b/drivers/gpu/drm/i915/gt/intel_rps_types.h > > @@ -37,6 +37,13 @@ enum { > > INTEL_RPS_TIMER, > > }; > > > > +/* Freq caps exposed by HW, in units of 16.67 MHz for recent gens */ > > "recent gens" is probably too broad. Since we are exporting this struct > to other parts of the driver and we are already abstracting the > register location and bit position, maybe we should also already > abstract the unit in the same place? i.e. just make it always be > "units of 16.67 MHz", or even just make it a standard Hz unit. > > If this would rather make things more complicated for places that expect > "hw units", then maybe just say in this comment the value is in "HW > units" and intel_gpu_freq() should be used to convert to hz. Fixed in v2. In v2 I've changed the comment to say values are in "hw units" and intel_gpu_freq() should be used to convert to MHz. I have also added a couple of hopefully clarifying comments to intel_rps_get_freq_caps() in v2. Some of the history of this code was not clear to me previously and I had to trace all the way back to cee991cb9323 to figure out what is happening. Thanks. -- Ashutosh > > +struct intel_rps_freq_caps { > > + u8 rp0_freq; /* Non-overclocked max frequency. */ > > + u8 rp1_freq; /* "less than" RP0 power/freqency */ > > + u8 min_freq; /* AKA RPn. Minimum frequency */ > > +}; > > + > > struct intel_rps { > > struct mutex lock; /* protects enabling and the worker */ > >