From patchwork Sat Mar 4 01:27:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dixit, Ashutosh" X-Patchwork-Id: 13159751 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 6A096C61DA3 for ; Sat, 4 Mar 2023 01:27:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B979F10E78E; Sat, 4 Mar 2023 01:27:13 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE8EF10E16E; Sat, 4 Mar 2023 01:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677893231; x=1709429231; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7dpECU4MqObJRz0NzkxNZ7JG9chBk9PRUu+NmDoady4=; b=XiLZ6SXVuher3QocpjGlnDQ0AL2HQZb2ZbaVspQmaCBH+E+f3kgcFji4 sDNo6xGLc78paopcey99azILoY+e0DdvdsdATFQwNmIu604QfxCsmSrb4 SqTjUKqdehPVM/9D/gxet5bMNa9jEY5aX6B8Ic0fH7n6LxLo0fFKhSqJ+ 6Vgx5xjOExUmAJ8pbmKFHN3f9ZGUceI9ZKvsf2FVcLSv0PWVBZyvVakfW ueK0ygxctD40XnXa3MBnTdTj3IwAqlr4RkXdF+/7K17SSrcxK8Um908Dw 1htT+IzUVfYb8kJprX0NwPwN9oq+2uipQMA40l974zuW/gYGts+UTWV39 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="323504929" X-IronPort-AV: E=Sophos;i="5.98,232,1673942400"; d="scan'208";a="323504929" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 17:27:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="849684693" X-IronPort-AV: E=Sophos;i="5.98,232,1673942400"; d="scan'208";a="849684693" Received: from orsosgc001.jf.intel.com ([10.165.21.138]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 17:27:10 -0800 From: Ashutosh Dixit To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915/pmu: Use correct requested freq for SLPC Date: Fri, 3 Mar 2023 17:27:05 -0800 Message-Id: <20230304012705.70003-3-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230304012705.70003-1-ashutosh.dixit@intel.com> References: <20230304012705.70003-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 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: Vinay Belgaumkar , dri-devel@lists.freedesktop.org, Tvrtko Ursulin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" SLPC does not use 'struct intel_rps'. Use UNSLICE_RATIO bits from GEN6_RPNSWREQ for SLPC. See intel_rps_get_requested_frequency. Bspec: 52745 Signed-off-by: Ashutosh Dixit --- drivers/gpu/drm/i915/i915_pmu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index f0a1e36915b8..5ee836610801 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -394,8 +394,13 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns) * frequency. Fortunately, the read should rarely fail! */ val = intel_rps_get_cagf(rps, intel_rps_read_rpstat_fw(rps)); - if (!val) - val = rps->cur_freq; + if (!val) { + if (intel_uc_uses_guc_slpc(>->uc)) + val = intel_rps_read_punit_req(rps) >> + GEN9_SW_REQ_UNSLICE_RATIO_SHIFT; + else + val = rps->cur_freq; + } add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT], intel_gpu_freq(rps, val), period_ns / 1000);