From patchwork Tue Oct 9 04:27:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeykumar Sankaran X-Patchwork-Id: 10631851 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 7231E1867 for ; Tue, 9 Oct 2018 04:28:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6590829876 for ; Tue, 9 Oct 2018 04:28:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59CF729A51; Tue, 9 Oct 2018 04:28:23 +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 DC53D29A4D for ; Tue, 9 Oct 2018 04:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725828AbeJILnU (ORCPT ); Tue, 9 Oct 2018 07:43:20 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60116 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbeJILnT (ORCPT ); Tue, 9 Oct 2018 07:43:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 54E8D60D92; Tue, 9 Oct 2018 04:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059301; bh=iiqicmKDhybcohdj7RL6Y73UCrY1VLsoC00Cg2M0c1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X06a3wOw+qUUrnC4FMsdlGPA6AhZao8w/ur8ce/6a2fj3IBhanYdUEqSessp1lsOZ M4YUZh6xg1xA8K+htH7n+1cLpc9KEIKqJQg9XkfOWwYkwutgo6X/XDHg8AKusBC9Pu k+2OvEaz4UGCU+zuTpUv6EiLEjLTa8oLu/Msk9tw= 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 26BD360DA8; Tue, 9 Oct 2018 04:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059286; bh=iiqicmKDhybcohdj7RL6Y73UCrY1VLsoC00Cg2M0c1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FwqD52LZ50pJ8CbqhIibbSBtHpOGo4JgjguiL5XL0l2yQKp9xrIzJntkEupBLD74l V62OjTsBH4TMZy5tya9y3H4cgnM/N3jZZCaF6lzh3Axn5hyZoq+zzePpL4dSeo5eVe DA5MEsibPsLP6zkEWmC3FcHm6pT11vsWPIlqAADs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 26BD360DA8 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 13/25] drm/msm/dpu: make RM iterator hw type specific Date: Mon, 8 Oct 2018 21:27:30 -0700 Message-Id: <1539059262-8326-14-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 Usage of hw block iterators are only RM internal. Instead of using generic void pointers for HW blocks, use dpu specific structure. It helps us to get rid of duplicate hw block id's maintained in RM wrapper. Signed-off-by: Jeykumar Sankaran Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index 561120d..303f1b3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -38,13 +38,11 @@ struct dpu_rm_requirements { /** * struct dpu_rm_hw_blk - hardware block tracking list member * @list: List head for list of all hardware blocks tracking items - * @id: Hardware ID number, within it's own space, ie. LM_X * @enc_id: Encoder id to which this blk is binded * @hw: Pointer to the hardware register access object for this block */ struct dpu_rm_hw_blk { struct list_head list; - uint32_t id; uint32_t enc_id; struct dpu_hw_blk *hw; }; @@ -57,7 +55,7 @@ struct dpu_rm_hw_blk { * @type: Hardware Block Type client wishes to search for. */ struct dpu_rm_hw_iter { - void *hw; + struct dpu_hw_blk *hw; struct dpu_rm_hw_blk *blk; uint32_t enc_id; enum dpu_hw_blk_type type; @@ -96,7 +94,7 @@ static bool _dpu_rm_get_hw_locked(struct dpu_rm *rm, struct dpu_rm_hw_iter *i) if (i->enc_id == i->blk->enc_id) { i->hw = i->blk->hw; DPU_DEBUG("found type %d id %d for enc %d\n", - i->type, i->blk->id, i->enc_id); + i->type, i->blk->hw->id, i->enc_id); return true; } } @@ -197,7 +195,6 @@ static int _dpu_rm_hw_blk_create( return -ENOMEM; } - blk->id = id; blk->hw = hw; blk->enc_id = 0; list_add_tail(&blk->list, &rm->hw_blks[type]); @@ -350,7 +347,7 @@ static bool _dpu_rm_check_lm_and_get_connected_blks( _dpu_rm_init_hw_iter(&iter, 0, DPU_HW_BLK_PINGPONG); while (_dpu_rm_get_hw_locked(rm, &iter)) { - if (iter.blk->id == lm_cfg->pingpong) { + if (iter.blk->hw->id == lm_cfg->pingpong) { *pp = iter.blk; break; } @@ -362,8 +359,8 @@ static bool _dpu_rm_check_lm_and_get_connected_blks( } if (RESERVED_BY_OTHER(*pp, enc_id)) { - DPU_DEBUG("lm %d pp %d already reserved\n", lm->id, - (*pp)->id); + DPU_DEBUG("lm %d pp %d already reserved\n", lm->hw->id, + (*pp)->hw->id); return false; } @@ -436,8 +433,8 @@ static int _dpu_rm_reserve_lms(struct dpu_rm *rm, uint32_t enc_id, dpu_cstate->mixers[i].hw_lm = to_dpu_hw_mixer(lm[i]->hw); dpu_cstate->mixers[i].hw_pp = to_dpu_hw_pingpong(pp[i]->hw); - trace_dpu_rm_reserve_lms(lm[i]->id, DPU_HW_BLK_LM, enc_id, - pp[i]->id); + trace_dpu_rm_reserve_lms(lm[i]->hw->id, DPU_HW_BLK_LM, enc_id, + pp[i]->hw->id); } dpu_cstate->num_mixers = lm_count; @@ -474,13 +471,13 @@ static int _dpu_rm_reserve_ctls( has_split_display = BIT(DPU_CTL_SPLIT_DISPLAY) & features; - DPU_DEBUG("ctl %d caps 0x%lX\n", iter.blk->id, features); + DPU_DEBUG("ctl %d caps 0x%lX\n", iter.blk->hw->id, features); if (needs_split_display != has_split_display) continue; ctls[i] = iter.blk; - DPU_DEBUG("ctl %d match\n", iter.blk->id); + DPU_DEBUG("ctl %d match\n", iter.blk->hw->id); if (++i == num_ctls) break; @@ -493,7 +490,7 @@ static int _dpu_rm_reserve_ctls( ctls[i]->enc_id = enc_id; dpu_cstate->hw_ctls[i] = to_dpu_hw_ctl(ctls[i]->hw); - trace_dpu_rm_reserve_ctls(ctls[i]->id, DPU_HW_BLK_CTL, + trace_dpu_rm_reserve_ctls(ctls[i]->hw->id, DPU_HW_BLK_CTL, enc_id); } @@ -513,7 +510,7 @@ static struct dpu_rm_hw_blk *_dpu_rm_reserve_intf( /* Find the block entry in the rm, and note the reservation */ _dpu_rm_init_hw_iter(&iter, 0, type); while (_dpu_rm_get_hw_locked(rm, &iter)) { - if (iter.blk->id != id) + if (iter.blk->hw->id != id) continue; if (RESERVED_BY_OTHER(iter.blk, enc_id)) { @@ -522,7 +519,7 @@ static struct dpu_rm_hw_blk *_dpu_rm_reserve_intf( } iter.blk->enc_id = enc_id; - trace_dpu_rm_reserve_intf(iter.blk->id, DPU_HW_BLK_INTF, + trace_dpu_rm_reserve_intf(iter.blk->hw->id, DPU_HW_BLK_INTF, enc_id); break; }