From patchwork Mon Oct 28 21:42:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11216667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D58BA913 for ; Mon, 28 Oct 2019 21:53:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 683F9218AC for ; Mon, 28 Oct 2019 21:53:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="jU1X6aSQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qET5lgYj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 683F9218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD3D6215A; Mon, 28 Oct 2019 22:52:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD3D6215A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572299579; bh=r/RONVSndOKt6Cie1F52vGXojWBQoaWoPzSU29FCHwU=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jU1X6aSQLPSdoJ1RvmON5welzNraNWyB2AxRxh561N1dqNh9cvevNB0vvnRlTztni 7UrS6LnUg0PJoCd/LTCsewJ6dcsrWVcONtdKdXujxXY4vi3TDPG34r7izualTH3wtO BLoqcBhkQ3SMvLw/dpPWkJ/tCkg93EKtJ6FC47Es= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 613E7F80717; Mon, 28 Oct 2019 22:43:44 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3BA2AF8071F; Mon, 28 Oct 2019 22:43:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 54E5AF8070E for ; Mon, 28 Oct 2019 22:43:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 54E5AF8070E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qET5lgYj" Received: by mail-yb1-xb43.google.com with SMTP id c13so4047077ybq.3 for ; Mon, 28 Oct 2019 14:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GJZAPAB9TzHoxM5Wh1v3IEaEGA/8F0zj5r6AgfYhfEs=; b=qET5lgYjfUo4xmVbpEMi/WTVGBgq/MjwXyLCGrzRWCaBU0eNJFg3fnLSYeCi6DDZnT m4XTvfe1aCH23/PCfdrhBbcGs4PXz7Qa4FCpffRzOSOM6/U+CnvGpAKEKqYqUU7mGP9J 3/pfHEQLyPtFSFuYlWojFL71vpqK3SIaBG4rxjaapSEIq5aVRIV44xz0BDbUbd5I78qU 2r710M8+gfApoB+8Q8qvZsOi2nU98h11zaaOYnbcHCMc6N+Aypl436d6WbNM9ZHnD9Bz t9WG3SWoKR7hCiVNCNIT6ES7VPnqrK7gDTjkdnTBn7/Vop9oTUxvhdaWPQu0/EXEZ7Np P2qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GJZAPAB9TzHoxM5Wh1v3IEaEGA/8F0zj5r6AgfYhfEs=; b=oA9yYS5ZtvkPukAaNx4MjmQ+JiuUY7IQsaIGMjdKDTf3Vls7fMl+61aAn5U86Fnl29 q5hog3rZ/feZZj9OHYP/xgbDC7DbTImVm4/V/LVcU8vGY67AWMbflHF6iXnurqzL7e9H lR9eHjkkwzvs6t/hcR/njqRFDxxvl7vR4ClgNvCkCcA68QrfBk6Y33V23at6xu/XUYSj tj+rghU1rUmqD9qpljNaNtIgA9SDqBS6tSgI4B16rFwzqq/GT8iskTTG4pk6s/yuB3mK FubdVRH7H8Xt9Z4u8h7odZv7NMFhv7Il2nbX0IxPulBc+/iUUj0faxW8X6K7BfoMJ9Uq tTKA== X-Gm-Message-State: APjAAAWkdPwJIb7d6PqW2wCTcibAsW15HEFZzz8z9qIZiBxMhiBBLgn6 nM7KKNXIbPytI9jZAu2EUlA= X-Google-Smtp-Source: APXvYqwISLLy2E0UUjwlfDLL2xxVlWWh9Gs5O5w8L2UXtcqu9Hvc3NrziwdR8Xo8DvRCWWhkPnzY0Q== X-Received: by 2002:a25:7c7:: with SMTP id 190mr15918296ybh.24.1572299018037; Mon, 28 Oct 2019 14:43:38 -0700 (PDT) Received: from tr4.amd.com (atlvpn.amd.com. [165.204.84.11]) by smtp.gmail.com with ESMTPSA id l68sm3421090ywf.95.2019.10.28.14.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 14:43:36 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, tiwai@suse.de, lukas@wunner.de Date: Mon, 28 Oct 2019 17:42:08 -0400 Message-Id: <20191028214216.1508370-14-alexander.deucher@amd.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191028214216.1508370-1-alexander.deucher@amd.com> References: <20191028214216.1508370-1-alexander.deucher@amd.com> MIME-Version: 1.0 Cc: Alex Deucher , Evan Quan Subject: [alsa-devel] [PATCH 13/21] drm/amdgpu: add baco support to runtime suspend/resume X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" BACO - Bus Active, Chip Off This adds the necessary support to the runtime suspend and resume functions to handle boards that support baco. Reviewed-by: Evan Quan Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 7b8478d08b2b..849784e27a98 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1164,7 +1164,8 @@ static int amdgpu_pmops_resume(struct device *dev) struct drm_device *drm_dev = dev_get_drvdata(dev); /* GPU comes up enabled by the bios on resume */ - if (amdgpu_device_supports_boco(drm_dev)) { + if (amdgpu_device_supports_boco(drm_dev) || + amdgpu_device_supports_baco(drm_dev)) { pm_runtime_disable(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); @@ -1231,6 +1232,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) else if (!amdgpu_has_atpx_dgpu_power_cntl()) pci_set_power_state(pdev, PCI_D3hot); drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; + } else if (amdgpu_device_supports_baco(drm_dev)) { + amdgpu_device_baco_enter(drm_dev); } return 0; @@ -1256,6 +1259,8 @@ static int amdgpu_pmops_runtime_resume(struct device *dev) if (ret) return ret; pci_set_master(pdev); + } else if (amdgpu_device_supports_baco(drm_dev)) { + amdgpu_device_baco_exit(drm_dev); } ret = amdgpu_device_resume(drm_dev, false, false); drm_kms_helper_poll_enable(drm_dev);