Commit 348769d1 authored by Fei Yang's avatar Fei Yang Committed by Matt Roper

drm/xe: correct the assertion for number of PTEs

While one MI_STORE_DATA_IMM can take no more than 0x1fe qwords,
the size of the pgtable can be 512 entries.

Fixes: 43d48379 ("drm/xe: correct the calculation of remaining size")
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarFei Yang <fei.yang@intel.com>
Tested-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240125065245.1204731-2-fei.yang@intel.com
parent d688b86a
...@@ -71,6 +71,7 @@ struct xe_migrate { ...@@ -71,6 +71,7 @@ struct xe_migrate {
#define NUM_KERNEL_PDE 17 #define NUM_KERNEL_PDE 17
#define NUM_PT_SLOTS 32 #define NUM_PT_SLOTS 32
#define LEVEL0_PAGE_TABLE_ENCODE_SIZE SZ_2M #define LEVEL0_PAGE_TABLE_ENCODE_SIZE SZ_2M
#define MAX_NUM_PTE 512
/* /*
* Although MI_STORE_DATA_IMM's "length" field is 10-bits, 0x3FE is the largest * Although MI_STORE_DATA_IMM's "length" field is 10-bits, 0x3FE is the largest
...@@ -1107,7 +1108,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs, ...@@ -1107,7 +1108,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,
* This shouldn't be possible in practice.. might change when 16K * This shouldn't be possible in practice.. might change when 16K
* pages are used. Hence the assert. * pages are used. Hence the assert.
*/ */
xe_tile_assert(tile, update->qwords <= MAX_PTE_PER_SDI); xe_tile_assert(tile, update->qwords < MAX_NUM_PTE);
if (!ppgtt_ofs) if (!ppgtt_ofs)
ppgtt_ofs = xe_migrate_vram_ofs(tile_to_xe(tile), ppgtt_ofs = xe_migrate_vram_ofs(tile_to_xe(tile),
xe_bo_addr(update->pt_bo, 0, xe_bo_addr(update->pt_bo, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment