Received: by 10.223.148.5 with SMTP id 5csp7453595wrq; Thu, 18 Jan 2018 05:47:26 -0800 (PST) X-Google-Smtp-Source: ACJfBouLS3VfrGM6XWJYv8xY/wyiOMWiQOu+5qiAyrkgeexCNiRz418ThB7qzaxNzi0p92j/4stV X-Received: by 10.99.110.78 with SMTP id j75mr35939711pgc.96.1516283246521; Thu, 18 Jan 2018 05:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516283246; cv=none; d=google.com; s=arc-20160816; b=s57kJ20MV4yEWxdvCe/NrjqRf6otJYwcz/IqfBnpyGg5uwCoFk1OzJHezlhkNoXsoA dVqfIw5wc7xDZs/yzCvD0LLhCIbThP1Wbw14AeskQ6BZY18tssSl+W9Jly7Ly8ySlb6H 9fxE9XmXFNEryCxMruV+YcLhlmbEcyhKuUEAA5gicT/+SqDu2OxMWD4Ze/DX4caPiVux XF+VhaCOkyVNmBhzHFW19Z6Y13Ldis0UzgojHso3UTL1GTRfWApUOdAjUqSUEZSz1Ipj 4CEe7FPVmHZJeb/2XtzoXevpjvHkT/RUg2y22DxRo4b26MiMjNdHqMf2m5eP61R4M8MP cfoQ== 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:subject:cc:to:from:date :arc-authentication-results; bh=W1Ay5pRKyLpnEtQ9MpvaVYhRYetP6j78EMUUY/ZOz5k=; b=eneXui3SnthZGwBpO514o5PIMfLOoD7ZK3/E4/loZ5oYkLNd56inSWjwNNVyOaZmJ9 3YFT34fSSPfcaLTBlGN+u41sDGzzRwOcuXZeCicKBgUWamklkRWUtrthAp6VvfDMrlP1 AtnYGoFRESEqbsmSAqSjdC6kTE09wiCha4GEtBU+qTbrWkXTqi7cCgLio0R1aGZpuxKA r6zByTFVIdSd4E9yM1H3Xxi2JKbk9GaWgO5YadHk3w+1036/m242RyHapJZfcuLPmog7 fV2dHwkbcHC+tA7NDV3xKLghOfH7WGeosL9zPzkPO/2OxdahTGVTlK+DqLdECQ934TiZ CBeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si6547986pfe.378.2018.01.18.05.47.11; Thu, 18 Jan 2018 05:47:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756388AbeARNqB (ORCPT + 99 others); Thu, 18 Jan 2018 08:46:01 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:35391 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755840AbeARNqA (ORCPT ); Thu, 18 Jan 2018 08:46:00 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 20710208F1; Thu, 18 Jan 2018 14:45:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id E3ED9208E2; Thu, 18 Jan 2018 14:45:47 +0100 (CET) Date: Thu, 18 Jan 2018 14:45:48 +0100 From: Boris Brezillon To: Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/vc4: Flush the caches before the bin jobs, as well. Message-ID: <20180118144548.3db88ecf@bbrezillon> In-Reply-To: <20171221221722.23809-1-eric@anholt.net> References: <20171221221722.23809-1-eric@anholt.net> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Dec 2017 14:17:22 -0800 Eric Anholt wrote: > If the frame samples from a render target that was just written, its > cache flush during the binning step may have occurred before the > previous frame's RCL was completed. Flush the texture caches again > before starting each RCL job to make sure that the sampling of the > previous RCL's output is correct. > > Fixes flickering in the top left of 3DMMES Taiji. > > Signed-off-by: Eric Anholt > Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs") Reviewed-by: Boris Brezillon > --- > drivers/gpu/drm/vc4/vc4_gem.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c > index 6c32c89a83a9..afa7fe21b35e 100644 > --- a/drivers/gpu/drm/vc4/vc4_gem.c > +++ b/drivers/gpu/drm/vc4/vc4_gem.c > @@ -436,6 +436,19 @@ vc4_flush_caches(struct drm_device *dev) > VC4_SET_FIELD(0xf, V3D_SLCACTL_ICC)); > } > > +static void > +vc4_flush_texture_caches(struct drm_device *dev) > +{ > + struct vc4_dev *vc4 = to_vc4_dev(dev); > + > + V3D_WRITE(V3D_L2CACTL, > + V3D_L2CACTL_L2CCLR); > + > + V3D_WRITE(V3D_SLCACTL, > + VC4_SET_FIELD(0xf, V3D_SLCACTL_T1CC) | > + VC4_SET_FIELD(0xf, V3D_SLCACTL_T0CC)); > +} > + > /* Sets the registers for the next job to be actually be executed in > * the hardware. > * > @@ -474,6 +487,14 @@ vc4_submit_next_render_job(struct drm_device *dev) > if (!exec) > return; > > + /* A previous RCL may have written to one of our textures, and > + * our full cache flush at bin time may have occurred before > + * that RCL completed. Flush the texture cache now, but not > + * the instructions or uniforms (since we don't write those > + * from an RCL). > + */ > + vc4_flush_texture_caches(dev); > + > submit_cl(dev, 1, exec->ct1ca, exec->ct1ea); > } >