Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp776225rdf; Tue, 21 Nov 2023 17:01:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQ80SYv8pGpLhAJFrf8fPbRCUmYumBQdiz6ka1tw7GrSVSK24HshQH9dYZEI+0XXYlNyl5 X-Received: by 2002:a05:6820:810:b0:582:c8b4:d9df with SMTP id bg16-20020a056820081000b00582c8b4d9dfmr1160336oob.1.1700614875916; Tue, 21 Nov 2023 17:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700614875; cv=none; d=google.com; s=arc-20160816; b=G44JTyfTqIuZLt4gzVs+XFZYPTV4ZFKAnKweFCzNcJMe0EWRx7ogVXBe0ob4qzHslf yzwwb6h/xZ/at5mgS18Nf5TS7MpdlSNM5oCx8jqJMSjzNbtX5VNcB757/xecRR9eH9l3 MgCiu30PAZbZP3y1nuhqrzTK8V9oVRiLrTjGW3qcZPn0Wjb6GJQXghKAerZpY1hz/qp6 rrkd4QTTGnO1zOEwUFu9iPIYIXm+krFBNBSpDnk1koHt7aBEUf9XLinN8JgUzplkhoOC /vIQE2ScqRb8Xveg16A7CEJ8/1FaXyRYPAbns/3pGt/vj0kJ4HbASnmxN9FUxdcJw3pK 96dA== 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=at4TJKe5/xTv1ywl/HVRKfJ6QkWba3i5SVFbw7qSANo=; fh=lk63d3b3mdaxDgKVqjvQ/+Mucchp2n1VYraxRDxuMxE=; b=JPAgaB8j1ute8fNDBgyxuRnHaYKdNvO9ZIyGRWxcL85PVXcQDLUbibTnx4VePIKra/ wsuh2owFn8wv5MLJyCVFUgBYuU3NgKLC4meh3IemxgYlDUZIUUReHkSXnNyNmD9gures T6n7LwbnBidm2VO7lWDxE/EwyxENBgi0zSbZ4hzm3aAoAljYABJZRaTtflwn9j2nIoQS JGXkSsSpr70zSamR2YdkG5p6J1YcvliHWCz5IZfgsTomwtY8On2OvTGWOOguQD3I2CiX KqwrT97G0l1sF4kmoPTiLyeaZn5LVPrnRBZIgBsh/0TJ5l00U3+5rtvRz2d0RYSX8Sch nfLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DP+Ij6jz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bw24-20020a056820021800b0057b9d1a44c6si4248880oob.44.2023.11.21.17.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 17:01:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DP+Ij6jz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AD9BB8084963; Tue, 21 Nov 2023 17:00:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234986AbjKVBAJ (ORCPT + 99 others); Tue, 21 Nov 2023 20:00:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjKVBAJ (ORCPT ); Tue, 21 Nov 2023 20:00:09 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A321593; Tue, 21 Nov 2023 17:00:04 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AM0OF2A019663; Wed, 22 Nov 2023 00:59:33 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=at4TJKe5/xTv1ywl/HVRKfJ6QkWba3i5SVFbw7qSANo=; b=DP+Ij6jz6i7SWdlWX2Ycn3q9vhHTRIYEMS9vWJ6rdqsytUWjTZBUZffecATHIkFMym9o MZqXRc9zEyTrMtS4synjiLtqe8u0jNa5XSnm9F/5ohvsiNI/9rn5u/AWyt74kQhTK7cP cxFSV0ASYwmHkJvsIEJBKC8Nky2ADlGCWpCl2ND7bPW2jLYoyTgd5CqnuOXgc4Mf1wG1 Uk4L2mGDUbiK+MWJ+XWzffwZ4EEUnA510q3Zf+a1b5/cv5WbWHNg2k7+5GRNL/5NMR9K cZPz54natW2awGiiwjDAoN+wXPYmUmo7Zs7r8r1fY/b5EzF5Xk4wsvONR0X1mGXXOl6L FQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uh477gccj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 00:59:32 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AM0xWJ9008877 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 00:59:32 GMT Received: from [10.71.109.77] (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.40; Tue, 21 Nov 2023 16:59:31 -0800 Message-ID: <191a3d1a-bcd3-4e0d-360d-61c1c2a61147@quicinc.com> Date: Tue, 21 Nov 2023 16:59:30 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] drm/msm/dpu: Fix encoder CRC to account for CTM enablement Content-Language: en-US To: Rob Clark CC: Dmitry Baryshkov , Rob Clark , , "Jeykumar Sankaran" , Kalyan Thota , , Jiasheng Jiang , Arnaud Vrac , , Vinod Polimera , Konrad Dybcio , "Marijn Suijten" , Jessica Zhang , Kuogee Hsieh , "Sean Paul" , open list References: <20231023221250.116500-1-robdclark@gmail.com> From: Abhinav Kumar 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: 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: crbydftlUTBVoJVWlAu6jMsxM9b4MI50 X-Proofpoint-GUID: crbydftlUTBVoJVWlAu6jMsxM9b4MI50 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-21_16,2023-11-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311220004 X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 17:00:37 -0800 (PST) On 11/21/2023 4:27 PM, Rob Clark wrote: > On Tue, Nov 21, 2023 at 4:41 PM Abhinav Kumar wrote: >> >> >> >> On 10/24/2023 12:01 PM, Abhinav Kumar wrote: >>> >>> >>> On 10/23/2023 4:03 PM, Dmitry Baryshkov wrote: >>>> On Tue, 24 Oct 2023 at 01:36, Rob Clark wrote: >>>>> >>>>> On Mon, Oct 23, 2023 at 3:30 PM Dmitry Baryshkov >>>>> wrote: >>>>>> >>>>>> On Tue, 24 Oct 2023 at 01:12, Rob Clark wrote: >>>>>>> >>>>>>> From: Rob Clark >>>>>>> >>>>>>> Seems like we need to pick INPUT_SEL=1 when CTM is enabled. But not >>>>>>> otherwise. >>>>>>> >>>>>>> Suggested-by: Dmitry Baryshkov >>>>>>> Signed-off-by: Rob Clark >>>>>>> --- >>> >>> I cannot find anything in the docs which suggest this solution is correct. >>> >>> Different blocks in the DPU pipeline have their own CRC (MISR) registers >>> like LM, intf etc. >>> >>> We dont need to change INPUT_SEL to tell DPU from which pipeline to take >>> the CRC from as each of them have their own registers. >>> >>> INPUT_SEL is controlling whether the CRC needs to be calculated over the >>> entire display timings or only the active pixels. I am unable to tell at >>> the moment why this is making a difference in this use-case. >>> >>> Since I am unable to find any documentation proving this solution is >>> correct so far, unfortunately I would hold this back till then. >>> >>> We will investigate this issue and report our findings on this thread on >>> how to proceed. >>> >> >> Alright, we debugged and also found some more answers. >> >> The correct solution is indeed to set INPUT_SEL = 1 but let me explain >> why and what should be the correct way. >> >> INPUT_SEL was indeed telling whether to compute CRC over active pixels >> or active pixels + timings like I wrote before but this behavior changed >> since some chipsets. >> >> Now, INPUT_SEL = 0 means compute CRC *only* over timings and not the >> active area (and not display + timings like before) and like mentioned >> before this has nothing to do with what is the input to the CRC. Not >> covering the active area will not change the CRC at all as Rob reported >> but its not specific to CTM. >> >> Which means we should have been setting INPUT_SEL=1 whenever we use INTF >> CRC irrespective of whether CTM is used or not. >> >> What this also means is INTF CRC was not working correctly at all so far >> irrespecive of CTM or not because it was always computing CRC only on >> the timings (non-active area). >> >> This was not caught so far because it looks like IGT's >> kms_pipe_crc_basic test which was used to validate this only compares >> CRC between two frames of the same content to match if they were equal >> and not changing contents and comparing like kms_plane does. It will >> pass as CRC would not have changed. >> >> Now coming to the fix, the reset value of this register INTF_MISR_CTRL >> already sets the INPUT_SEL bit (or unsets it) correctly based on >> whichever DPU version is used so we should just change the >> dpu_hw_setup_misr() to a read on the register followed by ORing the >> required bits without touching INPUT_SEL and write. >> >> That will address this issue and also cover version control since the >> expected value of this bit has changed across DPU revisions. > > Ok, thanks for following up on this. Mind posting a patch to > supersede this one? > > BR, > -R > Yup, we will. Thanks Abhinav >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 3 ++- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 4 ++-- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 2 +- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c | 2 +- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 5 ++++- >>>>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h | 3 ++- >>>>>>> 8 files changed, 15 insertions(+), 10 deletions(-) >>>>>>> >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>>>>>> index 2b83a13b3aa9..d93a92ffd5df 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>>>>>> @@ -134,7 +134,7 @@ static void dpu_crtc_setup_encoder_misr(struct >>>>>>> drm_crtc *crtc) >>>>>>> struct drm_encoder *drm_enc; >>>>>>> >>>>>>> drm_for_each_encoder_mask(drm_enc, crtc->dev, >>>>>>> crtc->state->encoder_mask) >>>>>>> - dpu_encoder_setup_misr(drm_enc); >>>>>>> + dpu_encoder_setup_misr(drm_enc, !!crtc->state->ctm); >>>>>>> } >>>>>>> >>>>>>> static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const >>>>>>> char *src_name) >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>>>>>> index b0a7908418ed..12ee7acb5ea6 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >>>>>>> @@ -241,7 +241,7 @@ int dpu_encoder_get_crc_values_cnt(const struct >>>>>>> drm_encoder *drm_enc) >>>>>>> return num_intf; >>>>>>> } >>>>>>> >>>>>>> -void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc) >>>>>>> +void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc, >>>>>>> bool has_ctm) >>>>>>> { >>>>>>> struct dpu_encoder_virt *dpu_enc; >>>>>>> >>>>>>> @@ -255,7 +255,7 @@ void dpu_encoder_setup_misr(const struct >>>>>>> drm_encoder *drm_enc) >>>>>>> if (!phys->hw_intf || !phys->hw_intf->ops.setup_misr) >>>>>>> continue; >>>>>>> >>>>>>> - phys->hw_intf->ops.setup_misr(phys->hw_intf, true, 1); >>>>>>> + phys->hw_intf->ops.setup_misr(phys->hw_intf, true, >>>>>>> 1, has_ctm); >>>>>>> } >>>>>>> } >>>>>>> >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h >>>>>>> index 4c05fd5e9ed1..510783b2fb24 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h >>>>>>> @@ -169,8 +169,9 @@ int dpu_encoder_get_crc_values_cnt(const struct >>>>>>> drm_encoder *drm_enc); >>>>>>> /** >>>>>>> * dpu_encoder_setup_misr - enable misr calculations >>>>>>> * @drm_enc: Pointer to previously created drm encoder structure >>>>>>> + * @has_ctm: Is CTM enabled >>>>>>> */ >>>>>>> -void dpu_encoder_setup_misr(const struct drm_encoder *drm_encoder); >>>>>>> +void dpu_encoder_setup_misr(const struct drm_encoder *drm_encoder, >>>>>>> bool has_ctm); >>>>>>> >>>>>>> /** >>>>>>> * dpu_encoder_get_crc - get the crc value from interface blocks >>>>>>> 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 e8b8908d3e12..cb06f80cc671 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c >>>>>>> @@ -318,9 +318,9 @@ static u32 dpu_hw_intf_get_line_count(struct >>>>>>> dpu_hw_intf *intf) >>>>>>> return DPU_REG_READ(c, INTF_LINE_COUNT); >>>>>>> } >>>>>>> >>>>>>> -static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool >>>>>>> enable, u32 frame_count) >>>>>>> +static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool >>>>>>> enable, u32 frame_count, bool has_ctm) >>>>>>> { >>>>>>> - dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, >>>>>>> frame_count); >>>>>>> + dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, >>>>>>> frame_count, has_ctm); >>>>>> >>>>>> I'm not sure about the dpu_encoder and dpu_hw_intf interfaces. But >>>>>> dpu_hw_setup_misr definitely needs the `u8 input_sel` parameter >>>>>> instead of `bool has_ctm`. >>>>> >>>>> That seems a bit premature without knowing what the other values are. >>>>> (And I also question a bit the whole abstraction layer thing if it is >>>>> taking directly register bitfield enum's..) >>>> >>>> dpu_hw_intf and especially dpu_hw_util are not real abstractions. I >>>> always viewed them as useful low-level helpers. >>>> >>>> I think that has_ctm is valid at the dpu_encoder level, which selects >>>> which input to use. on the lower levels has_ctm doesn't make sense. >>>> IOW dpu_hw_setup_misr can be used to setup MISR for other blocks, >>>> where CTM doesn't exist. >>>> >>>>> >>>>> BR, >>>>> -R >>>>> >>>>>> Most likely, I'd use u8 for dpu_hw_intf operation too. >>>>>> >>>>>> Could you please adjust? >>>>>> >>>>>>> } >>>>>>> >>>>>>> static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 >>>>>>> *misr_value) >>>>>>> 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 c539025c418b..95aafc4cf58e 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h >>>>>>> @@ -95,7 +95,7 @@ struct dpu_hw_intf_ops { >>>>>>> >>>>>>> void (*bind_pingpong_blk)(struct dpu_hw_intf *intf, >>>>>>> const enum dpu_pingpong pp); >>>>>>> - void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, >>>>>>> u32 frame_count); >>>>>>> + void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, >>>>>>> u32 frame_count, bool has_ctm); >>>>>>> int (*collect_misr)(struct dpu_hw_intf *intf, u32 >>>>>>> *misr_value); >>>>>>> >>>>>>> // Tearcheck on INTF since DPU 5.0.0 >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c >>>>>>> index d1c3bd8379ea..2efe29396c6a 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c >>>>>>> @@ -83,7 +83,7 @@ static void dpu_hw_lm_setup_border_color(struct >>>>>>> dpu_hw_mixer *ctx, >>>>>>> >>>>>>> static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool >>>>>>> enable, u32 frame_count) >>>>>>> { >>>>>>> - dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, >>>>>>> frame_count); >>>>>>> + dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, >>>>>>> frame_count, false); >>>>>>> } >>>>>>> >>>>>>> static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 >>>>>>> *misr_value) >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c >>>>>>> index 9d2273fd2fed..528b8439209f 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c >>>>>>> @@ -483,7 +483,7 @@ void _dpu_hw_setup_qos_lut(struct >>>>>>> dpu_hw_blk_reg_map *c, u32 offset, >>>>>>> >>>>>>> void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, >>>>>>> u32 misr_ctrl_offset, >>>>>>> - bool enable, u32 frame_count) >>>>>>> + bool enable, u32 frame_count, bool has_ctm) >>>>>>> { >>>>>>> u32 config = 0; >>>>>>> >>>>>>> @@ -496,6 +496,9 @@ void dpu_hw_setup_misr(struct >>>>>>> dpu_hw_blk_reg_map *c, >>>>>>> config = (frame_count & MISR_FRAME_COUNT_MASK) | >>>>>>> MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK; >>>>>>> >>>>>>> + if (!has_ctm) >>>>>>> + config |= 1 << 24; >>>>>> >>>>>> Please define MISR_CTRL_INPUT_SEL instead. >>>>>> >>>>>>> + >>>>>>> DPU_REG_WRITE(c, misr_ctrl_offset, config); >>>>>>> } else { >>>>>>> DPU_REG_WRITE(c, misr_ctrl_offset, 0); >>>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h >>>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h >>>>>>> index 1f6079f47071..e42d9d00e40e 100644 >>>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h >>>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h >>>>>>> @@ -360,7 +360,8 @@ void _dpu_hw_setup_qos_lut(struct >>>>>>> dpu_hw_blk_reg_map *c, u32 offset, >>>>>>> void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, >>>>>>> u32 misr_ctrl_offset, >>>>>>> bool enable, >>>>>>> - u32 frame_count); >>>>>>> + u32 frame_count, >>>>>>> + bool has_ctm); >>>>>>> >>>>>>> int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c, >>>>>>> u32 misr_ctrl_offset, >>>>>>> -- >>>>>>> 2.41.0 >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> With best wishes >>>>>> Dmitry >>>> >>>> >>>>