Message ID | 20230629193001.22618-2-quic_abhinavk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9876173vqr; Thu, 29 Jun 2023 12:56:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hjEuNMFloEuZ65XLS0LzIqfZw5nxHsNL4AA+wLWIbyFiDRiBWKF5SaeAzDZ1xU1eWDVLa X-Received: by 2002:a05:6a21:6811:b0:12a:cc8:75dc with SMTP id wr17-20020a056a21681100b0012a0cc875dcmr524889pzb.31.1688068581824; Thu, 29 Jun 2023 12:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688068581; cv=none; d=google.com; s=arc-20160816; b=CYLGy6+03CzI9EakTBJi+1dwdVDsnuHrpISGw5U76aSCQ2wGV29o/GbSvp60i2mv/B d8bJj2LTHfIJvumQ4HmZwKuo9AVbbBlGhbuVZdx4pnsI2uFqs6TY/rTbaeKjO16WYChC /7t0DaeWjqz75btW7v+ItB+f9E4XhrkvDm4M20+ynFCBxjETmU80c49zeJ9pzwqEkd/A DO7HJHKjSQbLEdHIOSV7f/n837c6cNNW/Rf2cI7gcPKRACVsVnIAM3hrpsMp8mVgNHfW OhV7h/98oPLOtIk0dZkzRuxOEiwzRqI66Nk57E0GzvEgQEaUNK3spKpkhHfedGSJaM19 uRdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+hWul2nekoDN8xRttv+Z7MLmGJ5cvGp4fmfxDkERFUQ=; fh=r+FpN7If8GWuIi7B8VdUbCtL0rBZiJimtUxfKchadqw=; b=qtzZ0NK+TWXc3zf6nb5HlyYdHhaAIsHmhIBnzcWBGetv5EoloHap29BOvIISWKR+kK qTy47XeDN7yB7APD6BgvAijCBqeKIoKN9oNhlr8ESCtzj9DTBUDIkTcH5TO83hr9NI2/ RUZwlBg4QPtQS/5GEbuPLUc6D8vwdjIQ9lTEdjFk/gvoa5jMMf1iEewN7UljycPvNwf7 qAadFherXdts8T/w8SxpImVHSdbcj/uKUfuJr4caerIDx1x98wQXkhwj4tviUl/Nz1yj wQ+OMJaE53r/wIwEJbXQ5SJokbwrUcZPcgF9aUs09UcI7YHwsS8CzVwjHmiip6Sd8u69 pUgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QMmYLGIG; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020a631c08000000b0055745f8d6afsi11643213pgc.736.2023.06.29.12.56.08; Thu, 29 Jun 2023 12:56:21 -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=@quicinc.com header.s=qcppdkim1 header.b=QMmYLGIG; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231691AbjF2Tbb (ORCPT <rfc822;adanhawthorn@gmail.com> + 99 others); Thu, 29 Jun 2023 15:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232094AbjF2TbF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 29 Jun 2023 15:31:05 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91E9F3A92; Thu, 29 Jun 2023 12:30:25 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TInCVv017183; Thu, 29 Jun 2023 19:30:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=+hWul2nekoDN8xRttv+Z7MLmGJ5cvGp4fmfxDkERFUQ=; b=QMmYLGIGJ545+k1NwyPwnuIGq4gDdFqfekQdI1dNrBeiFe4WQsqimdG4eM+lJBJpur7K f+cYJIRUPo5uYpkXFuFohxwyAx0oTjPQSeWHdPsR50MR0/aPJB/IA49BlgEm9RUZVCPN 6uOENLjwuQxnDCp4NzCOMSt0v/NO1s7TECsgoVqOCthwXL61li17RuvxP+D/Vju3UPXz dWByswXYJ6j3E0/pDrmQm8+CRCIHALr3cuATwVZoXuuHkgeM/k2DxTkcGYxSQMnFoYv/ FowPYuBiwInbfa+pLlb4xBv5a0gJvuP0TbFDb3Bxj90lt+TwHSCGop4i+N9ILERD6tJO pg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rhamwgtxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 19:30:15 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35TJUEtl005027 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 19:30:14 GMT Received: from abhinavk-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.7; Thu, 29 Jun 2023 12:30:13 -0700 From: Abhinav Kumar <quic_abhinavk@quicinc.com> To: <freedreno@lists.freedesktop.org>, Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>, David Airlie <airlied@gmail.com>, "Daniel Vetter" <daniel@ffwll.ch> CC: <dri-devel@lists.freedesktop.org>, <quic_jesszhan@quicinc.com>, <andersson@kernel.org>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 2/3] drm/msm/dpu: use dpu core's major version to enable data compress Date: Thu, 29 Jun 2023 12:29:57 -0700 Message-ID: <20230629193001.22618-2-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230629193001.22618-1-quic_abhinavk@quicinc.com> References: <20230629193001.22618-1-quic_abhinavk@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: TDVU8Io6UUEhbslln6ZF1msXg7-J-J4x X-Proofpoint-GUID: TDVU8Io6UUEhbslln6ZF1msXg7-J-J4x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_06,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 phishscore=0 clxscore=1015 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290175 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770068200815107623?= X-GMAIL-MSGID: =?utf-8?q?1770068200815107623?= |
Series |
[v3,1/3] drm/msm/dpu: re-introduce dpu core revision to the catalog
|
|
Commit Message
Abhinav Kumar
June 29, 2023, 7:29 p.m. UTC
Instead of using a feature bit to decide whether to enable data
compress or not for DSC use-cases, use dpu core's major version instead.
This will avoid defining feature bits for every bit level details of
registers.
Also, rename the intf's enable_compression() op to program_datapath()
and allow it to accept a struct intf_dpu_datapath_cfg to program
all the bits at once. This can be re-used by widebus later on as
well as it touches the same register.
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
.../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++--
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++----
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 16 ++++++++++++++--
3 files changed, 26 insertions(+), 8 deletions(-)
Comments
On 29/06/2023 22:29, Abhinav Kumar wrote: > Instead of using a feature bit to decide whether to enable data > compress or not for DSC use-cases, use dpu core's major version instead. > This will avoid defining feature bits for every bit level details of > registers. > > Also, rename the intf's enable_compression() op to program_datapath() > and allow it to accept a struct intf_dpu_datapath_cfg to program > all the bits at once. This can be re-used by widebus later on as > well as it touches the same register. Two separate commits please, because... > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> > --- > .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++-- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++---- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 16 ++++++++++++++-- > 3 files changed, 26 insertions(+), 8 deletions(-) > > 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 b856c6286c85..f4e15b4c4cc9 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 > @@ -50,6 +50,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( > to_dpu_encoder_phys_cmd(phys_enc); > struct dpu_hw_ctl *ctl; > struct dpu_hw_intf_cfg intf_cfg = { 0 }; > + struct dpu_kms *dpu_kms = phys_enc->dpu_kms; > > ctl = phys_enc->hw_ctl; > if (!ctl->ops.setup_intf_cfg) > @@ -68,8 +69,12 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( > phys_enc->hw_intf, > phys_enc->hw_pp->idx); > > - if (intf_cfg.dsc != 0 && phys_enc->hw_intf->ops.enable_compression) > - phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); > + if (intf_cfg.dsc != 0 && dpu_kms->catalog->core_major_version >= 0x7) { ... because this becomes incorrect. The datapath should be programmed in all the cases, if there is a corresponding callback. intf_cfg.dsc should be used as a condition to set datapath_cfg. > + struct intf_dpu_datapath_cfg datapath_cfg = { 0 }; No need for `0' in the init, empty braces would be enough. > + > + datapath_cfg.data_compress = true; > + phys_enc->hw_intf->ops.program_datapath(phys_enc->hw_intf, &datapath_cfg); > + } > } > > 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 5b0f6627e29b..85333df08fbc 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c > @@ -513,11 +513,13 @@ static void dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, > > } > > -static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) > +static void dpu_hw_intf_program_datapath(struct dpu_hw_intf *ctx, > + struct intf_dpu_datapath_cfg *datapath_cfg) > { > u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); > > - intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; > + if (datapath_cfg->data_compress) > + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; > > DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); > } > @@ -543,8 +545,7 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops *ops, > ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; > } > > - if (cap & BIT(DPU_INTF_DATA_COMPRESS)) > - ops->enable_compression = dpu_hw_intf_enable_compression; > + ops->program_datapath = dpu_hw_intf_program_datapath; The `core_major_version >= 7' should either be here or in the callback itself. > } > > 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 99e21c4137f9..f736dca38463 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h > @@ -48,6 +48,11 @@ struct intf_status { > u32 line_count; /* current line count including blanking */ > }; > > +struct intf_dpu_datapath_cfg { > + u8 data_compress; /* enable data compress between dpu and dsi */ > + /* can be expanded for other programmable bits */ > +}; I'd say, dpu_datapath is too generic. What about intf_cmd_mode_cfg? > + > /** > * struct dpu_hw_intf_ops : Interface to the interface Hw driver functions > * Assumption is these functions will be called after clocks are enabled > @@ -70,7 +75,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 > + * @program_datapath: Program the DPU to interface datapath for relevant chipsets > */ > struct dpu_hw_intf_ops { > void (*setup_timing_gen)(struct dpu_hw_intf *intf, > @@ -108,7 +113,14 @@ struct dpu_hw_intf_ops { > */ > void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t encoder_id, u16 vdisplay); > > - void (*enable_compression)(struct dpu_hw_intf *intf); > + /** > + * Program the DPU to intf datapath by specifying > + * which of the settings need to be programmed for > + * use-cases which need DPU-intf handshake such as > + * widebus, compression etc. This is not a valid kerneldoc. > + */ > + void (*program_datapath)(struct dpu_hw_intf *intf, > + struct intf_dpu_datapath_cfg *datapath_cfg); > }; > > struct dpu_hw_intf {
On 6/29/2023 5:20 PM, Dmitry Baryshkov wrote: > On 29/06/2023 22:29, Abhinav Kumar wrote: >> Instead of using a feature bit to decide whether to enable data >> compress or not for DSC use-cases, use dpu core's major version instead. >> This will avoid defining feature bits for every bit level details of >> registers. >> >> Also, rename the intf's enable_compression() op to program_datapath() >> and allow it to accept a struct intf_dpu_datapath_cfg to program >> all the bits at once. This can be re-used by widebus later on as >> well as it touches the same register. > > Two separate commits please, because... > I thought of it but it seemed better together and was the only way I could think of. Please see below. >> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> >> --- >> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++-- >> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++---- >> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 16 ++++++++++++++-- >> 3 files changed, 26 insertions(+), 8 deletions(-) >> >> 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 b856c6286c85..f4e15b4c4cc9 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 >> @@ -50,6 +50,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >> to_dpu_encoder_phys_cmd(phys_enc); >> struct dpu_hw_ctl *ctl; >> struct dpu_hw_intf_cfg intf_cfg = { 0 }; >> + struct dpu_kms *dpu_kms = phys_enc->dpu_kms; >> ctl = phys_enc->hw_ctl; >> if (!ctl->ops.setup_intf_cfg) >> @@ -68,8 +69,12 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >> phys_enc->hw_intf, >> phys_enc->hw_pp->idx); >> - if (intf_cfg.dsc != 0 && phys_enc->hw_intf->ops.enable_compression) >> - phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); >> + if (intf_cfg.dsc != 0 && dpu_kms->catalog->core_major_version >= >> 0x7) { > > ... because this becomes incorrect. The datapath should be programmed in > all the cases, if there is a corresponding callback. intf_cfg.dsc should > be used as a condition to set datapath_cfg. > The issue is that today we do not have dpu_mdss_cfg as part of dpu_hw_intf nor _setup_intf_ops because all of those have been dropped with some rework or cleanup. Ideally even I would like to assign this op only for core_rev >=7 but that information is no longer available. We would have to start passing the major and minor versions to _setup_intf_ops() to go with that approach. So without making all of those changes, the only way I had was to assign the op unconditionally but call it only for major_rev >= 7. Passing core_rev to the op itself so that we can write the register only for core_rev >=7 is an option but then what if some bits start becoming usable only after minor rev. then we will have to start passing major and minor rev to program_datapath too. Again getting little messy. I am open to ideas to achieve the goal of assigning this op only for core_rev >=7 other than what I wrote above. > >> + struct intf_dpu_datapath_cfg datapath_cfg = { 0 }; > > No need for `0' in the init, empty braces would be enough. > ack. >> + >> + datapath_cfg.data_compress = true; >> + phys_enc->hw_intf->ops.program_datapath(phys_enc->hw_intf, >> &datapath_cfg); >> + } >> } >> 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 5b0f6627e29b..85333df08fbc 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >> @@ -513,11 +513,13 @@ static void >> dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, >> } >> -static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) >> +static void dpu_hw_intf_program_datapath(struct dpu_hw_intf *ctx, >> + struct intf_dpu_datapath_cfg *datapath_cfg) >> { >> u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); >> - intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >> + if (datapath_cfg->data_compress) >> + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >> DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); >> } >> @@ -543,8 +545,7 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops >> *ops, >> ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; >> } >> - if (cap & BIT(DPU_INTF_DATA_COMPRESS)) >> - ops->enable_compression = dpu_hw_intf_enable_compression; >> + ops->program_datapath = dpu_hw_intf_program_datapath; > > The `core_major_version >= 7' should either be here or in the callback > itself. > Yes, ideally I would like it like that but please see above why I couldnt do it. >> } >> 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 99e21c4137f9..f736dca38463 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >> @@ -48,6 +48,11 @@ struct intf_status { >> u32 line_count; /* current line count including blanking */ >> }; >> +struct intf_dpu_datapath_cfg { >> + u8 data_compress; /* enable data compress between dpu and dsi */ >> + /* can be expanded for other programmable bits */ >> +}; > > I'd say, dpu_datapath is too generic. What about intf_cmd_mode_cfg? > The goal was to keep it generic. Its actually the handshake between DPU and interface datapath so I chose that name. This is not specific to command mode and intf_cfg is already there so I chose that one :) >> + >> /** >> * struct dpu_hw_intf_ops : Interface to the interface Hw driver >> functions >> * Assumption is these functions will be called after clocks are >> enabled >> @@ -70,7 +75,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 >> + * @program_datapath: Program the DPU to interface datapath >> for relevant chipsets >> */ >> struct dpu_hw_intf_ops { >> void (*setup_timing_gen)(struct dpu_hw_intf *intf, >> @@ -108,7 +113,14 @@ struct dpu_hw_intf_ops { >> */ >> void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t >> encoder_id, u16 vdisplay); >> - void (*enable_compression)(struct dpu_hw_intf *intf); >> + /** >> + * Program the DPU to intf datapath by specifying >> + * which of the settings need to be programmed for >> + * use-cases which need DPU-intf handshake such as >> + * widebus, compression etc. > > This is not a valid kerneldoc. > hmmm ... ok so just // ? I referred disable_autorefresh from above and did the same. >> + */ >> + void (*program_datapath)(struct dpu_hw_intf *intf, >> + struct intf_dpu_datapath_cfg *datapath_cfg); >> }; >> struct dpu_hw_intf { >
On 30/06/2023 06:07, Abhinav Kumar wrote: > > > On 6/29/2023 5:20 PM, Dmitry Baryshkov wrote: >> On 29/06/2023 22:29, Abhinav Kumar wrote: >>> Instead of using a feature bit to decide whether to enable data >>> compress or not for DSC use-cases, use dpu core's major version instead. >>> This will avoid defining feature bits for every bit level details of >>> registers. >>> >>> Also, rename the intf's enable_compression() op to program_datapath() >>> and allow it to accept a struct intf_dpu_datapath_cfg to program >>> all the bits at once. This can be re-used by widebus later on as >>> well as it touches the same register. >> >> Two separate commits please, because... >> > > I thought of it but it seemed better together and was the only way I > could think of. Please see below. > >>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> >>> --- >>> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++-- >>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++---- >>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 16 ++++++++++++++-- >>> 3 files changed, 26 insertions(+), 8 deletions(-) >>> >>> 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 b856c6286c85..f4e15b4c4cc9 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 >>> @@ -50,6 +50,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >>> to_dpu_encoder_phys_cmd(phys_enc); >>> struct dpu_hw_ctl *ctl; >>> struct dpu_hw_intf_cfg intf_cfg = { 0 }; >>> + struct dpu_kms *dpu_kms = phys_enc->dpu_kms; >>> ctl = phys_enc->hw_ctl; >>> if (!ctl->ops.setup_intf_cfg) >>> @@ -68,8 +69,12 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >>> phys_enc->hw_intf, >>> phys_enc->hw_pp->idx); >>> - if (intf_cfg.dsc != 0 && phys_enc->hw_intf->ops.enable_compression) >>> - phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); >>> + if (intf_cfg.dsc != 0 && dpu_kms->catalog->core_major_version >= >>> 0x7) { >> >> ... because this becomes incorrect. The datapath should be programmed >> in all the cases, if there is a corresponding callback. intf_cfg.dsc >> should be used as a condition to set datapath_cfg. >> > > The issue is that today we do not have dpu_mdss_cfg as part of > dpu_hw_intf nor _setup_intf_ops because all of those have been dropped > with some rework or cleanup. Pass dpu_mdss_cfg to dpu_hw_intf_init(). It was removed as a cleanup, now we can reintroduce it. > > Ideally even I would like to assign this op only for core_rev >=7 but > that information is no longer available. We would have to start passing > the major and minor versions to _setup_intf_ops() to go with that > approach. So without making all of those changes, the only way I had was > to assign the op unconditionally but call it only for major_rev >= 7. > > Passing core_rev to the op itself so that we can write the register only > for core_rev >=7 is an option but then what if some bits start becoming > usable only after minor rev. then we will have to start passing major > and minor rev to program_datapath too. Again getting little messy. > > I am open to ideas to achieve the goal of assigning this op only for > core_rev >=7 other than what I wrote above. > >> >>> + struct intf_dpu_datapath_cfg datapath_cfg = { 0 }; >> >> No need for `0' in the init, empty braces would be enough. >> > > ack. > >>> + >>> + datapath_cfg.data_compress = true; >>> + phys_enc->hw_intf->ops.program_datapath(phys_enc->hw_intf, >>> &datapath_cfg); >>> + } >>> } >>> 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 5b0f6627e29b..85333df08fbc 100644 >>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>> @@ -513,11 +513,13 @@ static void >>> dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, >>> } >>> -static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) >>> +static void dpu_hw_intf_program_datapath(struct dpu_hw_intf *ctx, >>> + struct intf_dpu_datapath_cfg *datapath_cfg) >>> { >>> u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); >>> - intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >>> + if (datapath_cfg->data_compress) >>> + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >>> DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); >>> } >>> @@ -543,8 +545,7 @@ static void _setup_intf_ops(struct >>> dpu_hw_intf_ops *ops, >>> ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; >>> } >>> - if (cap & BIT(DPU_INTF_DATA_COMPRESS)) >>> - ops->enable_compression = dpu_hw_intf_enable_compression; >>> + ops->program_datapath = dpu_hw_intf_program_datapath; >> >> The `core_major_version >= 7' should either be here or in the callback >> itself. >> > > Yes, ideally I would like it like that but please see above why I > couldnt do it. > >>> } >>> 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 99e21c4137f9..f736dca38463 100644 >>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>> @@ -48,6 +48,11 @@ struct intf_status { >>> u32 line_count; /* current line count including blanking */ >>> }; >>> +struct intf_dpu_datapath_cfg { >>> + u8 data_compress; /* enable data compress between dpu and dsi */ >>> + /* can be expanded for other programmable bits */ >>> +}; >> >> I'd say, dpu_datapath is too generic. What about intf_cmd_mode_cfg? >> > > The goal was to keep it generic. Its actually the handshake between DPU > and interface datapath so I chose that name. Do you have plans of using it for the video mode? > > This is not specific to command mode and intf_cfg is already there so I > chose that one :) > >>> + >>> /** >>> * struct dpu_hw_intf_ops : Interface to the interface Hw driver >>> functions >>> * Assumption is these functions will be called after clocks are >>> enabled >>> @@ -70,7 +75,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 >>> + * @program_datapath: Program the DPU to interface >>> datapath for relevant chipsets >>> */ >>> struct dpu_hw_intf_ops { >>> void (*setup_timing_gen)(struct dpu_hw_intf *intf, >>> @@ -108,7 +113,14 @@ struct dpu_hw_intf_ops { >>> */ >>> void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t >>> encoder_id, u16 vdisplay); >>> - void (*enable_compression)(struct dpu_hw_intf *intf); >>> + /** >>> + * Program the DPU to intf datapath by specifying >>> + * which of the settings need to be programmed for >>> + * use-cases which need DPU-intf handshake such as >>> + * widebus, compression etc. >> >> This is not a valid kerneldoc. >> > > hmmm ... ok so just // ? > > I referred disable_autorefresh from above and did the same. > >>> + */ >>> + void (*program_datapath)(struct dpu_hw_intf *intf, >>> + struct intf_dpu_datapath_cfg *datapath_cfg); >>> }; >>> struct dpu_hw_intf { >>
On 6/29/2023 8:22 PM, Dmitry Baryshkov wrote: > On 30/06/2023 06:07, Abhinav Kumar wrote: >> >> >> On 6/29/2023 5:20 PM, Dmitry Baryshkov wrote: >>> On 29/06/2023 22:29, Abhinav Kumar wrote: >>>> Instead of using a feature bit to decide whether to enable data >>>> compress or not for DSC use-cases, use dpu core's major version >>>> instead. >>>> This will avoid defining feature bits for every bit level details of >>>> registers. >>>> >>>> Also, rename the intf's enable_compression() op to program_datapath() >>>> and allow it to accept a struct intf_dpu_datapath_cfg to program >>>> all the bits at once. This can be re-used by widebus later on as >>>> well as it touches the same register. >>> >>> Two separate commits please, because... >>> >> >> I thought of it but it seemed better together and was the only way I >> could think of. Please see below. >> >>>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> >>>> --- >>>> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++-- >>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++---- >>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 16 >>>> ++++++++++++++-- >>>> 3 files changed, 26 insertions(+), 8 deletions(-) >>>> >>>> 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 b856c6286c85..f4e15b4c4cc9 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 >>>> @@ -50,6 +50,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >>>> to_dpu_encoder_phys_cmd(phys_enc); >>>> struct dpu_hw_ctl *ctl; >>>> struct dpu_hw_intf_cfg intf_cfg = { 0 }; >>>> + struct dpu_kms *dpu_kms = phys_enc->dpu_kms; >>>> ctl = phys_enc->hw_ctl; >>>> if (!ctl->ops.setup_intf_cfg) >>>> @@ -68,8 +69,12 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( >>>> phys_enc->hw_intf, >>>> phys_enc->hw_pp->idx); >>>> - if (intf_cfg.dsc != 0 && >>>> phys_enc->hw_intf->ops.enable_compression) >>>> - phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); >>>> + if (intf_cfg.dsc != 0 && dpu_kms->catalog->core_major_version >>>> >= 0x7) { >>> >>> ... because this becomes incorrect. The datapath should be programmed >>> in all the cases, if there is a corresponding callback. intf_cfg.dsc >>> should be used as a condition to set datapath_cfg. >>> >> >> The issue is that today we do not have dpu_mdss_cfg as part of >> dpu_hw_intf nor _setup_intf_ops because all of those have been dropped >> with some rework or cleanup. > > Pass dpu_mdss_cfg to dpu_hw_intf_init(). It was removed as a cleanup, > now we can reintroduce it. > Thanks, that will address all these concerns. I wanted to get agreement before re-introducing it and also make sure there was no other way. >> >> Ideally even I would like to assign this op only for core_rev >=7 but >> that information is no longer available. We would have to start >> passing the major and minor versions to _setup_intf_ops() to go with >> that approach. So without making all of those changes, the only way I >> had was to assign the op unconditionally but call it only for >> major_rev >= 7. >> >> Passing core_rev to the op itself so that we can write the register >> only for core_rev >=7 is an option but then what if some bits start >> becoming usable only after minor rev. then we will have to start >> passing major and minor rev to program_datapath too. Again getting >> little messy. >> >> I am open to ideas to achieve the goal of assigning this op only for >> core_rev >=7 other than what I wrote above. >> >>> >>>> + struct intf_dpu_datapath_cfg datapath_cfg = { 0 }; >>> >>> No need for `0' in the init, empty braces would be enough. >>> >> >> ack. >> >>>> + >>>> + datapath_cfg.data_compress = true; >>>> + phys_enc->hw_intf->ops.program_datapath(phys_enc->hw_intf, >>>> &datapath_cfg); >>>> + } >>>> } >>>> 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 5b0f6627e29b..85333df08fbc 100644 >>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>>> @@ -513,11 +513,13 @@ static void >>>> dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, >>>> } >>>> -static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) >>>> +static void dpu_hw_intf_program_datapath(struct dpu_hw_intf *ctx, >>>> + struct intf_dpu_datapath_cfg *datapath_cfg) >>>> { >>>> u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); >>>> - intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >>>> + if (datapath_cfg->data_compress) >>>> + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; >>>> DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); >>>> } >>>> @@ -543,8 +545,7 @@ static void _setup_intf_ops(struct >>>> dpu_hw_intf_ops *ops, >>>> ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; >>>> } >>>> - if (cap & BIT(DPU_INTF_DATA_COMPRESS)) >>>> - ops->enable_compression = dpu_hw_intf_enable_compression; >>>> + ops->program_datapath = dpu_hw_intf_program_datapath; >>> >>> The `core_major_version >= 7' should either be here or in the >>> callback itself. >>> >> >> Yes, ideally I would like it like that but please see above why I >> couldnt do it. >> >>>> } >>>> 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 99e21c4137f9..f736dca38463 100644 >>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>>> @@ -48,6 +48,11 @@ struct intf_status { >>>> u32 line_count; /* current line count including >>>> blanking */ >>>> }; >>>> +struct intf_dpu_datapath_cfg { >>>> + u8 data_compress; /* enable data compress between dpu and >>>> dsi */ >>>> + /* can be expanded for other programmable bits */ >>>> +}; >>> >>> I'd say, dpu_datapath is too generic. What about intf_cmd_mode_cfg? >>> >> >> The goal was to keep it generic. Its actually the handshake between >> DPU and interface datapath so I chose that name. > > Do you have plans of using it for the video mode? > No because we didnt want to touch the video mode path as that was discussed in the widebus series already. Ok, I am fine with intf_cmd_mode_cfg in that case. >> >> This is not specific to command mode and intf_cfg is already there so >> I chose that one :) >> >>>> + >>>> /** >>>> * struct dpu_hw_intf_ops : Interface to the interface Hw driver >>>> functions >>>> * Assumption is these functions will be called after clocks are >>>> enabled >>>> @@ -70,7 +75,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 >>>> + * @program_datapath: Program the DPU to interface >>>> datapath for relevant chipsets >>>> */ >>>> struct dpu_hw_intf_ops { >>>> void (*setup_timing_gen)(struct dpu_hw_intf *intf, >>>> @@ -108,7 +113,14 @@ struct dpu_hw_intf_ops { >>>> */ >>>> void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t >>>> encoder_id, u16 vdisplay); >>>> - void (*enable_compression)(struct dpu_hw_intf *intf); >>>> + /** >>>> + * Program the DPU to intf datapath by specifying >>>> + * which of the settings need to be programmed for >>>> + * use-cases which need DPU-intf handshake such as >>>> + * widebus, compression etc. >>> >>> This is not a valid kerneldoc. >>> >> >> hmmm ... ok so just // ? >> >> I referred disable_autorefresh from above and did the same. >> >>>> + */ >>>> + void (*program_datapath)(struct dpu_hw_intf *intf, >>>> + struct intf_dpu_datapath_cfg *datapath_cfg); >>>> }; >>>> struct dpu_hw_intf { >>> >
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 b856c6286c85..f4e15b4c4cc9 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 @@ -50,6 +50,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( to_dpu_encoder_phys_cmd(phys_enc); struct dpu_hw_ctl *ctl; struct dpu_hw_intf_cfg intf_cfg = { 0 }; + struct dpu_kms *dpu_kms = phys_enc->dpu_kms; ctl = phys_enc->hw_ctl; if (!ctl->ops.setup_intf_cfg) @@ -68,8 +69,12 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( phys_enc->hw_intf, phys_enc->hw_pp->idx); - if (intf_cfg.dsc != 0 && phys_enc->hw_intf->ops.enable_compression) - phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); + if (intf_cfg.dsc != 0 && dpu_kms->catalog->core_major_version >= 0x7) { + struct intf_dpu_datapath_cfg datapath_cfg = { 0 }; + + datapath_cfg.data_compress = true; + phys_enc->hw_intf->ops.program_datapath(phys_enc->hw_intf, &datapath_cfg); + } } 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 5b0f6627e29b..85333df08fbc 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -513,11 +513,13 @@ static void dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, } -static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx) +static void dpu_hw_intf_program_datapath(struct dpu_hw_intf *ctx, + struct intf_dpu_datapath_cfg *datapath_cfg) { u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); - intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; + if (datapath_cfg->data_compress) + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); } @@ -543,8 +545,7 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops *ops, ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh; } - if (cap & BIT(DPU_INTF_DATA_COMPRESS)) - ops->enable_compression = dpu_hw_intf_enable_compression; + ops->program_datapath = dpu_hw_intf_program_datapath; } 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 99e21c4137f9..f736dca38463 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h @@ -48,6 +48,11 @@ struct intf_status { u32 line_count; /* current line count including blanking */ }; +struct intf_dpu_datapath_cfg { + u8 data_compress; /* enable data compress between dpu and dsi */ + /* can be expanded for other programmable bits */ +}; + /** * struct dpu_hw_intf_ops : Interface to the interface Hw driver functions * Assumption is these functions will be called after clocks are enabled @@ -70,7 +75,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 + * @program_datapath: Program the DPU to interface datapath for relevant chipsets */ struct dpu_hw_intf_ops { void (*setup_timing_gen)(struct dpu_hw_intf *intf, @@ -108,7 +113,14 @@ struct dpu_hw_intf_ops { */ void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t encoder_id, u16 vdisplay); - void (*enable_compression)(struct dpu_hw_intf *intf); + /** + * Program the DPU to intf datapath by specifying + * which of the settings need to be programmed for + * use-cases which need DPU-intf handshake such as + * widebus, compression etc. + */ + void (*program_datapath)(struct dpu_hw_intf *intf, + struct intf_dpu_datapath_cfg *datapath_cfg); }; struct dpu_hw_intf {