Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp69409rwb; Wed, 14 Dec 2022 14:07:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5BqEo6KKQro8FjKS7pdNBt4hiVOLhipmQGzNnPRyz5fz57CED4wOLWUUQeI63JJzbfH3vd X-Received: by 2002:aa7:c055:0:b0:467:481e:5ef1 with SMTP id k21-20020aa7c055000000b00467481e5ef1mr21724929edo.16.1671055676572; Wed, 14 Dec 2022 14:07:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671055676; cv=none; d=google.com; s=arc-20160816; b=GS/H3JCGfLRCh6AOTKAiPwUiHDy0WOmKwaunBcwomA9o5p55c/d49TuvIe83LJWGvK xYz9qqoUjs8bJhxXvfZFyH3Qc5otJqXyNlhzBXrtKaYGqGslnDyzZ/AFv3aFKSOlCIis GP0kckviy4+26YRdwuMImW0py70yt0RaAQdadJ8ojwyVl17sdNy7q/A3vpipmDEWijzR KCWJrXbqttsZu7Hv083gGMKYEdz8Nd+H6rpdPbu2QBZ2PcbJnvaItNl5VUOdjesJB829 bd9J/OmkkkPEJNZ5aKCB+90/R6iDnEAT1ypI44nZHUmyZBy4qm74aSHD4cngdm8Tm9TA ZuJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XpqqzXjQ5AFOKzg4+LZBQR5kvWNjCEkfNjS668a8ia8=; b=EocS6GYblSPuy+2MGSqKbTSnYLBxMpoi8+V4hJJrZ2+uP8DNEJ62jrK01AU0iFifXs jNkMl9ULWYJJS1U7mgK9acWIvuZgO1QcqGbYeiaNXRc+amY4rZ2FJuvP5dOFLozQ3e91 H6fmkqb0JbYCp/39Cl5tSo5bx7KlgYUhM6ahmghx4Hkiw7ccQlICnNgRUcTID6A+JID0 dU4elVYG0tMC59KKbJqTAgh9VoAvaOp0wdZ0f6Z8ZTIF0thHOlvTJ/eF/B9ylv/wuSDW kaNG1+us5HmX7x4sHgMTjraSgqO6LgLRT2Iri5zKs9pAErGILgp4KGr3MRiU/9DtUykF fVfQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a50e607000000b00469e7011949si10618861edm.508.2022.12.14.14.07.39; Wed, 14 Dec 2022 14:07:56 -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 S229620AbiLNVFW (ORCPT + 69 others); Wed, 14 Dec 2022 16:05:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiLNVFU (ORCPT ); Wed, 14 Dec 2022 16:05:20 -0500 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [5.144.164.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A06F02C661 for ; Wed, 14 Dec 2022 13:05:19 -0800 (PST) Received: from SoMainline.org (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 ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 983FE3F790; Wed, 14 Dec 2022 22:05:17 +0100 (CET) Date: Wed, 14 Dec 2022 22:05:16 +0100 From: Marijn Suijten To: Kalyan Thota Cc: "Kalyan Thota (QUIC)" , "dri-devel@lists.freedesktop.org" , "linux-arm-msm@vger.kernel.org" , "freedreno@lists.freedesktop.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "robdclark@chromium.org" , "dianders@chromium.org" , "swboyd@chromium.org" , "Vinod Polimera (QUIC)" , "dmitry.baryshkov@linaro.org" , "Abhinav Kumar (QUIC)" Subject: Re: [v10] drm/msm/disp/dpu1: add support for dspp sub block flush in sc7280 Message-ID: <20221214210516.u7drmdhc74a7rxvk@SoMainline.org> References: <1670417963-19426-1-git-send-email-quic_kalyant@quicinc.com> <20221207140832.6r2kznoulfek7yye@SoMainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 On 2022-12-12 11:35:15, Kalyan Thota wrote: > [..] > >> + if (ctx->pending_dspp_flush_mask[dspp - DSPP_0]) > >> + DPU_REG_WRITE(&ctx->hw, CTL_DSPP_n_FLUSH(dspp - DSPP_0), > >> + ctx->pending_dspp_flush_mask[dspp - > >> + DSPP_0]); > > > >Shouldn't this loop as a whole check if _any_ DSPP flush is requested via > >`pending_flush_mask & BIT(29)`? The other flushes don't check the per-block > >mask value either (and could write zero that way) but only base this check on the > >presence of a global flush mask for that block. > > > BIT(29) enables dspp flush only from DPU rev 7.x.x where hierarchal flush is introduced. For other targets that supports CTL_ACTIVE, it's a NOP. The only way this patch ever writes pending_dspp_flush_mask is followed by unconditionally setting BIT(29) in pending_flush_mask. I was under the assumption that pending_dspp_flush_mask should be considered invalid or irrelevant unless BIT(29) is set. > With the check "pending_flush_mask & BIT(29)", unintended DSPP registers for that CTL path will be programmed to "0" which is not correct IMO. You can also keep the second `if` to guard against that; as said the code above does exactly this though, but I think we could assume that if a pending sub-block flush is set, pending_dspp_flush_mask is nonzero? > Secondly "pending_flush_mask & BIT(29)" although will not be true for DPU 6.x.x versions but can be confusing w.r.t code readability. > Let me know your thoughts. Ack, it is /super/ confusing that BIT(29) is used for DSPP (sub-block) flush, but also to flash INTF_2?? In fact there are many overlapping flush bits used for different components. Only few are clarified via a #define. Can you confirm whether this is correct? And whether these should all be pulled out into numerically-sorted defines to improve readability and document intentional overlap? - Marijn