Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 06/21] lib/intel_allocator: Drop aliasing allocator handle api
Date: Wed, 12 Jul 2023 19:12:16 +0200	[thread overview]
Message-ID: <20230712171231.290555-7-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20230712171231.290555-1-zbigniew.kempczynski@intel.com>

There's no real user of this api, lets drop it.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Karolina Stolarek <karolina.stolarek@intel.com>
--
v3: Remove also ipc message passing for open-as (Karolina)
---
 lib/intel_allocator.c            | 73 --------------------------------
 lib/intel_allocator.h            |  1 -
 lib/intel_allocator_msgchannel.h |  8 +---
 3 files changed, 1 insertion(+), 81 deletions(-)

diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
index 8161221dbf..09f665fbb9 100644
--- a/lib/intel_allocator.c
+++ b/lib/intel_allocator.c
@@ -25,7 +25,6 @@
 static const char *reqtype_str[] = {
 	[REQ_STOP]		= "stop",
 	[REQ_OPEN]		= "open",
-	[REQ_OPEN_AS]		= "open as",
 	[REQ_CLOSE]		= "close",
 	[REQ_ADDRESS_RANGE]	= "address range",
 	[REQ_ALLOC]		= "alloc",
@@ -376,19 +375,6 @@ static struct allocator *allocator_open(int fd, uint32_t ctx, uint32_t vm,
 	return al;
 }
 
-static struct allocator *allocator_open_as(struct allocator *base,
-					   uint32_t new_vm, uint64_t *ahndp)
-{
-	struct allocator *al;
-
-	igt_assert(ahndp);
-	al = __allocator_create(base->fd, base->ctx, new_vm, base->ial);
-	__allocator_get(al);
-	*ahndp = __handle_create(al);
-
-	return al;
-}
-
 static bool allocator_close(uint64_t ahnd)
 {
 	struct allocator *al;
@@ -512,47 +498,6 @@ static int handle_request(struct alloc_req *req, struct alloc_resp *resp)
 				   refcnt - 1, refcnt, ret - 1, ret);
 			break;
 
-		case REQ_OPEN_AS:
-			/* lock first to avoid concurrent close */
-			pthread_mutex_lock(&map_mutex);
-
-			al = __allocator_find_by_handle(req->allocator_handle);
-			resp->response_type = RESP_OPEN_AS;
-
-			if (!al) {
-				alloc_info("<open as> [tid: %ld] ahnd: %" PRIx64
-					   " -> no handle\n",
-					   (long) req->tid, req->allocator_handle);
-				pthread_mutex_unlock(&map_mutex);
-				break;
-			}
-
-			if (!al->vm) {
-				alloc_info("<open as> [tid: %ld] ahnd: %" PRIx64
-					   " -> only open as for <fd, vm> is possible\n",
-					   (long) req->tid, req->allocator_handle);
-				pthread_mutex_unlock(&map_mutex);
-				break;
-			}
-
-
-			al = allocator_open_as(al, req->open_as.new_vm, &ahnd);
-			refcnt = atomic_load(&al->refcount);
-			ret = atomic_load(&al->ial->refcount);
-			pthread_mutex_unlock(&map_mutex);
-
-			resp->response_type = RESP_OPEN_AS;
-			resp->open.allocator_handle = ahnd;
-
-			alloc_info("<open as> [tid: %ld] fd: %d, ahnd: %" PRIx64
-				   ", ctx: %u, vm: %u"
-				   ", alloc_type: %u, al->refcnt: %ld->%ld"
-				   ", refcnt: %d->%d\n",
-				   (long) req->tid, al->fd, ahnd,
-				   al->ctx, al->vm, al->ial->type,
-				   refcnt - 1, refcnt, ret - 1, ret);
-			break;
-
 		case REQ_CLOSE:
 			pthread_mutex_lock(&map_mutex);
 			al = __allocator_find_by_handle(req->allocator_handle);
@@ -1037,24 +982,6 @@ uint64_t intel_allocator_open_vm(int fd, uint32_t vm, uint8_t allocator_type)
 					    ALLOC_STRATEGY_HIGH_TO_LOW, 0);
 }
 
