From patchwork Fri Jul 20 20:43:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10538347 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 B986B6029B for ; Fri, 20 Jul 2018 20:46:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A67A41FF7F for ; Fri, 20 Jul 2018 20:46:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9953628ED9; Fri, 20 Jul 2018 20:46:11 +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 2F9AF1FF7F for ; Fri, 20 Jul 2018 20:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbeGTVgG (ORCPT ); Fri, 20 Jul 2018 17:36:06 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:42267 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727633AbeGTVgG (ORCPT ); Fri, 20 Jul 2018 17:36:06 -0400 Received: by mail-yb0-f194.google.com with SMTP id c10-v6so5119422ybf.9 for ; Fri, 20 Jul 2018 13:46:10 -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=6HL2GFfKxy7HzJUsvg4SVvMLq7dNVcweosdrVjjwlPk=; b=B1iuAUnht6DBXYPhkCJsjHHrhjoiLSDdFVOaoLzW8S5zWSQTFEy4aFJFfRd/OIP4xH n8o0ZNyj79+4m7/YLPQBAoNKWIxsKQmf5meTOozpzzSv/OhKDgXAA3+QT+UNIaPNXaF3 VsR8OMz+TqzRMzFiZPbsEjeqV3dJ+729fYNzM= 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=6HL2GFfKxy7HzJUsvg4SVvMLq7dNVcweosdrVjjwlPk=; b=c2t1owmnr0SmQr43WPkxaJPl5dg1FFnw6/op6ujPqfSwh70EQB5kNd4RHSepXbk633 FeYjrVAVWuUS8kSQlIKD/UPUgfhCO1w+7QAZSLMox5HHS66IPQDE+3wq6g5dvpkWWCO8 SFifxf+hMePKTnj2Y6KzxyBxOS4hcpf9p5jOsvwihdeATX+N5j5E+Yg+a0jqc7ojH5+g /vEaXck24usZwt7JD7gyNheGozs5ovxFzqbxMPkV3uMGvVl0qypBncKQfDe67D41/TPu zO34OUvUG1WDbnKn1TLesNUHFz0lGrYBaaJCH9P79ma2Mzs+J9rxf8uo1A/JSxy930b5 rxyw== X-Gm-Message-State: AOUpUlH6hVWjS8GoX9ekRNtoiI2kPYiqzlG4iX6v/KEip2NoOK078984 vynTnUEpuGfAkJ/tCMp2n5dEIg== X-Google-Smtp-Source: AAOMgpdhnhon7U0je7234k3riWZcSOgqLQEsN+6WMMiPo/AcX7wFGUporgA4Bp0BxylkpEfQpBx1ug== X-Received: by 2002:a25:8b04:: with SMTP id i4-v6mr1902664ybl.12.1532119569688; Fri, 20 Jul 2018 13:46:09 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id a2-v6sm2453831ywm.7.2018.07.20.13.46.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 13:46:09 -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 v3 17/19] drm/msm: Add pm_suspend/resume callbacks to msm_kms Date: Fri, 20 Jul 2018 16:43:08 -0400 Message-Id: <20180720204315.19054-18-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog In-Reply-To: <20180720204315.19054-1-seanpaul@chromium.org> References: <20180720204315.19054-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. Changes in v3: - None 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 8bd9fe831968..e79ad74ca98c 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -903,6 +903,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); @@ -919,6 +924,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 761bb07cd7bf..c15de28ae2dd 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -61,6 +61,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