[igt-dev] [PATCH i-g-t 4/5] tests/xe/query: extend for CPU visible accounting

Gwan-gyeong Mun gwan-gyeong.mun at intel.com
Mon Apr 17 05:54:16 UTC 2023



On 3/29/23 2:56 PM, Matthew Auld wrote:
> Print the visible size and how much is used. Also sanity check the
> values.
> 
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
> ---
>   tests/xe/xe_query.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/tests/xe/xe_query.c b/tests/xe/xe_query.c
> index 3f038225..9367d65e 100644
> --- a/tests/xe/xe_query.c
> +++ b/tests/xe/xe_query.c
> @@ -228,6 +228,21 @@ test_query_mem_usage(int fd)
>   		igt_info("min_page_size=0x%x, max_page_size=0x%x\n",
>   		       mem_usage->regions[i].min_page_size,
>   		       mem_usage->regions[i].max_page_size);
> +
> +		igt_info("visible size=%lluMiB\n",
> +			 mem_usage->regions[i].cpu_visible_size >> 20);
> +		igt_info("visible used=%lluMiB\n",
> +			 mem_usage->regions[i].cpu_visible_used >> 20);
> +
> +		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_size,
> +				   mem_usage->regions[i].total_size);
> +		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_used,
> +				   mem_usage->regions[i].cpu_visible_size);
> +		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_used,
> +				   mem_usage->regions[i].used);
> +		igt_assert_lte_u64(mem_usage->regions[i].used -
> +				   mem_usage->regions[i].cpu_visible_used,
> +				   mem_usage->regions[i].total_size);
Although not exactly the cpu visible sanity check that the title of this 
commit refers to, but there is no sanity check between used and total_size.
If it's not a semantic duplicate check, could you add this sanity check 
as well?

Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>

>   	}
>   	dump_hex_debug(mem_usage, query.size);
>   	free(mem_usage);


More information about the igt-dev mailing list