From patchwork Thu Sep 20 16:49:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10608215 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 6F12015E8 for ; Thu, 20 Sep 2018 16:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E1472E179 for ; Thu, 20 Sep 2018 16:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 501A72E1A7; Thu, 20 Sep 2018 16:49:38 +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 CBFF42E179 for ; Thu, 20 Sep 2018 16:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbeITWd6 (ORCPT ); Thu, 20 Sep 2018 18:33:58 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:47086 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730936AbeITWd6 (ORCPT ); Thu, 20 Sep 2018 18:33:58 -0400 Received: by mail-yb1-f196.google.com with SMTP id y20-v6so4185579ybi.13 for ; Thu, 20 Sep 2018 09:49:35 -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=4WZsy5Eiep2NU6sOJGTxGG0XQeIOPdOWZgVtQq/ezUY=; b=SY+h323iyRYbHgprNumndfs8gbpwAyR9HMjuEGgxJn1f/+xYRYgXm1K5NtFTVQwZJB 7+/XAmEH6ub8nLBkPke4ZGJFUJOAXihL1/I3ywciNM0++650fHCuahI6SheSYahv+emC wpO1ngAU9TkKtnVnJCdGCsxbLG4zYXC626Pxw= 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=4WZsy5Eiep2NU6sOJGTxGG0XQeIOPdOWZgVtQq/ezUY=; b=Fldc9OmSDXFaLHwZxX05d5/3geCvwUfiSrr7VDCEoTgjfBDXgbIrjwKzOfQLlYMgDw 6y1P8B8UYdNMCZOyb+XD9tvUyUSd6HRPdldIji+Iv5uE8YYOzDs5H/FRHVk71jyBa4rN yiG496z5nRoTdtWP6jgZY9AeYAh5ATYcPpY65ADfALlSa8yWH/0chKgDxtbthAtve6YQ YnfvCR1+r7okRT6rR00QexUZK/Ygai4UbutTvbBz4QAlNS5wB29QnIJ+IaDOtorEm8RT LiCvq9Ea3loRh5uSlLMm9RnxYsimTqNjw0hwEuTbSLUXBM8AZosG/ouRSmXRt2yAEgx8 BXSg== X-Gm-Message-State: APzg51AhvAMCxnd7Pah73xEqPR2dA1WprQizIq3vT0Q50El5K+OQutco Cj0NJbVJ1x4fU26M3aCw/+G/Fg== X-Google-Smtp-Source: ANB0Vdb4mA3sZz8vV0LdfAnKdM7w6AtWZGfbiSqd4665kWftJ44+e+3wPiaUcVfM6e0Nf2LKd8oU1Q== X-Received: by 2002:a25:f02:: with SMTP id 2-v6mr18384765ybp.299.1537462175379; Thu, 20 Sep 2018 09:49:35 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id e126-v6sm6332688ywf.72.2018.09.20.09.49.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:49:34 -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 Subject: [PATCH v2 5/7] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void Date: Thu, 20 Sep 2018 12:49:22 -0400 Message-Id: <20180920164924.225847-6-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: <20180920164924.225847-1-bzwang@chromium.org> References: <20180920164924.225847-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 redundant tests for _dpu_crtc_vblank_enable_no_lock. Function return type is now void and all function calls have been changed accordingly. Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 42 ++++-------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 648d77c41c3e..0a2d52847655 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -782,24 +782,14 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc) * _dpu_crtc_vblank_enable_no_lock - update power resource and vblank request * @dpu_crtc: Pointer to dpu crtc structure * @enable: Whether to enable/disable vblanks - * - * @Return: error code */ -static int _dpu_crtc_vblank_enable_no_lock( +static void _dpu_crtc_vblank_enable_no_lock( struct dpu_crtc *dpu_crtc, bool enable) { - struct drm_device *dev; - struct drm_crtc *crtc; + struct drm_crtc *crtc = &dpu_crtc->base; + struct drm_device *dev = crtc->dev; struct drm_encoder *enc; - if (!dpu_crtc) { - DPU_ERROR("invalid crtc\n"); - return -EINVAL; - } - - crtc = &dpu_crtc->base; - dev = crtc->dev; - if (enable) { /* drop lock since power crtc cb may try to re-acquire lock */ mutex_unlock(&dpu_crtc->crtc_lock); @@ -834,8 +824,6 @@ static int _dpu_crtc_vblank_enable_no_lock( _dpu_crtc_power_enable(dpu_crtc, false); mutex_lock(&dpu_crtc->crtc_lock); } - - return 0; } /** @@ -846,7 +834,6 @@ static int _dpu_crtc_vblank_enable_no_lock( static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable) { struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); - int ret = 0; DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable); @@ -861,10 +848,7 @@ static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable) DPU_DEBUG("crtc%d suspend already set to %d, ignoring update\n", crtc->base.id, enable); else if (dpu_crtc->enabled && dpu_crtc->vblank_requested) { - ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, !enable); - if (ret) - DPU_ERROR("%s vblank enable failed: %d\n", - dpu_crtc->name, ret); + _dpu_crtc_vblank_enable_no_lock(dpu_crtc, !enable); } dpu_crtc->suspend = enable; @@ -965,7 +949,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc) struct drm_display_mode *mode; struct drm_encoder *encoder; struct msm_drm_private *priv; - int ret; unsigned long flags; if (!crtc || !crtc->dev || !crtc->dev->dev_private || !crtc->state) { @@ -996,10 +979,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc) trace_dpu_crtc_disable(DRMID(crtc), false, dpu_crtc); if (dpu_crtc->enabled && !dpu_crtc->suspend && dpu_crtc->vblank_requested) { - ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, false); - if (ret) - DPU_ERROR("%s vblank enable failed: %d\n", - dpu_crtc->name, ret); + _dpu_crtc_vblank_enable_no_lock(dpu_crtc, false); } dpu_crtc->enabled = false; @@ -1045,7 +1025,6 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, struct dpu_crtc *dpu_crtc; struct drm_encoder *encoder; struct msm_drm_private *priv; - int ret; if (!crtc || !crtc->dev || !crtc->dev->dev_private) { DPU_ERROR("invalid crtc\n"); @@ -1067,10 +1046,7 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc); if (!dpu_crtc->enabled && !dpu_crtc->suspend && dpu_crtc->vblank_requested) { - ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, true); - if (ret) - DPU_ERROR("%s vblank enable failed: %d\n", - dpu_crtc->name, ret); + _dpu_crtc_vblank_enable_no_lock(dpu_crtc, true); } dpu_crtc->enabled = true; @@ -1325,7 +1301,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) { struct dpu_crtc *dpu_crtc; - int ret; if (!crtc) { DPU_ERROR("invalid crtc\n"); @@ -1336,10 +1311,7 @@ int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) mutex_lock(&dpu_crtc->crtc_lock); trace_dpu_crtc_vblank(DRMID(&dpu_crtc->base), en, dpu_crtc); if (dpu_crtc->enabled && !dpu_crtc->suspend) { - ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, en); - if (ret) - DPU_ERROR("%s vblank enable failed: %d\n", - dpu_crtc->name, ret); + _dpu_crtc_vblank_enable_no_lock(dpu_crtc, en); } dpu_crtc->vblank_requested = en; mutex_unlock(&dpu_crtc->crtc_lock);