Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5017526rwr; Mon, 8 May 2023 16:51:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OdLNyVtjYk7pgA8DOz1QzROFN70bzBLeaNcoTu5RH2HlfIVjtlmVkGu4qJIg0m9Qog7b8 X-Received: by 2002:a17:903:11c7:b0:1a9:7b5e:14ba with SMTP id q7-20020a17090311c700b001a97b5e14bamr14180960plh.29.1683589870408; Mon, 08 May 2023 16:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683589870; cv=none; d=google.com; s=arc-20160816; b=ySRhBioiubeYMV9j2F+HBgOhY+PB1hswLgJ3bax+WByOQPaUNvUyJiqaKooiiE48ux mDhcQvNUx3yB1Fr1IRLXkmAV/iFVp5neG9dbBKjb/zO50OV6/OXuvojieXuF5RJs65j1 veYR57pU44DeUGzj+KCbZ9LzNX+X1EBOQZdtNPloOBfMo128D62O6iqj+sayIG8P5zK8 bi3GwS6j0+VTUrHomHnDgcP7EWhZlgXy9aMahpduGi+G5Qi6OVKpMXxJ8n5HFGDTFcSo vlNr1v0nqjxPN5QXaGWyf1RwyEn26BEAL/8D2Oh+GPvWo7vrH0L0A4ActNp6fli4vYlF UoaA== 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=2S/JvWbRe7wfchHGc0JcrfFf1R7m1YVrYv1Sf3TcO1M=; b=asc7RHst8SGrvq26B3J4/iyxX/uzqbAlXzYmIi63/KJN/eZIkFc+pHDOBOdP86dT56 jXsUjxTsXp4kLrQCqRzc6KdqDviSdq8cxaEOBwlIjXshb5dbxjp7E8IoH9x6TgMvsSW2 EjC9PycBEZT5ubgK6G4XKlwM1vMGgMSz+E7erzdRejf35G7FKwwK8MnLtRQ5XOrAl9wY dnp04PWv6a6ybgw2Qc4V0muRiy5LJQbtAnOgtYGD/xkO6aOOemzWPI/Owk4D0GU7tyzy ZstOy/IIh2BM1Y2UUXUSbyRa+ZvNpq/zeg0QZKyWnI/XXZAQV46gKvdL7jGNSVLaVfMi zXgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RJ9lq9I1; 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 j4-20020a170903028400b001aaff9c8dd1si92320plr.427.2023.05.08.16.50.56; Mon, 08 May 2023 16:51:10 -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=RJ9lq9I1; 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 S234031AbjEHXSH (ORCPT + 99 others); Mon, 8 May 2023 19:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjEHXSF (ORCPT ); Mon, 8 May 2023 19:18:05 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F3D959D5; Mon, 8 May 2023 16:18:03 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 348MpGSa011632; Mon, 8 May 2023 23:17:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=2S/JvWbRe7wfchHGc0JcrfFf1R7m1YVrYv1Sf3TcO1M=; b=RJ9lq9I1iLSLUBSrx9T9M8Lsr61BagKdyr6/4HS7dkimUCwofYt9nl1WUuuWYgSr7s0o Y7cFalYwpsVM9ri0N0xfW2kTpupmTGKBYnA/qbX0+0FFoGrEcm/jkSb4ll1jAJCznRO7 YRuRYv7bKpUQpjkCn3p1zl7Mc7jLYerBksFd5AeVeVWd9dI5jYnpwzZZ74YPGVGMEf2A WM1pGy8aTnnbNuDPPkCnMuTXJrrWGGxkP3KNoM3wr2Rwc+XcqA6RYAYDGr3DRUtcBd8i iwawT1rBKOv4Zw0wsiT9iq+TkNk9EIyn9I5eup2oo3tlJ5SMIWn2hquQHE0r2hz2Yqad Uw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qf77f0awg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 May 2023 23:17:56 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 348NHt3n024386 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 May 2023 23:17:55 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 16:17:55 -0700 Message-ID: Date: Mon, 8 May 2023 16:17:54 -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: [PATCH v2 4/4] drm/msm/dpu: Set DATA_COMPRESS for command mode Content-Language: en-US To: Marijn Suijten CC: , Sean Paul , "Abhinav Kumar" , , , Konrad Dybcio , , Dmitry Baryshkov References: <20230405-add-dsc-support-v2-0-1072c70e9786@quicinc.com> <20230405-add-dsc-support-v2-4-1072c70e9786@quicinc.com> From: Jessica Zhang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: YX-fttudjvb0muIfc-sSLL9i2vgy4x-U X-Proofpoint-GUID: YX-fttudjvb0muIfc-sSLL9i2vgy4x-U 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_16,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305080156 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, 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/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. > >> 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 >>