Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH 1/2] lib/intel_memory_region: Remove function which returns batch size in regions
Date: Fri, 30 Sep 2022 11:02:28 +0530	[thread overview]
Message-ID: <20220930053229.9755-2-jeevan.b@intel.com> (raw)
In-Reply-To: <20220930053229.9755-1-jeevan.b@intel.com>

From: Zbigniew Kempczyński <zbigniew.kempczynski@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@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@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

  reply	other threads:[~2022-09-30  5:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  5:32 [igt-dev] [PATCH 0/2] tests/kms_writeback: Test cleanup Jeevan B
2022-09-30  5:32 ` Jeevan B [this message]
2022-09-30  5:32 ` [igt-dev] [PATCH 2/2] " Jeevan B
  -- strict thread matches above, loose matches on Subject: below --
2022-09-30  5:41 [igt-dev] [PATCH 0/2] " Nidhi Gupta
2022-09-30  5:41 ` [igt-dev] [PATCH 1/2] lib/intel_memory_region: Remove function which returns batch size in regions Nidhi Gupta

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=20220930053229.9755-2-jeevan.b@intel.com \
    --to=jeevan.b@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox