Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp843049pxb; Thu, 17 Feb 2022 16:21:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0aUO5kon8Q6uzJ0IqC9dd8IVUKMfndE7z7LMOj5yVfUVWakFSjRiaIzKIwBfG5Ld+GqnX X-Received: by 2002:a17:902:ccc8:b0:14e:e89c:c688 with SMTP id z8-20020a170902ccc800b0014ee89cc688mr5089340ple.121.1645143689279; Thu, 17 Feb 2022 16:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645143689; cv=none; d=google.com; s=arc-20160816; b=X7n1D46XOykmYZahcx10yaIFn7g+VELMv+L2822atXNwL4kpdxaoTu8YPYvBE+Mmeh SjIpEohFq+I2G6gEgL/5kI/faRtwp1HEpOOZ77oT0y0U4MJ/ma2o7We29K+529hrj55H zCSJL6HZhk5EuglMzzMePswe55lFA5AgPutsL7X39tzbIeqBWRhJRtblxK2Wj1YjCedV uPSkHtUuo8YjuKwaROwyLnV9yGGBg43y22JLqcqweYpR/axUqbjxvaLoR1mjDjDlkKFh dU3V/Z392zx+Mc2/DfKHmEzH6tDYG9kXF2k+LJfADKWi8iFrml/nrhtm54e22OZOmQAz Qemg== 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=KwOWcmymGtsUkLzWQ2/01CmyMsx1skZLFrjnRa6Z6ao=; b=aDEUPeRT+O4hZA8el8BckIXACbZiIpE5Jq7G8HyLV/qzCKzR79IEG4nRyXCd7vsQ2c 2v9+JLKJLfC8YnV+A/rrtWQyR2AD4Ig5jYk3OxDFew2gYn+dZInC9FffGboRKgOOFgzn kMOsdtsVW8Z2ldL1y4yA4g8Gw3aGSlUKehW8AeG13ODuAmrbAWQ1O6kYega4KSRkbAJ6 01SGKSMCTQdsNtcDMWZ1zWvucsMBF7fr4g0PFMipXfFSTWKG10FiV5r1wcnJmo1tin4w 9fPhMikRx4JX0kRPMycxm/ZU52Sc5ti+3H/EULVzxVfugNePKUdXyAC08zwz4lPbGcTJ gPBA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b12si26172378plg.8.2022.02.17.16.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 16:21:29 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 84347363DA6; Thu, 17 Feb 2022 15:44:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343767AbiBQWUo (ORCPT + 99 others); Thu, 17 Feb 2022 17:20:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244857AbiBQWUo (ORCPT ); Thu, 17 Feb 2022 17:20:44 -0500 Received: from relay05.th.seeweb.it (relay05.th.seeweb.it [5.144.164.166]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B37B166E01 for ; Thu, 17 Feb 2022 14:20:27 -0800 (PST) Received: from SoMainline.org (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (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 7C0EA3F810; Thu, 17 Feb 2022 23:20:25 +0100 (CET) Date: Thu, 17 Feb 2022 23:20:24 +0100 From: Marijn Suijten To: Vinod Koul Cc: Rob Clark , linux-arm-msm@vger.kernel.org, Bjorn Andersson , David Airlie , Daniel Vetter , Jonathan Marek , Dmitry Baryshkov , Abhinav Kumar , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: Re: [REPOST PATCH v4 06/13] drm/msm/disp/dpu1: Add DSC support in hw_ctl Message-ID: <20220217222024.mf4cmgtpvvg3bftm@SoMainline.org> References: <20220210103423.271016-1-vkoul@kernel.org> <20220210103423.271016-7-vkoul@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220210103423.271016-7-vkoul@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-02-10 16:04:16, Vinod Koul wrote: > Later gens of hardware have DSC bits moved to hw_ctl, so configure these > bits so that DSC would work there as well > > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Vinod Koul > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 11 ++++++++++- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 2 ++ > 2 files changed, 12 insertions(+), 1 deletion(-) > > 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 02da9ecf71f1..49659165cea8 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > @@ -25,6 +25,8 @@ > #define CTL_MERGE_3D_ACTIVE 0x0E4 > #define CTL_INTF_ACTIVE 0x0F4 > #define CTL_MERGE_3D_FLUSH 0x100 > +#define CTL_DSC_ACTIVE 0x0E8 > +#define CTL_DSC_FLUSH 0x104 > #define CTL_INTF_FLUSH 0x110 > #define CTL_INTF_MASTER 0x134 > #define CTL_FETCH_PIPE_ACTIVE 0x0FC > @@ -34,6 +36,7 @@ > > #define DPU_REG_RESET_TIMEOUT_US 2000 > #define MERGE_3D_IDX 23 > +#define DSC_IDX 22 This define does not seem used in any of these patches. Is that intended? > #define INTF_IDX 31 > #define CTL_INVALID_BIT 0xffff > #define CTL_DEFAULT_GROUP_ID 0xf > @@ -121,7 +124,6 @@ static u32 dpu_hw_ctl_get_pending_flush(struct dpu_hw_ctl *ctx) > > static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) > { > - > if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX)) > DPU_REG_WRITE(&ctx->hw, CTL_MERGE_3D_FLUSH, > ctx->pending_merge_3d_flush_mask); > @@ -506,6 +508,9 @@ 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); > > @@ -517,6 +522,10 @@ 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, cfg->dsc); Perhaps this should have been `DSC_IDX`, as the index to flush is set in the CTL_DSC_FLUSH register already? Should this go through pending_flush_mask machinery? > + DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc); > + } > } > > static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, > 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 806c171e5df2..9847c9c46d6f 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h > @@ -40,6 +40,7 @@ struct dpu_hw_stage_cfg { > * @merge_3d: 3d merge block used > * @intf_mode_sel: Interface mode, cmd / vid > * @stream_sel: Stream selection for multi-stream interfaces > + * @dsc: DSC BIT masks Bit masks of what? Enabled DSCs? A more verbose doc-comment is desired here, matching the rest of the fields :) - something like "DSC block(s) used" similar to merge_3d? Or copy the docs from `dsc_mask`, which is the value that is written into this field. - Marijn > */ > struct dpu_hw_intf_cfg { > enum dpu_intf intf; > @@ -47,6 +48,7 @@ struct dpu_hw_intf_cfg { > enum dpu_merge_3d merge_3d; > enum dpu_ctl_mode_sel intf_mode_sel; > int stream_sel; > + unsigned int dsc; > }; > > /** > -- > 2.31.1 >