From patchwork Thu Jun 2 13:33:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9149969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59BC460751 for ; Thu, 2 Jun 2016 13:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C1D3254F7 for ; Thu, 2 Jun 2016 13:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4132928047; Thu, 2 Jun 2016 13:33:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F508254F7 for ; Thu, 2 Jun 2016 13:33:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 690246EB89; Thu, 2 Jun 2016 13:33:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-x241.google.com (mail-qg0-x241.google.com [IPv6:2607:f8b0:400d:c04::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id CED4A6E619 for ; Thu, 2 Jun 2016 13:33:46 +0000 (UTC) Received: by mail-qg0-x241.google.com with SMTP id z67so9013805qgz.1 for ; Thu, 02 Jun 2016 06:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OAXsSDzK2wMBPHzOyYR1BPmBF3ZHhJUrY5I340argac=; b=RfR+unLJDE5Eh8GZfD1PNqZ2KvXbE7hi5PFSqhim93Eu6YNhPdXNohe7z2X5tY+irW kqLe4BFV0O3mL7fp5AeptM72l+m08AbDdIInkWuZyowZPBZJ0SxNyBe5rc6hfZgQKAmn viAn8/tQlDr39b1B7UFPNw2wEK8I7RDIVkzXlF+Q2P9we5LWDsDpcI7fFK/Sk/BmrfOv 5oHCb6phhUA01K3M17LKz60ET2pY/whjp7P+XZyDOzTgNyBx6HX8ynHfdk/Rj22HCX2W PYbyonEFns0wC3NvjZ9I39Wm8NB9ux9bIerYsTrse9VKODQrgfufkWZVGgjQZ58QQFER RU2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OAXsSDzK2wMBPHzOyYR1BPmBF3ZHhJUrY5I340argac=; b=FgDTGN37zzQSecehaMB0uCx79cE4nqPiU6A2EEjYySJXoLonDU0pPzZWqy0440M3S3 A5Ex1R6p44CGAK+UTn5Of0DoR0+V/9aVMoTcysXwK29t62r9B6w7jjhbobxRsewecLvr sq09NGHTxzRPLAUyv5qgNdbIKWDbFjygJmHoAp+A6zA2baTAKGgwAeuJko6p79qmi/DI ZHiT6CKN5VtVcybtuhc/M64e7IT5Bm1atL6s7/aGgmN6C+Xx6ukc6VvQi0qtIu/4lDbq jUpOuzezQgn3wyfzZnfNtLraLulnHR8jcw1q2yeKRQBzIHrRtkDXT9qPHs0NpPgWJ2A5 bxng== X-Gm-Message-State: ALyK8tLhKus7Cyh0G1fg9JHRb6O//4FTu8yOgqF38TQDR+/MHcC/nw7oPS/B8TbTuMRvKg== X-Received: by 10.140.99.109 with SMTP id p100mr40432677qge.97.1464874425497; Thu, 02 Jun 2016 06:33:45 -0700 (PDT) Received: from cm.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id u131sm7962690qka.44.2016.06.02.06.33.45 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 06:33:45 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/radeon: drop explicit pci D3/D0 setting for ATPX power control Date: Thu, 2 Jun 2016 09:33:37 -0400 Message-Id: <1464874417-27272-6-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464874417-27272-1-git-send-email-alexander.deucher@amd.com> References: <1464874417-27272-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ATPX power control method does this for you. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index f453450..56d15e6 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -419,9 +419,7 @@ static int radeon_pmops_runtime_suspend(struct device *dev) pci_ignore_hotplug(pdev); if (radeon_is_atpx_hybrid()) pci_set_power_state(pdev, PCI_D3cold); - else if (radeon_has_atpx_dgpu_power_cntl()) - pci_set_power_state(pdev, PCI_D3cold); - else + else if (!radeon_has_atpx_dgpu_power_cntl()) pci_set_power_state(pdev, PCI_D3hot); drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; @@ -439,7 +437,9 @@ static int radeon_pmops_runtime_resume(struct device *dev) drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; - pci_set_power_state(pdev, PCI_D0); + if (radeon_is_atpx_hybrid() || + !radeon_has_atpx_dgpu_power_cntl()) + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret)