Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp610634pxj; Thu, 20 May 2021 17:48:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1NiGYe8JaEYHdrTcJbQHMZBCzci5Zz/Z7DgcNo8cnyQnX4JHtgMrkuKa0gkgoYMnK7idm X-Received: by 2002:a05:6e02:1d9b:: with SMTP id h27mr8989838ila.243.1621558124634; Thu, 20 May 2021 17:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621558124; cv=none; d=google.com; s=arc-20160816; b=xyZUubA4VGVV4qfYcXO7VdCcx5KJR2gp9JAjdn/FIBeOh49psmMHg6WTTUnnrE2EOU l4mHrF+nHARH1QupulpJzbyXoJnON7+ChwvGeZzPDrj25hjXvzYiKPibOy24WZnThW0T zyl01aWC5sl9pIDDuiJ0ipkWqZXT6dxO+SJSY0StMFVhDTYPslWMg0PBroVc9g2LoD7d 40omooqFkT0ihm91FDoO6DYaf36QbTRdL/MIHnSzVLU19NWx8b5c7BD0mVfUwHtli7b6 bf8FBGC5rOX5EDfOWcW0ms95Ykphavz1DSlh4VqMu/dDLY+V+BY4LtSe5mK19WI3o9/9 7cpg== 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=yDqrKGlbTdN4rbgCns7awN62LPdmwfb/0wI9CDlN3pE=; b=b167JbGEghdlOdwI+uq3rcsfTlRyIgxQJoAzO2WoxneioJ1jj5/D020bMnGPoft1SA pO6mR3HuiTApUVFqwWm8R7PvkwdLipwaMWbp9WqvsXEu9igDV0CzWzssGCnN4k7I9CeT AvLWrs/XJjDMa2r9Fff8zLP+p/bWmnplt06DBSg69qhT1Vw9IsWdYdXZruEZ0ZJllvtP 72kq6ukRPAAwxlx1yrgMcCKa/JZ+Oi4k9lPmCj57JHsEXSx9wd+f/ARXJnwT24StWrjQ 6HdNC9Lhpq0ql3GGQ4vP8F4Lt8s8AXJJIgcneVH5bCdw3WwqW4MZmMI4Si/8OPSSF2sk dUPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bZ3tKkDV; 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 k5si4581442ilv.81.2021.05.20.17.48.30; Thu, 20 May 2021 17:48:44 -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=bZ3tKkDV; 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 S241373AbhETLbO (ORCPT + 99 others); Thu, 20 May 2021 07:31:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239506AbhETLLB (ORCPT ); Thu, 20 May 2021 07:11:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CE27561D39; Thu, 20 May 2021 10:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505234; bh=CUa6fDlJdtOnkrgQq1DKHgdCRYF4uXoisvo2HPBjMs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZ3tKkDV8oU5t9ixE9paGrPkFmef/mZP6w4zwR0MDKRxslKdsEcrIOqJGw4LlxCnY FdQpoGESM9Ymi2CVZLTCZIbFLLFn6t3Inj/RHmrAlldcrfo3vzCp9s1KXaeWZYAFMo foFECTU9c3DfSIcnyPg80zS9w2mstOTqngofZFeM= 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 4.4 035/190] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal Date: Thu, 20 May 2021 11:21:39 +0200 Message-Id: <20210520092103.332509149@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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/mdp/mdp5/mdp5_cmd_encoder.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c index 8e6c9b598a57..d8c7b8a6a418 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c @@ -128,9 +128,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