Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2489479pxj; Mon, 10 May 2021 04:20:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLDT/yDm+RHYK3nFKDPlgXi6O8hAUK/7jP6BwNZvbMh40kadPHxdN+Trnh8Gv/pWBIUBa/ X-Received: by 2002:a05:6e02:1b83:: with SMTP id h3mr6070099ili.199.1620645640600; Mon, 10 May 2021 04:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645640; cv=none; d=google.com; s=arc-20160816; b=z3RQCnrCM1Cdt/sN1KOh1iWLY6WuafLU002tLcQPKrQBxosZtaPLfA0BWYRCQ59/P4 Dx5F8S5WPsYiICbuW8xOGVEKZSNcya0aIWF2ix8BoyTGlQcvWGDg+doXH791ZSaED9p9 Uzk013F0AxrndSOyPPsc7oB6gaclRJA/y7B/ShNhQWoeSTKi/m/ceCm9mQzUdwDwUvjW 9cEJGZArd7FXm6qHrQUQ2D5D85NKpz8vDZhyxmCFOJe6bTSOXXqf8bA3dl7cuOC1CNDk OvKf1vnGj72AAz9yUgoJGHv06WWRjYpTxRvpDk7iC3uPfFlefmHaO4XuYPcnBuUAvcfG /oFg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HjCVl0U3jyTeGgmYJIjoJPlqtyEf42peqkSYwq8IFAM=; b=IR76CMhVL74rK/dXmlRkyVZ6pjKO1ES5ioncT7boalDjh8xiZr6Gb6t+jvDYgfBW4K TlIESu2SEH1nVr1VzgdaHNKWQg+ucoo8uo1rjfrycfP2bE1EY17R8Z4VoLxFF++IpRJz X2sH99hhdUUGtsLwzwfPGpd1OIapqiD7qxpRXjp40vJ33wy8zN41YVXUNFDKblO7YCVx uP76fZxMR50LYf8NN858ED3ZhaWEllNgo1flv7CrXK0r+l46KPp12ZSH+Yl+S57lIgGO UZoxFYM71MtRIBGRrj1Yt16supadpEowqKZQUA/ELUcMobb3jSVMYGc5qWjDu+p28JQa R6sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Zofs/htk"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si16490185jal.64.2021.05.10.04.20.26; Mon, 10 May 2021 04:20:40 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Zofs/htk"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbhEJLLu (ORCPT + 99 others); Mon, 10 May 2021 07:11:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:41768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233233AbhEJKtw (ORCPT ); Mon, 10 May 2021 06:49:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1826261628; Mon, 10 May 2021 10:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643120; bh=6L+UN9HNWtK4MTQO6xqBHLL8BwK5sHu8Y0fdOskqV+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zofs/htkCiJjuio/8QxYqadQQY5VnH/KcgadCiFTxOYoHfKuqVMAQpmTeK5nQPCHe 6tmiD+SdTXhglHOj/tI7mgbyDKNgIte8ncJSIkoith8CV3/cTr2grAQk2HtS+jBSfq LpnAkO7MJx81X4/+7ODcjIV66JiC/fqJDtkgnTWI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, AngeloGioacchino Del Regno , Marijn Suijten , Rob Clark , Sasha Levin Subject: [PATCH 5.10 186/299] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal Date: Mon, 10 May 2021 12:19:43 +0200 Message-Id: <20210510102011.100424459@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marijn Suijten [ Upstream commit 2ad52bdb220de5ab348098e3482b01235d15a842 ] 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. Suggested-by: AngeloGioacchino Del Regno Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210406214726.131534-2-marijn.suijten@somainline.org Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c | 10 +++++++++- 1 file changed, 9 insertions(+), 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..f6df4d3b1406 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c @@ -49,9 +49,17 @@ static int pingpong_tearcheck_setup(struct drm_encoder *encoder, | MDP5_PP_SYNC_CONFIG_VSYNC_IN_EN; cfg |= MDP5_PP_SYNC_CONFIG_VSYNC_COUNT(vclks_line); + /* + * Tearcheck emits a blanking signal every vclks_line * vtotal * 2 ticks on + * the vsync_clk equating to roughly half the desired panel refresh rate. + * This is only necessary as stability fallback if interrupts from the + * panel arrive too late or not at all, but is currently used by default + * because these panel interrupts are not wired up yet. + */ 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); -- 2.30.2