All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: igt-dev@lists.freedesktop.org, Upadhyay <tejas.upadhyay@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v7 4/4] tests/xe/xe_sysfs_tile_prop: adds new test to verify per tile vram addr_range
Date: Thu, 06 Jul 2023 18:10:47 -0700	[thread overview]
Message-ID: <87bkgocyqw.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230706104500.595707-5-himal.prasad.ghimiray@intel.com>

On Thu, 06 Jul 2023 03:45:00 -0700, Himal Prasad Ghimiray wrote:
>
> diff --git a/tests/xe/xe_sysfs_tile_prop.c b/tests/xe/xe_sysfs_tile_prop.c

Let's call this either xe_sysfs_tile_properties.c or xe_sysfs_tile.c

> +static void test_vram_physical_vram_size_bytes(int sysfs, int tile_num, u64 vram_size)

Pass tilefd into this function, see below, so

static void test_vram_physical_vram_size_bytes(int tilefd, u64 vram_size)

> +{
> +	u64 physical_vram_size_bytes;
> +	char path[40];
> +
> +	igt_assert(snprintf(path, sizeof(path), "device/tile%d/physical_vram_size_bytes",
> +			    tile_num) < sizeof(path));

No need for all this.

> +	igt_assert(igt_sysfs_scanf(sysfs, path, "%lx", &physical_vram_size_bytes) > 0);

This just becomes

	igt_assert(igt_sysfs_scanf(tilefd, "physical_vram_size_bytes", "%lx", &physical_vram_size_bytes) > 0);

> +	igt_assert_lt_u64(vram_size, physical_vram_size_bytes);
> +}
> +
> +igt_main
> +{
> +	int fd, tmp;

s/tmp/tilefd/

> +	int tile;
> +	static int sysfs = -1;
> +	u64 vram_size;
> +
> +	igt_fixture {
> +		fd = drm_open_driver(DRIVER_XE);
> +		xe_device_get(fd);
> +
> +		sysfs = igt_sysfs_open(fd);

No need to do this, we already have tilefd in xe_for_each_tile, we can pass
that into test_vram_physical_vram_size_bytes.

> +		igt_assert(sysfs != -1);
> +	}
> +
> +	igt_subtest("physical_vram_size_bytes") {
> +		igt_require(xe_has_vram(fd));
> +		xe_for_each_tile(fd, tmp, tile) {
> +			vram_size = xe_vram_size(fd, tile);
> +			test_vram_physical_vram_size_bytes(sysfs, tile, vram_size);
> +		}
> +	}
> +
> +	igt_fixture {
> +		close(sysfs);
> +		xe_device_put(fd);
> +		close(fd);
> +	}
> +}
> --
> 2.25.1
>

  reply	other threads:[~2023-07-07  1:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 10:44 [igt-dev] [PATCH i-g-t v7 0/4] Handle GT and tile seperation in IGT Himal Prasad Ghimiray
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 1/4] lib/igt_sysfs: Add support to query number of tiles Himal Prasad Ghimiray
2023-07-06 23:46   ` Dixit, Ashutosh
2023-07-07  3:57     ` Ghimiray, Himal Prasad
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes Himal Prasad Ghimiray
2023-07-07  0:56   ` Dixit, Ashutosh
2023-07-07  4:29     ` Ghimiray, Himal Prasad
2023-07-07  5:02     ` Ghimiray, Himal Prasad
2023-07-06 10:44 ` [igt-dev] [PATCH i-g-t v7 3/4] tests/xe/xe_guc_pc: Change the sysfs paths Himal Prasad Ghimiray
2023-07-07  1:01   ` Dixit, Ashutosh
2023-07-07  5:03     ` Ghimiray, Himal Prasad
2023-07-06 10:45 ` [igt-dev] [PATCH i-g-t v7 4/4] tests/xe/xe_sysfs_tile_prop: adds new test to verify per tile vram addr_range Himal Prasad Ghimiray
2023-07-07  1:10   ` Dixit, Ashutosh [this message]
2023-07-07  5:04     ` Ghimiray, Himal Prasad
2023-07-06 13:03 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle GT and tile seperation in IGT (rev6) Patchwork
2023-07-06 13:12 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-06 17:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=87bkgocyqw.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tejas.upadhyay@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.