All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Petri Latvala <petri.latvala@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] gem_lmem_swapping: Check requirements before module unload
Date: Wed, 20 Apr 2022 09:43:48 +0100	[thread overview]
Message-ID: <7c9abea0-715b-fef3-48c0-ec9c27a993d1@intel.com> (raw)
In-Reply-To: <20220419130057.9141-1-petri.latvala@intel.com>

On 19/04/2022 14:00, Petri Latvala wrote:
> To prevent a needless unload-load cycle, check for lmem before the
> unload if i915 is already loaded.
> 
> Also check that the device is there at all so we get a better error
> message than EBADFD from require_gem.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Acked-by: Matthew Auld <matthew.auld@intel.com>

> ---
>   tests/i915/gem_lmem_swapping.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/tests/i915/gem_lmem_swapping.c b/tests/i915/gem_lmem_swapping.c
> index 2f9f3268..ec41dfc3 100644
> --- a/tests/i915/gem_lmem_swapping.c
> +++ b/tests/i915/gem_lmem_swapping.c
> @@ -534,10 +534,25 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
>   		struct intel_execution_engine2 *e;
>   		char *tmp;
>   
> +		/*
> +		 * If the driver is already loaded, check that it has
> +		 * lmem before unloading to prevent a needless
> +		 * unload-load cycle on integrated platforms.
> +		 */
> +		if (igt_kmod_is_loaded("i915")) {
> +			i915 = __drm_open_driver(DRIVER_INTEL);
> +			igt_require_fd(i915);
> +			igt_require_gem(i915);
> +			igt_require(gem_has_lmem(i915));
> +			close(i915);
> +		}
> +
>   		igt_i915_driver_unload();
>   		igt_assert_eq(igt_i915_driver_load("lmem_size=4096"), 0);
>   
>   		i915 = __drm_open_driver(DRIVER_INTEL);
> +		igt_require_fd(i915);
> +		/* Do the lmem check again in case the reload messed something up (as unlikely it is) */
>   		igt_require_gem(i915);
>   		igt_require(gem_has_lmem(i915));
>   

  parent reply	other threads:[~2022-04-20  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 13:00 [igt-dev] [PATCH i-g-t] gem_lmem_swapping: Check requirements before module unload Petri Latvala
2022-04-19 13:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2022-04-19 16:14 ` [igt-dev] ✓ Fi.CI.BAT: success for gem_lmem_swapping: Check requirements before module unload (rev2) Patchwork
2022-04-19 19:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-04-20  8:43 ` Matthew Auld [this message]
2022-04-20 10:32   ` [igt-dev] [PATCH i-g-t] gem_lmem_swapping: Check requirements before module unload Petri Latvala

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=7c9abea0-715b-fef3-48c0-ec9c27a993d1@intel.com \
    --to=matthew.auld@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.