[igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Sep 27 14:44:52 UTC 2022


Hi Zbigniew,

On 2022-09-27 at 11:17:27 +0200, Zbigniew Kempczyński wrote:
> Function gem_get_batch_size() is confusing as it might return different
> size thus deceiving reader of object real size created in different
> memory regions.
> 
> Let's remove it and enforce igt user to be aware altered by kernel size
> where it is necessary.

Maybe some word reoder here: to be aware that kernel may alter size
where it is necessary.

> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  lib/i915/intel_memory_region.c | 14 --------------
>  lib/i915/intel_memory_region.h |  1 -
>  2 files changed, 15 deletions(-)
> 
> diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
> index 568bace949..d80cb3a061 100644
> --- a/lib/i915/intel_memory_region.c
> +++ b/lib/i915/intel_memory_region.c
> @@ -92,20 +92,6 @@ const char *get_memory_region_name(uint32_t region)
>  	igt_assert_f(false, "Unknown memory region");
>  }
>  
> -/**
> - *  gem_get_batch_size:
> - *  @fd: open i915 drm file descriptor
> - *  @mem_region_type: used memory_region type
> - *
> - *  With introduction of LMEM we observe different page sizes for those two
> - *  memory regions. Without this helper funtion we may be prone to forget
> - *  about setting proper page size.
> - */
> -uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
> -{
> -	return (mem_region_type == I915_MEMORY_CLASS_DEVICE) ? 65536 : 4096;
> -}
> -
>  /**
>   * gem_get_query_memory_regions:
>   * @fd: open i915 drm file descriptor
> diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
> index fd04df83b5..425bda0ec7 100644
> --- a/lib/i915/intel_memory_region.h
> +++ b/lib/i915/intel_memory_region.h
> @@ -56,7 +56,6 @@
>  bool gem_has_query_support(int fd);
>  
>  const char *get_memory_region_name(uint32_t region);
> -uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
>  
>  struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
>  
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list