Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2844848rwr; Fri, 28 Apr 2023 17:37:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57beC1iqoPInItXMgoCtcmUE08HHHnWRGNLkBNrxsfytUabQXRYmlppeivQc3pY7ADAhSP X-Received: by 2002:a17:903:124c:b0:1a6:6bdb:b548 with SMTP id u12-20020a170903124c00b001a66bdbb548mr8216614plh.1.1682728654081; Fri, 28 Apr 2023 17:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682728654; cv=none; d=google.com; s=arc-20160816; b=TGRXmhIqBTD1MU6G+RCy9BfRkySg1UTkXqriv/mIceYBD93Wg5/CHAUeFad9HQF5W8 rwhn0J211Bb9GwfgP2NBhSuSkyFsWixfX6J5b5fnEjkvGKFPx19vTaz3nqviFq5JvGAF 44UrX0em2R4orPTQToHGuLUA5LKD14+yclrY+gxpai7NO2HJs+TrFWmAoTz7jbmVajNs duU2zkxHeA2epySNSV+ig8C+lMKSQ0nDKkMnuO4unc+L5C4xkKqr64WWNgKYSDMGLhKG hvJNDhm1f8v5JkTjtpO4EbySLV2Xt15EhvhTAR7C/pj2LbNfAdsW1uqGZk5AKVGUeMzC HLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=F2XR0z/V+qipW/Xk/AG/sbFXdxf2KNfIbpWmM5bO0cU=; b=MJYHYVMONK9cjOKaClk7nGI2x+92AzHnsEy98lBQ+LCQPra5Sp9ErToleipB3N4i5/ FaQg2cAJ7T6Hb5IjnGffOYh/dhNBGAWyYEtE03FiIo68fw+hjUjyN4mUfz9gq4dk5uc3 YVVMgrvViJDsWtlkXZVW6odR2jYmqUUC1W/3u4GVkXEdZ4Z7p5ZKOsk0lUzXYhQp4PX8 9rlWhst+S4shF1ThLI4VS+KYovrd8wBrHtmP2mHHwQFlh37rfKHTFs1ebgSeYNPUPNkj 1fAZRJSQCVK8NFch6Q6yTZT81z+EGZLA0Q/ekx1avX6ykYNe6dt/QfsbPS5a95DlWDXg oABw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zbgq1BOO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a170902d4cc00b001a8031f3964si25228174plg.437.2023.04.28.17.37.23; Fri, 28 Apr 2023 17:37:34 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Zbgq1BOO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347076AbjD2Abe (ORCPT + 99 others); Fri, 28 Apr 2023 20:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjD2Abd (ORCPT ); Fri, 28 Apr 2023 20:31:33 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88A833AB6 for ; Fri, 28 Apr 2023 17:31:31 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-2efbaad9d76so325412f8f.0 for ; Fri, 28 Apr 2023 17:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682728290; x=1685320290; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=F2XR0z/V+qipW/Xk/AG/sbFXdxf2KNfIbpWmM5bO0cU=; b=Zbgq1BOOCN9HSBrZ8p7F3HAIrgpRiKzTK5yEX/tMtj4DlYZ0xva7V5OtlNzZhWzoJS u6c/2aXewDpEY7UDx5sTdgz1r5eLD++UIwAj8oaFnXFAgcb7+COW34CKf1jVli2xoeqY mHjrQvdBmXt/9XQTKT6wHBvMBgibNHq1neTKMltSpRVZFhujRDxuoIjFVZgSbCAaTTL1 syOVQJXCmvMptd/jYBeLd47aH35g0mX+alyj2PszFkyyC10oFg9K2n9uwQTHNLm+dycH ufgM02+vZ33+J+UYohYYmJC5CpV+cCOtXnOGsaPAqUl6q6D5bwxKKfXcqBcbcX0gZmJ5 wS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682728290; x=1685320290; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F2XR0z/V+qipW/Xk/AG/sbFXdxf2KNfIbpWmM5bO0cU=; b=Y/TCsl0g4eMozuXKeFw8yxlr80HBMZAa7Dov4BEtiwaJqSuWKWU/MEZW5XOdDFaGmm ocbXiEVlhKqcfj+MPKAZf2PuRD3tZmRDxfAH/jvHFjpHmTW2NSPRd0HpCQG05b1yHDb2 gbrRBDNmYXwax/yU/saD4VboWvKHlOeGDGsoU2zEO4Z067C98WXVcjC4uFrZDk4Pu/XQ FDMu/GOwlnaiwZvz/rhbDrCcrxSjH1u4wuKu9ZoItMAnVRqgMPS0Z4eD8L2IIS1CuB1P GS5oHtduzA+k0ybmJWM5HopZwNm0z8dI3rFVYmlAfzIuQiA6mBAFPejiUMOW19sRPAMf cOEg== X-Gm-Message-State: AC+VfDxCrCwDCNGclCEajuJvTPW53UObidsfs8POokdyb/snLOwY6402 t0IltlxgCWNQAYkLEiQnGEVIIQ== X-Received: by 2002:a5d:460b:0:b0:2f0:bd17:2d2c with SMTP id t11-20020a5d460b000000b002f0bd172d2cmr5241974wrq.9.1682728289965; Fri, 28 Apr 2023 17:31:29 -0700 (PDT) Received: from [10.6.147.212] ([212.140.138.218]) by smtp.gmail.com with ESMTPSA id k6-20020a5d5246000000b002e71156b0fcsm22373199wrc.6.2023.04.28.17.31.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Apr 2023 17:31:29 -0700 (PDT) Message-ID: Date: Sat, 29 Apr 2023 03:31:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2 2/7] drm/msm/dpu: separate DSC flush update out of interface Content-Language: en-GB To: Kuogee Hsieh , 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 Cc: quic_abhinavk@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 References: <1682725511-18185-1-git-send-email-quic_khsieh@quicinc.com> <1682725511-18185-3-git-send-email-quic_khsieh@quicinc.com> From: Dmitry Baryshkov In-Reply-To: <1682725511-18185-3-git-send-email-quic_khsieh@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 29/04/2023 02:45, Kuogee Hsieh wrote: > Current DSC flush update is piggyback inside dpu_hw_ctl_intf_cfg_v1(). > This patch separate DSC flush away from dpu_hw_ctl_intf_cfg_v1() by Nit: separates > adding dpu_hw_ctl_update_pending_flush_dsc_v1() to handle both per > DSC engine and DSC flush bits at same time to make it consistent with > the location of flush programming of other dpu sub blocks. > > Signed-off-by: Kuogee Hsieh > Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 14 ++++++++++++-- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 22 ++++++++++++++++------ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 10 ++++++++++ > 3 files changed, 38 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 1dc5dbe..ecb87bc 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -1823,12 +1823,18 @@ dpu_encoder_dsc_initial_line_calc(struct drm_dsc_config *dsc, > return DIV_ROUND_UP(total_pixels, dsc->slice_width); > } > > -static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc, > +static void dpu_encoder_dsc_pipe_cfg(struct dpu_encoder_virt *dpu_enc, > + struct dpu_hw_dsc *hw_dsc, > struct dpu_hw_pingpong *hw_pp, > struct drm_dsc_config *dsc, > u32 common_mode, > u32 initial_lines) > { > + struct dpu_encoder_phys *cur_master = dpu_enc->cur_master; > + struct dpu_hw_ctl *ctl; > + > + ctl = cur_master->hw_ctl; > + > if (hw_dsc->ops.dsc_config) > hw_dsc->ops.dsc_config(hw_dsc, dsc, common_mode, initial_lines); > > @@ -1843,6 +1849,9 @@ static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc, > > if (hw_pp->ops.enable_dsc) > hw_pp->ops.enable_dsc(hw_pp); > + > + if (ctl->ops.update_pending_flush_dsc) > + ctl->ops.update_pending_flush_dsc(ctl, hw_dsc->idx); > } > > static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc, > @@ -1887,7 +1896,8 @@ static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc, > initial_lines = dpu_encoder_dsc_initial_line_calc(dsc, enc_ip_w); > > for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) > - dpu_encoder_dsc_pipe_cfg(hw_dsc[i], hw_pp[i], dsc, dsc_common_mode, initial_lines); > + dpu_encoder_dsc_pipe_cfg(dpu_enc, hw_dsc[i], hw_pp[i], dsc, > + dsc_common_mode, initial_lines); > } > > void dpu_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc) > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > index 4f7cfa9..832a6a7 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > @@ -139,6 +139,11 @@ static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) > CTL_DSPP_n_FLUSH(dspp - DSPP_0), > ctx->pending_dspp_flush_mask[dspp - DSPP_0]); > } > + > + if (ctx->pending_flush_mask & BIT(DSC_IDX)) > + DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH, > + ctx->pending_dsc_flush_mask); > + > DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, ctx->pending_flush_mask); > } > > @@ -285,6 +290,13 @@ static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx, > ctx->pending_flush_mask |= BIT(MERGE_3D_IDX); > } > > +static void dpu_hw_ctl_update_pending_flush_dsc_v1(struct dpu_hw_ctl *ctx, > + enum dpu_dsc dsc_num) > +{ > + ctx->pending_dsc_flush_mask |= BIT(dsc_num - DSC_0); > + ctx->pending_flush_mask |= BIT(DSC_IDX); > +} > + > static void dpu_hw_ctl_update_pending_flush_dspp(struct dpu_hw_ctl *ctx, > enum dpu_dspp dspp, u32 dspp_sub_blk) > { > @@ -502,9 +514,6 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, > if ((test_bit(DPU_CTL_VM_CFG, &ctx->caps->features))) > mode_sel = CTL_DEFAULT_GROUP_ID << 28; > > - if (cfg->dsc) > - DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH, cfg->dsc); > - > if (cfg->intf_mode_sel == DPU_CTL_MODE_SEL_CMD) > mode_sel |= BIT(17); > > @@ -524,10 +533,8 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, > if (cfg->merge_3d) > DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, > BIT(cfg->merge_3d - MERGE_3D_0)); > - if (cfg->dsc) { > - DPU_REG_WRITE(&ctx->hw, CTL_FLUSH, DSC_IDX); > + if (cfg->dsc) > DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc); > - } > } > > static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, > @@ -630,6 +637,9 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops, > ops->update_pending_flush_merge_3d = > dpu_hw_ctl_update_pending_flush_merge_3d_v1; > ops->update_pending_flush_wb = dpu_hw_ctl_update_pending_flush_wb_v1; > + > + ops->update_pending_flush_dsc = > + dpu_hw_ctl_update_pending_flush_dsc_v1; > } else { > ops->trigger_flush = dpu_hw_ctl_trigger_flush; > ops->setup_intf_cfg = dpu_hw_ctl_intf_cfg; > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h > index 6292002..5762752 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h > @@ -158,6 +158,15 @@ struct dpu_hw_ctl_ops { > enum dpu_dspp blk, u32 dspp_sub_blk); > > /** > + * OR in the given flushbits to the cached pending_(dsc_)flush_mask > + * No effect on hardware > + * @ctx : ctl path ctx pointer > + * @blk : interface block index > + */ > + void (*update_pending_flush_dsc)(struct dpu_hw_ctl *ctx, > + enum dpu_dsc blk); > + > + /** > * Write the value of the pending_flush_mask to hardware > * @ctx : ctl path ctx pointer > */ > @@ -245,6 +254,7 @@ struct dpu_hw_ctl { > u32 pending_wb_flush_mask; > u32 pending_merge_3d_flush_mask; > u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0]; > + u32 pending_dsc_flush_mask; > > /* ops */ > struct dpu_hw_ctl_ops ops; -- With best wishes Dmitry