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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70318C3A5A0 for ; Mon, 20 Apr 2020 11:06:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 43B8120724 for ; Mon, 20 Apr 2020 11:06:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43B8120724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3D7F6E0D0; Mon, 20 Apr 2020 11:06:56 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id B29D16E0D0 for ; Mon, 20 Apr 2020 11:06:55 +0000 (UTC) IronPort-SDR: 73ref+9HXS8OBKbXFYFB4oftqxOYUSNhmCVA4z8Yj8UWoIzikvoV8ThMgbFNa72SXfAcoehqBJ 0BYmpHBpbPOg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 04:06:55 -0700 IronPort-SDR: Fw8b0FCNGKTj+NAbyyTSMudoh6AtghcSnoxip9xm5J6f1RpJFfYpeU7aJYuDwGGGMCevHDNio/ yrEpDaTfebrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,406,1580803200"; d="scan'208";a="254906828" Received: from gaia.fi.intel.com ([10.237.72.192]) by orsmga003.jf.intel.com with ESMTP; 20 Apr 2020 04:06:54 -0700 Received: by gaia.fi.intel.com (Postfix, from userid 1000) id 4484A5C3A0F; Mon, 20 Apr 2020 14:05:00 +0300 (EEST) From: Mika Kuoppala To: Chris Wilson , intel-gfx@lists.freedesktop.org In-Reply-To: <20200420090914.14679-2-chris@chris-wilson.co.uk> References: <20200420090914.14679-1-chris@chris-wilson.co.uk> <20200420090914.14679-2-chris@chris-wilson.co.uk> Date: Mon, 20 Apr 2020 14:05:00 +0300 Message-ID: <87v9lumn8j.fsf@gaia.fi.intel.com> MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915/selftests: Skip energy consumption tests if not controlling freq 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: Chris Wilson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Chris Wilson writes: > If we can not manipulate the frequency with RPS, then comparing min/max > power consumption is pointless / misleading. We will leave the warning > about not being able to control the frequency selection via RPS to other > tests so as not to confuse this more specialised check. > > Signed-off-by: Chris Wilson > --- > drivers/gpu/drm/i915/gt/selftest_rps.c | 37 ++++++++++++++++---------- > 1 file changed, 23 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c > index b1a435db1edc..149a3de86cb9 100644 > --- a/drivers/gpu/drm/i915/gt/selftest_rps.c > +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c > @@ -485,26 +485,21 @@ static u64 __measure_power(int duration_ms) > return div64_u64(1000 * 1000 * dE, dt); > } > > -static u64 measure_power_at(struct intel_rps *rps, int freq) > +static u64 measure_power_at(struct intel_rps *rps, int *freq) > { > u64 x[5]; > int i; > > mutex_lock(&rps->lock); > GEM_BUG_ON(!rps->active); > - intel_rps_set(rps, freq); > + intel_rps_set(rps, *freq); > mutex_unlock(&rps->lock); > > msleep(20); /* more than enough time to stabilise! */ > > - i = read_cagf(rps); > - if (i != freq) > - pr_notice("Running at %x [%uMHz], not target %x [%uMHz]\n", > - i, intel_gpu_freq(rps, i), > - freq, intel_gpu_freq(rps, freq)); > - > for (i = 0; i < 5; i++) > x[i] = __measure_power(5); > + *freq = read_cagf(rps); > > /* A simple triangle filter for better result stability */ > sort(x, 5, sizeof(*x), cmp_u64, NULL); > @@ -542,7 +537,10 @@ int live_rps_power(void *arg) > > for_each_engine(engine, gt, id) { > struct i915_request *rq; > - u64 min, max; > + struct { > + u64 power; > + int freq; Typelocking the hw reprentation might have some benefits. Reviewed-by: Mika Kuoppala > + } min, max; > > if (!intel_engine_can_store_dword(engine)) > continue; > @@ -565,16 +563,27 @@ int live_rps_power(void *arg) > break; > } > > - max = measure_power_at(rps, rps->max_freq); > - min = measure_power_at(rps, rps->min_freq); > + max.freq = rps->max_freq; > + max.power = measure_power_at(rps, &max.freq); > + > + min.freq = rps->min_freq; > + min.power = measure_power_at(rps, &min.freq); > > igt_spinner_end(&spin); > > pr_info("%s: min:%llumW @ %uMHz, max:%llumW @ %uMHz\n", > engine->name, > - min, intel_gpu_freq(rps, rps->min_freq), > - max, intel_gpu_freq(rps, rps->max_freq)); > - if (11 * min > 10 * max) { > + min.power, intel_gpu_freq(rps, min.freq), > + max.power, intel_gpu_freq(rps, max.freq)); > + > + if (10 * min.freq >= 9 * max.freq) { > + pr_notice("Could not control frequency, ran at [%d:%uMHz, %d:%uMhz]\n", > + min.freq, intel_gpu_freq(rps, min.freq), > + max.freq, intel_gpu_freq(rps, max.freq)); > + continue; > + } > + > + if (11 * min.power > 10 * max.power) { > pr_err("%s: did not conserve power when setting lower frequency!\n", > engine->name); > err = -EINVAL; > -- > 2.20.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx