linux/drivers
Akshata Jahagirdar 2b808d6b29 drm/xe/xe2: Introduce identity map for compressed pat for vram
Xe2+ has unified compression (exactly one compression mode/format),
where compression is now controlled via PAT at PTE level.
This simplifies KMD operations, as it can now decompress freely
without concern for the buffer's original compression format—unlike DG2,
which had multiple compression formats and thus required copying the
raw CCS state during VRAM eviction. In addition mixed VRAM and system
memory buffers were not supported with compression enabled.

On Xe2 dGPU compression is still only supported with VRAM, however we
can now support compression with VRAM and system memory buffers,
with GPU access being seamless underneath. So long as when doing
VRAM -> system memory the KMD uses compressed -> uncompressed,
to decompress it. This also allows CPU access to such buffers,
assuming that userspace first decompress the corresponding
pages being accessed.
If the pages are already in system memory then KMD would have already
decompressed them. When restoring such buffers with sysmem -> VRAM
the KMD can't easily know which pages were originally compressed,
so we always use uncompressed -> uncompressed here.
With this it also means we can drop all the raw CCS handling on such
platforms (including needing to allocate extra CCS storage).

In order to support this we now need to have two different identity
mappings for compressed and uncompressed VRAM.
In this patch, we set up the additional identity map for the VRAM with
compressed pat_index. We then select the appropriate mapping during
migration/clear. During eviction (vram->sysmem), we use the mapping
from compressed -> uncompressed. During restore (sysmem->vram), we need
the mapping from uncompressed -> uncompressed.
Therefore, we need to have two different mappings for compressed and
uncompressed vram. We set up an additional identity map for the vram
with compressed pat_index.
We then select the appropriate mapping during migration/clear.

v2: Formatting nits, Updated code to match recent changes in
    xe_migrate_prepare_vm(). (Matt)

v3: Move identity map loop to a helper function. (Matt Brost)

v4: Split helper function in different patch, and
	add asserts and nits. (Matt Brost)

v5: Convert the 2 bool arguments of pte_update_size to flags
	argument (Matt Brost)

