From patchwork Fri Dec 19 15:24:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 5520491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3AB69BEEA8 for ; Fri, 19 Dec 2014 15:25:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 276BA2013D for ; Fri, 19 Dec 2014 15:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A801020131 for ; Fri, 19 Dec 2014 15:25:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0686B6E8EC; Fri, 19 Dec 2014 07:25:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 833CD6E8F3 for ; Fri, 19 Dec 2014 07:25:20 -0800 (PST) Received: by mail-pd0-f182.google.com with SMTP id p10so1385449pdj.27 for ; Fri, 19 Dec 2014 07:25:20 -0800 (PST) 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=tNnEcXdER3zJetuqkqF0gVm2VwO9RlusaaPcCIUJe/o=; b=RsXGapOLaYKwo9GXezOopq+kzwGwnRycsdPeaWps7fpXV42LFUeltqSapa4yjKg6WA jtyTAJCIKI/2XynlYIZeQhdb2d1nqQ5Ql4qeKbqu+lREvmdEKjcmD/WMJDURHxSeLrvB AIUI1Mx1+qD3fuofnJC881Rmjd+oOleQuOYP0DE9CP0F3xBlFY+2vVBdS/yHkbwixmEU iOZvyNtpb5NKaC7yPUrOE5gbcYf90Ck5TmkrM/VX58E//dfFy3sCh36ST4Lr+nJ6lPu4 SMyyqsn5qHuMz6NHheMHyClKpCUKcE5Us9K874WfALSQMcGHEg6KZwFE+UQkFq/dxVVk P5nQ== X-Received: by 10.68.230.105 with SMTP id sx9mr7583816pbc.64.1419002720374; Fri, 19 Dec 2014 07:25:20 -0800 (PST) Received: from localhost ([216.228.120.20]) by mx.google.com with ESMTPSA id c9sm9909859pdj.52.2014.12.19.07.25.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Dec 2014 07:25:19 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/tegra: Add minimal power management Date: Fri, 19 Dec 2014 16:24:58 +0100 Message-Id: <1419002698-4963-5-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1419002698-4963-1-git-send-email-thierry.reding@gmail.com> References: <1419002698-4963-1-git-send-email-thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org, Mark Zhang 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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: Thierry Reding For now only disable the KMS hotplug polling helper logic upon suspend and re-enable it on resume. Signed-off-by: Thierry Reding Reviewed-by: Sean Paul Reviewed-by: Mark Zhang --- drivers/gpu/drm/tegra/drm.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 272c2dca3536..16c44b9abbd8 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -889,6 +889,30 @@ static int host1x_drm_remove(struct host1x_device *dev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int host1x_drm_suspend(struct device *dev) +{ + struct drm_device *drm = dev_get_drvdata(dev); + + drm_kms_helper_poll_disable(drm); + + return 0; +} + +static int host1x_drm_resume(struct device *dev) +{ + struct drm_device *drm = dev_get_drvdata(dev); + + drm_kms_helper_poll_enable(drm); + + return 0; +} +#endif + +static const struct dev_pm_ops host1x_drm_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(host1x_drm_suspend, host1x_drm_resume) +}; + static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra20-dc", }, { .compatible = "nvidia,tegra20-hdmi", }, @@ -910,6 +934,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { static struct host1x_driver host1x_drm_driver = { .driver = { .name = "drm", + .pm = &host1x_drm_pm_ops, }, .probe = host1x_drm_probe, .remove = host1x_drm_remove,