Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4589835pja; Thu, 21 Nov 2019 22:25:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzPrW+MtV/bca+THqxVK1cXOt0SgeL+sYlVPTFwjZwj2xuID+s6lu1UQcStgJXKxBucRVSE X-Received: by 2002:a17:906:709:: with SMTP id y9mr19120254ejb.321.1574403912626; Thu, 21 Nov 2019 22:25:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403912; cv=none; d=google.com; s=arc-20160816; b=PpyNCuur9e8UoyVv9KY53BvUbaV+5UZRYsweVmkjWSslReqHvz0QZQT9NXOaq7sPUI oZ9sKcFNZSExXyR1+6Uzrz76sSYdNVXriAoDL7NouQF9ti5KP4HX0jmFMuqpOXKIxcL8 F0Q0H8TMShoVmaMIWu2oxrq81Ips+nFyV3sBpCZf3ph0tWEDs1xpQ6XxxhuugbLcSyVb eQOZsFuAuJiVodRSGhsrPXtEbIlIOpWfgspurVuNmPaxSMYml2ty8ZfCApyq5BqksbrW Dg9f5A1NpKHcp9go96Giinm3z1TRmYxUJbPHKeamU5UHFCasXanNuCq+2tAACaaTcbkE 1EEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2FsNeDjLUGsKVpe3sCsixBqQam01gjlFm8UKwgexw1s=; b=W2X6hTRn0SSrKiAkBA+mfRSLb+7M6xjFvgVuvYiZEI4GHcv0ZFLQ5Oz6LFoNfzDkPd FL+XDi5rNNFHqQLny40j9nFKZ2urbyEMblCB/meo9Zrr1cKMcknnsOUIukpXVc1NxiLA ldMqHYFPCFv+4NeTLZUloGrvBO7gs16bJ1eH2CRuTO6Y33GdM9YmG5NYsTESydMUTInJ 2gVvwmdUU0qNQFs/d8HPehyriBDN1xhLKeBV8lLeGdvMeJTsTedZ+mVGvRi7VopmDCsf IltC9zpzDqxx1+1LjNbo+lekqclfDd87+F06Fd8hLoZSxtcYT1SbkJ5OH64B5KVg8ug+ HY6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="fxuUXIo/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30si491331edr.9.2019.11.21.22.24.49; Thu, 21 Nov 2019 22:25:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="fxuUXIo/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728708AbfKVGUp (ORCPT + 99 others); Fri, 22 Nov 2019 01:20:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:58324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728576AbfKVFwe (ORCPT ); Fri, 22 Nov 2019 00:52:34 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 143672073B; Fri, 22 Nov 2019 05:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401953; bh=DVaKPiUmHGKWMJgDHNMiWfSzaP1Ywwb9Top1BdaLCeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxuUXIo/dVhzdK+qgDJHdYtJXTqnHMjp2yum9t9gl3dcES2MmpIJBovzDmD9vmaUU dhpVrOlUtb12lNWrQ3AB5yf9gyHCMNHkapll/MegtW2QVQGI9JrDx7l48jsK3XDd88 IMuDBFTMbTz9N7rsWUlUrDf5IAFAEqdJdw6svvhI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lucas Stach , Philipp Zabel , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.19 176/219] gpu: ipu-v3: pre: don't trigger update if buffer address doesn't change Date: Fri, 22 Nov 2019 00:48:28 -0500 Message-Id: <20191122054911.1750-169-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach [ Upstream commit eb0200a4357da100064971689d3a0e9e3cf57f33 ] On a NOP double buffer update where current buffer address is the same as the next buffer address, the SDW_UPDATE bit clears too late. As we are now using this bit to determine when it is safe to signal flip completion to userspace this will delay completion of atomic commits where one plane doesn't change the buffer by a whole frame period. Fix this by remembering the last buffer address and just skip the double buffer update if it would not change the buffer address. Signed-off-by: Lucas Stach [p.zabel@pengutronix.de: initialize last_bufaddr in ipu_pre_configure] Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-pre.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c index 2f8db9d625514..4a28f3fbb0a28 100644 --- a/drivers/gpu/ipu-v3/ipu-pre.c +++ b/drivers/gpu/ipu-v3/ipu-pre.c @@ -106,6 +106,7 @@ struct ipu_pre { void *buffer_virt; bool in_use; unsigned int safe_window_end; + unsigned int last_bufaddr; }; static DEFINE_MUTEX(ipu_pre_list_mutex); @@ -185,6 +186,7 @@ void ipu_pre_configure(struct ipu_pre *pre, unsigned int width, writel(bufaddr, pre->regs + IPU_PRE_CUR_BUF); writel(bufaddr, pre->regs + IPU_PRE_NEXT_BUF); + pre->last_bufaddr = bufaddr; val = IPU_PRE_PREF_ENG_CTRL_INPUT_PIXEL_FORMAT(0) | IPU_PRE_PREF_ENG_CTRL_INPUT_ACTIVE_BPP(active_bpp) | @@ -242,7 +244,11 @@ void ipu_pre_update(struct ipu_pre *pre, unsigned int bufaddr) unsigned short current_yblock; u32 val; + if (bufaddr == pre->last_bufaddr) + return; + writel(bufaddr, pre->regs + IPU_PRE_NEXT_BUF); + pre->last_bufaddr = bufaddr; do { if (time_after(jiffies, timeout)) { -- 2.20.1