Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3696842imw; Mon, 18 Jul 2022 12:50:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1se30gpRV7Ht7naratfH70aTAcdX+MQrWkuiNKJ/XOAfmLUCLbLjJmEPNwILfzo3HL8K8ML X-Received: by 2002:a17:907:2d8b:b0:72b:7152:aa6a with SMTP id gt11-20020a1709072d8b00b0072b7152aa6amr27297745ejc.732.1658173856746; Mon, 18 Jul 2022 12:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658173856; cv=none; d=google.com; s=arc-20160816; b=DCO/cg1f6jMfFoloJIuLgq+DdJowiDynsRTGpGXIVPWGMh76nbehhPJm8eUFh2DGvx kP4fJEvhpMEGjWW5yER2mlbCg3AzFwC9i7ZNFBuiBeYN7n/KmiiBYFVEh94j30+7P1H2 giL+nYd8I+BWy2pyN3eZLODMOMSajo4llYV3ggrkf9FEb9h0ZmRm8UslDPEKI/GknzK5 7+V2uzxQe2Bwn2a/6pfvcgMAc59rgBdaT0625uEIOgPCkR2X4Ytzf+6xOtn4eKCXUTrL 7sBQ3lF0/cpIlao3Xmle3FrBI6yenm0wSRvk7jsAlq65Fs8YNEs0jPmdt0psP3DJExci UwWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=T6pIhZoCfcBPiPwmB8bNAnYeRRxbKbLMH2IiA6YSiS4=; b=0GphxC/OTtvKBQiXk7XpGy2rizuYAPZWdkq0rsNWYYAmwptQxwJ//MUr8fj4PQjzKZ B1TqyLKvV2Gd9V0+yb9kPz9strssK8v1l3+LlYKlTB6+QXaEv+37OuCHPhV58KaX3re5 96reRQT1AxMQxxFqqY0UpZMZ8vNORPuXjc4mstx1eAvxqSop4PdIPejlkAYxceMLZp3f haDYGyZFrMlGBK8esix9HUp1D1jk5p50dqpnkfyjT2V1OuCTwAhA6ccUmfSjG0K0ucnm Hw+cnNAvRXnOI2/bqkf+N3tYYIGgu7CHkd0Kf5APoxzWWe/7t0v9uCi91PwGR0IqVdDN xGUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=faNSnFWt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rv3-20020a17090710c300b0072b408fc69dsi15539054ejb.951.2022.07.18.12.50.31; Mon, 18 Jul 2022 12:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=faNSnFWt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235833AbiGRT05 (ORCPT + 99 others); Mon, 18 Jul 2022 15:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233716AbiGRT04 (ORCPT ); Mon, 18 Jul 2022 15:26:56 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05A362F652 for ; Mon, 18 Jul 2022 12:26:56 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id ss3so23103567ejc.11 for ; Mon, 18 Jul 2022 12:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=T6pIhZoCfcBPiPwmB8bNAnYeRRxbKbLMH2IiA6YSiS4=; b=faNSnFWta+P8uRY/mAT3+Za/vDXl1BUX2axDNHN+u6Fk25/DihtmqZ1ez9cCMledSv o9/1J17v9pQBQ22wZBZk65u+HaKDsSyplTzLJbloNiWSa4yK5aWNB/+W8djYr2BZXbMZ nKmVyznhptfFFftvmKRyAAkKgxPgg9l0mNz9LgrVHwb391NNfRtHq0xyMzcQZokkGGPL 4DGyWU6qA5cME9WgwEB7+dKnSmwvgkqDLyeWjtQgBo1SRTiXygp4trF8CEYjuCnYrYe4 H32fixbFwKgd/J0xdyHHfgXAiROs0ZPcMZsb0YVnWBoyx4TKU4Utes2OE4K+STSipjAg QEMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=T6pIhZoCfcBPiPwmB8bNAnYeRRxbKbLMH2IiA6YSiS4=; b=plKANYAMynSpJ3SHDMp8iEi+z8d8cIU9uA/ovbGoH17IECIsosrjlQxu1caPsFW1Hl j7A7ARp8LWgZAsEa1GViruFt6rwEmNXOknRwmGWRZwe1ZXs4lIGgRc6jGAnZ00QZJZAP 84ztMzJb3QPw9weL0HB/DHLWq7GWUP1/rS4FoQYsXtGRgElJ6+5GUxXJt986CzWEfrcx Vb88XUF8x8y0QlK0kNpp5++aq8RqVKgma/ts15o0SAuN+XpoNt0fRp5BOP6GNubBeViu vmUrEyCZjfT4I4I+s1Wx9SnK2rSGH2jZQ29Oyhj9rQWK3PlfTOL8bdG/Rn+HxYaQafw0 ShdA== X-Gm-Message-State: AJIora+XDD2Bn282FCzYaLKZtU3Hat71GUKIO1z/6YA3B9zkehONB0lo oBL2Z64OER9h4lHltzxZdQCh5DhBSdTfp7tSy0A= X-Received: by 2002:a17:906:4fc5:b0:72b:9943:6f10 with SMTP id i5-20020a1709064fc500b0072b99436f10mr27435815ejw.722.1658172414591; Mon, 18 Jul 2022 12:26:54 -0700 (PDT) MIME-Version: 1.0 References: <20220714191745.45512-1-andrealmeid@igalia.com> <20220714191745.45512-2-andrealmeid@igalia.com> In-Reply-To: <20220714191745.45512-2-andrealmeid@igalia.com> From: Alex Deucher Date: Mon, 18 Jul 2022 15:26:42 -0400 Message-ID: Subject: Re: [PATCH v2 2/2] Documentation/gpu: Add GFXOFF section To: =?UTF-8?Q?Andr=C3=A9_Almeida?= Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , Pan Xinhui , David Airlie , Daniel Vetter , Hawking Zhang , Tao Zhou , Felix Kuehling , Jack Xiao , amd-gfx list , Maling list - DRI developers , LKML , Tom St Denis , Rodrigo Siqueira , kernel-dev@igalia.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied the series with some minor tweaks to the documentation. Thanks! Alex On Thu, Jul 14, 2022 at 3:18 PM Andr=C3=A9 Almeida = wrote: > > Add a GFXOFF section at "GPU Power Controls" file, explaining what it is > and how userspace can interact with it. > > Signed-off-by: Andr=C3=A9 Almeida > --- > Changes from v1: file created > > Documentation/gpu/amdgpu/thermal.rst | 41 ++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/Documentation/gpu/amdgpu/thermal.rst b/Documentation/gpu/amd= gpu/thermal.rst > index 8aeb0186c9ef..14c0fb874cf6 100644 > --- a/Documentation/gpu/amdgpu/thermal.rst > +++ b/Documentation/gpu/amdgpu/thermal.rst > @@ -63,3 +63,44 @@ gpu_metrics > > .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c > :doc: gpu_metrics > + > +GFXOFF > +=3D=3D=3D=3D=3D=3D > + > +GFXOFF is a feature found in some mobile GPUs that saves power consumpti= on. The > +card's firmware uses RLC (RunList Controller) to power off the gfx engin= e > +dynamically when there is no workload on gfx pipe and puts gfx into "idl= e" > +state. GFXOFF is on by default on supported GPUs. > + > +Userspace can interact with GFXOFF through a debugfs interface: > + > +``amdgpu_gfxoff`` > +----------------- > + > +Use it to enable/disable GFXOFF, and to check if it's current enabled/di= sabled:: > + > + $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff > + 01 > + > +- Write 0 to disable it, and 1 to enable it. > +- Read 0 means it's disabled, 1 it's enabled. > + > +If it's enabled, that means that the GPU is free to enter into GFXOFF mo= de as > +needed. Disabled means that it will never enter GFXOFF mode. > + > +``amdgpu_gfxoff_status`` > +------------------------ > + > +Read it to check current GFXOFF's status of a GPU:: > + > + $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff_status > + 02 > + > +- 0: GPU is in GFXOFF state, the gfx engine is powered down. > +- 1: Transition out of GFXOFF state > +- 2: Not in GFXOFF state > +- 3: Transition into GFXOFF state > + > +If GFXOFF is enabled, the value will be transitioning around [0, 3], alw= ays > +getting into 0 when possible. When it's disabled, it's always at 2. Retu= rns > +``-EINVAL`` if it's not supported. > -- > 2.37.0 >