Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5067723rwr; Mon, 8 May 2023 17:47:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bNTsN1GgEB3I5+HdYRpBQOOUVfvyuhSIfYwC+4soVuzBUhXg+K56y9j/MhPl5XY0w8IOo X-Received: by 2002:a05:6a20:938f:b0:ff:6d33:f16c with SMTP id x15-20020a056a20938f00b000ff6d33f16cmr12741257pzh.8.1683593266560; Mon, 08 May 2023 17:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683593266; cv=none; d=google.com; s=arc-20160816; b=x7jUFzdNb/TcUReus1DjW2We+OQMpGnLm2/l+aGW47RwslzCcRV5uiWniTlvPP57Xu Nyfbvf0iBkP9sCq4mv69a9vdeYNLxMsdkp2+ZcnRRs5TJF5hjzveM/XPZxNxKrwUmhqo BoYL4CaY7iH7JLuBr9tkwCd11ZrK2wpOKGyWUe3BAI53rrco1yCuCP9Z6N7uWzoKAAsU 7DY625FdEXMUsv/84wmPTkz1jn69xCRLGHh74hKRlToGi5vFddpRBz3vff+HW8+m+C/g X/HAz2jky0BQDZm5KZzE9FLEcadcu594V8LFtWImKJiEU7jZ0RFU2Sdwgl7/WoFKFLG0 o2EA== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=cP644vxFEnuaq+QtuLolN7H6tCQK5Xhu+hJjts/Za70=; b=IdpCaHijLECJI5Oa1t4FlB6+8WkQr1JwVoDVQgoKwZoEyI53SfhgnSuqi2dFhcG/ii LTVRFPxdzgRfrm24RrIpIt5h8hO91Wv2idIQ6au7i9G0b5br3ig/5zZfvXPc5Pp8mlso wNF1OznL3+WjZmwpJOHcQIArVgxoqNm43z5x7vaq8ynuc4/4Tt3KNCeDwmAJPkQw8nlV IBzLQiKSzhuyWHPLcPtTq4HlZfGix5Z1q4iFPFGoQ0nk18TCFlgLWe/3VlxF2+lEqOmb QLAxZ8m/FFsKV+pZzU9hGzgqyctAjVWLgj1W1E9TJvmFMOGZ0GG6Wq7htbVwDXjn1CD0 4hWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hdNWiJGN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c18-20020a637252000000b00528d30e698bsi180949pgn.734.2023.05.08.17.47.34; Mon, 08 May 2023 17:47:46 -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=hdNWiJGN; 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 S229637AbjEIAAX (ORCPT + 99 others); Mon, 8 May 2023 20:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjEIAAW (ORCPT ); Mon, 8 May 2023 20:00:22 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC00110FE; Mon, 8 May 2023 17:00:20 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 348McX2R025295; Tue, 9 May 2023 00:00:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=cP644vxFEnuaq+QtuLolN7H6tCQK5Xhu+hJjts/Za70=; b=hdNWiJGNumrf+wHcJb0OhWcWCZq4eR7ycDjbYLIttrYycqoTNC9mCem+4EmHsCaks/9T CydqkDJEGuaEcAMYEglX9hOn+enbzKp6Pun45Ss+Owi9czJp+RcYw5pa4X3DrSjEF3J8 uU7HBat/HL8YPJhni1q81QqB9cO2yct37c0MQhPvY1z0wm5qrhVkH9VpYtiVq3JZVB+6 P6kQxyPr2Pc6kcXAHHyrJZzF5EYyrUfZE8TexwMrl1t1C4lc0D6KIqqHrTBZARQe27bM jlG0wF9fG6aqDKhRTOieR21Rv7XJJW2nGy7R3MPDfToUGlfn13myFRXedWvODeQDFpnu 2A== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qf7850cfw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 May 2023 00:00:14 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34900D9F006263 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 May 2023 00:00:13 GMT Received: from [10.71.110.193] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 8 May 2023 17:00:12 -0700 Message-ID: Date: Mon, 8 May 2023 17:00:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [Freedreno] [PATCH v2 4/4] drm/msm/dpu: Set DATA_COMPRESS for command mode Content-Language: en-US From: Jessica Zhang To: Marijn Suijten CC: , Abhinav Kumar , , , Konrad Dybcio , , Dmitry Baryshkov , Sean Paul References: <20230405-add-dsc-support-v2-0-1072c70e9786@quicinc.com> <20230405-add-dsc-support-v2-4-1072c70e9786@quicinc.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: QBar3oebH9jA8Nv2xS7BoBDWjAVa9JQO X-Proofpoint-GUID: QBar3oebH9jA8Nv2xS7BoBDWjAVa9JQO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-08_17,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 impostorscore=0 spamscore=0 mlxscore=0 priorityscore=1501 adultscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305080161 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 5/8/2023 4:17 PM, Jessica Zhang wrote: > > > On 5/7/2023 9:06 AM, Marijn Suijten wrote: >> 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. (Sorry, forgot to address this comment in my initial reply) The op will be available for video mode to use, but most likely video mode will set DATA_COMPRESS (or call dpu_hw_intf_enable_compression()) directly in dpu_hw_intf_setup_timing_engine(). Thanks, Jessica Zhang >> >>> 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. > > Hi Marijn, > > Sounds good. > >> >>> +} >> >> 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(). > > Acked. > >> >>>   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. > > Sure, is the plan to correct the whitespace in the first half of the > comment block in the future? > > Thanks, > > Jessica Zhang > >> >> - 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 >>>