Re: [PATCH 10/12] drm/i915/selftests: Eliminate duplicate vma size check

Jani Nikula
2026-04-08T09:01:33Z

On Tue, 07 Apr 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Both remapped and rotated views need the exact same size check.

This is misleading, see below. At the very least the commit message
needs amending.

> Currently that is being done separately for each type. Share
> the code by just checking for !NORMAL view. This test doesn't
> use I915_GTT_VIEW_PARTIAL so the inverse check is fine here.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/selftests/i915_vma.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
> index 7c4111e60f2e..258557388a2d 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_vma.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
> @@ -634,7 +634,7 @@ static int igt_vma_rotate_remap(void *arg)
>
> expected_pages = remapped_size(view.type, &plane_info[0], &plane_info[1]);
>
> - if (view.type == I915_GTT_VIEW_ROTATED &&
> + if (view.type != I915_GTT_VIEW_NORMAL &&
> vma->size != expected_pages * PAGE_SIZE) {
> pr_err("VMA is wrong size, expected %lu, found %llu\n",
> PAGE_SIZE * expected_pages, vma->size);
> @@ -642,14 +642,6 @@ static int igt_vma_rotate_remap(void *arg)
> goto out_object;
> }
>
> - if (view.type == I915_GTT_VIEW_REMAPPED &&
> - vma->size > expected_pages * PAGE_SIZE) {

This check becomes stricter now, expecting exact match. Does it matter?

History points at you! ;)

e2e394bffa19 ("drm/i915/selftests: Add mock selftest for remapped vmas")

If you think the change in the check is okay, and with the commit
message amended,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> - pr_err("VMA is wrong size, expected %lu, found %llu\n",
> - PAGE_SIZE * expected_pages, vma->size);
> - err = -EINVAL;
> - goto out_object;
> - }
> -
> if (vma->pages->nents > expected_pages) {
> pr_err("sg table is wrong sizeo, expected %u, found %u nents\n",
> expected_pages, vma->pages->nents);

--
Jani Nikula, Intel