From patchwork Wed Dec 21 23:19:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 35567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp33288wrn; Wed, 21 Dec 2022 15:21:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXt6U6qNTiLRj5JAV026Y0fkYpqFUpaIpT7eGHV7pKVA5wYPBQ/O7la5mTIVr2cwsIlsqiwd X-Received: by 2002:a05:6a20:4f88:b0:ac:5a0c:32ad with SMTP id gh8-20020a056a204f8800b000ac5a0c32admr3251654pzb.53.1671664917817; Wed, 21 Dec 2022 15:21:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671664917; cv=none; d=google.com; s=arc-20160816; b=CsSSpJjnStxzd4GSVc8XqmqTVFvU/oFeHNjlQihV269IwMIqrCQituXLAb8D5Gqz76 N+rxMwgXBwC5IQE4JK9r8j/3eooxDX3WSskITtJ4bmqqP5YAO6KV33O6YhFYt85IT9kx 3lk3xbMJwmvEVGZVpUdMeZog19F0E1AOiTXo8S5xfbZrbAwEVpEFacbnyfOyogHnZKgC 5muecacIM56TtyEa7kKvJUM2iqo+uLpzHwocQe33krrAH5cBOTGW8pWUjdcqhhRct1e4 V6GMPy7Mu7B/BDgQWa83eeykUd4JsxKfO5YieDj0wjxO2jwGi9fY6tqQGfjZ56wxnPdI y/hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FpJ/J2rmkueAtztW1ZEE/VCFcMHbv+ru35oRYFjAtbY=; b=VslREwMr6UTK72j32y+mKLE5Y3MyWZMkQJBgJBmjCui40foFKJ9zBkslBCQie7SyzP HyOb6gLvlX8R4Sub80aeqBD8NKur6orOzGdTXB5SAoViSMDzCHsbQ9diPlxznQEbkfxM Nw9apHA98zFfuOzdKq940RgaKMxtB1zvO7sGevQ2CtMgw6fjkYCqK+bMSQ1W7GBZ1uI+ G2qSn+UH9L1FeFGgdOMvSeB5wRsYGUF1oGaobyXtsmrmM9IMa9+vP97U1TjaYCi4b4Gk 93cOpMYb0aPyB6h4KmEaxj7B7K86BtJK3KgxONgAxprf2Ov8aUYWBJTSWm/sUI6ZjIk1 lmsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 141-20020a630193000000b00491c2c993b8si3882392pgb.763.2022.12.21.15.21.44; Wed, 21 Dec 2022 15:21:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235027AbiLUXUY (ORCPT + 99 others); Wed, 21 Dec 2022 18:20:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbiLUXUL (ORCPT ); Wed, 21 Dec 2022 18:20:11 -0500 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [IPv6:2001:4b7a:2000:18::163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F287024BE3 for ; Wed, 21 Dec 2022 15:20:05 -0800 (PST) Received: from localhost.localdomain (94-209-172-39.cable.dynamic.v4.ziggo.nl [94.209.172.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 8ACD82038C; Thu, 22 Dec 2022 00:20:03 +0100 (CET) From: Marijn Suijten To: phone-devel@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Vinod Koul Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Sean Paul , David Airlie , Daniel Vetter , Stephen Boyd , Bjorn Andersson , Jessica Zhang , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Kuogee Hsieh , Jani Nikula , sunliming , Sam Ravnborg , Haowen Bai , Konrad Dybcio , Loic Poulain , Vinod Polimera , Douglas Anderson , Vladimir Lypak , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available Date: Thu, 22 Dec 2022 00:19:40 +0100 Message-Id: <20221221231943.1961117-6-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221231943.1961117-1-marijn.suijten@somainline.org> References: <20221221231943.1961117-1-marijn.suijten@somainline.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752867712599292034?= X-GMAIL-MSGID: =?utf-8?q?1752867712599292034?= Resource allocation of DSC blocks should behave more like LMs and CTLs where NULL resources (based on initial hw_blk creation via definitions in the catalog) are skipped ^1. The current hardcoded mapping of DSC blocks however means that resource allocation shouldn't succeed at all when the DSC block on the corresponding index doesn't exist, rather than searching for the next free block. This hardcoded mapping should be loosened separately as DPU 5.0.0 introduced a crossbar where DSC blocks can be "somewhat" freely bound to any PP and CTL (in proper pairs). ^1: which, on hardware that supports DSC, can happen after a git rebase ended up moving additions to _dpu_cfg to a different struct which has the same patch context. Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM") Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index 8471d04bff50..dcbf03d2940a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -496,6 +496,11 @@ static int _dpu_rm_reserve_dsc(struct dpu_rm *rm, /* check if DSC required are allocated or not */ for (i = 0; i < num_dsc; i++) { + if (!rm->dsc_blks[i]) { + DPU_ERROR("DSC %d does not exist\n", i); + return -EIO; + } + if (global_state->dsc_to_enc_id[i]) { DPU_ERROR("DSC %d is already allocated\n", i); return -EIO;