Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] benchmarks/gem_userptr_benchmark: Remove tests with unsynchronized flag
Date: Wed, 26 May 2021 09:56:08 +0100	[thread overview]
Message-ID: <e4b22a23-421e-cc77-fd0a-5a1b4354c206@linux.intel.com> (raw)
In-Reply-To: <20210521164637.7306-1-zbigniew.kempczynski@intel.com>


On 21/05/2021 17:46, Zbigniew Kempczyński wrote:
> As flag I915_USERPTR_UNSYNCHRONIZED is not supported by the i915 anymore
> remove tests which tries to use it in the benchmark.
> 
> Remove benchmark from meson libdrm depending code as it is a little bit
> confusing.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>

Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

> ---
>   benchmarks/gem_userptr_benchmark.c | 54 +++++++-----------------------
>   benchmarks/meson.build             |  2 +-
>   2 files changed, 14 insertions(+), 42 deletions(-)
> 
> diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
> index d7a495209..a85997b86 100644
> --- a/benchmarks/gem_userptr_benchmark.c
> +++ b/benchmarks/gem_userptr_benchmark.c
> @@ -57,20 +57,10 @@
>     #define PAGE_SIZE 4096
>   #endif
>   
> -static uint32_t userptr_flags = I915_USERPTR_UNSYNCHRONIZED;
> +static uint32_t userptr_flags = 0;
>   
>   #define BO_SIZE (65536)
>   
> -static void gem_userptr_test_unsynchronized(void)
> -{
> -	userptr_flags = I915_USERPTR_UNSYNCHRONIZED;
> -}
> -
> -static void gem_userptr_test_synchronized(void)
> -{
> -	userptr_flags = 0;
> -}
> -
>   static void **handle_ptr_map;
>   static unsigned int num_handle_ptr_map;
>   
> @@ -124,14 +114,10 @@ static int has_userptr(int fd)
>   {
>   	uint32_t handle = 0;
>   	void *ptr;
> -	uint32_t oldflags;
>   	int ret;
>   
>   	assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0);
> -	oldflags = userptr_flags;
> -	gem_userptr_test_unsynchronized();
> -	ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, userptr_flags, &handle);
> -	userptr_flags = oldflags;
> +	ret = __gem_userptr(fd, ptr, PAGE_SIZE, 0, 0, &handle);
>   	if (ret != 0) {
>   		free(ptr);
>   		return 0;
> @@ -464,32 +450,18 @@ static void test_userptr(int fd)
>   	test_multiple(fd, 100, 1);
>   }
>   
> -int main(int argc, char **argv)
> +igt_main
>   {
>   	int fd = -1, ret;
>   
> -	igt_subtest_init(argc, argv);
> -
> -	fd = drm_open_driver(DRIVER_INTEL);
> -	igt_assert(fd >= 0);
> -
> -	ret = has_userptr(fd);
> -	igt_skip_on_f(ret == 0, "No userptr support - %s (%d)\n",
> -			strerror(errno), ret);
> -
> +	igt_fixture {
> +		fd = drm_open_driver(DRIVER_INTEL);
> +		igt_assert(fd >= 0);
>   
> -	gem_userptr_test_unsynchronized();
> -
> -	igt_subtest("userptr-unsync")
> -		test_userptr(fd);
> -
> -	igt_subtest("userptr-impact-unsync")
> -		test_impact(fd, "unsync-");
> -
> -	igt_subtest("userptr-impact-unsync-overlap")
> -		test_impact_overlap(fd, "unsync-");
> -
> -	gem_userptr_test_synchronized();
> +		ret = has_userptr(fd);
> +		igt_skip_on_f(ret == 0, "No userptr support - %s (%d)\n",
> +			      strerror(errno), ret);
> +	}
>   
>   	igt_subtest("userptr-sync")
>   		test_userptr(fd);
> @@ -500,7 +472,7 @@ int main(int argc, char **argv)
>   	igt_subtest("userptr-impact-sync-overlap")
>   		test_impact_overlap(fd, "sync-");
>   
> -	igt_exit();
> -
> -	return 0;
> +	igt_fixture {
> +		close(fd);
> +	}
>   }
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> index bede51dce..98a08e25c 100644
> --- a/benchmarks/meson.build
> +++ b/benchmarks/meson.build
> @@ -11,6 +11,7 @@ benchmark_progs = [
>   	'gem_prw',
>   	'gem_set_domain',
>   	'gem_syslatency',
> +	'gem_userptr_benchmark',
>   	'gem_wsim',
>   	'kms_vblank',
>   	'prime_lookup',
> @@ -23,7 +24,6 @@ if libdrm_intel.found()
>   		'intel_upload_blit_large_gtt',
>   		'intel_upload_blit_large_map',
>   		'intel_upload_blit_small',
> -		'gem_userptr_benchmark',
>   	]
>   endif
>   
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-05-26  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 16:46 [igt-dev] [PATCH i-g-t] benchmarks/gem_userptr_benchmark: Remove tests with unsynchronized flag Zbigniew Kempczyński
2021-05-21 17:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-24  0:56 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-05-26  8:56 ` Tvrtko Ursulin [this message]
2021-05-26  9:00   ` [igt-dev] [PATCH i-g-t] " Tvrtko Ursulin

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=e4b22a23-421e-cc77-fd0a-5a1b4354c206@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    --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