From patchwork Wed Mar 9 06:14:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Airlie X-Patchwork-Id: 8542661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A363C0554 for ; Wed, 9 Mar 2016 06:14:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4E3F20148 for ; Wed, 9 Mar 2016 06:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2E9620218 for ; Wed, 9 Mar 2016 06:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268AbcCIGOS (ORCPT ); Wed, 9 Mar 2016 01:14:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52652 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbcCIGOK (ORCPT ); Wed, 9 Mar 2016 01:14:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D6557C0AAB23; Wed, 9 Mar 2016 06:14:09 +0000 (UTC) Received: from dreadlord-bne-redhat-com.bne.redhat.com (dhcp-40-179.bne.redhat.com [10.64.40.179]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u296E69V004757; Wed, 9 Mar 2016 01:14:08 -0500 From: Dave Airlie To: dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] nouveau: use new vga_switcheroo power domain. Date: Wed, 9 Mar 2016 16:14:05 +1000 Message-Id: <1457504045-12738-2-git-send-email-airlied@gmail.com> In-Reply-To: <1457504045-12738-1-git-send-email-airlied@gmail.com> References: <1457504045-12738-1-git-send-email-airlied@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Airlie This fixes GPU auto powerdown on the Lenovo W541, since we advertise Windows 2013 to the ACPI layer. Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_vga.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index af89c36..b987427f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c @@ -101,8 +101,12 @@ nouveau_vga_init(struct nouveau_drm *drm) runtime = true; vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime); - if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) - vga_switcheroo_init_domain_pm_ops(drm->dev->dev, &drm->vga_pm_domain); + if (runtime) { + if (nouveau_is_v1_dsm() && !nouveau_is_optimus()) + vga_switcheroo_init_domain_pm_ops(drm->dev->dev, &drm->vga_pm_domain); + else if (nouveau_is_optimus()) + vga_switcheroo_init_parent_pr3_ops(drm->dev->dev, &drm->vga_pm_domain); + } } void @@ -117,7 +121,7 @@ nouveau_vga_fini(struct nouveau_drm *drm) runtime = true; vga_switcheroo_unregister_client(dev->pdev); - if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) + if (runtime && (nouveau_is_v1_dsm() || nouveau_is_optimus())) vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); vga_client_register(dev->pdev, NULL, NULL, NULL); }