Message ID | 20230215-sspp-scaler-version-v1-0-416b1500b85b@somainline.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp465302wrn; Wed, 15 Feb 2023 15:03:00 -0800 (PST) X-Google-Smtp-Source: AK7set/8bTW3E6dN5OOYyoBX3X0X7rQYsU8fz6kW82nYSsXf1MPZ/dphLmfBUmC6ZKaBXlCGCYzT X-Received: by 2002:a17:903:5cb:b0:199:bcb:3dae with SMTP id kf11-20020a17090305cb00b001990bcb3daemr3145370plb.56.1676502180020; Wed, 15 Feb 2023 15:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676502180; cv=none; d=google.com; s=arc-20160816; b=uBydpn5agGEI1aA1kvMwN1snOKPPmqpg1iilM++4/CpcslZHTZ/H5Gio8vGqngiB1X eyuKT2V1ygcyHkiPyWCRkjZRU50q+anD8BoEgC6s/XdfiI7zlk2tgCH5jF+2KNMIioSZ B49CI3FYbmk+8hBFG1rp9EuNr7KqColdVW7wATgytXBCE9EAZM8l1ue2UF+isk1P7lD0 5SbR6idbOTmqqxFQ9ncmYwkMUi4EBRkRaWbPnKGF5gEG4zxmSfS1/+i1xR/nzaGz7snh PjjH6GpCTGMj2RcsnoWJUjVjJ6NjLxkVyGJYjhyWVfTYSUljp2FUENSkc0Od6H/15mGn +eOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=+QT4WBA3CF/ciR+3foTnOvCjpp1ykI317ZVr7O5h/aY=; b=aqMu6WwxOK1I93GzWKTZhbCyZPIvDgrtVN2AySfyKnUynYT43FcSYKiAJ3UmRuF4ga dae3Hxu5j/CjoNT+DUWxYeYkp4gIdOpHJEXVtRiS9Hoo+Qo2uYTYUI/nW759FhhSqnJW j4STwfrgpn+3fcy/tYArtk41UHUcy5gBLF7ER/fw5/lNQO5W2DOP+IYB0oWP8bJK+vVW bJz77r6pXhI6IfbuxyV3JZqMCOMMbr34oTACCzCY3nUWMJkbeY5YkQFYg7jO4HDEldxw Sq8g2DgICfobOmGmkj5fsODMAw0yajy2hryapK1+f5n+Dcyf2gVHjTsIZ38A1m3c+3X2 pz6Q== 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 j9-20020a170903024900b00194a374bbdfsi20448616plh.403.2023.02.15.15.02.47; Wed, 15 Feb 2023 15:02:59 -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 S229863AbjBOXCi (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Wed, 15 Feb 2023 18:02:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjBOXCg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Feb 2023 18:02:36 -0500 Received: from relay03.th.seeweb.it (relay03.th.seeweb.it [IPv6:2001:4b7a:2000:18::164]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81B8039286; Wed, 15 Feb 2023 15:02:32 -0800 (PST) Received: from Marijn-Arch-PC.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (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 7D2B81F544; Thu, 16 Feb 2023 00:02:24 +0100 (CET) From: Marijn Suijten <marijn.suijten@somainline.org> Subject: [PATCH 0/3] drm/msm/dpu: Initialize SSPP scaler version (from register read) Date: Thu, 16 Feb 2023 00:02:22 +0100 Message-Id: <20230215-sspp-scaler-version-v1-0-416b1500b85b@somainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAH9k7WMC/x2NwQrCMBBEf6Xs2YUmElB/RTykcWoXQgy7WAql/ +7q8c3MY3YyqMDoNuykWMXk3RzCaaCy5PYCy9OZ4hjPYwyJzXpnK7lCeYX+9hyuc/TukkoCuTl lA0+aW1ncbZ9aPeyKWbb/1f1xHF+RhmoWegAAAA== To: Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sean Paul <sean@poorly.run>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Archit Taneja <architt@codeaurora.org>, Chandan Uddaraju <chandanu@codeaurora.org>, Sravanthi Kollukuduru <skolluku@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Martin Botka <martin.botka@somainline.org>, Jami Kettunen <jami.kettunen@somainline.org>, phone-devel@vger.kernel.org, Marijn Suijten <marijn.suijten@somainline.org> X-Mailer: b4 0.12.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757939949804508669?= X-GMAIL-MSGID: =?utf-8?q?1757939949804508669?= |
Series |
drm/msm/dpu: Initialize SSPP scaler version (from register read)
|
|
Message
Marijn Suijten
Feb. 15, 2023, 11:02 p.m. UTC
Random inspection of the SSPP code surfaced that the version field of dpu_scaler_blk was never assigned in the catalog, resulting in wrong codepaths to be taken within dpu_hw_setup_scaler3 based on a 0 version. Rectify this by reading an accurate value from a register (that is not equal to the values represented by DPU_SSPP_SCALER_QSEEDx enum variants) and deleting dead code around QSEED versioning. Future changes should likely get rid of the distinction between QSEED3 and up, as these are now purely determined from the register value. Furthermore implementations could look at the scaler subblk .id field rather than the SSPP feature bits, which currently hold redundant information. --- Marijn Suijten (3): drm/msm/dpu: Read previously-uninitialized SSPP scaler version from hw drm/msm/dpu: Drop unused get_scaler_ver callback from SSPP drm/msm/dpu: Drop unused qseed_type from catalog dpu_caps drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 12 ------------ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 ---- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 12 ++++++++---- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 9 +++------ 4 files changed, 11 insertions(+), 26 deletions(-) --- base-commit: 9d9019bcea1aac7eed64a1a4966282b6b7b141c8 change-id: 20230215-sspp-scaler-version-19f221585c5e Best regards,
Comments
On Thu, 16 Feb 2023 at 01:02, Marijn Suijten <marijn.suijten@somainline.org> wrote: > > Random inspection of the SSPP code surfaced that the version field of > dpu_scaler_blk was never assigned in the catalog, resulting in wrong > codepaths to be taken within dpu_hw_setup_scaler3 based on a 0 version. > Rectify this by reading an accurate value from a register (that is not > equal to the values represented by DPU_SSPP_SCALER_QSEEDx enum > variants) and deleting dead code around QSEED versioning. > > Future changes should likely get rid of the distinction between QSEED3 > and up, as these are now purely determined from the register value. > Furthermore implementations could look at the scaler subblk .id field > rather than the SSPP feature bits, which currently hold redundant > information. > > --- > Marijn Suijten (3): > drm/msm/dpu: Read previously-uninitialized SSPP scaler version from hw > drm/msm/dpu: Drop unused get_scaler_ver callback from SSPP > drm/msm/dpu: Drop unused qseed_type from catalog dpu_caps The cleanup looks good. However as you are on it, maybe you can also add patch 4, dropping DPU_SSPP_SCALER_QSEED3LITE and DPU_SSPP_SCALER_QSEED4 in favour of using QSEED3 for all these scalers? As we are going to use scaler_version to distinguish between them, it would be logical not to duplicate that bit of information (not to mention all the possible troubles if scaler_version disagrees with the sblk->scaler_blk.id). > > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 12 ------------ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 ---- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 12 ++++++++---- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 9 +++------ > 4 files changed, 11 insertions(+), 26 deletions(-) > --- > base-commit: 9d9019bcea1aac7eed64a1a4966282b6b7b141c8 > change-id: 20230215-sspp-scaler-version-19f221585c5e > > Best regards, > -- > Marijn Suijten <marijn.suijten@somainline.org> >
On 2023-02-16 05:02:32, Dmitry Baryshkov wrote: > On Thu, 16 Feb 2023 at 01:02, Marijn Suijten > <marijn.suijten@somainline.org> wrote: > > > > Random inspection of the SSPP code surfaced that the version field of > > dpu_scaler_blk was never assigned in the catalog, resulting in wrong > > codepaths to be taken within dpu_hw_setup_scaler3 based on a 0 version. > > Rectify this by reading an accurate value from a register (that is not > > equal to the values represented by DPU_SSPP_SCALER_QSEEDx enum > > variants) and deleting dead code around QSEED versioning. > > > > Future changes should likely get rid of the distinction between QSEED3 > > and up, as these are now purely determined from the register value. > > Furthermore implementations could look at the scaler subblk .id field > > rather than the SSPP feature bits, which currently hold redundant > > information. > > > > --- > > Marijn Suijten (3): > > drm/msm/dpu: Read previously-uninitialized SSPP scaler version from hw > > drm/msm/dpu: Drop unused get_scaler_ver callback from SSPP > > drm/msm/dpu: Drop unused qseed_type from catalog dpu_caps > > The cleanup looks good. However as you are on it, maybe you can also > add patch 4, dropping DPU_SSPP_SCALER_QSEED3LITE and > DPU_SSPP_SCALER_QSEED4 in favour of using QSEED3 for all these > scalers? I surely can! Do you mind if I rename it to QSEED3_AND_UP for clarity? How about the second question, dropping this redundant information from the SSPP feature flags and only looking at the scaler_blk.id? > As we are going to use scaler_version to distinguish between > them, it would be logical not to duplicate that bit of information > (not to mention all the possible troubles if scaler_version disagrees > with the sblk->scaler_blk.id). Note that we had a similar discussion for UBWC HW decoder version and it was decided to go the opposite route [1]. That may have been for technical reasons (unclocked register access), but it's an inconsistent approach to say the least. [1]: https://lore.kernel.org/linux-arm-msm/71f96910-e7b1-92f9-ae15-79bd1da40a0d@quicinc.com/ - Marijn