From patchwork Wed Sep 19 15:44:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606047 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 A684D913 for ; Wed, 19 Sep 2018 15:44:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96335286DC for ; Wed, 19 Sep 2018 15:44:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A66928826; Wed, 19 Sep 2018 15:44:35 +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 1B835286DC for ; Wed, 19 Sep 2018 15:44:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732559AbeISVXE (ORCPT ); Wed, 19 Sep 2018 17:23:04 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:46711 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVXE (ORCPT ); Wed, 19 Sep 2018 17:23:04 -0400 Received: by mail-yw1-f68.google.com with SMTP id j131-v6so2436307ywc.13 for ; Wed, 19 Sep 2018 08:44:33 -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=wKc9XT6P/ph0wVDq8UzJvuBk1oFrirvEh5jCgOWA1ZE=; b=Bp02UYkByS+YHj4GhWXk3Wz8gDzztwzCnpP0EoV4GuKHZo5XleZ3YRTKsyfGHsq/Qy wndQ0LoLBF61i2vJZTQWccuOAsduH7D4B9IMzeURB0uZDvMVARTdue9WvnTPSd+YqZsC 1zD2lJ3LbZuZtKQxzXpQiINxXq+wpCwi1OuWk= 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=wKc9XT6P/ph0wVDq8UzJvuBk1oFrirvEh5jCgOWA1ZE=; b=MURn/5JX/Og59cw+pYGpdtQqGFYMkjMsFwmTwEqBopkwUzNY5i7qD4DAWyI/+briV8 41qUBVtKN8XZtqAMdSGC3yFlASTgXlwUVwjAUdRsiWfb+ndVBoB0buRywauEZ7Yp6gPa 6JhfAbdqiI6vhmXxr/oIopdh25jrKxseB/+2CO62q6oyZgwsvUduKbSX5BAnu4BnOPsa ynMcxvLEnmDkHrgT+aaLAvTmKf+dhGHEledLj48uBLrR3wKqiWwn90L8WlD80pimykpk OK4XQXVpBEI/BJCEbfUzFDaNaq1BacJpBZLjeXDrLy8TxDTgUoYsfD0xgDhxBZiRr1DA DejQ== X-Gm-Message-State: APzg51C1/Wc2Bpmpe5rERf4cptSHoMaUzTkTBkGJWvAsrMrqpfVTw1GD EmqPwiW4Autoq82xOJSnVHM/Cg== X-Google-Smtp-Source: ANB0VdZYNEnm4n2CQmlueNmk3rpZA6j5LDpkR8RCBO13ZZN8ZV8lAc61qe/zqh59eMO1b0Z6Z/0Ahg== X-Received: by 2002:a0d:ee01:: with SMTP id x1-v6mr14544654ywe.312.1537371872813; Wed, 19 Sep 2018 08:44:32 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id h10-v6sm4425921ywa.35.2018.09.19.08.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:31 -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, Bruce Wang Subject: [PATCH 5/5] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void Date: Wed, 19 Sep 2018 11:44:15 -0400 Message-Id: <20180919154415.131292-6-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.397.gdd90340f6a-goog In-Reply-To: <20180919154415.131292-1-bzwang@chromium.org> References: <20180919154415.131292-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 f0b52281c46f..8ce24a85e70b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -809,24 +809,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); @@ -861,8 +851,6 @@ static int _dpu_crtc_vblank_enable_no_lock( _dpu_crtc_power_enable(dpu_crtc, false); mutex_lock(&dpu_crtc->crtc_lock); } - - return 0; } /** @@ -873,7 +861,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); @@ -888,10 +875,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; @@ -1000,7 +984,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) { @@ -1031,10 +1014,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; @@ -1080,7 +1060,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"); @@ -1102,10 +1081,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; @@ -1360,7 +1336,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"); @@ -1371,10 +1346,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);