From patchwork Fri Nov 26 02:26:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 519678 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1729599imj; Thu, 25 Nov 2021 18:26:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJ+VoTY7bBYDcVNdw1XID8Zb4HGD7bfRDzswmPTjz14kVEstzw6fuhzdg2z/ZB9wb7REEn X-Received: by 2002:a65:55c1:: with SMTP id k1mr19015355pgs.84.1637893613332; Thu, 25 Nov 2021 18:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637893613; cv=none; d=google.com; s=arc-20160816; b=az4wkUO7fYpapV0+4UCgNM57xegrAo1IUGbLNNmizmdhcZLZ97Zrna3V4PRW1fsolA FG9b9GTeOoLXEvzH98b/j2GgNXbs2o2TxKPyG8wgMWYZudnqpQfIIOgEo9yT+yFLUPhp MNFVrmRAY/LJg3SWyYq5Iuem9Pt+WGQzHBXSloIdUxwFuG4duHyzo7KlpUz/RXrXkfVk XjSrjh1Nofy8nmGLpG4c/bN392xbRQx+cXZz9TYcDipkr70pdl2uRiS/DlujAf2Q9yFa gg+I+UOXlW9XtKZuYdMYSLdQOY4Y9VUN4LEwNuC+1kt54J+cPcLgy+yS51tkE2R/pIe2 sYOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=I1rm/Jq26oF750hAIzAZnETPbyjuEDPSRcantqm5hzk=; b=S7JgQLV3boWZlWg4WO7nR3Qa3poTdcstwbNi41JzCL1pyesQSi6jKulu6bu8K5THZV IY9yrbMfAyCnreMp+BBviYyI0xxPe2fF30fUfek3dpcD5eU67+4Xq1h5bhKmMh48UZuR bUPONV6K/Ms/c6fhi9MP2SdCazYJ5GJh2mSOZ2fOIMCQ+CguwnCspstaeL4FTaXrGY3/ Hs3kfkDIZSwJY28+8hTn7vgh8s5I51cK9LAywJaVNHbxjxFrVEeo9MPV+uDE5oSmYyUF Lr0RlPZPSofJLXsx8gvRwZDrIAd7rCxc8CEKRnomASaF1d4zj28MSBPShCpF4fUPBG5K sbIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p3RbkfyS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id y15si6581865pfp.195.2021.11.25.18.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:26:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p3RbkfyS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE8C16E435; Fri, 26 Nov 2021 02:26:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C66C6E43F for ; Fri, 26 Nov 2021 02:26:47 +0000 (UTC) Received: by mail-lf1-x134.google.com with SMTP id u3so20492954lfl.2 for ; Thu, 25 Nov 2021 18:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I1rm/Jq26oF750hAIzAZnETPbyjuEDPSRcantqm5hzk=; b=p3RbkfySYS15f3JktRp/ICFfXKUEOE5t/hoQQfLNrILJRnMKLNFPkAEEmHNa96vkhM L9BJgNowHwb/YT3zzXQRMNvZG5vlIHPIepPKJtDDYRDaFV/n7gXAiT+7T2rsGimtFqdO raV3Fb9/j+MPXqHOJNUXwq7xhevUdGooQWk+2PlCWIK5mejiJi3mwOyBhJVyrRfILXL4 mmcOKeah7zguMf+7nbzsFsdHcTpaLr4EER+D4FFJh12mMyZ/F9hlPg/R5IBGe9rg0Nmc QWr6KtjS4pDNjxWg9zuJTZ1MpqfVM5qiikfhhC6Cg1buA6fP15eBpCYQ6paQ4/5zgueP NJog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I1rm/Jq26oF750hAIzAZnETPbyjuEDPSRcantqm5hzk=; b=mcSarCtYS5/gADglBHeTgGjP2zv1M83adjT83xA/CHSVLxgvDUPn3co3ux1/huisog hKxoGyxtsu1kV+SttNtqyU3kNm52Rh+JIjFDAfUVmuXOLuzAeAZTbO19NC+3u/xUmtna hO7pkPHFGu6F7Gy2Sp+rZamt4j+LcQcsdAJjqH1AeVpUohY9HOgE2aNtidrSbttRAh+L IB59OnKMIqlmxxICNBhA2uA4nDO1OwmV/W/65841AZpBcbRAZyvd6B1JWshxlYPqSpA2 ZCLqqsT0xF6O+1lZDegofTp2SsrJvwWRKthHFiepWXysdNfYMoZv2oklNeLwrdr0PcVS OKRQ== X-Gm-Message-State: AOAM530cmq4L0jOoJ2FkHjhNVCOLHYu6oqKj8502u63CU+0QO2V++MhY k4a/ul5FTRzE5S1UXMKLTRGBNQ== X-Received: by 2002:a05:6512:1289:: with SMTP id u9mr27603853lfs.273.1637893605421; Thu, 25 Nov 2021 18:26:45 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x6sm388764lff.125.2021.11.25.18.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:26:45 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v3 1/3] drm/msm/dpu: consistently index dpu_kms->hw_vbif Date: Fri, 26 Nov 2021 05:26:40 +0300 Message-Id: <20211126022642.1105979-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> References: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Always use vbif_idx to index VBIFs in the dpu_kms->hw_vbif. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index a15b26428280..8e2236fe5039 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1057,7 +1057,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) for (i = 0; i < dpu_kms->catalog->vbif_count; i++) { u32 vbif_idx = dpu_kms->catalog->vbif[i].id; - dpu_kms->hw_vbif[i] = dpu_hw_vbif_init(vbif_idx, + dpu_kms->hw_vbif[vbif_idx] = dpu_hw_vbif_init(vbif_idx, dpu_kms->vbif[vbif_idx], dpu_kms->catalog); if (IS_ERR_OR_NULL(dpu_kms->hw_vbif[vbif_idx])) { rc = PTR_ERR(dpu_kms->hw_vbif[vbif_idx]); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c index 21d20373eb8b..bd328b5c6306 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c @@ -152,14 +152,12 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, struct dpu_hw_mdp *mdp; bool forced_on = false; u32 ot_lim; - int ret, i; + int ret; mdp = dpu_kms->hw_mdp; - for (i = 0; i < ARRAY_SIZE(dpu_kms->hw_vbif); i++) { - if (dpu_kms->hw_vbif[i] && - dpu_kms->hw_vbif[i]->idx == params->vbif_idx) - vbif = dpu_kms->hw_vbif[i]; + if (params->vbif_idx < VBIF_MAX) { + vbif = dpu_kms->hw_vbif[params->vbif_idx]; } if (!vbif || !mdp) { From patchwork Fri Nov 26 02:26:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 519681 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1729696imj; Thu, 25 Nov 2021 18:27:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEzOvGIO9ONYBTkLPOvNHehcIaQMhDI6DGQy3Z8fS1d/I8IdHPax45ZQGoMKTu6UC8Nb/8 X-Received: by 2002:a63:4c09:: with SMTP id z9mr5184431pga.561.1637893621664; Thu, 25 Nov 2021 18:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637893621; cv=none; d=google.com; s=arc-20160816; b=CpdXahL4jJAO5M1/661QGibuGLl745JkduOjjLGEMB8HRLVHAUEZisAu4WKryNa0FL l+i/qWg1JEN9F61/p+fHjhRVEu8g8PTpUSPRFT3bwKVLg+ebgrmLljZbrz796Hafeb4T wQcdvLFZ3el6H+eEu1LZdtnLe8KryuGI8lDzxVA4k9QuHAh96Vkxfpq0ixUaBTaZqnen T5apidFFF9S3F2oFwjVniWfAYUIjXHswIht9VsYNcuvgROrD4zMgrRE0GKOU2FNthGoq uZR4IEnbXOCmjsli1Tj2NCp/Lqopu/GQs1LOcd7ueUs2v4CmEsnzX8f3XRPRUSaAYkrJ rQEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=80LKuN/tcEA+Bcj0tg6X3nyrCTUndXNZko1Vc1kJ9dQ=; b=Onm5emAkviRYvQMKjh+pdS/vQwEPtrVHu1lrcVOOPY7yQdC80LWQ0KZaqzZzRc9R+Q 1dCQcqyJjE8k2CjesL1WupmPbwdjsz5MRwcFMmHmGHEO2qkxTjCyv/qVrQBg9oD2bJN7 MQMQkxSY0lhP2E0WoZe1HWMPoaOtyP19DoVwwwgqTG1wzw561X+6TBYTxzwy09T16qhi vOAIhahhvPrKudU8Lah1VSId0y8fiw10DfnnGX+dXGkPeeSD59qdC4VPaGOKM43UQAFn tEAkrw0B7hJ1peesFku71Q69KBIUtVjqtm8eL6kDOY2E8JIlZT5+R7tTJdb1kLF1GYYc vCJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rXZcx0cI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 17si7003426pli.284.2021.11.25.18.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:27:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rXZcx0cI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E866B6E4B7; Fri, 26 Nov 2021 02:26:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by gabe.freedesktop.org (Postfix) with ESMTPS id F12B16E448 for ; Fri, 26 Nov 2021 02:26:47 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id bu18so20631928lfb.0 for ; Thu, 25 Nov 2021 18:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=80LKuN/tcEA+Bcj0tg6X3nyrCTUndXNZko1Vc1kJ9dQ=; b=rXZcx0cICa+WZma5dmy+PY9lYpLq2T3ISIfUMy+atBDDpn00ElUPLSoTwNM6sKWrjF IN9lugWTjzjsM2vyGPpOArhvOJfJGSC8ChzWF09Cgq3mR9qdng5hV2EXr8JUrZ5pkD9h c2lzl2Zt3Yn6x5+C50f7izp8YoFSgctDhcSkAY1S8oW3OMyHrwJ7pJBAreplDBlO/QT5 x8Bu5XMaAW0dC4BrTPnN5c+QbzoHHOFsEOrHkn+z06vqb3M4c+P88zivIcmboMEFpMJo urIiFBr9IYlDktOwRnI1F+RTAcH3zFtUrz/l1V18F/H6uyNtzNG/4QplV5oMvCRVYzf3 5Abg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=80LKuN/tcEA+Bcj0tg6X3nyrCTUndXNZko1Vc1kJ9dQ=; b=0YfoP43c+u/Fu+J8K2gWDv9GNoO7japtYoVcAyp5uTWk0rg9xlbjsPxi5LFw+2OsJw vzGg0y191QynMqRZFH9U1z5Sr5MttcjINTUl4ot5H0Tuewcx0j5u4O67eRjfGB9VVvWl odZeq+KHhrO7ux0c/WNoWkUlV5SUfR+NLQN2XqZdNFGUUmmZKpOg53SRtdV+K7KENK8f c4UTig9j670dldiMXr3U05voZwKKblVHlxK9QbU6/Ob1A9BDok9QkFo1B+7fn2YR5sF8 aKO8fS68rwTXt7VZNNfCmgaEVpEyNWS9ZdCJlR7+AQU/3ds+QDb6bYpvNVmc8eGe4aJ7 yrcg== X-Gm-Message-State: AOAM531IM9j5eCjZMmwk4m3IQK86Rlq1hFleE+ognUGcM3z2pCr6cKVi BtTfDucAEtx92fzkNfTW32BJTw== X-Received: by 2002:a05:6512:2615:: with SMTP id bt21mr28804976lfb.129.1637893606195; Thu, 25 Nov 2021 18:26:46 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x6sm388764lff.125.2021.11.25.18.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:26:45 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v3 2/3] drm/msm/dpu: get INTF blocks directly rather than through RM Date: Fri, 26 Nov 2021 05:26:41 +0300 Message-Id: <20211126022642.1105979-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> References: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" INTF blocks are not really handled by resource manager, they are assigned at dpu_encoder_setup_display using dpu_encoder_get_intf(). Then this allocation is passed to RM and then returned to then dpu_encoder. So allocate them outside of RM and use them directly. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 36 +------- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 16 ---- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 5 - .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 -- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 8 -- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 24 +++++ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 92 ------------------- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 2 - 9 files changed, 28 insertions(+), 165 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index e7ee4cfb8461..95674bbf75f0 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -420,26 +420,6 @@ int dpu_encoder_get_linecount(struct drm_encoder *drm_enc) return linecount; } -void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc, - struct dpu_encoder_hw_resources *hw_res) -{ - struct dpu_encoder_virt *dpu_enc = NULL; - int i = 0; - - dpu_enc = to_dpu_encoder_virt(drm_enc); - DPU_DEBUG_ENC(dpu_enc, "\n"); - - /* Query resources used by phys encs, expected to be without overlap */ - memset(hw_res, 0, sizeof(*hw_res)); - - for (i = 0; i < dpu_enc->num_phys_encs; i++) { - struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i]; - - if (phys->ops.get_hw_resources) - phys->ops.get_hw_resources(phys, hw_res); - } -} - static void dpu_encoder_destroy(struct drm_encoder *drm_enc) { struct dpu_encoder_virt *dpu_enc = NULL; @@ -973,7 +953,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, struct dpu_hw_blk *hw_lm[MAX_CHANNELS_PER_ENC]; struct dpu_hw_blk *hw_dspp[MAX_CHANNELS_PER_ENC] = { NULL }; int num_lm, num_ctl, num_pp; - int i, j; + int i; if (!drm_enc) { DPU_ERROR("invalid encoder\n"); @@ -1043,8 +1023,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, cstate->num_mixers = num_lm; for (i = 0; i < dpu_enc->num_phys_encs; i++) { - int num_blk; - struct dpu_hw_blk *hw_blk[MAX_CHANNELS_PER_ENC]; struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i]; if (!dpu_enc->hw_pp[i]) { @@ -1062,16 +1040,8 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, phys->hw_pp = dpu_enc->hw_pp[i]; phys->hw_ctl = to_dpu_hw_ctl(hw_ctl[i]); - num_blk = dpu_rm_get_assigned_resources(&dpu_kms->rm, - global_state, drm_enc->base.id, DPU_HW_BLK_INTF, - hw_blk, ARRAY_SIZE(hw_blk)); - for (j = 0; j < num_blk; j++) { - struct dpu_hw_intf *hw_intf; - - hw_intf = to_dpu_hw_intf(hw_blk[i]); - if (hw_intf->idx == phys->intf_idx) - phys->hw_intf = hw_intf; - } + if (phys->intf_idx >= INTF_0 && phys->intf_idx < INTF_MAX) + phys->hw_intf = dpu_kms->hw_intf[phys->intf_idx]; if (!phys->hw_intf) { DPU_ERROR_ENC(dpu_enc, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h index e241914a9677..722dd7db6bdf 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h @@ -18,22 +18,6 @@ #define IDLE_TIMEOUT (66 - 16/2) -/** - * Encoder functions and data types - * @intfs: Interfaces this encoder is using, INTF_MODE_NONE if unused - */ -struct dpu_encoder_hw_resources { - enum dpu_intf_mode intfs[INTF_MAX]; -}; - -/** - * dpu_encoder_get_hw_resources - Populate table of required hardware resources - * @encoder: encoder pointer - * @hw_res: resource table to populate with encoder required resources - */ -void dpu_encoder_get_hw_resources(struct drm_encoder *encoder, - struct dpu_encoder_hw_resources *hw_res); - /** * dpu_encoder_assign_crtc - Link the encoder to the crtc it's assigned to * @encoder: encoder pointer diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index e7270eb6b84b..42febfce79c7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -91,9 +91,6 @@ struct dpu_encoder_virt_ops { * @disable: DRM Call. Disable mode. * @atomic_check: DRM Call. Atomic check new DRM state. * @destroy: DRM Call. Destroy and release resources. - * @get_hw_resources: Populate the structure with the hardware - * resources that this phys_enc is using. - * Expect no overlap between phys_encs. * @control_vblank_irq Register/Deregister for VBLANK IRQ * @wait_for_commit_done: Wait for hardware to have flushed the * current pending frames to hardware @@ -129,8 +126,6 @@ struct dpu_encoder_phys_ops { struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state); void (*destroy)(struct dpu_encoder_phys *encoder); - void (*get_hw_resources)(struct dpu_encoder_phys *encoder, - struct dpu_encoder_hw_resources *hw_res); int (*control_vblank_irq)(struct dpu_encoder_phys *enc, bool enable); int (*wait_for_commit_done)(struct dpu_encoder_phys *phys_enc); int (*wait_for_tx_complete)(struct dpu_encoder_phys *phys_enc); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 34a6940d12c5..7d2beea9cc4e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -534,13 +534,6 @@ static void dpu_encoder_phys_cmd_destroy(struct dpu_encoder_phys *phys_enc) kfree(cmd_enc); } -static void dpu_encoder_phys_cmd_get_hw_resources( - struct dpu_encoder_phys *phys_enc, - struct dpu_encoder_hw_resources *hw_res) -{ - hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_CMD; -} - static void dpu_encoder_phys_cmd_prepare_for_kickoff( struct dpu_encoder_phys *phys_enc) { @@ -736,7 +729,6 @@ static void dpu_encoder_phys_cmd_init_ops( ops->enable = dpu_encoder_phys_cmd_enable; ops->disable = dpu_encoder_phys_cmd_disable; ops->destroy = dpu_encoder_phys_cmd_destroy; - ops->get_hw_resources = dpu_encoder_phys_cmd_get_hw_resources; ops->control_vblank_irq = dpu_encoder_phys_cmd_control_vblank_irq; ops->wait_for_commit_done = dpu_encoder_phys_cmd_wait_for_commit_done; ops->prepare_for_kickoff = dpu_encoder_phys_cmd_prepare_for_kickoff; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 185379b18572..9863e5ee61f4 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -465,13 +465,6 @@ static void dpu_encoder_phys_vid_destroy(struct dpu_encoder_phys *phys_enc) kfree(phys_enc); } -static void dpu_encoder_phys_vid_get_hw_resources( - struct dpu_encoder_phys *phys_enc, - struct dpu_encoder_hw_resources *hw_res) -{ - hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO; -} - static int dpu_encoder_phys_vid_wait_for_vblank( struct dpu_encoder_phys *phys_enc) { @@ -680,7 +673,6 @@ static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops) ops->enable = dpu_encoder_phys_vid_enable; ops->disable = dpu_encoder_phys_vid_disable; ops->destroy = dpu_encoder_phys_vid_destroy; - ops->get_hw_resources = dpu_encoder_phys_vid_get_hw_resources; ops->control_vblank_irq = dpu_encoder_phys_vid_control_vblank_irq; ops->wait_for_commit_done = dpu_encoder_phys_vid_wait_for_commit_done; ops->wait_for_vblank = dpu_encoder_phys_vid_wait_for_vblank; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 8e2236fe5039..cf9a24777f76 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -741,6 +741,12 @@ static void _dpu_kms_hw_destroy(struct dpu_kms *dpu_kms) if ((vbif_idx < VBIF_MAX) && dpu_kms->hw_vbif[vbif_idx]) dpu_hw_vbif_destroy(dpu_kms->hw_vbif[vbif_idx]); } + for (i = 0; i < dpu_kms->catalog->intf_count; i++) { + u32 intf_idx = dpu_kms->catalog->intf[i].id; + + if ((intf_idx < INTF_MAX) && dpu_kms->hw_intf[intf_idx]) + dpu_hw_intf_destroy(dpu_kms->hw_intf[intf_idx]); + } } if (dpu_kms->rm_init) @@ -1069,6 +1075,24 @@ static int dpu_kms_hw_init(struct msm_kms *kms) } } + for (i = 0; i < dpu_kms->catalog->intf_count; i++) { + u32 intf_idx = dpu_kms->catalog->intf[i].id; + + if (dpu_kms->catalog->intf[i].type == INTF_NONE) + continue; + + dpu_kms->hw_intf[intf_idx] = dpu_hw_intf_init(intf_idx, + dpu_kms->mmio, dpu_kms->catalog); + if (IS_ERR_OR_NULL(dpu_kms->hw_intf[intf_idx])) { + rc = PTR_ERR(dpu_kms->hw_intf[intf_idx]); + if (!dpu_kms->hw_intf[intf_idx]) + rc = -EINVAL; + DPU_ERROR("failed to init intf %d: %d\n", intf_idx, rc); + dpu_kms->hw_intf[intf_idx] = NULL; + goto power_error; + } + } + rc = dpu_core_perf_init(&dpu_kms->perf, dev, dpu_kms->catalog, _dpu_kms_get_clk(dpu_kms, "core")); if (rc) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h index 775bcbda860f..48b59971ee8e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h @@ -106,6 +106,7 @@ struct dpu_kms { bool rm_init; struct dpu_hw_vbif *hw_vbif[VBIF_MAX]; + struct dpu_hw_intf *hw_intf[INTF_MAX]; struct dpu_hw_mdp *hw_mdp; bool has_danger_ctrl; @@ -144,7 +145,6 @@ struct dpu_global_state { uint32_t pingpong_to_enc_id[PINGPONG_MAX - PINGPONG_0]; uint32_t mixer_to_enc_id[LM_MAX - LM_0]; uint32_t ctl_to_enc_id[CTL_MAX - CTL_0]; - uint32_t intf_to_enc_id[INTF_MAX - INTF_0]; uint32_t dspp_to_enc_id[DSPP_MAX - DSPP_0]; }; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index f9c83d6e427a..d8d3f87a0ed2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -28,7 +28,6 @@ static inline bool reserved_by_other(uint32_t *res_map, int idx, */ struct dpu_rm_requirements { struct msm_display_topology topology; - struct dpu_encoder_hw_resources hw_res; }; int dpu_rm_destroy(struct dpu_rm *rm) @@ -67,14 +66,6 @@ int dpu_rm_destroy(struct dpu_rm *rm) dpu_hw_ctl_destroy(hw); } } - for (i = 0; i < ARRAY_SIZE(rm->intf_blks); i++) { - struct dpu_hw_intf *hw; - - if (rm->intf_blks[i]) { - hw = to_dpu_hw_intf(rm->intf_blks[i]); - dpu_hw_intf_destroy(hw); - } - } return 0; } @@ -166,27 +157,6 @@ int dpu_rm_init(struct dpu_rm *rm, rm->pingpong_blks[pp->id - PINGPONG_0] = &hw->base; } - for (i = 0; i < cat->intf_count; i++) { - struct dpu_hw_intf *hw; - const struct dpu_intf_cfg *intf = &cat->intf[i]; - - if (intf->type == INTF_NONE) { - DPU_DEBUG("skip intf %d with type none\n", i); - continue; - } - if (intf->id < INTF_0 || intf->id >= INTF_MAX) { - DPU_ERROR("skip intf %d with invalid id\n", intf->id); - continue; - } - hw = dpu_hw_intf_init(intf->id, mmio, cat); - if (IS_ERR_OR_NULL(hw)) { - rc = PTR_ERR(hw); - DPU_ERROR("failed intf object creation: err %d\n", rc); - goto fail; - } - rm->intf_blks[intf->id - INTF_0] = &hw->base; - } - for (i = 0; i < cat->ctl_count; i++) { struct dpu_hw_ctl *hw; const struct dpu_ctl_cfg *ctl = &cat->ctl[i]; @@ -452,54 +422,6 @@ static int _dpu_rm_reserve_ctls( return 0; } -static int _dpu_rm_reserve_intf( - struct dpu_rm *rm, - struct dpu_global_state *global_state, - uint32_t enc_id, - uint32_t id) -{ - int idx = id - INTF_0; - - if (idx < 0 || idx >= ARRAY_SIZE(rm->intf_blks)) { - DPU_ERROR("invalid intf id: %d", id); - return -EINVAL; - } - - if (!rm->intf_blks[idx]) { - DPU_ERROR("couldn't find intf id %d\n", id); - return -EINVAL; - } - - if (reserved_by_other(global_state->intf_to_enc_id, idx, enc_id)) { - DPU_ERROR("intf id %d already reserved\n", id); - return -ENAVAIL; - } - - global_state->intf_to_enc_id[idx] = enc_id; - return 0; -} - -static int _dpu_rm_reserve_intf_related_hw( - struct dpu_rm *rm, - struct dpu_global_state *global_state, - uint32_t enc_id, - struct dpu_encoder_hw_resources *hw_res) -{ - int i, ret = 0; - u32 id; - - for (i = 0; i < ARRAY_SIZE(hw_res->intfs); i++) { - if (hw_res->intfs[i] == INTF_MODE_NONE) - continue; - id = i + INTF_0; - ret = _dpu_rm_reserve_intf(rm, global_state, enc_id, id); - if (ret) - return ret; - } - - return ret; -} - static int _dpu_rm_make_reservation( struct dpu_rm *rm, struct dpu_global_state *global_state, @@ -521,11 +443,6 @@ static int _dpu_rm_make_reservation( return ret; } - ret = _dpu_rm_reserve_intf_related_hw(rm, global_state, enc->base.id, - &reqs->hw_res); - if (ret) - return ret; - return ret; } @@ -534,8 +451,6 @@ static int _dpu_rm_populate_requirements( struct dpu_rm_requirements *reqs, struct msm_display_topology req_topology) { - dpu_encoder_get_hw_resources(enc, &reqs->hw_res); - reqs->topology = req_topology; DRM_DEBUG_KMS("num_lm: %d num_enc: %d num_intf: %d\n", @@ -565,8 +480,6 @@ void dpu_rm_release(struct dpu_global_state *global_state, ARRAY_SIZE(global_state->mixer_to_enc_id), enc->base.id); _dpu_rm_clear_mapping(global_state->ctl_to_enc_id, ARRAY_SIZE(global_state->ctl_to_enc_id), enc->base.id); - _dpu_rm_clear_mapping(global_state->intf_to_enc_id, - ARRAY_SIZE(global_state->intf_to_enc_id), enc->base.id); } int dpu_rm_reserve( @@ -630,11 +543,6 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm, hw_to_enc_id = global_state->ctl_to_enc_id; max_blks = ARRAY_SIZE(rm->ctl_blks); break; - case DPU_HW_BLK_INTF: - hw_blks = rm->intf_blks; - hw_to_enc_id = global_state->intf_to_enc_id; - max_blks = ARRAY_SIZE(rm->intf_blks); - break; case DPU_HW_BLK_DSPP: hw_blks = rm->dspp_blks; hw_to_enc_id = global_state->dspp_to_enc_id; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h index 1f12c8d5b8aa..27afe55f1f55 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h @@ -18,7 +18,6 @@ struct dpu_global_state; * @pingpong_blks: array of pingpong hardware resources * @mixer_blks: array of layer mixer hardware resources * @ctl_blks: array of ctl hardware resources - * @intf_blks: array of intf hardware resources * @dspp_blks: array of dspp hardware resources * @lm_max_width: cached layer mixer maximum width * @rm_lock: resource manager mutex @@ -27,7 +26,6 @@ struct dpu_rm { struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0]; struct dpu_hw_blk *mixer_blks[LM_MAX - LM_0]; struct dpu_hw_blk *ctl_blks[CTL_MAX - CTL_0]; - struct dpu_hw_blk *intf_blks[INTF_MAX - INTF_0]; struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0]; struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0]; From patchwork Fri Nov 26 02:26:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 519680 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1729664imj; Thu, 25 Nov 2021 18:26:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp11b8fhKKmSwkwg2dv+Y1AV7rfCUjU+wgitpwxLAJGURBU3Pzui0ndtcApkkH6H9Nj7Qs X-Received: by 2002:a63:ce46:: with SMTP id r6mr18939017pgi.132.1637893619252; Thu, 25 Nov 2021 18:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637893619; cv=none; d=google.com; s=arc-20160816; b=n+BP6jTKlVEhkBTZyZwe2InZ1c++zNbUZWioRvB86gIDi+VFyb3cS75I/AP9eRADoL dcuhOuIKyM64pVVaGqpsLrlHwZYZ8pj/7qmQkkUp6UE39UgQ+iHHp0TdO2RySXw8F8c+ eHiVW9nSUdRsNc9q3R9uothL47htwVVRkanWpOGH2mKhUsmVsrAYIEVEfIv/b2ZqLxdu I9rHHMzqXbf8lo+BzY8MiI7wCn60z+3zMLOdjUOM2H8jbuUD2KRG0cVjiGOJiSyNochW 03IhsfuJamtczjHQWVYH79vTM2ORgNWhYg/v8eelZR6HvZ0wjs8yt4B77Ad4VZhLutRl VT0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=SjvwkpUPVxTN10HZUyOLDN4iEgATg5pex/yAH6C4wmk=; b=Y9h6ZGNtZk7hjJtUkHvcQ5ft+htNow2xEmZK2gd6X3tl1ufM8BWmeI/USWODOdI0Lu OSeo9CSEt4ThIBuw1CW4KNJCtty4BxrQ/CCe/Sym94PRGty3oy0APJ6y23g0bIHBV3hy Wjwq4MHh2GrKzMZpCKivXyaWCnQ2zrIE2iqs5nzE2oVRPNoNPAW/VTGnjWec45KfOMcs ZCUaS3dHcRUKWynefatB2v7+VaS71ofMj7kfU8SnVHwZeNA4kOVjZ/4723BqR4mINBbr 0PKQ1bBn/ETe3yABnv60C1os4Uko9pyrIfMUW2cXrwPOp0AL/GnIOYQQErtgx0X27+Fs h5nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bE6gsDYc; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p36si7002667pgl.349.2021.11.25.18.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:26:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bE6gsDYc; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 273486E4B5; Fri, 26 Nov 2021 02:26:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 808576E466 for ; Fri, 26 Nov 2021 02:26:48 +0000 (UTC) Received: by mail-lf1-x133.google.com with SMTP id k37so20547309lfv.3 for ; Thu, 25 Nov 2021 18:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SjvwkpUPVxTN10HZUyOLDN4iEgATg5pex/yAH6C4wmk=; b=bE6gsDYcf3HpAMDe676F6s2AZyX7DtcqPXEUlAEp6XnSdElSjkBnJBq0zqFDuut5NT /+PV5yNx84b/VA0JbKoPCRepkemTp0gswj7w4CVkUkVVpwSuI9VNwvu3lYRMVLSKPSab tE/wAy9BNwefirBNHBpaaHUXFi0sL7f4zP4DVm2M+SmdzsDqqbkyv1fyf61GiEJPk09e b8bKM6lmldKzdrmHIm05TZmjvKTq8OFJ3FVAubMxvnIWrn/+vY8ZgZwMnRE0k7igRDy4 l7BbKxTXTiMM5676Xj9eDn7vUgVIeBQHLE46ZNKlElFKGiHdTs2tiVYYLO1axY41Jtiw 44AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SjvwkpUPVxTN10HZUyOLDN4iEgATg5pex/yAH6C4wmk=; b=haK8NMjpKG2k/aDlpf1i+oKTAh9UeVhSE2lPaARlXCuBXHxWhbklJKb2Wmz30U0Rjs SHX6VzUyQRHAdh2HXu/mr9Sc40Q6UefVv4qKy1BB1vUne2CkGcl1Ga43kYV22imuiSI2 vuz3jd7H/2+XK+5tZdXxn4fGqBpa09uXGrPBKRAa/3UiG/J9A49KFoDzeUZwnL+ubYeX EGDZoRqSuReTjKUHeU1Df1isqc9zTg0+nU8jU5H8JgRwkYfrau38RGgWPBUWLMNPADnr 30CNOsP+e+uLzWt+UOSbU/5cXWbZXFs1rQ1zTBRz0cXbe7EUb3L4SxmrlAX+b/AVmcD3 obAQ== X-Gm-Message-State: AOAM531ujvdYsnD3TUy7H60IDY1VtXesq/sfzGI9/3/vTd3y0rsprDGS JW4V/El+/Nknr5Sv8toRO1A59g== X-Received: by 2002:a05:6512:3f86:: with SMTP id x6mr26665606lfa.616.1637893606803; Thu, 25 Nov 2021 18:26:46 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x6sm388764lff.125.2021.11.25.18.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:26:46 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v3 3/3] drm/msm/dpu: drop unused lm_max_width from RM Date: Fri, 26 Nov 2021 05:26:42 +0300 Message-Id: <20211126022642.1105979-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> References: <20211126022642.1105979-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" No code uses lm_max_width from resource manager, so drop it. Instead of calculating the lm_max_width, code can use max_mixer_width field from the hw catalog. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 12 ------------ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 4 ---- 2 files changed, 16 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index d8d3f87a0ed2..bb69dcf2c13a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -105,18 +105,6 @@ int dpu_rm_init(struct dpu_rm *rm, goto fail; } rm->mixer_blks[lm->id - LM_0] = &hw->base; - - if (!rm->lm_max_width) { - rm->lm_max_width = lm->sblk->maxwidth; - } else if (rm->lm_max_width != lm->sblk->maxwidth) { - /* - * Don't expect to have hw where lm max widths differ. - * If found, take the min. - */ - DPU_ERROR("unsupported: lm maxwidth differs\n"); - if (rm->lm_max_width > lm->sblk->maxwidth) - rm->lm_max_width = lm->sblk->maxwidth; - } } for (i = 0; i < cat->merge_3d_count; i++) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h index 27afe55f1f55..90f5d1d9844f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h @@ -19,8 +19,6 @@ struct dpu_global_state; * @mixer_blks: array of layer mixer hardware resources * @ctl_blks: array of ctl hardware resources * @dspp_blks: array of dspp hardware resources - * @lm_max_width: cached layer mixer maximum width - * @rm_lock: resource manager mutex */ struct dpu_rm { struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0]; @@ -28,8 +26,6 @@ struct dpu_rm { struct dpu_hw_blk *ctl_blks[CTL_MAX - CTL_0]; struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0]; struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0]; - - uint32_t lm_max_width; }; /**