Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp914085pxf; Wed, 7 Apr 2021 14:57:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww4K5bhmXFAO2BxwR17nvfMmx5wuQAaDFFgJttRw8W7PeOAwwt0WQyitSuZ71n5oBzLaaz X-Received: by 2002:a62:8fcd:0:b029:218:461:2279 with SMTP id n196-20020a628fcd0000b029021804612279mr4687145pfd.43.1617832621855; Wed, 07 Apr 2021 14:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617832621; cv=none; d=google.com; s=arc-20160816; b=Z9MHm9/i9Rx2j/tOh9rSZwC6uaHkPcwEpY1tS5eXLcxajQN+6vaVcfuEzf9Zjf7YU3 DYfUXBS9LR1wLXJn9MMEWFbtYYCBI6I2R/TriCttzbPAUISuDJjT4h1caGu5GBCltyMi WJOyfN5LLss71FuFBPjpSG5+W3ihDjXWZqhibQ/Nf2YUJV/UaD658cPocjAyGHVEOFYN GSUWxU68Z/GbexG99ANvfrlDAV0bC9Cf4YUI6bcCzjenqkZd9WHOmyKVOdbcAo6kwiuu 89emF7XJJZNn/qSt4pD3ckSbsueU9/CxzwsdP59UXaDZ6Q+RR9yvE66+Co9/MvvtdCBU YvSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=GidkbR/JsKI0tkyOaXnDG0cfGBulR2TXtWAGWU9Cz+0=; b=DBqyw9AG+nNDisMTsbjhEsKTxEWEkQUSagCAiCWLla7ExQkbmCsoq5l3CE2VqK+Tn/ wsRU5ucDorzq/ujixRGUR1Drqb0euZkrPQPMTl7qxS21QG7yihRQc0Uz6YSmeuKeNGwh ujvcTS55Jao0r+DUYHvh+wCShz6shBonL/v28z0N4aufRGBS0OLsgx9xLlpF+FhheBvB muyJ8WD9vf9ytqbgikvyBSLA20JTL+OJVQU219A9RWF3FWLtgnH+XPe9f4av+nfC+zIT IgGKhzZZ4r1FQiA8Vi6eon5NTcTo7RpEVagTv+U/g9t2LRJqEHksywbHA1KOTBpo3qUw T+Nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si27845180pls.90.2021.04.07.14.56.50; Wed, 07 Apr 2021 14:57:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344887AbhDGTML (ORCPT + 99 others); Wed, 7 Apr 2021 15:12:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhDGTMJ (ORCPT ); Wed, 7 Apr 2021 15:12:09 -0400 Received: from relay06.th.seeweb.it (relay06.th.seeweb.it [IPv6:2001:4b7a:2000:18::167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B19C061760 for ; Wed, 7 Apr 2021 12:11:59 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 5ABA73ED55; Wed, 7 Apr 2021 21:11:54 +0200 (CEST) Subject: Re: [Freedreno] [PATCH 1/3] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal To: abhinavk@codeaurora.org, Marijn Suijten Cc: phone-devel@vger.kernel.org, freedreno@lists.freedesktop.org, Sai Prakash Ranjan , David Airlie , linux-arm-msm@vger.kernel.org, Konrad Dybcio , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Clark , Martin Botka , ~postmarketos/upstreaming@lists.sr.ht, Daniel Vetter , Sean Paul References: <20210406214726.131534-1-marijn.suijten@somainline.org> <20210406214726.131534-2-marijn.suijten@somainline.org> <6413863d04df9743e2d7e81beff5c3e8@codeaurora.org> From: AngeloGioacchino Del Regno Message-ID: <04860f05-f79f-de0b-13d1-aba85065b4da@somainline.org> Date: Wed, 7 Apr 2021 21:11:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <6413863d04df9743e2d7e81beff5c3e8@codeaurora.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 07/04/21 20:19, abhinavk@codeaurora.org ha scritto: > Hi Marijn > > On 2021-04-06 14:47, Marijn Suijten wrote: >> Leaving this at a close-to-maximum register value 0xFFF0 means it takes >> very long for the MDSS to generate a software vsync interrupt when the >> hardware TE interrupt doesn't arrive.? Configuring this to double the >> vtotal (like some downstream kernels) leads to a frame to take at most >> twice before the vsync signal, until hardware TE comes up. >> >> In this case the hardware interrupt responsible for providing this >> signal - "disp-te" gpio - is not hooked up to the mdp5 vsync/pp logic at >> all.? This solves severe panel update issues observed on at least the >> Xperia Loire and Tone series, until said gpio is properly hooked up to >> an irq. > > The reason the CONFIG_HEIGHT was at such a high value is to make sure that > we always get the TE only from the panel vsync and not false positives > coming > from the tear check logic itself. > > When you say that disp-te gpio is not hooked up, is it something > incorrect with > the schematic OR panel is not generating the TE correctly? > Sometimes, some panels aren't getting correctly configured by the OEM/ODM in the first place: especially when porting devices from downstream to upstream, developers often get in a situation in which their TE line is either misconfigured or the DriverIC is not configured to raise V-Sync interrupts. Please remember: some DDICs need a "commands sequence" to enable generating the TE interrupts, sometimes this is not standard, and sometimes OEMs/ODMs are not even doing that in their downstream code (but instead they work around it in creative ways "for reasons", even though their DDIC supports indeed sending TE events). This mostly happens when bringing up devices that have autorefresh enabled from the bootloader (when the bootloader sets up the splash screen) by using simple-panel as a (hopefully) temporary solution to get through the initial stages of porting. We are not trying to cover cases related to incorrect schematics or hardware mistakes here, as the fix for that - as you know - is to just fix your hardware. What we're trying to do here is to stop freezes and, in some cases, lockups, other than false positives making the developer go offroad when the platform shows that something is wrong during early porting. Also, sometimes, some DDICs will not generate TE interrupts when expected... in these cases we get a PP timeout and a MDP5 recovery: this is totally avoidable if we rely on the 2*vtotal, as we wouldn't get through the very time consuming task of recovering the entire MDP. Of course, if something is wrong in the MDP and the block really needs recovery, this "trick" won't save anyone and the recovery will anyway be triggered, as the PP-done will anyway timeout. >> >> Suggested-by: AngeloGioacchino Del Regno >> >> Signed-off-by: Marijn Suijten >> Reviewed-by: AngeloGioacchino Del Regno >> >> --- >> ?drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c | 2 +- >> ?1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c >> b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c >> index ff2c1d583c79..2d5ac03dbc17 100644 >> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c >> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c >> @@ -51,7 +51,7 @@ static int pingpong_tearcheck_setup(struct >> drm_encoder *encoder, >> >> ???? mdp5_write(mdp5_kms, REG_MDP5_PP_SYNC_CONFIG_VSYNC(pp_id), cfg); >> ???? mdp5_write(mdp5_kms, >> -??????? REG_MDP5_PP_SYNC_CONFIG_HEIGHT(pp_id), 0xfff0); >> +??????? REG_MDP5_PP_SYNC_CONFIG_HEIGHT(pp_id), (2 * mode->vtotal)); >> ???? mdp5_write(mdp5_kms, >> ???????? REG_MDP5_PP_VSYNC_INIT_VAL(pp_id), mode->vdisplay); >> ???? mdp5_write(mdp5_kms, REG_MDP5_PP_RD_PTR_IRQ(pp_id), >> mode->vdisplay + 1);