Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4451212rdb; Mon, 11 Dec 2023 22:32:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTsag9hUeTibqpIpIwZkchuM/FmuXcfOtg0g+Nfa1DrzpybGWolhrIHYkxtkPH2yfDqZY1 X-Received: by 2002:a05:6870:414a:b0:1fb:2329:6426 with SMTP id r10-20020a056870414a00b001fb23296426mr7670618oad.12.1702362729643; Mon, 11 Dec 2023 22:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702362729; cv=none; d=google.com; s=arc-20160816; b=aBW/LZFhi1ANS10jnrfs216klXy+K798S95S5AVf57Ur5S4RaWIlNUZKmaksqfQioC fOKxNhDIacGfmyOw0R+TmGAtYXV5zJqEzx/TDLY2o6Dm9VWNLsC8i/FZuEzra85A+h9/ XM6OOc6i6IIfI8j9DmU3CS4aouno+lB0m2NSiQprPF90R70lod/LnP0XAd4939FMu8TU ONY65D2UcovhF0SraE57krgQOx3sCDxo6Q+Q3CuvlXSjiPbNfDj+scMwYgPdAoGcw0Fy Uqc35UyVrEAdVf7w4DtlD1LCRmZTNqnqAvkdYQzaf1vkkvySwluefflbKcM2b7/Nj229 6YPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GTyimt7NL0UKlmZiXkz9uafKVfa8o+8ACsFlcy9zsvM=; fh=Iu05yrOKhRyKBOIps2Mjvip7s5lelUzP4uL09HFczko=; b=COtQ1KXM4DSyQ7XweGQXL0kHMO5j6Rk3HBnHdQssyWAY2dBg0e5tQyAUcl/sjebOfz yQKAqNZZ6qubT+W7sS4Co1r4ePodu5uXmZntkH1pCMLMxukwMayvnZM0r61+06hSyBp6 VSKU1HElkBDE2PsgMl620uwUlgColuxwaHYH4uispBiYwYpmXF2pgTqLIY1JYMRMYIvs 1ybAs7aqrwlEhwKWfarB4luD5D2U2tz0KOUNCpndk3OwYq5wo5h5rdOj3cmAFwaZWIrd fM6RwVpLo4+p3gSq76a1Ds7+3w51FgRn6mSzlOC3wubJpv/RbsACbw4KlLQ+bO/OVODC 6Mbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SP96YnY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a9-20020a654189000000b005be3683ec6asi7265112pgq.184.2023.12.11.22.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 22:32:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SP96YnY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1C91880B1E76; Mon, 11 Dec 2023 22:32:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbjLLGby (ORCPT + 99 others); Tue, 12 Dec 2023 01:31:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjLLGbx (ORCPT ); Tue, 12 Dec 2023 01:31:53 -0500 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FFA6C7 for ; Mon, 11 Dec 2023 22:31:59 -0800 (PST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5d3c7ef7b31so51536327b3.3 for ; Mon, 11 Dec 2023 22:31:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702362719; x=1702967519; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GTyimt7NL0UKlmZiXkz9uafKVfa8o+8ACsFlcy9zsvM=; b=SP96YnY6GQafSBIMWcKBHkXDjR3K0Km9NxcDDSY7i9dE6ZVvVA2ToXtu/baWiCaF6W IDK5mmkm3/Bfw26piaVm6XoaQiVXBdjIhn2qFL4lsBZUOpcZ1N8TbEcfW1JzI2wXMFTf EU68wdDb2EFVtFFip04Jg9HTei7LWz/t4RNq6N3Bb9GwtCSeJ5P83knOSEXc/JG4UiBP xpPXKr/njJ9vaeVVg3trjHCQSHKbc9mocfs3YgOC27uMgUdBylaHp9qEBRqidwHVbifX tVh/TesCxc5SbJ8H0N364gr8wifRgUmjDNUDKVUnVhrZbTTrDLGr8EpiOVFupgru0a3J 5W1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702362719; x=1702967519; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GTyimt7NL0UKlmZiXkz9uafKVfa8o+8ACsFlcy9zsvM=; b=pD3X34AbG/l6ZTm4Yp2kLfU86EmQt2nCShtYy7bMXKP8M3gXE06CgWSZDTtQ5nOgrt T5jfIR3+ouICytAOXHirChXMJC1ttNaZNHK0ZJA4W9A5sj8P9BHNSom1Wdp2IbIilMhH jOgKMWW/DKvG+TdmGPUwGOoe6vdcjWuHKKwyknb6MhA6av2BVilq5SjDUAGKUrMcEdra 7Tdo4fuSd22WoFVfN2pBSmd8vBruwn0Cr6KG8xtzKboo6K7sQ0f6AHP0zMKs9z8wulvR CLiCD6Xrm3S0DJY0Dczq2BgoLnHrOkgNAa+lUvEmvbv6tJIeWVCom6AJdOaYtvTYTgvC QTog== X-Gm-Message-State: AOJu0Yz5lyBYGef0bke0OV5iywV8K7FUVBRrodPzk1UizJfzcBHUzptZ H0xGwEGpMSoLiLVqCq9Wm1Cn5CTrCaRcad9OZ/ARfw== X-Received: by 2002:a0d:d305:0:b0:5d7:2c6b:623 with SMTP id v5-20020a0dd305000000b005d72c6b0623mr4258949ywd.39.1702362718756; Mon, 11 Dec 2023 22:31:58 -0800 (PST) MIME-Version: 1.0 References: <1702319923-24518-1-git-send-email-quic_khsieh@quicinc.com> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 12 Dec 2023 08:31:47 +0200 Message-ID: Subject: Re: [PATCH v3] drm/msm/dpu: improve DSC allocation To: Kuogee Hsieh Cc: dri-devel@lists.freedesktop.org, robdclark@gmail.com, sean@poorly.run, swboyd@chromium.org, dianders@chromium.org, vkoul@kernel.org, daniel@ffwll.ch, airlied@gmail.com, agross@kernel.org, andersson@kernel.org, quic_abhinavk@quicinc.com, quic_jesszhan@quicinc.com, quic_sbillaka@quicinc.com, marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 22:32:07 -0800 (PST) On Tue, 12 Dec 2023 at 02:03, Kuogee Hsieh wrote: > > > On 12/11/2023 1:30 PM, Dmitry Baryshkov wrote: > > On Mon, 11 Dec 2023 at 20:38, Kuogee Hsieh wrote: > >> A DCE (Display Compression Engine) contains two DSC hard slice > >> encoders. Each DCE start with even DSC encoder index followed by > > "starts". But it will not be correct. The DCE doesn't start with the > > DSC encoder. DCE consists of two DSC encoders, one has an odd index > > and another one has an even index. > > > >> an odd DSC encoder index. Each encoder can work independently. > >> But Only two DSC encoders from same DCE can be paired to work > > only > > > >> together to support merge mode. In addition, the DSC with even > > There are different merge modes. Here you are talking about the DSC merge mode. > > > >> index have to mapping to even pingpong index and DSC with odd > > PINGPONG (end everywhere else). > > > > have to be mapped, should be used, etc. > > > >> index have to mapping to odd pingpong index at its data path. > >> This patch improve DSC allocation mechanism with consideration > > improves > > > >> of above factors. > > of these factors. > > > >> Changes in V3: > >> -- add dpu_rm_pingpong_dsc_check() > >> -- for pair allocation use i += 2 at for loop > >> > >> Changes in V2: > >> -- split _dpu_rm_reserve_dsc() into _dpu_rm_reserve_dsc_single() and > >> _dpu_rm_reserve_dsc_pair() > >> > >> Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM") > > This tag is incorrect. The patch should be split into two pieces. One > > which fixes DSC allocation for DSC 1.1 encoders, where there were no > > DCE blocks, another one which adds proper handling for DCE. > > Unless the paired allocation requirement also applies to pre-DCE DSC > > encoders. But in that case the commit message doesn't make any sense. > > > > I checked 4.x Qualcomm kernels. None of them contained any of these > > restrictions for DSC blocks. Only the displaypack targeting 4.19 > > kernel got these changes. But it predates DCE pairs support. > > as I said earlier the rule of odd/even pp-index map to odd/even > dsc-index is there since dsc v1.1. > > I think current code (including down stream code) works by luck to not > encounter a configuration with two independence paths, one with single > dsc and the other one use two dsc to support dsc merge mode. > > this patch is the fix to enforce this rule for both dsc v1.1 and v1.2 > and I will rework commit message yo have better description. Good. Does this apply to paired allocation too? I think so, as the techpack first got the paired allocation and only afterwards it has got the DSC/PP idx check. Regarding the patch itself. May I suggest an alternative approach, which should work better, I think. At least it will not require 'deleting' the PP indices. First you preprocess the pp_to_enc_id array and list all PP indices selected for this encoder. Then you work with this array, matching PP and DSC blocks. -- With best wishes Dmitry