Skip to content

Commit

Permalink
drm/i915/selftests: handle more rounding
Browse files Browse the repository at this point in the history
Ensure we account for potential rounding up of lmem objects.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5485
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220406173023.1039107-1-matthew.auld@intel.com
  • Loading branch information
Matthew Auld committed Apr 7, 2022
1 parent ce3d4d7 commit ae686e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/i915/gt/selftest_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,15 @@ static int perf_copy_blt(void *arg)

for (i = 0; i < ARRAY_SIZE(sizes); i++) {
struct drm_i915_gem_object *src, *dst;
size_t sz;
int err;

src = create_init_lmem_internal(gt, sizes[i], true);
if (IS_ERR(src))
return PTR_ERR(src);

dst = create_init_lmem_internal(gt, sizes[i], false);
sz = src->base.size;
dst = create_init_lmem_internal(gt, sz, false);
if (IS_ERR(dst)) {
err = PTR_ERR(dst);
goto err_src;
Expand All @@ -640,7 +642,7 @@ static int perf_copy_blt(void *arg)
dst->mm.pages->sgl,
I915_CACHE_NONE,
i915_gem_object_is_lmem(dst),
sizes[i]);
sz);

i915_gem_object_unlock(dst);
i915_gem_object_put(dst);
Expand Down

0 comments on commit ae686e2

Please sign in to comment.