From patchwork Fri Oct 5 15:48:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10628347 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 A7DE815E2 for ; Fri, 5 Oct 2018 15:48:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CFB329854 for ; Fri, 5 Oct 2018 15:48:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90E8C29859; Fri, 5 Oct 2018 15:48:51 +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 333A029854 for ; Fri, 5 Oct 2018 15:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727958AbeJEWsG (ORCPT ); Fri, 5 Oct 2018 18:48:06 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:36665 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727572AbeJEWsG (ORCPT ); Fri, 5 Oct 2018 18:48:06 -0400 Received: by mail-yw1-f67.google.com with SMTP id e201-v6so5426762ywa.3 for ; Fri, 05 Oct 2018 08:48:49 -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=UskCe1qUSQB8EunJ/KkV7we0yFmkRvYoIjzrrAGJqNY=; b=bjK1mEPMny1B79G24gpj46Xd2u+S0gYUaBFGKlYMGMCIuu1xnTV87gpzeweC+mrEFb usDltWAVExl1qplm1xt+E3xgAIoWfiQo8+YiQjlaooAYw2VtRe3ib8XCUDIIAK3f94fd 3/Z920+lTsf975Dez78QqozeriF1XtLl0L31g= 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=UskCe1qUSQB8EunJ/KkV7we0yFmkRvYoIjzrrAGJqNY=; b=LHfniWWs6r5RLhzffL1/A8jMlV3JPTmkU1zxwMF/Bj6qFcITOkd+wL8iu78j/INcJy pqE1SFfxZfqpwR7VV+hUHqEC9SVJQFfjkcsymbBkGBfTJLYoAT/eqTNh8E6MI4tvqIuS rQselT4HHZLrZ6A+wiPyCPfJfC7EPJaEXM3aPJOs6vPCC0tEboZuKZuM1pcjnBUdRtuo pMUW14ki984Ss1WHNSylkUUEMTVrc+yqZnzwgnHH2xF0tBOgoPXIhSQlGBOP19Iwl6pD /TW/ImoBrBxT+u3602l5mb2KWKwu1HdkVUn/zcmPcZ4N3oA/cyEHTQwqzhuFD/Bi49Z1 /JyQ== X-Gm-Message-State: ABuFfojcvL/Z91US+EOyVa0V03jS/+LlobMEvH0ah6rrpe1YmYIfgQm6 ae6C8vfIMbe6D2SzVZXmBWsxvA== X-Google-Smtp-Source: ACcGV616Ni23vG7cv5gZMtBT532p0ATcugvZXDYiA8vCS57ovluCEHG206NtpC2pn3JwjAxyFrdPVA== X-Received: by 2002:a0d:f9c1:: with SMTP id j184-v6mr6683667ywf.286.1538754529535; Fri, 05 Oct 2018 08:48:49 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id x64-v6sm7592281ywx.103.2018.10.05.08.48.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 08:48:48 -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 2/4] drm/msm: Cut dpu_kms hooks from msm_pm_suspend/resume Date: Fri, 5 Oct 2018 11:48:41 -0400 Message-Id: <20181005154843.172326-3-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181005154843.172326-1-bzwang@chromium.org> References: <20181005154843.172326-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. Signed-off-by: Bruce Wang --- drivers/gpu/drm/msm/msm_drv.c | 28 ++++++++++------------------ drivers/gpu/drm/msm/msm_kms.h | 3 --- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 4904d0d41409..f987df7f10df 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1069,37 +1069,29 @@ 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 (!IS_ERR_OR_NULL(priv->pm_state)) + return 0; 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); - } - return 0; + return PTR_ERR_OR_ZERO(priv->pm_state); } 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 (IS_ERR_OR_NULL(priv->pm_state)) + return 0; - 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 == 0) + 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