summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/intel_allocator.c4
-rw-r--r--lib/intel_allocator_msgchannel.c2
-rw-r--r--lib/intel_allocator_msgchannel.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
index 7882e484..717d7fc5 100644
--- a/lib/intel_allocator.c
+++ b/lib/intel_allocator.c
@@ -737,6 +737,10 @@ static int handle_request(struct alloc_req *req, struct alloc_resp *resp)
return 0;
}
+ igt_assert_f(channel->ready,
+ "Allocator must be called in multiprocess mode, "
+ "use intel_allocator_multiprocess_(start|stop)()\n");
+
ret = send_req_recv_resp(channel, req, resp);
if (ret < 0)
diff --git a/lib/intel_allocator_msgchannel.c b/lib/intel_allocator_msgchannel.c
index 172858d3..cd0f0a5d 100644
--- a/lib/intel_allocator_msgchannel.c
+++ b/lib/intel_allocator_msgchannel.c
@@ -75,6 +75,7 @@ static void msgqueue_init(struct msg_channel *channel)
msgdata->key = key;
msgdata->queue = queue;
channel->priv = msgdata;
+ channel->ready = true;
}
static void msgqueue_deinit(struct msg_channel *channel)
@@ -84,6 +85,7 @@ static void msgqueue_deinit(struct msg_channel *channel)
igt_debug("Deinit msgqueue\n");
msgctl(msgdata->queue, IPC_RMID, NULL);
free(channel->priv);
+ channel->ready = false;
}
static int msgqueue_send_req(struct msg_channel *channel,
diff --git a/lib/intel_allocator_msgchannel.h b/lib/intel_allocator_msgchannel.h
index ef129c30..cefbf4ce 100644
--- a/lib/intel_allocator_msgchannel.h
+++ b/lib/intel_allocator_msgchannel.h
@@ -140,6 +140,7 @@ struct alloc_resp {
};
struct msg_channel {
+ bool ready;
void *priv;
void (*init)(struct msg_channel *channel);
void (*deinit)(struct msg_channel *channel);