Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Matt Atwood <matthew.s.atwood@intel.com>,
	Satyanarayana K V P <satyanarayana.k.v.p@intel.com>,
	Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>,
	Varun Gupta <varun.gupta@intel.com>
Subject: Re: [PATCH v2 3/5] drm/xe/tests: Test shareable GGTT alignment by GGTT address
Date: Thu, 3 Dec 2026 15:07:02 -0500	[thread overview]
Message-ID: <axHL5sB2x72uH7_J@intel.com> (raw)
In-Reply-To: <20261203181408.362175-4-piotr.piorkowski@intel.com>

On Thu, Dec 03, 2026 at 07:14:06PM +0100, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski@intel.com>
> 
> Add a test for a shareable GGTT node and the largest GGTT hole with a
> 4M alignment, which the 1M GGTT start used by the tests does not
> satisfy. Check that the GGTT address of the node is aligned and that
> the node is placed at the top of the GGTT. Also check the largest hole
> before and after the node is inserted.
> 
> Cc: Matt Atwood <matthew.s.atwood@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>
> Cc: Varun Gupta <varun.gupta@intel.com>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/tests/xe_ggtt_kunit.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/tests/xe_ggtt_kunit.c b/drivers/gpu/drm/xe/tests/xe_ggtt_kunit.c
> index 202b48b0c984..090b7dd88888 100644
> --- a/drivers/gpu/drm/xe/tests/xe_ggtt_kunit.c
> +++ b/drivers/gpu/drm/xe/tests/xe_ggtt_kunit.c
> @@ -306,6 +306,29 @@ static void alloc_shareable_pool_oversized(struct kunit *test)
>  	KUNIT_EXPECT_EQ(test, PTR_ERR(node), -ENOSPC);
>  }
>  
> +static void alloc_shareable_aligned_addr(struct kunit *test)
> +{
> +	u64 accessible = ggtt_test_accessible_size(test);
> +	u64 top = ALIGN_DOWN(GGTT_TEST_START + accessible, SZ_4M);
> +	struct xe_ggtt_node *node;
> +	struct xe_ggtt *ggtt;
> +
> +	ggtt = ggtt_test_create(test, accessible, accessible, accessible);
> +	KUNIT_ASSERT_NOT_NULL(test, ggtt);
> +	/* Force the path for a GGTT start that is not aligned */
> +	KUNIT_ASSERT_FALSE(test, IS_ALIGNED(GGTT_TEST_START, SZ_4M));
> +
> +	KUNIT_EXPECT_EQ(test, xe_ggtt_largest_hole(ggtt, SZ_4M, NULL),
> +			top - ALIGN(GGTT_TEST_START, SZ_4M));
> +
> +	node = ggtt_test_track_node(test, xe_ggtt_insert_node_shareable(ggtt, SZ_8M, SZ_4M));
> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node);
> +	KUNIT_EXPECT_TRUE(test, IS_ALIGNED(xe_ggtt_node_addr(node), SZ_4M));
> +	KUNIT_EXPECT_EQ(test, xe_ggtt_node_addr(node) + SZ_8M, top);
> +	KUNIT_EXPECT_EQ(test, xe_ggtt_largest_hole(ggtt, SZ_4M, NULL),
> +			top - SZ_8M - ALIGN(GGTT_TEST_START, SZ_4M));
> +}
> +
>  static struct kunit_case ggtt_iov_test_cases[] = {
>  	KUNIT_CASE(init_shared_pf),
>  	KUNIT_CASE(init_partial_overlap),
> @@ -316,6 +339,7 @@ static struct kunit_case ggtt_iov_test_cases[] = {
>  	KUNIT_CASE(alloc_partial_overlap_shareable_full),
>  	KUNIT_CASE(alloc_shareable_pool_unavailable),
>  	KUNIT_CASE(alloc_shareable_pool_oversized),
> +	KUNIT_CASE(alloc_shareable_aligned_addr),
>  	{}
>  };
>  
> -- 
> 2.34.1
> 

  reply	other threads:[~2026-12-03 20:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 18:14 [PATCH v2 0/5] Apply Wa_14028597154 to SR-IOV VF Piórkowski, Piotr
2026-12-03 18:14 ` [PATCH v2 1/5] drm/xe: Don't allow disabling multi-queue on PF Piórkowski, Piotr
2026-12-03 20:06   ` Piotr Piórkowski
2026-12-03 20:30     ` Rodrigo Vivi
2026-12-03 18:14 ` [PATCH v2 2/5] drm/xe/ggtt: Align shareable GGTT nodes by GGTT address Piórkowski, Piotr
2026-12-03 20:06   ` Rodrigo Vivi
2026-12-03 18:14 ` [PATCH v2 3/5] drm/xe/tests: Test shareable GGTT alignment " Piórkowski, Piotr
2026-12-03 20:07   ` Rodrigo Vivi [this message]
2026-12-03 18:14 ` [PATCH v2 4/5] drm/xe/xe3p_lpg: Apply Wa_14028597154 to SR-IOV PF Piórkowski, Piotr
2026-12-03 20:30   ` Rodrigo Vivi
2026-12-03 18:14 ` [PATCH v2 5/5] drm/xe/xe3p_lpg: Apply Wa_14028597154 to SR-IOV VF Piórkowski, Piotr
2026-12-03 20:31   ` Rodrigo Vivi
2026-12-03 18:28 ` ✓ CI.KUnit: success for Apply Wa_14028597154 to SR-IOV VF (rev2) Patchwork
2026-12-03 19:04 ` ✓ Xe.CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axHL5sB2x72uH7_J@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.s.atwood@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=satyanarayana.k.v.p@intel.com \
    --cc=tilak.tirumalesh.tangudu@intel.com \
    --cc=varun.gupta@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox