Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp870277rwr; Thu, 4 May 2023 10:37:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4EWBIcEapAj//Ben97SoUVSedg9KpBsNcpQMIQGXn6S/mn5GSuGt/QGcltxwzDLy5LVCBk X-Received: by 2002:a05:6a20:914d:b0:f5:d6cc:e3f1 with SMTP id x13-20020a056a20914d00b000f5d6cce3f1mr3808596pzc.20.1683221822613; Thu, 04 May 2023 10:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683221822; cv=none; d=google.com; s=arc-20160816; b=YCelaK3XxCj5XDFAwjv5vrT/OCZEhOmP6GHWc7Hfno72mDHPlqBIUNzVF00DGeU6DT 63Q+gIjhVFpJsW9p3CHBet6VXuNd8mPzJGXH8gXylRNMHnYIgg54KXaM/l7OQN4OOEvV yfQQaw0z4JfNoxNsnnUdHQNQ3KAkXzxh1hCdKcXyfrcqfb4SrnZN1T/W8nQ0teIjwly3 Be1wvcG4JSD43imsoLljC/u95pFobzMd7JlvLoIi7EclN6Eo62MjZ8AGc5FiJCBghOnV 6BvvcueMuhMuUlbqhKrptmZ8zZB4vxZUsrlO7uFf5t4NbcUXX2II+hCCMfqdeP9DqUwD nV3Q== 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=5imnNrrrAQ2rO5/QZMkWnj3XnTBCBDWN7EKO8lUgS3M=; b=0ufFCEmS2zmHnnZOsLDdZLVVaMgTKBP5EizIf555nhh4LAlijIXCMlR5SHF36cQg6S +gcVTtNBkO5Xr5TKhcTR7NcuEApQArMV+O1GEjaDe0W8bAKYeZMnDhqK41v2gpZ+QNxc zIMGz59biwn4S3Zn9tpCB9c1ZtRf9FG4135aQcif95QmAfiwb9jt8mw01emHghNF5F/U cz0mEhykb9My87P8Cvv84NaOh3rmNu332If0fyPhLOV75QJVud1T7/p7VUO52ULazJog Ctuf8q5uyYhl9tVr7zezEETEl+v9BqGzzkqWs56LiQSD9tej2uTy/bQbGD0vHyKay46R FQ/w== 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 h3-20020a654803000000b0050f66d4e070si36849875pgs.417.2023.05.04.10.36.49; Thu, 04 May 2023 10:37:02 -0700 (PDT) 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 S229609AbjEDR2Z (ORCPT + 99 others); Thu, 4 May 2023 13:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjEDR2X (ORCPT ); Thu, 4 May 2023 13:28:23 -0400 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [5.144.164.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1764ED7 for ; Thu, 4 May 2023 10:28:20 -0700 (PDT) Received: from SoMainline.org (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 ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 1C82B20C3D; Thu, 4 May 2023 19:28:15 +0200 (CEST) Date: Thu, 4 May 2023 19:28:14 +0200 From: Marijn Suijten 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, dmitry.baryshkov@linaro.org, andersson@kernel.org, quic_abhinavk@quicinc.com, quic_sbillaka@quicinc.com, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 4/7] drm/msm/dpu: Introduce PINGPONG_NONE to disconnect DSC from PINGPONG Message-ID: References: <1683218805-23419-1-git-send-email-quic_khsieh@quicinc.com> <1683218805-23419-5-git-send-email-quic_khsieh@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1683218805-23419-5-git-send-email-quic_khsieh@quicinc.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 2023-05-04 09:46:42, Kuogee Hsieh wrote: > Disabling the crossbar mux between DSC and PINGPONG currently > requires a bogus enum dpu_pingpong value to be passed when calling > dsc_bind_pingpong_blk() with enable=false, even though the register > value written is independent of the current PINGPONG block. Replace > that `bool enable` parameter with a new PINGPONG_NONE dpu_pingpong > flag that triggers the write of the "special" 0xF "crossbar > disabled" value to the register instead. > > Changes in v4: > -- more details to commit text > > Changes in v5: > -- rewording commit text suggested by Marijn > -- add DRM_DEBUG_KMS for DSC unbinding case > > Signed-off-by: Kuogee Hsieh > Reviewed-by: Dmitry Baryshkov Thanks for bearing with all the comments thus far! Reviewed-by: Marijn Suijten > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 15 ++++++++------- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h | 1 - > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 3 ++- > 4 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index cf1de5d..ffa6f04 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -1850,7 +1850,7 @@ static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc, > hw_pp->ops.setup_dsc(hw_pp); > > if (hw_dsc->ops.dsc_bind_pingpong_blk) > - hw_dsc->ops.dsc_bind_pingpong_blk(hw_dsc, true, hw_pp->idx); > + hw_dsc->ops.dsc_bind_pingpong_blk(hw_dsc, hw_pp->idx); > > if (hw_pp->ops.enable_dsc) > hw_pp->ops.enable_dsc(hw_pp); > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c > index 4a6bbcc..47cb9f3 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c > @@ -157,7 +157,6 @@ static void dpu_hw_dsc_config_thresh(struct dpu_hw_dsc *hw_dsc, > > static void dpu_hw_dsc_bind_pingpong_blk( > struct dpu_hw_dsc *hw_dsc, > - bool enable, > const enum dpu_pingpong pp) > { > struct dpu_hw_blk_reg_map *c = &hw_dsc->hw; > @@ -166,14 +165,16 @@ static void dpu_hw_dsc_bind_pingpong_blk( > > dsc_ctl_offset = DSC_CTL(hw_dsc->idx); > > - if (enable) > + if (pp) > mux_cfg = (pp - PINGPONG_0) & 0x7; > > - DRM_DEBUG_KMS("%s dsc:%d %s pp:%d\n", > - enable ? "Binding" : "Unbinding", > - hw_dsc->idx - DSC_0, > - enable ? "to" : "from", > - pp - PINGPONG_0); > + if (pp) > + DRM_DEBUG_KMS("Binding dsc:%d to pp:%d\n", > + hw_dsc->idx - DSC_0, > + pp - PINGPONG_0); > + else > + DRM_DEBUG_KMS("Unbinding dsc:%d from any pp\n", > + hw_dsc->idx - DSC_0); > > DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg); > } > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h > index 287ec5f..138080a 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h > @@ -44,7 +44,6 @@ struct dpu_hw_dsc_ops { > struct drm_dsc_config *dsc); > > void (*dsc_bind_pingpong_blk)(struct dpu_hw_dsc *hw_dsc, > - bool enable, > enum dpu_pingpong pp); > }; > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h > index 1913a19..02a0f48 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h > @@ -191,7 +191,8 @@ enum dpu_dsc { > }; > > enum dpu_pingpong { > - PINGPONG_0 = 1, > + PINGPONG_NONE, > + PINGPONG_0, > PINGPONG_1, > PINGPONG_2, > PINGPONG_3, > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >