linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.4 06/52] drm/amdgpu: add cache flush workaround to gfx8 emit_fence
Date: Fri, 20 Dec 2019 09:29:08 -0500	[thread overview]
Message-ID: <20191220142954.9500-6-sashal@kernel.org> (raw)
In-Reply-To: <20191220142954.9500-1-sashal@kernel.org>

From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>

[ Upstream commit bf26da927a1cd57c9deb2db29ae8cf276ba8b17b ]

The same workaround is used for gfx7.
Both PAL and Mesa use it for gfx8 too, so port this commit to
gfx_v8_0_ring_emit_fence_gfx.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 87dd55e9d72b2..cc88ba76a8d4a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -6184,7 +6184,23 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
 	bool write64bit = flags & AMDGPU_FENCE_FLAG_64BIT;
 	bool int_sel = flags & AMDGPU_FENCE_FLAG_INT;
 
-	/* EVENT_WRITE_EOP - flush caches, send int */
+	/* Workaround for cache flush problems. First send a dummy EOP
+	 * event down the pipe with seq one below.
+	 */
+	amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));
+	amdgpu_ring_write(ring, (EOP_TCL1_ACTION_EN |
+				 EOP_TC_ACTION_EN |
+				 EOP_TC_WB_ACTION_EN |
+				 EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
+				 EVENT_INDEX(5)));
+	amdgpu_ring_write(ring, addr & 0xfffffffc);
+	amdgpu_ring_write(ring, (upper_32_bits(addr) & 0xffff) |
+				DATA_SEL(1) | INT_SEL(0));
+	amdgpu_ring_write(ring, lower_32_bits(seq - 1));
+	amdgpu_ring_write(ring, upper_32_bits(seq - 1));
+
+	/* Then send the real EOP event down the pipe:
+	 * EVENT_WRITE_EOP - flush caches, send int */
 	amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));
 	amdgpu_ring_write(ring, (EOP_TCL1_ACTION_EN |
 				 EOP_TC_ACTION_EN |
@@ -6926,7 +6942,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
 		5 +  /* COND_EXEC */
 		7 +  /* PIPELINE_SYNC */
 		VI_FLUSH_GPU_TLB_NUM_WREG * 5 + 9 + /* VM_FLUSH */
-		8 +  /* FENCE for VM_FLUSH */
+		12 +  /* FENCE for VM_FLUSH */
 		20 + /* GDS switch */
 		4 + /* double SWITCH_BUFFER,
 		       the first COND_EXEC jump to the place just
@@ -6938,7 +6954,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
 		31 + /*	DE_META */
 		3 + /* CNTX_CTRL */
 		5 + /* HDP_INVL */
-		8 + 8 + /* FENCE x2 */
+		12 + 12 + /* FENCE x2 */
 		2, /* SWITCH_BUFFER */
 	.emit_ib_size =	4, /* gfx_v8_0_ring_emit_ib_gfx */
 	.emit_ib = gfx_v8_0_ring_emit_ib_gfx,
-- 
2.20.1


  parent reply	other threads:[~2019-12-20 14:30 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 14:29 [PATCH AUTOSEL 5.4 01/52] drm/mcde: dsi: Fix invalid pointer dereference if panel cannot be found Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 02/52] nvme_fc: add module to ops template to allow module references Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 03/52] nvme-fc: fix double-free scenarios on hw queues Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 04/52] drm/amdgpu: add check before enabling/disabling broadcast mode Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 05/52] drm/amdgpu: add header line for power profile on Arcturus Sasha Levin
2019-12-20 14:29 ` Sasha Levin [this message]
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 07/52] drm/amd/display: Map DSC resources 1-to-1 if numbers of OPPs and DSCs are equal Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 08/52] drm/amd/display: Fixed kernel panic when booting with DP-to-HDMI dongle Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 09/52] drm/amd/display: Change the delay time before enabling FEC Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 10/52] drm/amd/display: Reset steer fifo before unblanking the stream Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 11/52] drm/amd/display: update dispclk and dppclk vco frequency Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 12/52] nvme/pci: Fix write and poll queue types Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 13/52] nvme/pci: Fix read queue count Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 14/52] iio: st_accel: Fix unused variable warning Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 15/52] iio: adc: max9611: Fix too short conversion time delay Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 16/52] PM / devfreq: Fix devfreq_notifier_call returning errno Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 17/52] PM / devfreq: Set scaling_max_freq to max on OPP notifier error Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 18/52] PM / devfreq: Don't fail devfreq_dev_release if not in list Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 19/52] afs: Fix afs_find_server lookups for ipv4 peers Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 20/52] afs: Fix SELinux setting security label on /afs Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 21/52] RDMA/cma: add missed unregister_pernet_subsys in init failure Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 22/52] rxe: correctly calculate iCRC for unaligned payloads Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 23/52] scsi: lpfc: Fix memory leak on lpfc_bsg_write_ebuf_set func Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 24/52] scsi: qla2xxx: Use explicit LOGO in target mode Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 25/52] scsi: qla2xxx: Drop superfluous INIT_WORK of del_work Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 26/52] scsi: qla2xxx: Don't call qlt_async_event twice Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 27/52] scsi: qla2xxx: Fix PLOGI payload and ELS IOCB dump length Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 28/52] scsi: qla2xxx: Configure local loop for N2N target Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 29/52] scsi: qla2xxx: Send Notify ACK after N2N PLOGI Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 30/52] scsi: qla2xxx: Don't defer relogin unconditonally Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 31/52] scsi: qla2xxx: Ignore PORT UPDATE after N2N PLOGI Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 32/52] scsi: iscsi: qla4xxx: fix double free in probe Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 33/52] scsi: libsas: stop discovering if oob mode is disconnected Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 34/52] scsi: iscsi: Avoid potential deadlock in iscsi_if_rx func Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 35/52] staging/wlan-ng: add CRC32 dependency in Kconfig Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 36/52] drm/nouveau: Move the declaration of struct nouveau_conn_atom up a bit Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 37/52] drm/nouveau: Fix drm-core using atomic code-paths on pre-nv50 hardware Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 38/52] drm/nouveau/kms/nv50-: fix panel scaling Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 39/52] usb: gadget: fix wrong endpoint desc Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 40/52] net: make socket read/write_iter() honor IOCB_NOWAIT Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 41/52] afs: Fix mountpoint parsing Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 42/52] afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 43/52] raid5: need to set STRIPE_HANDLE for batch head Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 44/52] md: raid1: check rdev before reference in raid1_sync_request func Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 45/52] s390/cpum_sf: Adjust sampling interval to avoid hitting sample limits Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 46/52] s390/cpum_sf: Avoid SBD overflow condition in irq handler Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 47/52] RDMA/counter: Prevent auto-binding a QP which are not tracked with res Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 48/52] IB/mlx4: Follow mirror sequence of device add during device removal Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 49/52] IB/mlx5: Fix steering rule of drop and count Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 50/52] xen-blkback: prevent premature module unload Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 51/52] xen/balloon: fix ballooned page accounting without hotplug enabled Sasha Levin
2019-12-20 14:29 ` [PATCH AUTOSEL 5.4 52/52] PM / hibernate: memory_bm_find_bit(): Tighten node optimisation Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191220142954.9500-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).