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 E6790ECAAA1 for ; Tue, 30 Aug 2022 15:45:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E48B910E14D; Tue, 30 Aug 2022 15:45:36 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE5E510E151 for ; Tue, 30 Aug 2022 15:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661874332; x=1693410332; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=3wXpShAL+R+Ika/bzQGWfj39StX8LmqGshLP11D/XT4=; b=BFRAYc4TMlsQ0v3he8ATBRYRtzoVgoqXT+O2PRwu1Pnxn2fNqFg7f4Si iH4tCik9p2gqjfsrJlW7/4BVRXlTNxoOGRrOH53ojxi9ewFKtbZL5i2lR ffVsmeNS18y7XkEywJiFdTF8QwQTk7xBEGx5JlCQ1g7uFVc+t3HrWpkLG 0ISJJf/CTZYRV+Npw2J5GK2mf4RyI8JOQe3pOmqPPW5zZlUzfmb5vhL0R Je5JJsriERxWVGbzU+QmfCah4MOa/n5LV7MxT0QK/lhyE2DG3N/gVJRRb 6D/EYjpTnzPBZ0RRgynxOE7hmZ3PmqqsghbNy0cl38mEoSSZHGlSarCrS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10455"; a="293953502" X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="293953502" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 08:45:12 -0700 X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="701030342" Received: from deepashu-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.252.128.174]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 08:45:12 -0700 Date: Tue, 30 Aug 2022 08:42:52 -0700 Message-ID: <87edwxzqir.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Rodrigo Vivi In-Reply-To: <87v8qen56u.wl-ashutosh.dixit@intel.com> References: <87h71zjgfr.wl-ashutosh.dixit@intel.com> <20220826174434.157513-1-rodrigo.vivi@intel.com> <87v8qen56u.wl-ashutosh.dixit@intel.com> 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/28.1 (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/slpc: Fix PCODE IA Freq requests when using SLPC 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, Sushma Venkatesh Reddy , stable@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 26 Aug 2022 13:03:05 -0700, Dixit, Ashutosh wrote: > > On Fri, 26 Aug 2022 10:44:34 -0700, Rodrigo Vivi wrote: > > > > Fixes: 7ba79a671568 ("drm/i915/guc/slpc: Gate Host RPS when SLPC is enabled") > > Cc: # v5.15+ > > Cc: Ashutosh Dixit > > Tested-by: Sushma Venkatesh Reddy > > Signed-off-by: Rodrigo Vivi > > --- > > drivers/gpu/drm/i915/gt/intel_llc.c | 24 ++++++++++++++++-------- > > 1 file changed, 16 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c b/drivers/gpu/drm/i915/gt/intel_llc.c > > index 14fe65812e42..2677d62573d9 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_llc.c > > +++ b/drivers/gpu/drm/i915/gt/intel_llc.c > > @@ -49,13 +49,28 @@ static unsigned int cpu_max_MHz(void) > > static bool get_ia_constants(struct intel_llc *llc, > > struct ia_constants *consts) > > { > > + struct intel_guc_slpc *slpc = &llc_to_gt(llc)->uc.guc.slpc; > > struct drm_i915_private *i915 = llc_to_gt(llc)->i915; > > struct intel_rps *rps = &llc_to_gt(llc)->rps; > > > > if (!HAS_LLC(i915) || IS_DGFX(i915)) > > return false; > > > > - if (rps->max_freq <= rps->min_freq) > > + if (intel_uc_uses_guc_slpc(&llc_to_gt(llc)->uc)) { > > + consts->min_gpu_freq = slpc->min_freq; > > + consts->max_gpu_freq = slpc->rp0_freq; Sorry, this also doesn't work because slpc freq are converted using intel_gpu_freq(). How about calling gen6_rps_get_freq_caps() directly in the SLPC case? Or we could go with the original patch for now with a FIXME? Thanks. > > + } else { > > + consts->min_gpu_freq = rps->min_freq; > > + consts->max_gpu_freq = rps->max_freq; > > + } > > + > > + if (GRAPHICS_VER(i915) >= 9) { > > + /* Convert GT frequency to 50 HZ units */ > > + consts->min_gpu_freq /= GEN9_FREQ_SCALER; > > + consts->max_gpu_freq /= GEN9_FREQ_SCALER; > > + }