From patchwork Fri Oct 5 21:04:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10628737 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-2.web.codeaurora.org (Postfix) with ESMTP id A82E216B1 for ; Fri, 5 Oct 2018 21:04:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 979BD29C1A for ; Fri, 5 Oct 2018 21:04:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C3C329C21; Fri, 5 Oct 2018 21:04: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2FA4F29C1A for ; Fri, 5 Oct 2018 21:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725761AbeJFEEi (ORCPT ); Sat, 6 Oct 2018 00:04:38 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:40714 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbeJFEEi (ORCPT ); Sat, 6 Oct 2018 00:04:38 -0400 Received: by mail-yb1-f195.google.com with SMTP id w7-v6so6003981ybm.7 for ; Fri, 05 Oct 2018 14:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uw8mJE3gTuPqzzQdb292S4+x+sYbFPafHAzuQkhO+EA=; b=SQ/2VqQS9I8B+sBzpZ2UOIEyPBgEnut19+jxrr5KZ6so9AkjaXEwjspRCdCBXrKGp9 2qLxcftzM7iBBHyxZZVVi7/UGjt7iINZv/hdAM8upp6aDQgeqtxSniO6X1UUKDiN16qK rERH0OHVwzxbOog2QTJ55kIvXjONku+poYK5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uw8mJE3gTuPqzzQdb292S4+x+sYbFPafHAzuQkhO+EA=; b=LgUVc/fEIuDYuKTPKIBZ7VtHurB3QCAO8jxrur+53rKy1FRi6xyUJihq7dFXmNeWc+ PiO+N2BiDYNbHr68lxPfU18JiYcm4M4aciBxhzCnawJb95FVb9l6XDeEKxlj7PVFiY0Z VXVJ619M/41if0JYl7iPn3K2pEg8w7cJ+1/rTdkUq49ZBytfVhf2fVffBXDHUBwaAC0o 7odXogaqyaZjdoMBtcSdiYNZEIXNhtf55T8hr+cnBDSH1MVejyhCqohfHASkJT2TY9ZI bhELnjw6nGZU5iFKR+wj59urLeMCwHhtVdxIRRsLlHanmOxKemWuAer/AES2GLJv4K68 rSAA== X-Gm-Message-State: ABuFfoiGI2JM+L43AGpefJkfDxqPeMmq9pWEYVayuF4T9lJ+j7PRvVsa Ap6R1xmSipRxD9zWkK4VQr/cMg== X-Google-Smtp-Source: ACcGV62ngszigcilXu9ggAVpQKfrJxhQOnEImD5JsOuM7m4d8Ovck/PgWUhMcAQj/cHdtZm+jymT3w== X-Received: by 2002:a25:c4c4:: with SMTP id u187-v6mr7664075ybf.413.1538773449159; Fri, 05 Oct 2018 14:04:09 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id f5-v6sm3496141ywa.39.2018.10.05.14.04.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 14:04:07 -0700 (PDT) From: Bruce Wang To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: seanpaul@chromium.org, jsanka@codeaurora.org, robdclark@gmail.com, abhinavk@codeaurora.org, jcrouse@codeaurora.org Subject: [PATCH v3 2/4] drm/msm: Cut dpu_kms hooks from msm_pm_suspend/resume Date: Fri, 5 Oct 2018 17:04:01 -0400 Message-Id: <20181005210403.54615-3-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181005210403.54615-1-bzwang@chromium.org> References: <20181005210403.54615-1-bzwang@chromium.org> MIME-Version: 1.0 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 Removes the traces of the non-atomic helper calls in msm_pm_suspend/resume since we just deleted those functions (see patch 1). Also removes the drm_kms_helper_poll_disable/enable calls, since the DRM_CONNECTOR_POLL_CONNECT flag is never set so periodic polling doesn't happen anyways. v2: reorganized patch order v3: made error checks less severe Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/msm_drv.c | 27 ++++++++++++--------------- drivers/gpu/drm/msm/msm_kms.h | 3 --- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 4904d0d41409..f5cd7f6ce4f8 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1069,18 +1069,15 @@ 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); + if (WARN_ON(priv->pm_state)) + drm_atomic_state_put(priv->pm_state); priv->pm_state = drm_atomic_helper_suspend(ddev); if (IS_ERR(priv->pm_state)) { - drm_kms_helper_poll_enable(ddev); - return PTR_ERR(priv->pm_state); + int ret = PTR_ERR(priv->pm_state); + DRM_ERROR("Failed to suspend dpu, %d\n", ret); + return ret; } return 0; @@ -1090,16 +1087,16 @@ 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; + int ret; - /* TODO: Use atomic helper suspend/resume */ - if (kms && kms->funcs && kms->funcs->pm_resume) - return kms->funcs->pm_resume(dev); + if (WARN_ON(!priv->pm_state)) + return -ENOENT; - drm_atomic_helper_resume(ddev, priv->pm_state); - drm_kms_helper_poll_enable(ddev); + ret = drm_atomic_helper_resume(ddev, priv->pm_state); + if (!ret) + priv->pm_state = NULL; - return 0; + return ret; } #endif diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index fd88cebb6adb..2b81b43a4bab 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -67,9 +67,6 @@ 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