From patchwork Wed Sep 19 15:44:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606039 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 03DB71390 for ; Wed, 19 Sep 2018 15:44:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E92A9286DC for ; Wed, 19 Sep 2018 15:44:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC5162874A; Wed, 19 Sep 2018 15:44:28 +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 752C4286DC for ; Wed, 19 Sep 2018 15:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732469AbeISVW5 (ORCPT ); Wed, 19 Sep 2018 17:22:57 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:43059 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVW5 (ORCPT ); Wed, 19 Sep 2018 17:22:57 -0400 Received: by mail-yb1-f193.google.com with SMTP id w80-v6so2552896ybe.10 for ; Wed, 19 Sep 2018 08:44:26 -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=pWUoaHdWNYbT1VHvFbV5zRlmk2PD/DXO6SjUkzIlK6w=; b=AWnaeZbVwX0qeT/smEUKvChBtxTRxkksufyk4hxp4F4gYnc/PGV8sh+BsPDgrYe7fS HBhquPIwcohZV1d8ijjqwrG5LgbwmKGnXi5aikswKw8ajYZL+pCwzNMV9wO4wTQiLY0T mZC3ccLpxt+Eimzs/2lXKGWwT2d5Hrwt6hdho= 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=pWUoaHdWNYbT1VHvFbV5zRlmk2PD/DXO6SjUkzIlK6w=; b=ZbtiJjmNMoQJYUogQqJBdpUq2L68Jgqs9mRsQhN4KvSx3/fNnjGARBnK7lDwPnq/7+ WhsctGxLMeFyMyOa4s57lcWjH7AOssrz7mf/tyAAd7AZH0KYelyxWPd5DfHa/+cLd8LQ nWst5Frhj434L+BNxPJ/eTEVzuThahoBZwZuCgqtznJc/WzNhGX1GBcMB79wltN0YUHk bRJWQtt8ihY81yQdUpkJFr5Vp+h0pzPehJl3RrNx+FIycy3kmLSBuHaVezWwX12nE1lj sop5tC33r+4pRmlQLAlCbSuauI8oY+nB2MfnY7/MF6FCKmuev9Yl01dKliR3GxzrUnN4 FX3A== X-Gm-Message-State: APzg51DtfgjvWb0a/DIyYQSIowKiaDhFKMIWPOw6ZVKmU8RMkHYrQJ6c VjdwkxOINpVYZn7SqtdDaqX9ig== X-Google-Smtp-Source: ANB0VdZiBEC3pZ5ebeeSlt+VW4p5k9TJiLlqCZ1IFoODnFma3YeO0TVM0deRgsCAPfDsevbYPUsMYg== X-Received: by 2002:a25:b794:: with SMTP id n20-v6mr15768171ybh.130.1537371866333; Wed, 19 Sep 2018 08:44:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:25 -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 1/5] drm/msm/dpu: Remove unneeded checks from dpu_plane Date: Wed, 19 Sep 2018 11:44:11 -0400 Message-Id: <20180919154415.131292-2-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 some checks from dpu_plane.c that will never result in an error. Subsequent variable assignments become part of the initialization wherever possible. Signed-off-by: Bruce Wang --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 53 +++-------------------- 1 file changed, 6 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 1ce76460d710..a8d00f57f06a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -229,19 +229,11 @@ static u64 _dpu_plane_get_qos_lut(const struct dpu_qos_lut_tbl *tbl, static void _dpu_plane_set_qos_lut(struct drm_plane *plane, struct drm_framebuffer *fb) { - struct dpu_plane *pdpu; + struct dpu_plane *pdpu = to_dpu_plane(plane); const struct dpu_format *fmt = NULL; u64 qos_lut; u32 total_fl = 0, lut_usage; - if (!plane || !fb) { - DPU_ERROR("invalid arguments plane %d fb %d\n", - plane != 0, fb != 0); - return; - } - - pdpu = to_dpu_plane(plane); - if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) { DPU_ERROR("invalid arguments\n"); return; @@ -290,17 +282,10 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane, static void _dpu_plane_set_danger_lut(struct drm_plane *plane, struct drm_framebuffer *fb) { - struct dpu_plane *pdpu; + struct dpu_plane *pdpu = to_dpu_plane(plane); const struct dpu_format *fmt = NULL; u32 danger_lut, safe_lut; - if (!plane || !fb) { - DPU_ERROR("invalid arguments\n"); - return; - } - - pdpu = to_dpu_plane(plane); - if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) { DPU_ERROR("invalid arguments\n"); return; @@ -361,14 +346,7 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane, static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, bool enable, u32 flags) { - struct dpu_plane *pdpu; - - if (!plane) { - DPU_ERROR("invalid arguments\n"); - return; - } - - pdpu = to_dpu_plane(plane); + struct dpu_plane *pdpu = to_dpu_plane(plane); if (!pdpu->pipe_hw || !pdpu->pipe_sblk) { DPU_ERROR("invalid arguments\n"); @@ -452,16 +430,9 @@ static void _dpu_plane_set_ot_limit(struct drm_plane *plane, { struct dpu_plane *pdpu; struct dpu_vbif_set_ot_params ot_params; - struct msm_drm_private *priv; + struct msm_drm_private *priv = plane->dev->dev_private; struct dpu_kms *dpu_kms; - if (!plane || !plane->dev || !crtc) { - DPU_ERROR("invalid arguments plane %d crtc %d\n", - plane != 0, crtc != 0); - return; - } - - priv = plane->dev->dev_private; if (!priv || !priv->kms) { DPU_ERROR("invalid KMS reference\n"); return; @@ -496,15 +467,9 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane) { struct dpu_plane *pdpu; struct dpu_vbif_set_qos_params qos_params; - struct msm_drm_private *priv; + struct msm_drm_private *priv = plane->dev->dev_private; struct dpu_kms *dpu_kms; - if (!plane || !plane->dev) { - DPU_ERROR("invalid arguments\n"); - return; - } - - priv = plane->dev->dev_private; if (!priv || !priv->kms) { DPU_ERROR("invalid KMS reference\n"); return; @@ -1737,17 +1702,11 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, struct drm_plane *plane = NULL, *master_plane = NULL; const struct dpu_format_extended *format_list; struct dpu_plane *pdpu; - struct msm_drm_private *priv; + struct msm_drm_private *priv = dev->dev_private; struct dpu_kms *kms; int zpos_max = DPU_ZPOS_MAX; int ret = -EINVAL; - if (!dev) { - DPU_ERROR("[%u]device is NULL\n", pipe); - goto exit; - } - - priv = dev->dev_private; if (!priv) { DPU_ERROR("[%u]private data is NULL\n", pipe); goto exit; From patchwork Wed Sep 19 15:44:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606041 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 632F8913 for ; Wed, 19 Sep 2018 15:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C25286DC for ; Wed, 19 Sep 2018 15:44:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 475072874A; Wed, 19 Sep 2018 15:44:30 +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 E324E286DC for ; Wed, 19 Sep 2018 15:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732507AbeISVW7 (ORCPT ); Wed, 19 Sep 2018 17:22:59 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:36992 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVW7 (ORCPT ); Wed, 19 Sep 2018 17:22:59 -0400 Received: by mail-yw1-f68.google.com with SMTP id x83-v6so2456404ywd.4 for ; Wed, 19 Sep 2018 08:44:28 -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=xguB8uq+grSv3UIrFRlfF2AQzoRtxM+dUdZJImz3VFQ=; b=kz3BXxySSeTC/Kt8VVH6QdCpNk/+YDqJWVEPCsRSw7FGEf3q87BcO/0kbTMR9FEh4+ U20IjwAx2GdvcBlD+5JlukreziuJgC2vSzY66jXmNGR+Iw81cTTV4CWjbD7wuNQjQgI5 qOujQ+2E8gc5Z8vuHPaL8QSSs9tljPP896gNY= 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=xguB8uq+grSv3UIrFRlfF2AQzoRtxM+dUdZJImz3VFQ=; b=LkmNz1QlfSB2wawHJ8qEgWP/rfCWWGGwLEzft8Nb94mr1LzLuhdWxLA05Z+i3HLiw3 5yskhbHiY8WLNZ4xk+LRca75kSxnV/iBorxqg+u5oRIJh9BYa1vRYOmFAQ2ESEWlOqud aepybBDIq9ncauceLdy+9zh6I0CCUi2uDxuul0BoLfEA2pOx7Bi0BgUbiM/sF1ECvFtm 59+so2vk2DhSpKIEm8mq0CxxOWJBrtf4fTNwczi2+P9DqN+zwaE4TZ8WXOkB33ship7b WabtUkmNKg0uLwm9WmqZm/VRzPyIhWhRcO4flF0xKpaEj3HjPCRtZcpoHwnRLSzpM2C4 PgsQ== X-Gm-Message-State: APzg51DIb244foYzm1xWBx1n/OD91xWrKZSupVfJsvlWiNtWgbXd+NGF ciDayVSkwtgQxh67S14NkmEAEw== X-Google-Smtp-Source: ANB0VdZl4ri9xYPz0Xv9VhxyJybRV0ddKHYvWDpdAJ2pGdcuqOF6sLgrmAmHpoWiYRwelEmon+DMzg== X-Received: by 2002:a0d:f902:: with SMTP id j2-v6mr15436405ywf.62.1537371867783; Wed, 19 Sep 2018 08:44:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:26 -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 2/5] drm/msm/dpu: Clean up plane atomic disable/update Date: Wed, 19 Sep 2018 11:44:12 -0400 Message-Id: <20180919154415.131292-3-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 unnecessary checks from dpu_plane_atomic_disable, old_state argument for both dpu_plane_atomic_disable and dpu_plane_sspp_atomic_update is removed as it is no longer used. Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 31 +++++------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index a8d00f57f06a..7f6046166626 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1157,8 +1157,7 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error) pdpu->is_error = error; } -static void dpu_plane_sspp_atomic_update(struct drm_plane *plane, - struct drm_plane_state *old_state) +static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) { uint32_t src_flags; struct dpu_plane *pdpu = to_dpu_plane(plane); @@ -1271,27 +1270,11 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane, _dpu_plane_set_qos_remap(plane); } -static void _dpu_plane_atomic_disable(struct drm_plane *plane, - struct drm_plane_state *old_state) +static void _dpu_plane_atomic_disable(struct drm_plane *plane) { - struct dpu_plane *pdpu; - struct drm_plane_state *state; - struct dpu_plane_state *pstate; - - if (!plane) { - DPU_ERROR("invalid plane\n"); - return; - } else if (!plane->state) { - DPU_ERROR("invalid plane state\n"); - return; - } else if (!old_state) { - DPU_ERROR("invalid old state\n"); - return; - } - - pdpu = to_dpu_plane(plane); - state = plane->state; - pstate = to_dpu_plane_state(state); + struct dpu_plane *pdpu = to_dpu_plane(plane); + struct drm_plane_state *state = plane->state; + struct dpu_plane_state *pstate = to_dpu_plane_state(state); trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane), pstate->multirect_mode); @@ -1315,9 +1298,9 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, DPU_DEBUG_PLANE(pdpu, "\n"); if (!state->visible) { - _dpu_plane_atomic_disable(plane, old_state); + _dpu_plane_atomic_disable(plane); } else { - dpu_plane_sspp_atomic_update(plane, old_state); + dpu_plane_sspp_atomic_update(plane); } } From patchwork Wed Sep 19 15:44:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606043 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 210641390 for ; Wed, 19 Sep 2018 15:44:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EB8D286DC for ; Wed, 19 Sep 2018 15:44:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02CDE28826; Wed, 19 Sep 2018 15:44:31 +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 29FB4286DC for ; Wed, 19 Sep 2018 15:44:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732435AbeISVXA (ORCPT ); Wed, 19 Sep 2018 17:23:00 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:36994 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVXA (ORCPT ); Wed, 19 Sep 2018 17:23:00 -0400 Received: by mail-yw1-f65.google.com with SMTP id x83-v6so2456456ywd.4 for ; Wed, 19 Sep 2018 08:44:29 -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=JQGhaEhqhtBxos4ZcPNFTMtMCAsNOrEdyGZXcl+jlkw=; b=GUNegf6ssV2PBz1+jcU2RD93Fe25i83NuG+H1tp/iJSglTuQOut2px3dO1TOePWHsD OyuAiy/S+64Fl6hjsyetKik+sPnTOTP8HeOkE13btok/MAMRC/Z7ZIj8XgLeqSqi0J5O Y0d6trIn2IbngxAnL6S9Ushj/IW+NQBxAoj8U= 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=JQGhaEhqhtBxos4ZcPNFTMtMCAsNOrEdyGZXcl+jlkw=; b=VXfNy8XIjEIgual5l1nU3jYhJbI9CsmbAGwOMldpICRVhHg3uxLXxpO2fse/Hxhq1D NuxF4EZXBI/cPFUEG5JgPWvWxd7Ao74sancK7z9tLd2IztOtFq3KTrRaubX+7HyrfMB8 t+cVa4Yclh7c+2fkI4n+74kV9mRpME63x4D2FrV5LyKkxxvdt2lCWbcQWCb4XSwWEG1C Xxkd0iPldmKjRp6FAWZyhMockrXPHdyuDiE6rvYxdusK8HBDQb1dhRsr1Qi5YowuVdC1 PiGls0C0WFFIRkE8ZqeGBaeHRROmnZEjTElF0AKEtE8AmLDQiKBSJyz2pkgzGvPL7otI Zbgw== X-Gm-Message-State: APzg51BNxIyFcxramQtvOMyfC+unENjeVv9tU/myG1Lh2RYt/ISAZX28 BQTkruWNITf+YuMgXwAckSERxg== X-Google-Smtp-Source: ANB0VdbK8DJGXsQh7/hWc2AyRQCBUR+3lvh0ZZEL8eAgOBdO0omIlcOgXAjY88iqImXMDs30jWr5Gg== X-Received: by 2002:a0d:d905:: with SMTP id b5-v6mr14660315ywe.416.1537371869321; Wed, 19 Sep 2018 08:44:29 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:28 -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 3/5] drm/msm/dpu: Remove impossible checks Date: Wed, 19 Sep 2018 11:44:13 -0400 Message-Id: <20180919154415.131292-4-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 additional impossible checks in dpu_plane.c and dpu_crtc.c. Variable assignments are moved up to be initializations where possible. Some variables are no longer used, these are removed. Signed-off-by: Bruce Wang --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 121 +++------------------- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 +-- 2 files changed, 17 insertions(+), 120 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index a8f2dd7a37c7..017d16131dac 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -55,17 +55,7 @@ static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate, static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) { - struct msm_drm_private *priv; - - if (!crtc || !crtc->dev || !crtc->dev->dev_private) { - DPU_ERROR("invalid crtc\n"); - return NULL; - } - priv = crtc->dev->dev_private; - if (!priv || !priv->kms) { - DPU_ERROR("invalid kms\n"); - return NULL; - } + struct msm_drm_private *priv = crtc->dev->dev_private; return to_dpu_kms(priv->kms); } @@ -177,28 +167,17 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, struct drm_plane *plane; struct drm_framebuffer *fb; struct drm_plane_state *state; - struct dpu_crtc_state *cstate; + struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state); struct dpu_plane_state *pstate = NULL; struct dpu_format *format; - struct dpu_hw_ctl *ctl; - struct dpu_hw_mixer *lm; - struct dpu_hw_stage_cfg *stage_cfg; + struct dpu_hw_ctl *ctl = mixer->lm_ctl; + struct dpu_hw_stage_cfg *stage_cfg = &dpu_crtc->stage_cfg; u32 flush_mask; uint32_t stage_idx, lm_idx; int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 }; bool bg_alpha_enable = false; - if (!dpu_crtc || !mixer) { - DPU_ERROR("invalid dpu_crtc or mixer\n"); - return; - } - - ctl = mixer->lm_ctl; - lm = mixer->hw_lm; - stage_cfg = &dpu_crtc->stage_cfg; - cstate = to_dpu_crtc_state(crtc->state); - drm_atomic_crtc_for_each_plane(plane, crtc) { state = plane->state; if (!state) @@ -217,10 +196,6 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, state->fb ? state->fb->base.id : -1); format = to_dpu_format(msm_framebuffer_format(pstate->base.fb)); - if (!format) { - DPU_ERROR("invalid format\n"); - return; - } if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable) bg_alpha_enable = true; @@ -261,21 +236,13 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, */ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc) { - struct dpu_crtc *dpu_crtc; - struct dpu_crtc_state *cstate; - struct dpu_crtc_mixer *mixer; + struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); + struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state); + struct dpu_crtc_mixer *mixer = cstate->mixers; struct dpu_hw_ctl *ctl; struct dpu_hw_mixer *lm; - int i; - if (!crtc) - return; - - dpu_crtc = to_dpu_crtc(crtc); - cstate = to_dpu_crtc_state(crtc->state); - mixer = cstate->mixers; - DPU_DEBUG("%s\n", dpu_crtc->name); for (i = 0; i < cstate->num_mixers; i++) { @@ -377,7 +344,6 @@ static void dpu_crtc_vblank_cb(void *data) static void dpu_crtc_frame_event_work(struct kthread_work *work) { - struct msm_drm_private *priv; struct dpu_crtc_frame_event *fevent; struct drm_crtc *crtc; struct dpu_crtc *dpu_crtc; @@ -400,11 +366,6 @@ static void dpu_crtc_frame_event_work(struct kthread_work *work) dpu_crtc = to_dpu_crtc(crtc); dpu_kms = _dpu_crtc_get_kms(crtc); - if (!dpu_kms) { - DPU_ERROR("invalid kms handle\n"); - return; - } - priv = dpu_kms->dev->dev_private; DPU_ATRACE_BEGIN("crtc_frame_event"); DRM_DEBUG_KMS("crtc%d event:%u ts:%lld\n", crtc->base.id, fevent->event, @@ -470,11 +431,6 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event) unsigned long flags; u32 crtc_id; - if (!crtc || !crtc->dev || !crtc->dev->dev_private) { - DPU_ERROR("invalid parameters\n"); - return; - } - /* Nothing to do on idle event */ if (event & DPU_ENCODER_FRAME_EVENT_IDLE) return; @@ -583,23 +539,12 @@ static void _dpu_crtc_setup_mixers(struct drm_crtc *crtc) static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc, struct drm_crtc_state *state) { - struct dpu_crtc *dpu_crtc; - struct dpu_crtc_state *cstate; - struct drm_display_mode *adj_mode; - u32 crtc_split_width; + struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); + struct dpu_crtc_state *cstate = to_dpu_crtc_state(state); + struct drm_display_mode *adj_mode = &state->adjusted_mode; + u32 crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode); int i; - if (!crtc || !state) { - DPU_ERROR("invalid args\n"); - return; - } - - dpu_crtc = to_dpu_crtc(crtc); - cstate = to_dpu_crtc_state(state); - - adj_mode = &state->adjusted_mode; - crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode); - for (i = 0; i < cstate->num_mixers; i++) { struct drm_rect *r = &cstate->lm_bounds[i]; r->x1 = crtc_split_width * i; @@ -819,29 +764,12 @@ static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc) void dpu_crtc_commit_kickoff(struct drm_crtc *crtc) { struct drm_encoder *encoder; - struct drm_device *dev; - struct dpu_crtc *dpu_crtc; - struct msm_drm_private *priv; - struct dpu_kms *dpu_kms; - struct dpu_crtc_state *cstate; + struct drm_device *dev = crtc->dev; + struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); + struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc); + struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state); int ret; - if (!crtc) { - DPU_ERROR("invalid argument\n"); - return; - } - dev = crtc->dev; - dpu_crtc = to_dpu_crtc(crtc); - dpu_kms = _dpu_crtc_get_kms(crtc); - - if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev_private) { - DPU_ERROR("invalid argument\n"); - return; - } - - priv = dpu_kms->dev->dev_private; - cstate = to_dpu_crtc_state(crtc->state); - /* * If no mixers has been allocated in dpu_crtc_atomic_check(), * it means we are trying to start a CRTC whose state is disabled: @@ -969,24 +897,9 @@ 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; - struct msm_drm_private *priv; - struct dpu_kms *dpu_kms; + struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); int ret = 0; - if (!crtc || !crtc->dev || !crtc->dev->dev_private) { - DPU_ERROR("invalid crtc\n"); - return; - } - dpu_crtc = to_dpu_crtc(crtc); - priv = crtc->dev->dev_private; - - if (!priv->kms) { - DPU_ERROR("invalid crtc kms\n"); - return; - } - dpu_kms = to_dpu_kms(priv->kms); - DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable); mutex_lock(&dpu_crtc->crtc_lock); @@ -1673,8 +1586,6 @@ static int _dpu_crtc_init_debugfs(struct drm_crtc *crtc) dpu_crtc = to_dpu_crtc(crtc); dpu_kms = _dpu_crtc_get_kms(crtc); - if (!dpu_kms) - return -EINVAL; dpu_crtc->debugfs_root = debugfs_create_dir(dpu_crtc->name, crtc->dev->primary->debugfs_root); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 7f6046166626..0a223ac94cfb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -123,13 +123,8 @@ struct dpu_plane { static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) { - struct msm_drm_private *priv; + struct msm_drm_private *priv = plane->dev->dev_private; - if (!plane || !plane->dev) - return NULL; - priv = plane->dev->dev_private; - if (!priv) - return NULL; return to_dpu_kms(priv->kms); } @@ -514,10 +509,6 @@ static int _dpu_plane_get_aspace( } kms = _dpu_plane_get_kms(&pdpu->base); - if (!kms) { - DPU_ERROR("invalid kms\n"); - return -EINVAL; - } *aspace = kms->base.aspace; @@ -1690,11 +1681,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, int zpos_max = DPU_ZPOS_MAX; int ret = -EINVAL; - if (!priv) { - DPU_ERROR("[%u]private data is NULL\n", pipe); - goto exit; - } - if (!priv->kms) { DPU_ERROR("[%u]invalid KMS reference\n", pipe); goto exit; From patchwork Wed Sep 19 15:44:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606045 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 63FED1390 for ; Wed, 19 Sep 2018 15:44:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 547B528714 for ; Wed, 19 Sep 2018 15:44:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48A18286DC; Wed, 19 Sep 2018 15:44:33 +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 DDE8E286DC for ; Wed, 19 Sep 2018 15:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732527AbeISVXC (ORCPT ); Wed, 19 Sep 2018 17:23:02 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:35464 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVXC (ORCPT ); Wed, 19 Sep 2018 17:23:02 -0400 Received: by mail-yw1-f66.google.com with SMTP id 14-v6so2456602ywe.2 for ; Wed, 19 Sep 2018 08:44:31 -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=ah6vEE8a0Oo8APzDXS7KTOfBCzYSCNJjfPi8NKZ5qsw=; b=fgTtus+rUa2YevHC1AfliG74TRLa0rmkMYQyWYZL3RNeY0LYC4TpiFP5n8219OvmwZ F7Q8+Ko/RNab93Dz89rExDZ7p8ZAzjnQWHhuFwiAEph0qp4fbvAHG6sfbVlsr1SV+fhy FV/Um1dJXl+sDrfSMI4XU6GmOHEUBl9u9gXVY= 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=ah6vEE8a0Oo8APzDXS7KTOfBCzYSCNJjfPi8NKZ5qsw=; b=BppqgY8jHybGD5KxqOV10KaPKFxx0RefG7qZRdtvw3MPnE+HB3I0YwFmJgoTJgN4Ex Ie46zp9czD6nHBiz0GQ8bcUwL6/tBPSlHSUOCNGt66VD3kLrlRbjXMfk1q8ozxLxKI8s imyPxY8JoN8A+1/lFKFLd06DgGPAlr/Z16rsrSOuXvARtD3/Y5Gf8suSWjM9GV9zJ+Pb 7/80rvc6CPs//F+yOFQWkph47FnTAa/oCgQHjSCxZfQYRd275ap7OcmXj88iwOxGaQdZ T9RvtoUtxYTtsaOlaLQkn7yDuo886jczSpVxx2wyJ/ZKz7TOaxRbBV5mVFoZYNoE+hwk fFSA== X-Gm-Message-State: APzg51B6bLLINEnDaO8zReHhQZaJk9mxWm2NeySY3CV9S21UtVwNakr+ aTvSOzyJDbbJXWNlxg7Y+zFGig== X-Google-Smtp-Source: ANB0VdZTTt9nVs+LBj+z0BvZjV5eXcCnaC2jfx66w9BZe+qKJKVPg3ZURPy88g9ZpVPBseI24gXP6g== X-Received: by 2002:a81:ac44:: with SMTP id z4-v6mr14689429ywj.31.1537371870894; Wed, 19 Sep 2018 08:44:30 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:29 -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 4/5] drm/msm/dpu: Change _dpu_crtc_power_enable to void Date: Wed, 19 Sep 2018 11:44:14 -0400 Message-Id: <20180919154415.131292-5-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 All checks for _dpu_crtc_power_enable are not true, so the function can never return an error code. All calls of the function have also been changed so that they don't expect a return value. Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 35 ++++-------------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 017d16131dac..f0b52281c46f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -60,37 +60,16 @@ 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) +static inline void _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); + struct drm_crtc *crtc = &dpu_crtc->base; + struct msm_drm_private *priv = crtc->dev->dev_private; + struct dpu_kms *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) @@ -849,14 +828,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); + _dpu_crtc_power_enable(dpu_crtc, true); 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) 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);