[igt-dev] [PATCH] [PATCH i-g-t][V2]tests/i915/gem_ctx_create: Reverted device reopen logic
Melkaveri, Arjun
arjun.melkaveri at intel.com
Mon Mar 23 15:16:43 UTC 2020
Thanks
Arjun M
-----Original Message-----
From: Chris Wilson <chris at chris-wilson.co.uk>
Sent: Monday, March 23, 2020 4:24 PM
To: Melkaveri, Arjun <arjun.melkaveri at intel.com>; igt-dev at lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH] [PATCH i-g-t][V2]tests/i915/gem_ctx_create: Reverted device reopen logic
Quoting Arjun Melkaveri (2020-03-23 08:39:20)
> Removed gem_reopen_driver and gem_context_copy_engines logic from code
> as it is not recommended.
> No reopen after fork is needed .
>
> V2:
> Added gem_context_copy_engines to copy engines over.
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Ursulin Tvrtko <tvrtko.ursulin at intel.com>
> Signed-off-by: Arjun Melkaveri <arjun.melkaveri at intel.com>
> ---
> tests/i915/gem_ctx_create.c | 44
> +++++--------------------------------
> 1 file changed, 6 insertions(+), 38 deletions(-)
>
> diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c
> index 2d477226..61a25d5b 100644
> --- a/tests/i915/gem_ctx_create.c
> +++ b/tests/i915/gem_ctx_create.c
> @@ -100,11 +100,10 @@ static void files(int core, int timeout, const int ncpus)
> igt_fork(child, ncpus) {
> struct timespec start, end;
> unsigned count = 0;
> - int fd;
>
> clock_gettime(CLOCK_MONOTONIC, &start);
> do {
> - fd = gem_reopen_driver(core);
> + int fd = drm_open_driver(DRIVER_INTEL);
gem_reopen_driver() is an improvement over drm_open_driver() in this circumstance.
-Chris
This changes were done based on Tvrtko's comment .
To be clear . In Fork we need to use gem_reopen_driver for drm_open_driver() only .
If we are using FD , opened in main function , then we can avoid using gem_reopen_driver ?
-Arjun
More information about the igt-dev
mailing list