Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3339131rwr; Sun, 7 May 2023 09:29:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CfmhaXZm3f5jHVL/I3lfsP4nT/Zq7tb9XbaNNOTpj4c+FbU6mAUgB9a+EFbbH0frIL9oU X-Received: by 2002:a17:902:e850:b0:1aa:e5e9:6769 with SMTP id t16-20020a170902e85000b001aae5e96769mr11001929plg.23.1683476979629; Sun, 07 May 2023 09:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683476979; cv=none; d=google.com; s=arc-20160816; b=vn7BCB86f1PAhoZ0cIo0MlUbdKOcaIO4ZsjpZegySqxQ0dYRzkBz+xoGRvlHoPQbJt 6Yup98fdfngo7QqrRHAcfPOv2czJz2OPS8ZjLeAClszG7ecc81ZW9SyNuRhOmON528P+ TKC3XJ52z2iiwa0zB3NyaHy5PKDxZuM0RKpyiODO05d9bd5h45KyDVTARbfSEO8vDT0j D5g64A8RVzCD1bfNUaG2vbeihdGD8goSdmiM07ax5o44HJ2l47QXLM/5lRp4kM/c+ePJ HeE4BY2/cczBE3kQv+GG5rnlzQq6Af3b9g89RM5HfTKAhxxGjMubma0S7mYOAWgfUJ7j EjFw== 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=iwyufMBuI2kT16ammQMYggBHho2rtsuBmsPGubo1KLE=; b=flX4U34qylwtrgTyTbgphrwFfjGx5I5MmDIw5fYpfyGJJMNgntNjh2b4oAjfHGvH42 bYpl8CS2B3eCdnpE8sCgwQNYPkea6//tKbVGl4BDjCkvVeLEGCdIvULDx4M5Ssh7I0pu dfHAWHEEUH1dOebqWqgYqZq773PH88ggfRShOUEGAvZfaFCohRC1ISmgQ3qTzeW/XK+h 4nfOIqJnHN7+wwAgI4T44LJXmqECn3xSD/o8zjDTjZ81OK9iswOmSpTjLskroFPViPhA YgtsatXND7HsrCVY0+ycK1BhbbOucq5v9/0mLVRDDx4CJfdZfwkJdZY3PMyfDDFCB6YM O+/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 i6-20020a170902c94600b001a6db2bef14si6499940pla.157.2023.05.07.09.29.25; Sun, 07 May 2023 09:29:39 -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 S231593AbjEGQG7 (ORCPT + 99 others); Sun, 7 May 2023 12:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjEGQG6 (ORCPT ); Sun, 7 May 2023 12:06:58 -0400 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [IPv6:2001:4b7a:2000:18::169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29CF88A4C; Sun, 7 May 2023 09:06:49 -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-r2.th.seeweb.it (Postfix) with ESMTPSA id 248A23F1F3; Sun, 7 May 2023 18:06:46 +0200 (CEST) Date: Sun, 7 May 2023 18:06:44 +0200 From: Marijn Suijten To: Jessica Zhang Cc: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Konrad Dybcio , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] drm/msm/dpu: Set DATA_COMPRESS for command mode Message-ID: References: <20230405-add-dsc-support-v2-0-1072c70e9786@quicinc.com> <20230405-add-dsc-support-v2-4-1072c70e9786@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405-add-dsc-support-v2-4-1072c70e9786@quicinc.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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-05 14:23:51, Jessica Zhang wrote: > Add a DPU INTF op to set DATA_COMPRESS register for command mode panels if > the DPU_INTF_DATA_COMPRESS feature flag is set. This flag needs to be > enabled in order for DSC v1.2 to work. > > Note: These changes are for command mode only. Video mode changes will > be posted along with the DSC v1.2 support for DP. Nit: the "command mode" parts of both paragraphs only apply to the call in dpu_encoder_phys_cmd, right? If so, and the INTF op remains the same for video mode (but only the call needs to be added to the dpu_encoder_phy_vid), make this a bit more clear in your commit message. > Changes in v2: > - Fixed whitespace issue in macro definition > - Read INTF_CONFIG2 before writing to DATA_COMPRESS bit > - Only set dpu_hw_intf_ops.data_compress if DATA_COMPRESS feature is set > - Removed `inline` from dpu_hw_intf_enable_compression declaration > > Signed-off-by: Jessica Zhang > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 3 +++ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 11 +++++++++++ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 2 ++ > 3 files changed, 16 insertions(+) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > index d8ed85a238af..1a4c20f02312 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > @@ -68,6 +68,9 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( > phys_enc->hw_intf, > true, > phys_enc->hw_pp->idx); > + > + if (phys_enc->hw_intf->ops.enable_compression) > + phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); > } > > static void dpu_encoder_phys_cmd_pp_tx_done_irq(void *arg, int irq_idx) > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c > index 6485500eedb8..322c55a5042c 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c > @@ -91,6 +91,14 @@ > > #define INTF_CFG2_DATABUS_WIDEN BIT(0) > #define INTF_CFG2_DATA_HCTL_EN BIT(4) > +#define INTF_CFG2_DCE_DATA_COMPRESS BIT(12) > + > +static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) > +{ > + u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); > + > + DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2 | INTF_CFG2_DCE_DATA_COMPRESS); I'm not sure if it's more idiomatic to write: intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; On a separate line. > +} Move the function close to the bottom of this file. Right now all the functions are defined approximately in the same order as they're listed in the header and assigned in _setup_intf_ops(). > > static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, > const struct intf_timing_params *p, > @@ -542,6 +550,9 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops *ops, > ops->vsync_sel = dpu_hw_intf_vsync_sel; > ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; > } > + > + if (cap & BIT(DPU_INTF_DATA_COMPRESS)) > + ops->enable_compression = dpu_hw_intf_enable_compression; > } > > struct dpu_hw_intf *dpu_hw_intf_init(const struct dpu_intf_cfg *cfg, > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h > index 73b0885918f8..a8def68a5ec2 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h > @@ -70,6 +70,7 @@ struct intf_status { > * @get_autorefresh: Retrieve autorefresh config from hardware > * Return: 0 on success, -ETIMEDOUT on timeout > * @vsync_sel: Select vsync signal for tear-effect configuration > + * @enable_compression: Enable data compression Indent to match above. - Marijn > */ > struct dpu_hw_intf_ops { > void (*setup_timing_gen)(struct dpu_hw_intf *intf, > @@ -107,6 +108,7 @@ struct dpu_hw_intf_ops { > * Disable autorefresh if enabled > */ > void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t encoder_id, u16 vdisplay); > + void (*enable_compression)(struct dpu_hw_intf *intf); > }; > > struct dpu_hw_intf { > > -- > 2.40.1 >