v6: Formatting nits (Matt Brost)

Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b00db5c7267e54260cb6183ba24b15c1e6ae52a3.1721250309.git.akshata.jahagirdar@intel.com
2024-07-17 17:02:30 -07:00
..
accel accel/ivpu: Remove unused ivpu_rpm_get_if_active() 2024-06-14 09:15:28 +02:00
accessibility Char/Misc bugfix for 6.10-rc1 2024-05-24 08:43:25 -07:00
acpi Merge branches 'acpi-ec', 'acpi-apei' and 'pnp' 2024-06-05 16:58:09 +02:00
amba
android binder: fix max_thread type inconsistency 2024-05-04 18:59:47 +02:00
ata ata: pata_macio: Fix max_segment_size with PAGE_SIZE == 64K 2024-06-06 14:53:34 +02:00
atm atm/fore200e: Delete unused 'fore200e_boards' 2024-05-06 18:26:47 -07:00
auxdisplay - Fix-ups 2024-05-22 10:45:12 -07:00
base Merge drm/drm-next into drm-xe-next 2024-06-12 11:31:42 -04:00
bcma
block null_blk: fix validation of block size 2024-06-05 12:12:54 -06:00
bluetooth virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
bus tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
cache
cdrom cdrom: rearrange last_media_change check to avoid unintentional overflow 2024-05-15 12:59:55 -06:00
cdx
char agp: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:20:58 +10:00
clk clk: sifive: Do not register clkdevs for PRCI clocks 2024-05-29 12:31:02 -07:00
clocksource RISC-V Patches for the 6.10 Merge Window, Part 1 2024-05-22 09:56:00 -07:00
comedi
connector
counter
cpufreq cpufreq: intel_pstate: Fix unchecked HWP MSR access 2024-06-03 18:00:23 +02:00
cpuidle pmdomain core: 2024-05-16 08:50:32 -07:00
crypto virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
cxl cxl/region: Fix memregion leaks in devm_cxl_add_region() 2024-05-28 16:09:17 -07:00
dax The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
dca
devfreq PM / devfreq: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions 2024-05-09 00:30:37 +09:00
dio
dma dmaengine updates for v6.10 2024-05-21 11:15:56 -07:00
dma-buf drm-misc-next for 6.11: 2024-06-21 11:06:56 +10:00
dpll dpll: fix return value check for kmemdup 2024-05-13 16:53:53 -07:00
edac EDAC/igen6: Convert PCIBIOS_* return codes to errnos 2024-06-04 11:29:52 +02:00
eisa alpha: remove DECpc AXP150 (Jensen) support 2024-05-03 22:09:50 +02:00
extcon extcon: adc-jack: Document missing struct members 2024-05-09 01:03:39 +09:00
firewire firewire: add missing MODULE_DESCRIPTION() to test modules 2024-05-27 07:34:58 +09:00
firmware EFI fixes for v6.10 #2 2024-06-06 09:39:36 -07:00
fpga Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
fsi
gnss
gpio gpio: add missing MODULE_DESCRIPTION() macros 2024-06-07 10:05:21 +02:00
gpu drm/xe/xe2: Introduce identity map for compressed pat for vram 2024-07-17 17:02:30 -07:00
greybus greybus: Fix use-after-free bug in gb_interface_release due to race condition. 2024-05-04 18:59:41 +02:00
hid for-linus-2024060801 2024-06-08 10:48:11 -07:00
hsi
hte
hv Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
hwmon hwmon: (shtc1) Fix property misspelling 2024-05-30 09:05:19 -07:00
hwspinlock
hwtracing Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
i2c i2c: synquacer: Remove a clk reference from struct synquacer_i2c 2024-05-23 13:38:15 +02:00
i3c i3c: dw: Add hot-join support. 2024-05-23 00:29:19 +02:00
idle
iio Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
infiniband tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
input Input: silead - Always support 10 fingers 2024-06-03 11:10:08 +02:00
interconnect tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
iommu iommu/amd: Fix Invalid wait context issue 2024-06-04 14:00:59 +02:00
ipack
irqchip irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update() 2024-06-03 18:20:00 +02:00
isdn
leds leds: mt6370: Remove unused field 'reg_cfgs' from 'struct mt6370_priv' 2024-05-02 18:12:27 +01:00
macintosh powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
mailbox mailbox: zynqmp-ipi: drop irq_to_desc() call 2024-05-31 12:39:15 -05:00
mcb mcb: lpc: Convert to platform remove callback returning void 2024-04-29 10:53:31 +02:00
md bcache: code cleanup in __bch_bucket_alloc_set() 2024-05-28 06:55:59 -06:00
media media: intel/ipu6: add csi2 port sanity check in notifier bound 2024-05-30 16:34:59 +02:00
memory ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
memstick
message SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
mfd pci-v6.10-changes 2024-05-21 10:09:28 -07:00
misc Merge drm/drm-next into drm-intel-next 2024-06-19 11:38:31 +03:00
mmc MMC core: 2024-05-16 08:56:49 -07:00
most
mtd bd_inode series 2024-05-21 09:51:42 -07:00
mux mux: remove usage of the deprecated ida_simple_xx() API 2024-04-29 08:20:07 -07:00
net net: wwan: iosm: Fix tainted pointer delete is case of region creation fail 2024-06-06 10:15:14 +02:00
nfc nfc/nci: Add the inconsistency check between the input data length and count 2024-05-29 13:08:31 +01:00
ntb
nubus
nvdimm virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
nvme nvme: fix nvme_pr_* status code parsing 2024-05-31 13:50:59 -07:00
nvmem nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct 2024-05-03 07:26:39 +02:00
of of: property: Fix fw_devlink handling of interrupt-map 2024-05-30 19:43:47 -05:00
opp OPP Updates for 6.10 2024-05-17 13:01:24 +02:00
parisc
parport
pci PCI: Revert the cfg_access_lock lockdep mechanism 2024-06-04 12:10:05 -05:00
pcmcia
peci
perf arm64 fixes for -rc1 2024-05-23 12:09:22 -07:00
phy phy-for-6.10 2024-05-21 11:19:18 -07:00
pinctrl - New Device Support 2024-05-22 10:41:14 -07:00
platform Merge drm/drm-next into drm-intel-next 2024-06-19 11:38:31 +03:00
pmdomain pmdomain providers: 2024-05-27 08:18:31 -07:00
pnp PNP: Hide pnp_bus_type from the non-PNP code 2024-05-28 21:53:51 +02:00
power I2C core removes an argument from the i2c_mux_add_adapter() call to 2024-05-20 08:55:18 -07:00
powercap powercap: intel_rapl_tpmi: Enable PMU support 2024-04-30 21:10:37 +02:00
pps pps: remove usage of the deprecated ida_simple_xx() API 2024-04-29 08:20:06 -07:00
ps3
ptp ptp: Fix error message on failed pin verification 2024-06-05 16:01:16 -07:00
pwm pwm: pca9685: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-10 07:30:27 +02:00
rapidio rapidio: remove choice for enumeration 2024-05-14 23:36:19 +09:00
ras
regulator regulator: rtq2208: Fix invalid memory access when devm_of_regulator_put_matches is called 2024-05-28 13:22:54 +01:00
remoteproc remoteproc: k3-r5: Jump to error handling labels in start/stop errors 2024-05-06 13:34:12 -06:00
reset I'm actually surprised this time. There aren't any new Qualcomm SoC clk 2024-05-18 12:48:37 -07:00
rpmsg virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
rtc pcf8563: add wakeup-source support 2024-05-07 23:40:46 +02:00
s390 more s390 updates for 6.10 merge window 2024-05-21 12:09:36 -07:00
sbus
scsi SCSI fixes on 20240606 2024-06-06 14:40:51 -07:00
sh
siox
slimbus Linux 6.9-rc7 2024-05-08 19:21:51 +01:00
soc tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
soundwire soundwire updates for 6.10 2024-05-21 11:23:36 -07:00
spi spi: stm32: Don't warn about spurious interrupts 2024-05-29 19:12:09 +01:00
spmi spmi: pmic-arb: Add multi bus support 2024-05-08 19:46:11 +01:00
ssb
staging Staging driver changes for 6.10-rc1 2024-05-22 12:11:48 -07:00
target Assorted commits that had missed the last merge window... 2024-05-21 13:11:44 -07:00
tc
tee TEE driver for Trusted Services 2024-04-29 22:29:44 +02:00
thermal thermal: trip: Trigger trip down notifications when trips involved in mitigation become invalid 2024-05-27 13:00:00 +02:00
thunderbolt thunderbolt: Changes for v6.10 merge window 2024-05-10 10:25:22 +01:00
tty TTY/Serial fixes for 6.10-rc1 2024-05-24 08:38:28 -07:00
ufs scsi: ufs: mcq: Fix error output and clean up ufshcd_mcq_abort() 2024-05-30 20:40:48 -04:00
uio
usb tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
vdpa Merge tag 'stable/vduse-virtio-net' into vhost 2024-05-22 08:32:48 -04:00
vfio VFIO updates for v6.10-rc1 2024-05-20 14:56:50 -07:00
vhost virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
video Merge drm/drm-next into drm-misc-next 2024-05-27 11:08:31 +02:00
virt The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
virtio virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
w1
watchdog watchdog: LENOVO_SE10_WDT should depend on X86 && DMI 2024-05-11 11:32:06 +02:00
xen xen: branch for v6.10-rc1 2024-05-24 10:24:49 -07:00
zorro zorro: Use helpers from ioport.h 2024-04-29 16:45:53 +02:00
Kconfig
Makefile kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00