Skip to content

Commit

Permalink
drm/xe: correct the calculation of remaining size
Browse files Browse the repository at this point in the history
In function write_pgtable, the calculation of chunk in the do-while
loop is wrong, we should always compare against remaining size instead
of the total size update->qwords.

Signed-off-by: Fei Yang <fei.yang@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240116223709.652585-2-fei.yang@intel.com
  • Loading branch information
Fei Yang authored and Matt Roper committed Jan 18, 2024
1 parent eb08104 commit 43d4837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,
do {
u64 addr = ppgtt_ofs + ofs * 8;

chunk = min(update->qwords, MAX_PTE_PER_SDI);
chunk = min(size, MAX_PTE_PER_SDI);

/* Ensure populatefn can do memset64 by aligning bb->cs */
if (!(bb->len & 1))
Expand Down

0 comments on commit 43d4837

Please sign in to comment.