mirror-linux/drivers
Kenneth Graunke 61672806b5
drm/xe: Invalidate L3 read-only cachelines for geometry streams too
Historically, the Vertex Fetcher unit has not been an L3 client.  That
meant that, when a buffer containing vertex data was written to, it was
necessary to issue a PIPE_CONTROL::VF Cache Invalidate to invalidate any
VF L2 cachelines associated with that buffer, so the new value would be
properly read from memory.

Since Tigerlake and later, VERTEX_BUFFER_STATE and 3DSTATE_INDEX_BUFFER
have included an "L3 Bypass Enable" bit which userspace drivers can set
to request that the vertex fetcher unit snoop L3.  However, unlike most
true L3 clients, the "VF Cache Invalidate" bit continues to only
invalidate the VF L2 cache - and not any associated L3 lines.

To handle that, PIPE_CONTROL has a new "L3 Read Only Cache Invalidation
Bit", which according to the docs, "controls the invalidation of the
Geometry streams cached in L3 cache at the top of the pipe."  In other
words, the vertex and index buffer data that gets cached in L3 when
"L3 Bypass Disable" is set.

Mesa always sets L3 Bypass Disable so that the VF unit snoops L3, and
whenever it issues a VF Cache Invalidate, it also issues a L3 Read Only
Cache Invalidate so that both L2 and L3 vertex data is invalidated.

xe is issuing VF cache invalidates too (which handles cases like CPU
writes to a buffer between GPU batches).  Because userspace may enable
L3 snooping, it needs to issue an L3 Read Only Cache Invalidate as well.

Fixes significant flickering in Firefox on Meteorlake, which was writing
to vertex buffers via the CPU between batches; the missing L3 Read Only
invalidates were causing the vertex fetcher to read stale data from L3.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4460
Fixes: 6ef3bb6055 ("drm/xe: enable lite restore")
Cc: stable@vger.kernel.org # v6.13+
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250330165923.56410-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2025-03-31 12:18:41 -04:00
..
accel accel/amdxdna: Check interrupt register before mailbox_rx_worker exits 2025-02-27 08:41:46 -06:00
accessibility
acpi ACPI: platform_profile: Add support for hidden choices 2025-03-04 20:45:34 +01:00
amba
android binderfs: fix use-after-free in binder_devices 2025-02-20 15:20:11 +01:00
ata ata fixes for 6.14-rc5 2025-03-01 08:59:29 -08:00
atm
auxdisplay
base Linux 6.14-rc6 2025-03-12 09:43:12 +10:00
bcma
block block-6.14-20250306 2025-03-07 11:12:33 -10:00
bluetooth bluetooth: btusb: Initialize .owner field of force_poll_sync_fops 2025-02-27 16:50:05 -05:00
bus Linux 6.14-rc6 2025-03-12 09:43:12 +10:00
cache
cdrom
cdx cdx: Fix possible UAF error in driver_override_show() 2025-02-20 15:19:07 +01:00
char Char/Misc/IIO driver fixes for 6.14-rc6 2025-03-09 09:07:54 -10:00
clk
clocksource irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request 2025-02-17 23:27:49 +01:00
comedi
connector
counter
cpufreq
cpuidle
crypto crypto: ccp: Add external API interface for PSP module initialization 2025-02-14 18:39:19 -05:00
cxl
dax
dca
devfreq
dio
dma dmaengine fixes for v6.14 2025-03-02 10:08:45 -08:00
dma-buf
dpll
edac
eisa
extcon
firewire
firmware EFI fixes for v6.14 #2 2025-02-28 08:47:21 -08:00
fpga
fsi
gnss
gpio gpio: rcar: Fix missing of_node_put() call 2025-03-06 15:51:27 +01:00
gpu drm/xe: Invalidate L3 read-only cachelines for geometry streams too 2025-03-31 12:18:41 -04:00
greybus
hid hid-for-linus-2025030501 2025-03-05 07:46:59 -10:00
hsi
hte
hv
hwmon hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe() 2025-03-03 06:04:34 -08:00
hwspinlock
hwtracing intel_th: pci: Add Panther Lake-P/U support 2025-02-20 09:35:57 +01:00
i2c i2c: amd-asf: Fix EOI register write to enable successive interrupts 2025-02-26 23:28:41 +01:00
i3c
idle intel_idle: Handle older CPUs, which stop the TSC in deeper C states, correctly 2025-02-28 22:04:26 +01:00
iio
infiniband RDMA/bnxt_re: Fix the page details for the srq created by kernel consumers 2025-02-23 06:57:56 -05:00
input
interconnect
iommu iommu/vt-d: Fix suspicious RCU usage 2025-02-28 12:19:01 +01:00
ipack
irqchip irqchip/qcom-pdc: Workaround hardware register bug on X1E80100 2025-02-21 09:47:06 +01:00
isdn
leds
macintosh
mailbox
mcb
md - dm-vdo: add missing spin_lock_init 2025-02-24 16:29:48 -08:00
media
memory
memstick
message
mfd
misc Revert "drivers/card_reader/rtsx_usb: Restore interrupt based detection" 2025-02-27 12:24:53 -08:00
mmc
most
mtd Fix writes on SST flashes 2025-02-19 14:38:47 +01:00
mux
net mctp i3c: handle NULL header address 2025-03-06 10:33:07 +01:00
nfc
ntb
nubus
nvdimm
nvme nvme-tcp: fix signedness bug in nvme_tcp_init_connection() 2025-03-05 10:37:01 -08:00
nvmem
of Revert "of: reserved-memory: Fix using wrong number of cells to get property 'alignment'" 2025-02-26 13:39:28 -06:00
opp
parisc
parport
pci pci-v6.14-fixes-3 2025-02-14 16:49:07 -08:00
pcmcia
peci
perf
phy
pinctrl
platform ACPI fix for 6.14-rc6 2025-03-07 12:17:42 -10:00
pmdomain
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio rapidio: add check for rio_add_net() in rio_scan_alloc_net() 2025-03-05 21:36:19 -08:00
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 Smaller than usual with no fixes from any subtree. 2025-02-20 10:19:54 -08:00
sbus
scsi scsi: core: Clear driver private data when retrying request 2025-02-20 21:20:58 -05:00
sh
siox
slimbus slimbus: messaging: Free transaction ID in delayed interrupt scenario 2025-02-20 15:19:51 +01:00
soc soc: loongson: loongson2_guts: Add check for devm_kstrdup() 2025-02-20 22:29:05 +01:00
soundwire
spi
spmi
ssb
staging fbtft: Remove access to page->index 2025-03-05 08:38:21 +01:00
target
tc
tee
thermal thermal: gov_power_allocator: Update total_weight on bind and cdev updates 2025-02-25 12:30:45 +01:00
thunderbolt
tty Serial driver fixes for 6.14-rc3 2025-02-16 12:50:44 -08:00
ufs scsi: ufs: core: bsg: Fix crash when arpmb command fails 2025-02-20 22:18:24 -05:00
uio
usb usb: typec: ucsi: Fix NULL pointer access 2025-03-06 16:55:46 +01:00
vdpa
vfio
vhost vhost: return task creation error instead of NULL 2025-03-01 02:52:52 -05:00
video gpu: nova-core: add initial driver stub 2025-03-09 19:24:27 +01:00
virt Char/Misc/IIO driver fixes for 6.14-rc6 2025-03-09 09:07:54 -10:00
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile