Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [i-g-t V3 4/6] tests/kms_addfb_basic: Add XE support
Date: Thu, 6 Apr 2023 15:31:49 +0530	[thread overview]
Message-ID: <1130c8d9-9851-56fd-16a3-3d7064f99380@intel.com> (raw)
In-Reply-To: <20230406074815.463965-5-bhanuprakash.modem@intel.com>


On 4/6/2023 1:18 PM, Bhanuprakash Modem wrote:
> Update/fix necessary subtests for XE driver compatibility.
>
> V2: - Fix invalid-smem-bo-on-discrete subtest (Zbigniew)
> V3: - New patch to re-group the subtests (Karthik)
>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> ---
>   tests/kms_addfb_basic.c | 32 ++++++++++++++++++++++++--------
>   1 file changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
> index 4c498a40937..a66ccfa6bff 100644
> --- a/tests/kms_addfb_basic.c
> +++ b/tests/kms_addfb_basic.c
> @@ -41,6 +41,8 @@
>   #include "igt_rand.h"
>   #include "igt_device.h"
>   #include "i915/intel_memory_region.h"
> +#include "xe/xe_ioctl.h"
> +#include "xe/xe_query.h"
>   
>   static uint32_t gem_bo;
>   static uint32_t gem_bo_small;
> @@ -122,7 +124,7 @@ static void invalid_tests(int fd)
>   
>   	igt_describe("Check if addfb2 call works for clobbered modifier");
>   	igt_subtest("clobberred-modifier") {
> -		igt_require_intel(fd);
> +		igt_require_i915(fd);
>   		igt_require(gem_available_fences(fd) > 0);
>   		f.flags = 0;
>   		f.modifier[0] = 0;
> @@ -140,10 +142,17 @@ static void invalid_tests(int fd)
>   		uint64_t size;
>   
>   		igt_require_intel(fd);
> -		igt_require(gem_has_lmem(fd));
>   		igt_calc_fb_size(fd, f.width, f.height,
>   				DRM_FORMAT_XRGB8888, 0, &size, &stride);
> -		handle = gem_create_in_memory_regions(fd, size, REGION_SMEM);
> +
> +		if (is_i915_device(fd)) {
> +			igt_require(gem_has_lmem(fd));
> +			handle = gem_create_in_memory_regions(fd, size, REGION_SMEM);
> +		} else {
> +			igt_require(xe_has_vram(fd));
> +			handle = xe_bo_create_flags(fd, 0, size, system_memory(fd));
> +		}
> +
>   		f.handles[0] = handle;
>   		do_ioctl_err(fd, DRM_IOCTL_MODE_ADDFB2, &f, EREMOTE);
>   	}
> @@ -324,7 +333,7 @@ static void tiling_tests(int fd)
>   
>   	igt_subtest_group {
>   		igt_fixture {
> -			igt_require_intel(fd);
> +			igt_require_i915(fd);
>   			tiled_x_bo = igt_create_bo_with_dimensions(fd, 1024, 1024,
>   				DRM_FORMAT_XRGB8888, I915_FORMAT_MOD_X_TILED,
>   				1024*4, NULL, NULL, NULL);
> @@ -492,7 +501,7 @@ static void size_tests(int fd)
>   
>   	igt_describe("Test that addfb2 call fails correctly with small buffer object after changing tile");
>   	igt_subtest("bo-too-small-due-to-tiling") {
> -		igt_require_intel(fd);
> +		igt_require_i915(fd);
>   		igt_require(gem_available_fences(fd) > 0);
>   		gem_set_tiling(fd, gem_bo_small, I915_TILING_X, 1024*4);
>   		do_ioctl_err(fd, DRM_IOCTL_MODE_ADDFB2, &f, EINVAL);
> @@ -546,7 +555,7 @@ static void addfb25_tests(int fd)
>   
>   	igt_subtest_group {
>   		igt_fixture {
> -			igt_require_intel(fd);
> +			igt_require_i915(fd);
>   			igt_require(gem_available_fences(fd) > 0);
>   			gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4);
>   			igt_require_fb_modifiers(fd);
> @@ -827,6 +836,9 @@ igt_main
>   	igt_fixture {
>   		fd = drm_open_driver_master(DRIVER_ANY);
>   		igt_require(has_addfb2_iface(fd));
> +
> +		if (is_xe_device(fd))
> +			xe_device_get(fd);
>   	}
>   
>   	invalid_tests(fd);
> @@ -848,7 +860,7 @@ igt_main
>   		size_tests(fd);
>   
>   		igt_fixture
> -			igt_require_intel(fd);
> +			igt_require_i915(fd);
>   
>   		addfb25_ytile(fd);
>   
> @@ -858,6 +870,10 @@ igt_main
>   			igt_display_fini(&display);
>   	}
>   
> -	igt_fixture
> +	igt_fixture {
> +		if (is_xe_device(fd))
> +			xe_device_put(fd);
> +
>   		close(fd);
> +	}
>   }

  reply	other threads:[~2023-04-06 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06  7:48 [igt-dev] [i-g-t V3 0/6] Enable ADDFB tests for XE Bhanuprakash Modem
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 1/6] lib/xe/xe_ioctl: Add a helper to map the buffer Bhanuprakash Modem
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 2/6] lib/igt_fb: Add support for allocating buffers for XE Bhanuprakash Modem
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 3/6] tests/kms_addfb_basic: Code cleanup Bhanuprakash Modem
2023-04-06 10:01   ` Karthik B S
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 4/6] tests/kms_addfb_basic: Add XE support Bhanuprakash Modem
2023-04-06 10:01   ` Karthik B S [this message]
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 5/6] tests/kms_force_connector_basic: Set the param only if driver supports Bhanuprakash Modem
2023-04-06  7:48 ` [igt-dev] [i-g-t V3 6/6] xe-fast-feedback: Add basic kms tests to XE BAT Bhanuprakash Modem
2023-04-06  8:26   ` Karthik B S
2023-04-06  8:36 ` [igt-dev] ✗ Fi.CI.BAT: failure for Enable ADDFB tests for XE (rev4) Patchwork
2023-04-06 10:36 ` [igt-dev] ✓ Fi.CI.BAT: success for Enable ADDFB tests for XE (rev5) Patchwork
2023-04-07  0:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=1130c8d9-9851-56fd-16a3-3d7064f99380@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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