Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp879819imw; Thu, 14 Jul 2022 12:37:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vj+Nvdfir4AD/J9J1glK9BiFdfUBvwMkbmDIC8QoXAvJPh4EZUjuIZ5WvcZIA/kMJKIcsL X-Received: by 2002:a63:3286:0:b0:415:cfd5:32bb with SMTP id y128-20020a633286000000b00415cfd532bbmr8788399pgy.148.1657827454939; Thu, 14 Jul 2022 12:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657827454; cv=none; d=google.com; s=arc-20160816; b=QVhGhklHPxiZp6kcrF4DYL5oHsYxkmOS20braAhODmo/nNrFTjM3xNyZw0Jl2V9st+ dqlunrCygS6XDYlNvkhEzUZvR/Et20N8lKIG0Tl434wfpynfSf/AHi3XVCAvLqmEj/ra xH4vno+5Jr2DRhcyDpfbJctWC02swdIl+lgaF7M3u2/dl9VuK8+4EkvwCxYEDSkw9id0 opcXrwVq6YS6y6NzQy4FgkfQ3SS7MLqQV7FWBzPv7arBSkZoTwdoTbVtis5WS22fEX9T Nxfaq/9ZZtX/hJdCXZBw3CSKh2XBGlWTjM4e1MzKebLUu8yQZefbVCfRK9FEIMpBocx2 5asg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wlMwv2W7GppNW4+mdMkQLIwBGJUS+zaRkk+Q+NpsBjg=; b=Ai3jRPHDAql1cSKcnRkqyIJTZH3CReGf9TuzbvAusW2yRdAFVfmTFZheVNxhxvAALb 9L5DnoJB16MuAQvTGdA/iGsxFV9mQvyDeKtdzZz1d/KuTaI2EdWDJGnRaD0KFmt25K3k YBgBqriOJfHSJskZtldGKMAZ/V5nIFOCQ+V+sTC0hUUfz6/62ga8EM2gaKDZRnrIk7RI 4GvVScOFruiyEUzwhr7iBDZF2Hobh48Rhmx1MLKiep4ryYTDM0TRGXYD6eauyLwvDgP9 rBYhfTAwkJCzWgQzgqq2kVOo6HFQCoAbe/c0+KPs0FU8l5gQjfGyKyQNU1Rm5wEkMcx5 Usrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=ktpMXb04; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a056a00198e00b00525425b20f0si3357002pfl.257.2022.07.14.12.37.19; Thu, 14 Jul 2022 12:37:34 -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=fail header.i=@igalia.com header.s=20170329 header.b=ktpMXb04; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239746AbiGNTS2 (ORCPT + 99 others); Thu, 14 Jul 2022 15:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239672AbiGNTSZ (ORCPT ); Thu, 14 Jul 2022 15:18:25 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54DC943E58 for ; Thu, 14 Jul 2022 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wlMwv2W7GppNW4+mdMkQLIwBGJUS+zaRkk+Q+NpsBjg=; b=ktpMXb04Vk8Tfpp5vf51DoeBMR 5T/ukhWs+mpvQfTnfPSEGggnRMv7k/v9wOpIkVdJcb9CgyDrOnLF2WRSySYYr3fVfIRlpkjzW9w42 S8xvj2gKSCt69MaSqeNfHbMgV0t/bp10LOZOpM7CWfOIKETnLapjKL1omBmK2E8T8AktAurILQ+zz heV45xARt+ucMwBLnJpaNxi3ynM6P5VlEBVU5ygkH46qJv0up6QM1lcKS36U7T3CyeF5Jni0TumC5 ZE+WJ9Q7APe+qCI3JYl3Fho91/CmxeThqMdO44RnGwyTdZNfYm1F8toarDxhKIj+m100jfvCn+Oyg bL6Q2Iug==; Received: from [177.139.47.106] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oC4Ls-00Gla6-AH; Thu, 14 Jul 2022 21:18:20 +0200 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: Alex Deucher , =?UTF-8?q?=27Christian=20K=C3=B6nig=27?= , 'Pan Xinhui' , David Airlie , Daniel Vetter , Hawking Zhang , Tao Zhou , Felix Kuehling , Jack Xiao , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tom St Denis , Rodrigo Siqueira Cc: kernel-dev@igalia.com, =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v2 2/2] Documentation/gpu: Add GFXOFF section Date: Thu, 14 Jul 2022 16:17:45 -0300 Message-Id: <20220714191745.45512-2-andrealmeid@igalia.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220714191745.45512-1-andrealmeid@igalia.com> References: <20220714191745.45512-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Add a GFXOFF section at "GPU Power Controls" file, explaining what it is and how userspace can interact with it. Signed-off-by: André 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/amdgpu/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 +====== + +GFXOFF is a feature found in some mobile GPUs that saves power consumption. The +card's firmware uses RLC (RunList Controller) to power off the gfx engine +dynamically when there is no workload on gfx pipe and puts gfx into "idle" +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/disabled:: + + $ 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 mode 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], always +getting into 0 when possible. When it's disabled, it's always at 2. Returns +``-EINVAL`` if it's not supported. -- 2.37.0