Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp413294pxj; Thu, 20 May 2021 12:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxLawCi+WOvGNhjRx/qkWvZdPtl4RDK463eao8Mu6AOItUDiIsG+n6hACMy96hNgBJd3N9 X-Received: by 2002:a17:906:b104:: with SMTP id u4mr6096071ejy.211.1621538065749; Thu, 20 May 2021 12:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621538065; cv=none; d=google.com; s=arc-20160816; b=TMWX3GiTckNlmCHZGNh0CcLU2QjGkKCxloZpk6YBq3M9Her7vy8q69zEKLcLE9SK8j dqoFle2saNFQO2nw2tE/4iVe6e8JLm7M1yWc0jAeUcpsGt4vSPY99jb/C8GH5o73nNUo KVXlfsTH+H6L/GJjFA7XaaATKRsteP+ary+kTWPEVgu3K+mWDatnJPNCA55B60BwclYa ETgzm4EJSDC6wvODFzexV3SACcZxNX/XQaCYcuOtGf+LwTcL+C2ksag4aTnkm5vXMRAD K4EWaoGTzLn8vJtifWKoVFRIlKYHNCoE+9aTls6KI7b9aL2cN7U4S/6jK2RgoRDPKC1+ GuAQ== 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=IkRDv1Y9bW8p3P8anKdLxBoTRP2pWjQkCJyk+a9wxQU=; b=r++EfmoYr8kgotMpupajncCzKZPL6vWL7/pn/8H0v+SteBj6G6j+AXffWqHY6ZO9+V hmSw4bTLh0CunYlIdpZDXRaLX9dYRmhVyTCUjMWrSrCIMmTwAgECdJ95ziLG/jY2IdBR vVPghSKvOOMuKxqtLv3I3XBMcYTpmGFEeCB9/EDs0rVkeujBTsWyTjiN/Y3WZ17XXOwl axc4Cv9CTvyqg3hRER4rQFpdHc9mWjDHvtIhxoLhtO4AHrL9cLeSsyQ4849vcvHqzSGJ +1YBc7s2nVRGiK+tY4tsAxpSIVvEg6zSqF4VgmGAb1RjuAZ/NFG3KL2Xxs0cLHUhfKLl /gHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XwFAJkC+; 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 cn17si2823151edb.73.2021.05.20.12.14.01; Thu, 20 May 2021 12:14:25 -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=XwFAJkC+; 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 S237248AbhETKdM (ORCPT + 99 others); Thu, 20 May 2021 06:33:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:51084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236492AbhETKTn (ORCPT ); Thu, 20 May 2021 06:19:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F5646145F; Thu, 20 May 2021 09:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504040; bh=qmsD5qUUJyw98XkWtIT0ula+AfFy+NCvsgRg8vdj1+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwFAJkC+fRHK1QIeNeJk6Jnq6cdau3Gn7zINvrUiCvePybDo0Ui1Nf+Un1H5RUJdP mJjZo/yM8J8EOihis8rO+g+wYInthH7wDbzZoT9gEFXQsHWaMIVGb+ezsO0p5+sqJy 9tn+CTmSMvARyXlnYcy5JZNhiwcooLeCKqhjz2iM= 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.14 068/323] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal Date: Thu, 20 May 2021 11:19:20 +0200 Message-Id: <20210520092122.433277334@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 60790df91bfa..397e71481129 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cmd_encoder.c @@ -78,9 +78,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