Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/api_intel_allocator: Add default-alignment test
Date: Thu, 24 Feb 2022 12:16:38 -0800	[thread overview]
Message-ID: <87y2209g0p.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20220224075415.18663-3-zbigniew.kempczynski@intel.com>

On Wed, 23 Feb 2022 23:54:15 -0800, Zbigniew Kempczyński wrote:
>
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index 7ae4a00b7..32d1aad70 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -120,6 +120,34 @@ static void reserve(int fd, uint8_t type)
>	igt_assert_eq(intel_allocator_close(ahnd), true);
>  }
>
> +static void default_alignment(int fd)
> +{
> +	struct test_obj obj[3];
> +	uint64_t ahnd, default_alignment = 0x4000;
> +
> +	ahnd = intel_allocator_open_full(fd, 0, 0, 0, INTEL_ALLOCATOR_SIMPLE,
> +					 ALLOC_STRATEGY_LOW_TO_HIGH,
> +					 default_alignment);
> +
> +	for (int i = 0; i < ARRAY_SIZE(obj); i++) {
> +		obj[i].handle = gem_handle_gen();
> +		obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle, 4096,
> +				i == 2 ? 4096 : 0);
> +		igt_debug("obj[%d].offset: %llx, handle: %u\n", i,
> +			 (long long) obj[i].offset, obj[i].handle);
> +	}
> +
> +	igt_assert_eq(obj[1].offset - obj[0].offset, default_alignment);

What would happen here if we had not specified default_alignment (i.e. let
the allocator choose safe_alignment silently)? Do we need a
"get_alignment()" API? Or clients know that the default default_alignment
is safe_alignment?

In any case, this patch is fine so:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

  reply	other threads:[~2022-02-24 20:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  7:54 [igt-dev] [PATCH i-g-t 0/2] Use safe alignment as a default Zbigniew Kempczyński
2022-02-24  7:54 ` [igt-dev] [PATCH i-g-t 1/2] lib/intel_allocator: Add " Zbigniew Kempczyński
2022-02-24 20:50   ` Dixit, Ashutosh
2022-02-25  7:04     ` Zbigniew Kempczyński
2022-02-24  7:54 ` [igt-dev] [PATCH i-g-t 2/2] tests/api_intel_allocator: Add default-alignment test Zbigniew Kempczyński
2022-02-24 20:16   ` Dixit, Ashutosh [this message]
2022-02-25  7:22     ` Zbigniew Kempczyński
2022-02-24  8:57 ` [igt-dev] ✓ Fi.CI.BAT: success for Use safe alignment as a default (rev2) Patchwork
2022-02-24 21:20 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-25  7:26   ` Zbigniew Kempczyński
2022-02-25 16:25     ` Vudum, Lakshminarayana
2022-02-25 15:41 ` Patchwork
2022-02-25 16:04 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-02-23 10:33 [igt-dev] [PATCH i-g-t 0/2] Use safe alignment as a default Zbigniew Kempczyński
2022-02-23 10:33 ` [igt-dev] [PATCH i-g-t 2/2] tests/api_intel_allocator: Add default-alignment test Zbigniew Kempczyński

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=87y2209g0p.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@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