Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: "Kumar, Janga Rahul" <janga.rahul.kumar@intel.com>,
	"Das, Nirmoy" <nirmoy.das@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/intel/xe_compute_preempt: Extend it for more engines
Date: Fri, 23 Feb 2024 09:30:55 +0100	[thread overview]
Message-ID: <11b0271d-bec8-4287-abd4-70e2604e6e9f@linux.intel.com> (raw)
In-Reply-To: <MW3PR11MB47488666990DED86553DE57AAE562@MW3PR11MB4748.namprd11.prod.outlook.com>


On 2/22/2024 7:41 AM, Kumar, Janga Rahul wrote:
>
>> -----Original Message-----
>> From: Das, Nirmoy <nirmoy.das@intel.com>
>> Sent: Wednesday, February 21, 2024 1:35 AM
>> To: igt-dev@lists.freedesktop.org
>> Cc: Das, Nirmoy <nirmoy.das@intel.com>; Kumar, Janga Rahul
>> <janga.rahul.kumar@intel.com>
>> Subject: [PATCH i-g-t] tests/intel/xe_compute_preempt: Extend it for more
>> engines
>>
>> Extend the test to run on all eligible engines.
>>
>> Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> LGTM,
> Reviewed-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Thanks, merged!
>
> Thanks,
> Rahul
>> ---
>>   lib/intel_compute.c              | 21 +++++++++++++--------
>>   lib/intel_compute.h              |  2 +-
>>   tests/intel/xe_compute_preempt.c | 17 +++++++++++++----
>>   3 files changed, 27 insertions(+), 13 deletions(-)
>>
>> diff --git a/lib/intel_compute.c b/lib/intel_compute.c index
>> eab407a0d..c5d253ebc 100644
>> --- a/lib/intel_compute.c
>> +++ b/lib/intel_compute.c
>> @@ -1526,7 +1526,8 @@ static void xe2lpg_compute_preempt_exec(int fd,
>> const unsigned char *long_kernel
>>   					const unsigned char *short_kernel,
>>   					unsigned int short_kernel_size,
>>   					const unsigned char *sip_kernel,
>> -					unsigned int sip_kernel_size)
>> +					unsigned int sip_kernel_size,
>> +					struct drm_xe_engine_class_instance
>> *eci)
>>   {
>>   #define XE2_BO_PREEMPT_DICT_ENTRIES 11
>>   	struct bo_dict_entry bo_dict_long[XE2_BO_PREEMPT_DICT_ENTRIES] =
>> { @@ -1578,8 +1579,8 @@ static void xe2lpg_compute_preempt_exec(int fd,
>> const unsigned char *long_kernel
>>   	for (int i = 0; i < XE2_BO_PREEMPT_DICT_ENTRIES; ++i)
>>   		bo_dict_short[i] = bo_dict_long[i];
>>
>> -	bo_execenv_create(fd, &execenv_short, NULL);
>> -	bo_execenv_create(fd, &execenv_long, NULL);
>> +	bo_execenv_create(fd, &execenv_short, eci);
>> +	bo_execenv_create(fd, &execenv_long, eci);
>>
>>   	bo_dict_long[0].size = ALIGN(long_kernel_size, 0x1000);
>>   	bo_dict_short[0].size = ALIGN(short_kernel_size, 0x1000); @@ -1673,7
>> +1674,8 @@ static const struct {
>>   			     const unsigned char *short_kernel,
>>   			     unsigned int short_kernel_size,
>>   			     const unsigned char *sip_kernel,
>> -			     unsigned int sip_kernel_size);
>> +			     unsigned int sip_kernel_size,
>> +			     struct drm_xe_engine_class_instance *eci);
>>   	uint32_t compat;
>>   } intel_compute_preempt_batches[] = {
>>   	{
>> @@ -1683,7 +1685,8 @@ static const struct {
>>   	},
>>   };
>>
>> -static bool __run_intel_compute_kernel_preempt(int fd)
>> +static bool __run_intel_compute_kernel_preempt(int fd,
>> +		struct drm_xe_engine_class_instance *eci)
>>   {
>>   	unsigned int ip_ver = intel_graphics_ver(intel_get_drm_devid(fd));
>>   	unsigned int batch;
>> @@ -1720,7 +1723,8 @@ static bool __run_intel_compute_kernel_preempt(int
>> fd)
>>   							  kernels-
>>> long_kernel_size,
>>   							  kernels->kernel,
>> kernels->size,
>>   							  kernels->sip_kernel,
>> -							  kernels-
>>> sip_kernel_size);
>> +							  kernels-
>>> sip_kernel_size,
>> +							  eci);
>>
>>   	return true;
>>   }
>> @@ -1732,7 +1736,8 @@ static bool __run_intel_compute_kernel_preempt(int
>> fd)
>>    *
>>    * Returns true on success, false otherwise.
>>    */
>> -bool run_intel_compute_kernel_preempt(int fd)
>> +bool run_intel_compute_kernel_preempt(int fd,
>> +		struct drm_xe_engine_class_instance *eci)
>>   {
>> -	return __run_intel_compute_kernel_preempt(fd);
>> +	return __run_intel_compute_kernel_preempt(fd, eci);
>>   }
>> diff --git a/lib/intel_compute.h b/lib/intel_compute.h index
>> a02688ad4..fe9637b91 100644
>> --- a/lib/intel_compute.h
>> +++ b/lib/intel_compute.h
>> @@ -37,5 +37,5 @@ extern const struct intel_compute_kernels
>> intel_compute_square_kernels[];
>>
>>   bool run_intel_compute_kernel(int fd);
>>   bool xe_run_intel_compute_kernel_on_engine(int fd, struct
>> drm_xe_engine_class_instance *eci); -bool
>> run_intel_compute_kernel_preempt(int fd);
>> +bool run_intel_compute_kernel_preempt(int fd, struct
>> +drm_xe_engine_class_instance *eci);
>>   #endif	/* INTEL_COMPUTE_H */
>> diff --git a/tests/intel/xe_compute_preempt.c
>> b/tests/intel/xe_compute_preempt.c
>> index 31703638e..a4e0e1454 100644
>> --- a/tests/intel/xe_compute_preempt.c
>> +++ b/tests/intel/xe_compute_preempt.c
>> @@ -24,20 +24,29 @@
>>    * Functionality: compute openCL kernel
>>    */
>>   static void
>> -test_compute_preempt(int fd)
>> +test_compute_preempt(int fd, struct drm_xe_engine_class_instance *hwe)
>>   {
>> -	igt_require_f(run_intel_compute_kernel_preempt(fd), "GPU not
>> supported\n");
>> +	igt_require_f(run_intel_compute_kernel_preempt(fd, hwe), "GPU not
>> +supported\n");
>>   }
>>
>>   igt_main
>>   {
>>   	int xe;
>> +	struct drm_xe_engine_class_instance *hwe;
>>
>>   	igt_fixture
>>   		xe = drm_open_driver(DRIVER_XE);
>>
>> -	igt_subtest("compute-preempt")
>> -		test_compute_preempt(xe);
>> +	igt_subtest_with_dynamic("compute-preempt") {
>> +		xe_for_each_engine(xe, hwe) {
>> +			if (hwe->engine_class !=
>> DRM_XE_ENGINE_CLASS_COMPUTE &&
>> +			    hwe->engine_class !=
>> DRM_XE_ENGINE_CLASS_RENDER)
>> +				continue;
>> +
>> +			igt_dynamic_f("engine-%s",
>> xe_engine_class_string(hwe->engine_class))
>> +				test_compute_preempt(xe, hwe);
>> +		}
>> +	}
>>
>>   	igt_fixture
>>   		drm_close_driver(xe);
>> --
>> 2.42.0

      reply	other threads:[~2024-02-23  8:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 20:04 [PATCH i-g-t] tests/intel/xe_compute_preempt: Extend it for more engines Nirmoy Das
2024-02-20 23:12 ` ✓ CI.xeBAT: success for " Patchwork
2024-02-20 23:43 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-21  2:15 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-22  6:41 ` [PATCH i-g-t] " Kumar, Janga Rahul
2024-02-23  8:30   ` Nirmoy Das [this message]

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=11b0271d-bec8-4287-abd4-70e2604e6e9f@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janga.rahul.kumar@intel.com \
    --cc=nirmoy.das@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