From patchwork Wed Sep 26 21:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10616909 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 B1B5B180E for ; Wed, 26 Sep 2018 21:29:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1E6D2A5B6 for ; Wed, 26 Sep 2018 21:29:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95BC02B7AF; Wed, 26 Sep 2018 21:29:03 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, TVD_SUBJ_WIPE_DEBT 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 359BA2A5B6 for ; Wed, 26 Sep 2018 21:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726107AbeI0Dn4 (ORCPT ); Wed, 26 Sep 2018 23:43:56 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:42694 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727026AbeI0Dn4 (ORCPT ); Wed, 26 Sep 2018 23:43:56 -0400 Received: by mail-yb1-f194.google.com with SMTP id p74-v6so197475ybc.9 for ; Wed, 26 Sep 2018 14:29:01 -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=WNfewpXYjSHzq7o/XsbFAqQODYoj7fjA1US2CmvNiZY=; b=iVk+YJ3uhzgQXLSZEVwvykA+CQVc4j/rF4PXCqL/x7P7i8+kj1B3faQ7AX9EWYhj9Z SwjOG1pgq+H8s+PgDS7JPiQy60noRNmLMcl9UmGRPiBDuv0d8RigNrUC2EV09GWdcuez FD3M43Lchcv4cbvPTpzO/8f3FkrN6144tbfWA= 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=WNfewpXYjSHzq7o/XsbFAqQODYoj7fjA1US2CmvNiZY=; b=mpBr5/+OmSp2SkDLTE7zsdp4sGgosuF/Hfndi5ohqCzEhDadIvplw04QY14IjJsbzL RS1AuHVubDBKE3SzP84DNvEbTjcEFWQTapL5EtvKcBqeY+45jZpa1+KhuHK9eTm51LY7 lGVhn7hxgiG405J+gmx/iEeeZdZbcXQjDhZ3yJIIk2y2si89E3feZpGktvCj+tWu6unA PlFOq7EmaHce4YnC6EabOkdbYvNfw+mQw+T1938bsP2z3eW+/cdL5N7mPe82WU1s/iLs 0hwzz2IYUkSIoXq4XicqaB2OHNnguvRY5cqzjVrMwR1hmkvxMvUJuHI1EmOfMtdcqEOS 9jfw== X-Gm-Message-State: ABuFfohUQ7wBDDQWTvdpgPj2f8q7LTfHEfTslQYveyts91Jx05vm3obg jLzPDjUAM8jEQgPbjUYXIhXd/Q== X-Google-Smtp-Source: ACcGV626FOSFBLPSm+C4aiVY+gxt3mwOo2T2Dpp66jTFOp7p+3+vZGxGPW9WTp8W1d+YKvaPIzgBSA== X-Received: by 2002:a25:a426:: with SMTP id f35-v6mr4159231ybi.207.1537997341507; Wed, 26 Sep 2018 14:29:01 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id u143-v6sm240270ywc.28.2018.09.26.14.29.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 14:29:00 -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 v4 4/7] drm/msm/dpu: Remove _dpu_crtc_power_enable Date: Wed, 26 Sep 2018 17:28:59 -0400 Message-Id: <20180926212859.18097-1-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20180926081042.GN72545@art_vandelay> References: <20180926081042.GN72545@art_vandelay> 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 All checks for _dpu_crtc_power_enable are not true, so the function can never return an error code. This removes the need for the function as pm_runtime functions can be used instead. v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and _dpu_crtc_power_disable for clarity. v4: Removed both _dpu_crtc_power_enable and _dpu_crtc_power_disable and called pm_runtime_get_sync and pm_runtime_put_sync from all call points Signed-off-by: Bruce Wang Reviewed-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 41 ++---------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index e31e70f5dbac..c5373a6b51e9 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -60,39 +60,6 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) return to_dpu_kms(priv->kms); } -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable) -{ - struct drm_crtc *crtc; - struct msm_drm_private *priv; - struct dpu_kms *dpu_kms; - - if (!dpu_crtc) { - DPU_ERROR("invalid dpu crtc\n"); - return -EINVAL; - } - - crtc = &dpu_crtc->base; - if (!crtc->dev || !crtc->dev->dev_private) { - DPU_ERROR("invalid drm device\n"); - return -EINVAL; - } - - priv = crtc->dev->dev_private; - if (!priv->kms) { - DPU_ERROR("invalid kms\n"); - return -EINVAL; - } - - dpu_kms = to_dpu_kms(priv->kms); - - if (enable) - pm_runtime_get_sync(&dpu_kms->pdev->dev); - else - pm_runtime_put_sync(&dpu_kms->pdev->dev); - - return 0; -} - static void dpu_crtc_destroy(struct drm_crtc *crtc) { struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); @@ -823,14 +790,10 @@ static int _dpu_crtc_vblank_enable_no_lock( dev = crtc->dev; if (enable) { - int ret; - /* drop lock since power crtc cb may try to re-acquire lock */ mutex_unlock(&dpu_crtc->crtc_lock); - ret = _dpu_crtc_power_enable(dpu_crtc, true); + pm_runtime_get_sync(dev->dev); mutex_lock(&dpu_crtc->crtc_lock); - if (ret) - return ret; list_for_each_entry(enc, &dev->mode_config.encoder_list, head) { if (enc->crtc != crtc) @@ -857,7 +820,7 @@ static int _dpu_crtc_vblank_enable_no_lock( /* drop lock since power crtc cb may try to re-acquire lock */ mutex_unlock(&dpu_crtc->crtc_lock); - _dpu_crtc_power_enable(dpu_crtc, false); + pm_runtime_put_sync(dev->dev); mutex_lock(&dpu_crtc->crtc_lock); }