[igt-dev] [PATCH v1 6/7] drm-uapi/xe: Remove unused QUERY_CONFIG_GT_COUNT
Rodrigo Vivi
rodrigo.vivi at intel.com
Mon Nov 13 20:39:26 UTC 2023
On Fri, Nov 10, 2023 at 03:52:10PM +0000, Francois Dugast wrote:
> Align with commit ("drm/xe/uapi: Remove unused QUERY_CONFIG_GT_COUNT")
>
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> include/drm-uapi/xe_drm.h | 3 +--
> lib/xe/xe_query.c | 11 +++++------
> lib/xe/xe_query.h | 3 ---
> tests/intel/xe_debugfs.c | 2 --
> tests/intel/xe_query.c | 2 --
> 5 files changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/include/drm-uapi/xe_drm.h b/include/drm-uapi/xe_drm.h
> index db883fb6b..0f4c83e4c 100644
> --- a/include/drm-uapi/xe_drm.h
> +++ b/include/drm-uapi/xe_drm.h
> @@ -325,8 +325,7 @@ struct drm_xe_query_config {
> #define XE_QUERY_CONFIG_FLAGS_HAS_VRAM (0x1 << 0)
> #define XE_QUERY_CONFIG_MIN_ALIGNMENT 2
> #define XE_QUERY_CONFIG_VA_BITS 3
> -#define XE_QUERY_CONFIG_GT_COUNT 4
> -#define XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 5
> +#define XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
> /** @info: array of elements containing the config info */
> __u64 info[];
> };
> diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
> index 986a3a0c1..06d216cf9 100644
> --- a/lib/xe/xe_query.c
> +++ b/lib/xe/xe_query.c
> @@ -249,16 +249,15 @@ struct xe_device *xe_device_get(int fd)
>
> xe_dev->fd = fd;
> xe_dev->config = xe_query_config_new(fd);
> - xe_dev->number_gt = xe_dev->config->info[XE_QUERY_CONFIG_GT_COUNT];
> xe_dev->va_bits = xe_dev->config->info[XE_QUERY_CONFIG_VA_BITS];
> xe_dev->dev_id = xe_dev->config->info[XE_QUERY_CONFIG_REV_AND_DEVICE_ID] & 0xffff;
> xe_dev->gt_list = xe_query_gt_list_new(fd);
> xe_dev->memory_regions = __memory_regions(xe_dev->gt_list);
> xe_dev->hw_engines = xe_query_engines_new(fd, &xe_dev->number_hw_engines);
> xe_dev->mem_usage = xe_query_mem_usage_new(fd);
> - xe_dev->vram_size = calloc(xe_dev->number_gt, sizeof(*xe_dev->vram_size));
> - xe_dev->visible_vram_size = calloc(xe_dev->number_gt, sizeof(*xe_dev->visible_vram_size));
> - for (int gt = 0; gt < xe_dev->number_gt; gt++) {
> + xe_dev->vram_size = calloc(xe_dev->gt_list->num_gt, sizeof(*xe_dev->vram_size));
> + xe_dev->visible_vram_size = calloc(xe_dev->gt_list->num_gt, sizeof(*xe_dev->visible_vram_size));
> + for (int gt = 0; gt < xe_dev->gt_list->num_gt; gt++) {
> xe_dev->vram_size[gt] = gt_vram_size(xe_dev->mem_usage,
> xe_dev->gt_list, gt);
> xe_dev->visible_vram_size[gt] =
> @@ -358,7 +357,7 @@ _TYPE _NAME(int fd) \
> *
> * Return number of gt_list for xe device fd.
> */
> -xe_dev_FN(xe_number_gt, number_gt, unsigned int);
> +xe_dev_FN(xe_number_gt, gt_list->num_gt, unsigned int);
>
> /**
> * all_memory_regions:
> @@ -394,7 +393,7 @@ uint64_t vram_memory(int fd, int gt)
>
> xe_dev = find_in_cache(fd);
> igt_assert(xe_dev);
> - igt_assert(gt >= 0 && gt < xe_dev->number_gt);
> + igt_assert(gt >= 0 && gt < xe_dev->gt_list->num_gt);
>
> return xe_has_vram(fd) ? native_region_for_gt(xe_dev->gt_list, gt) : 0;
> }
> diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h
> index 7c0849bc1..fc81cc263 100644
> --- a/lib/xe/xe_query.h
> +++ b/lib/xe/xe_query.h
> @@ -27,9 +27,6 @@ struct xe_device {
> /** @gt_list: gt info */
> struct drm_xe_query_gt_list *gt_list;
>
> - /** @number_gt: number of gt */
> - unsigned int number_gt;
> -
> /** @gt_list: bitmask of all memory regions */
> uint64_t memory_regions;
>
> diff --git a/tests/intel/xe_debugfs.c b/tests/intel/xe_debugfs.c
> index e5bbb364c..4104bf5ae 100644
> --- a/tests/intel/xe_debugfs.c
> +++ b/tests/intel/xe_debugfs.c
> @@ -121,8 +121,6 @@ test_base(int fd, struct drm_xe_query_config *config)
> igt_assert(igt_debugfs_search(fd, "info", reference));
>
> igt_assert(igt_debugfs_exists(fd, "gt0", O_RDONLY));
> - if (config->info[XE_QUERY_CONFIG_GT_COUNT] > 1)
> - igt_assert(igt_debugfs_exists(fd, "gt1", O_RDONLY));
>
> igt_assert(igt_debugfs_exists(fd, "gtt_mm", O_RDONLY));
> igt_debugfs_dump(fd, "gtt_mm");
> diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
> index 66a714518..cf966d40d 100644
> --- a/tests/intel/xe_query.c
> +++ b/tests/intel/xe_query.c
> @@ -374,8 +374,6 @@ test_query_config(int fd)
> config->info[XE_QUERY_CONFIG_MIN_ALIGNMENT]);
> igt_info("XE_QUERY_CONFIG_VA_BITS\t\t\t%llu\n",
> config->info[XE_QUERY_CONFIG_VA_BITS]);
> - igt_info("XE_QUERY_CONFIG_GT_COUNT\t\t%llu\n",
> - config->info[XE_QUERY_CONFIG_GT_COUNT]);
> igt_info("XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY\t%llu\n",
> config->info[XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY]);
> dump_hex_debug(config, query.size);
> --
> 2.34.1
>
More information about the igt-dev
mailing list