From patchwork Tue Oct 9 04:27:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeykumar Sankaran X-Patchwork-Id: 10631867 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 49DEB16B1 for ; Tue, 9 Oct 2018 04:28:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A5429876 for ; Tue, 9 Oct 2018 04:28:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CEDB29A51; Tue, 9 Oct 2018 04:28:39 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 CB8E329876 for ; Tue, 9 Oct 2018 04:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbeJILng (ORCPT ); Tue, 9 Oct 2018 07:43:36 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60892 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbeJILnf (ORCPT ); Tue, 9 Oct 2018 07:43:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 11FA960D6F; Tue, 9 Oct 2018 04:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059317; bh=gJmJeaSaW3iawYH2a2MN1GDpmKIw5untKSXADbEwwxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mzsCvaJBn7BnT7gd0kqg3Smd+lTN9VsajC45sMy/caKUV4GsoILtp+1v+NFM5HnIA 75sSETxNOJDjPngqh0XJIufKvWAHZEC8oEzkLC1vVLcur2KX9MBlK1vjBdIRHvJK3U nHFSWHppLZEPL2j9Pvas2h9OFw4uhIo6Bkbjy6Zc= Received: from jeykumar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jsanka@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E300160C88; Tue, 9 Oct 2018 04:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059290; bh=gJmJeaSaW3iawYH2a2MN1GDpmKIw5untKSXADbEwwxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JIc4Levhj54Ivx4t0hPSrhQ1DUL0tBokpVcKkuHzhzkcTypzRmqzYEqQL7Jf6u1bM FZng8BHwp3iiXIklxVcQHH4TU2nN0PZSz4yqueGCZUmwPybcsTSsv7kCmSDPEMy/is wKGmVPNCp1mMKYfDCG/mskMiCwNC7Ll2kctFkjMo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E300160C88 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jsanka@codeaurora.org From: Jeykumar Sankaran To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: Jeykumar Sankaran , seanpaul@chromium.org, robdclark@gmail.com, hoegsberg@google.com, jcrouse@codeaurora.org Subject: [PATCH 15/25] drm/msm/dpu: avoid redundant hw blk reference Date: Mon, 8 Oct 2018 21:27:32 -0700 Message-Id: <1539059262-8326-16-git-send-email-jsanka@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539059262-8326-1-git-send-email-jsanka@codeaurora.org> References: <1539059262-8326-1-git-send-email-jsanka@codeaurora.org> 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 Get rid of hw block pointer in RM iter as we can access the same through dpu_hw_blk. Signed-off-by: Jeykumar Sankaran Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index a8461b8..3a92a3e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -47,12 +47,10 @@ struct dpu_rm_hw_blk { /** * struct dpu_rm_hw_iter - iterator for use with dpu_rm - * @hw: dpu_hw object requested, or NULL on failure * @blk: dpu_rm internal block representation. Clients ignore. Used as iterator. * @type: Hardware Block Type client wishes to search for. */ struct dpu_rm_hw_iter { - struct dpu_hw_blk *hw; struct dpu_rm_hw_blk *blk; enum dpu_hw_blk_type type; }; @@ -74,7 +72,6 @@ static bool _dpu_rm_get_hw_locked(struct dpu_rm *rm, struct dpu_rm_hw_iter *i) return false; } - i->hw = NULL; blk_list = &rm->hw_blks[i->type]; if (i->blk && (&i->blk->list == blk_list)) { @@ -84,12 +81,9 @@ static bool _dpu_rm_get_hw_locked(struct dpu_rm *rm, struct dpu_rm_hw_iter *i) i->blk = list_prepare_entry(i->blk, blk_list, list); - list_for_each_entry_continue(i->blk, blk_list, list) { - if (!i->blk->in_use) { - i->hw = i->blk->hw; + list_for_each_entry_continue(i->blk, blk_list, list) + if (!i->blk->in_use) return true; - } - } return false; }