-uint64_t intel_allocator_open_vm_as(uint64_t allocator_handle, uint32_t new_vm)
-{
-	struct alloc_req req = { .request_type = REQ_OPEN_AS,
-				 .allocator_handle = allocator_handle,
-				 .open_as.new_vm = new_vm };
-	struct alloc_resp resp;
-
-	/* Get child_tid only once at open() */
-	if (child_tid == -1)
-		child_tid = gettid();
-
-	igt_assert(handle_request(&req, &resp) == 0);
-	igt_assert(resp.open_as.allocator_handle);
-	igt_assert(resp.response_type == RESP_OPEN_AS);
-
-	return resp.open.allocator_handle;
-}
-
 /**
  * intel_allocator_close:
  * @allocator_handle: handle to the allocator that will be closed
diff --git a/lib/intel_allocator.h b/lib/intel_allocator.h
index a6bf573e9d..3ec74f6191 100644
--- a/lib/intel_allocator.h
+++ b/lib/intel_allocator.h
@@ -182,7 +182,6 @@ uint64_t intel_allocator_open_vm_full(int fd, uint32_t vm,
 				      enum allocator_strategy strategy,
 				      uint64_t default_alignment);
 
-uint64_t intel_allocator_open_vm_as(uint64_t allocator_handle, uint32_t new_vm);
 bool intel_allocator_close(uint64_t allocator_handle);
 void intel_allocator_get_address_range(uint64_t allocator_handle,
 				       uint64_t *startp, uint64_t *endp);
diff --git a/lib/intel_allocator_msgchannel.h b/lib/intel_allocator_msgchannel.h
index cefbf4ce33..ba38530fd1 100644
--- a/lib/intel_allocator_msgchannel.h
+++ b/lib/intel_allocator_msgchannel.h
@@ -13,7 +13,6 @@
 enum reqtype {
 	REQ_STOP,
 	REQ_OPEN,
-	REQ_OPEN_AS,
 	REQ_CLOSE,
 	REQ_ADDRESS_RANGE,
 	REQ_ALLOC,
@@ -27,7 +26,6 @@ enum reqtype {
 
 enum resptype {
 	RESP_OPEN,
-	RESP_OPEN_AS,
 	RESP_CLOSE,
 	RESP_ADDRESS_RANGE,
 	RESP_ALLOC,
@@ -58,10 +56,6 @@ struct alloc_req {
 			uint64_t default_alignment;
 		} open;
 
-		struct {
-			uint32_t new_vm;
-		} open_as;
-
 		struct {
 			uint32_t handle;
 			uint64_t size;
@@ -100,7 +94,7 @@ struct alloc_resp {
 	union {
 		struct {
 			uint64_t allocator_handle;
-		} open, open_as;
+		} open;
 
 		struct {
 			bool is_empty;
-- 
2.34.1

  parent reply	other threads:[~2023-07-12 17:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 17:12 [igt-dev] [PATCH i-g-t v4 00/21] Extend intel_blt to work on Xe Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 01/21] lib/intel_blt: Add blt_ctrl_surf_object() helper Zbigniew Kempczyński
2023-07-13  6:53   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 02/21] tests/gem_ccs: Drop local function for setting ctrl surface object Zbigniew Kempczyński
2023-07-13  6:59   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 03/21] lib/intel_blt: Add dump of two surfaces comparison in 8x8 blocks Zbigniew Kempczyński
2023-07-13  7:08   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 04/21] tests/gem_ccs: Use global image dump comparison function Zbigniew Kempczyński
2023-07-13  7:12   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 05/21] tests/api_intel_allocator: Don't use allocator ahnd aliasing api Zbigniew Kempczyński
2023-07-12 17:12 ` Zbigniew Kempczyński [this message]
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 07/21] lib/intel_allocator: Remove extensive debugging Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 08/21] lib/xe_ioctl: Export non-assert xe_exec function Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 09/21] lib/xe_query: Use vramN when returning string region name Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 10/21] lib/xe_query: Add xe_region_class() helper Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 11/21] lib/drmtest: Add get_intel_driver() helper Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 12/21] lib/xe_util: Return dynamic subtest name for Xe Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 13/21] lib/xe_util: Add vm bind/unbind helper " Zbigniew Kempczyński
2023-07-13  7:15   ` Karolina Stolarek
2023-07-13  7:53     ` Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 14/21] lib/intel_allocator: Add intel_allocator_bind() Zbigniew Kempczyński
2023-07-13  7:17   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 15/21] lib/intel_ctx: Add xe context information Zbigniew Kempczyński
2023-07-13  7:22   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 16/21] lib/intel_blt: Introduce blt_copy_init() helper to cache driver Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 17/21] lib/intel_blt: Extend blitter library to support xe driver Zbigniew Kempczyński
2023-07-13  7:24   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 18/21] tests/xe_ccs: Check if flatccs is working with block-copy for Xe Zbigniew Kempczyński
2023-07-13  7:40   ` Karolina Stolarek
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 19/21] tests/xe_exercise_blt: Check blitter library fast-copy " Zbigniew Kempczyński
2023-07-13  7:43   ` Karolina Stolarek
2023-07-13 10:39     ` Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 20/21] tests/api-intel-allocator: Adopt to exercise allocator to Xe Zbigniew Kempczyński
2023-07-12 17:12 ` [igt-dev] [PATCH i-g-t v4 21/21] tests/gem_ccs: Avoid writing png twice Zbigniew Kempczyński
2023-07-12 19:19 ` [igt-dev] ✓ Fi.CI.BAT: success for Extend intel_blt to work on Xe (rev4) Patchwork
2023-07-12 19:29 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-12 22:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-13  5:51   ` Zbigniew Kempczyński
2023-07-14  5:13     ` Yedireswarapu, SaiX Nandan
2023-07-13  7:30 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-14  5:02 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

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=20230712171231.290555-7-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@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