[igt-dev] [PATCH 1/2] lib/intel_memory_region: Remove function which returns batch size in regions
Nidhi Gupta
nidhi1.gupta at intel.com
Fri Sep 30 05:41:58 UTC 2022
From: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
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 that kernel may alter
size where it is necessary.
v2: reword commit message (Kamil)
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 568bace9..d80cb3a0 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 fd04df83..425bda0e 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.36.0
More information about the igt-dev
mailing list