From patchwork Mon Jul 9 17:31:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10515393 X-Patchwork-Delegate: agross@codeaurora.org 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 D8CE4600CA for ; Mon, 9 Jul 2018 17:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C215A28D0D for ; Mon, 9 Jul 2018 17:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B65A828DDE; Mon, 9 Jul 2018 17:35:21 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C7128D0D for ; Mon, 9 Jul 2018 17:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933779AbeGIRfU (ORCPT ); Mon, 9 Jul 2018 13:35:20 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:33509 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933489AbeGIRfU (ORCPT ); Mon, 9 Jul 2018 13:35:20 -0400 Received: by mail-yw0-f194.google.com with SMTP id c135-v6so6829001ywa.0 for ; Mon, 09 Jul 2018 10:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=53rnyvqYlK6HzP1kf+eGs3vCBJ4EIQ7zM1IrJfUlrRY=; b=Py5rFqvxNeB6Np+QMeBnvJd6cXos4Mq4GyDs8VRXVtsBuNryjdZEKu8qnfdqnuUVaR +61nt80ug4WDw8cEO3cG6cDSBe4FqAY1khfctA+K/JHfS3VjC+ADE9qwVPk0ct+k/q3+ Wl2g5ylzkd4mEnbvvgj+BMdpeSfbC1H+Y5QSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=53rnyvqYlK6HzP1kf+eGs3vCBJ4EIQ7zM1IrJfUlrRY=; b=KFSLXKS+KXgsWA7liu/ythUwqmkLuDzDMVc6f1s8q4EENCKdH17tqBKe3IP9PIBdeJ 7s42l/auoahwwj7fFIAv+A4ETHC7skgY4z2bBxQhbE3mqSb6jpfpmlZmC1yzrF761odP SYtUP6ktyPmYZCm9ltGl9btHoiFDotl06udckx+QUDYQ+3LqjFUeg2ZN3Gxc7AeMvylk wM9X6kDBS617tlWXaH8suT/gyHXJO06FNfkmly0R4zYcumhJ+2zKXrNf2VJPiykRzDBU +hGke8kBS6goY5QIDRkALAhloKIAvQDWl/hH0GECT5v8e6vnil82N9y/CEogw2LVIAd5 wYZw== X-Gm-Message-State: APt69E2UkKHmjMHFmnTAX4f/3Sj04amqEdm4RB4AvgNBQ7foi3ef43A4 PEmA2zxnu8qRw0GoqbKNaouEWw== X-Google-Smtp-Source: AAOMgpc/6NCf9ftRhj7fQtQY+uhdoox9AxWWzaoMcpJ0ULQsoLIKxARxYpWQ7DAWCI1dHxGWMDXo3A== X-Received: by 2002:a81:285:: with SMTP id 127-v6mr10501794ywc.0.1531157719636; Mon, 09 Jul 2018 10:35:19 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id s206-v6sm5885495ywc.55.2018.07.09.10.35.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 10:35:19 -0700 (PDT) From: Sean Paul To: abhinavk@codeaurora.org, architt@codeaurora.org, chandanu@codeaurora.org, jsanka@codeaurora.org, jcrouse@codeaurora.org, ryadav@codeaurora.org, seanpaul@chromium.org, skolluku@codeaurora.org, dri-devel@lists.freedesktop.org, robdclark@gmail.com, airlied@linux.ie, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, nganji@codeaurora.org, hoegsberg@chromium.org, dovizu@chromium.org, robh+dt@kernel.org Subject: [PATCH 18/21] drm/msm: Add pm_suspend/resume callbacks to msm_kms Date: Mon, 9 Jul 2018 13:31:54 -0400 Message-Id: <20180709173200.238457-19-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180709173200.238457-1-seanpaul@chromium.org> References: <20180709173200.238457-1-seanpaul@chromium.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeykumar Sankaran Used by the dpu driver for custom suspend/resume. Signed-off-by: Jeykumar Sankaran [seanpaul split this out of the megapatch] Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ drivers/gpu/drm/msm/msm_kms.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index ed6efebabc38..cd0959783203 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -912,6 +912,11 @@ static int msm_pm_suspend(struct device *dev) { struct drm_device *ddev = dev_get_drvdata(dev); struct msm_drm_private *priv = ddev->dev_private; + struct msm_kms *kms = priv->kms; + + /* TODO: Use atomic helper suspend/resume */ + if (kms && kms->funcs && kms->funcs->pm_suspend) + return kms->funcs->pm_suspend(dev); drm_kms_helper_poll_disable(ddev); @@ -928,6 +933,11 @@ static int msm_pm_resume(struct device *dev) { struct drm_device *ddev = dev_get_drvdata(dev); struct msm_drm_private *priv = ddev->dev_private; + struct msm_kms *kms = priv->kms; + + /* TODO: Use atomic helper suspend/resume */ + if (kms && kms->funcs && kms->funcs->pm_resume) + return kms->funcs->pm_resume(dev); drm_atomic_helper_resume(ddev, priv->pm_state); drm_kms_helper_poll_enable(ddev); diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index 9cd7223febcf..36201f43fa31 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -62,6 +62,9 @@ struct msm_kms_funcs { void (*set_encoder_mode)(struct msm_kms *kms, struct drm_encoder *encoder, bool cmd_mode); + /* pm suspend/resume hooks */ + int (*pm_suspend)(struct device *dev); + int (*pm_resume)(struct device *dev); /* cleanup: */ void (*destroy)(struct msm_kms *kms); #ifdef CONFIG_DEBUG_FS