Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/xe/vram: fix ccs offset calculation
@ 2024-09-16  8:49 Matthew Auld
  2024-09-16  8:54 ` ✓ CI.Patch_applied: success for drm/xe/vram: fix ccs offset calculation (rev3) Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Matthew Auld @ 2024-09-16  8:49 UTC (permalink / raw)
  To: intel-xe
  Cc: Himal Prasad Ghimiray, Akshata Jahagirdar, Lucas De Marchi,
	Shuicheng Lin, Matt Roper, stable

Spec says SW is expected to round up to the nearest 128K, if not already
aligned for the CC unit view of CCS. We are seeing the assert sometimes
pop on BMG to tell us that there is a hole between GSM and CCS, as well
as popping other asserts with having a vram size with strange alignment,
which is likely caused by misaligned offset here.

v2 (Shuicheng):
 - Do the round_up() on final SW address.

BSpec: 68023
Fixes: b5c2ca0372dc ("drm/xe/xe2hpg: Determine flat ccs offset for vram")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: <stable@vger.kernel.org> # v6.10+
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Tested-by: Shuicheng Lin <shuicheng.lin@intel.com>
---
 drivers/gpu/drm/xe/xe_vram.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_vram.c b/drivers/gpu/drm/xe/xe_vram.c
index 7e765b1499b1..2a623bfcda7e 100644
--- a/drivers/gpu/drm/xe/xe_vram.c
+++ b/drivers/gpu/drm/xe/xe_vram.c
@@ -182,6 +182,7 @@ static inline u64 get_flat_ccs_offset(struct xe_gt *gt, u64 tile_size)
 		offset = offset_hi << 32; /* HW view bits 39:32 */
 		offset |= offset_lo << 6; /* HW view bits 31:6 */
 		offset *= num_enabled; /* convert to SW view */
+		offset = round_up(offset, SZ_128K); /* SW must round up to nearest 128K */
 
 		/* We don't expect any holes */
 		xe_assert_msg(xe, offset == (xe_mmio_read64_2x32(&gt_to_tile(gt)->mmio, GSMBASE) -
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-09-16 20:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16  8:49 [PATCH v3] drm/xe/vram: fix ccs offset calculation Matthew Auld
2024-09-16  8:54 ` ✓ CI.Patch_applied: success for drm/xe/vram: fix ccs offset calculation (rev3) Patchwork
2024-09-16  8:55 ` ✓ CI.checkpatch: " Patchwork
2024-09-16  8:56 ` ✓ CI.KUnit: " Patchwork
2024-09-16  9:07 ` ✓ CI.Build: " Patchwork
2024-09-16  9:10 ` ✓ CI.Hooks: " Patchwork
2024-09-16  9:11 ` ✓ CI.checksparse: " Patchwork
2024-09-16  9:31 ` ✓ CI.BAT: " Patchwork
2024-09-16 10:35 ` ✗ CI.FULL: failure " Patchwork
2024-09-16 15:00 ` [PATCH v3] drm/xe/vram: fix ccs offset calculation Lucas De Marchi
2024-09-16 19:59   ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox