]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/xe/xe2: Modify main memory to ccs memory ratio.
authorHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Tue, 12 Dec 2023 18:25:25 +0000 (23:55 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:46:09 +0000 (11:46 -0500)
On xe2 platforms each byte of CCS data now represents 512 bytes of
main memory data.

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/regs/xe_gpu_commands.h
drivers/gpu/drm/xe/xe_device.c

index f1c5bf203b3dc990b7d9028534d591133c1339bb..1f9c32e694c6edd92052aeb3cdaec8951c28ba7e 100644 (file)
@@ -16,7 +16,7 @@
 #define   XY_CTRL_SURF_MOCS_MASK       GENMASK(31, 26)
 #define   XE2_XY_CTRL_SURF_MOCS_INDEX_MASK     GENMASK(31, 28)
 #define   NUM_CCS_BYTES_PER_BLOCK      256
-#define   NUM_BYTES_PER_CCS_BYTE       256
+#define   NUM_BYTES_PER_CCS_BYTE(_xe)  (GRAPHICS_VER(_xe) >= 20 ? 512 : 256)
 #define   NUM_CCS_BLKS_PER_XFER                1024
 
 #define XY_FAST_COLOR_BLT_CMD          (2 << 29 | 0x44 << 22)
index 82e3705b88cd916e7456d47e0bb106df8f748ca3..221e875843521e96e3ff4ca5a2594bc729775208 100644 (file)
@@ -615,7 +615,7 @@ void xe_device_wmb(struct xe_device *xe)
 u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size)
 {
        return xe_device_has_flat_ccs(xe) ?
-               DIV_ROUND_UP(size, NUM_BYTES_PER_CCS_BYTE) : 0;
+               DIV_ROUND_UP(size, NUM_BYTES_PER_CCS_BYTE(xe)) : 0;
 }
 
 bool xe_device_mem_access_ongoing(struct xe_device *xe)