Mesa (staging/19.3): radv: add some infrastructure for fresh forks for each secure compile

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 27 00:43:35 UTC 2019


Module: Mesa
Branch: staging/19.3
Commit: 093deac71f58eb875fe3f4ffc8cf060573a56163
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=093deac71f58eb875fe3f4ffc8cf060573a56163

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Nov 25 10:00:20 2019 +1100

radv: add some infrastructure for fresh forks for each secure compile

In the following commits we want to be able to fork an existing lightweight
fork created at device creation time. In order for the user facing process
to communicate with this new fresh fork we create some members here to hold
FIFO file descriptors and a unique id.

Here we also add a new fork enum that we use to tell the lightweight
process to create a fresh fork.

For more information on why we create a fresh fork see the following
commits.

(cherry picked from commit ef54f15da9ac11fafcbd6c91a7fcdac734436db8)

---

 src/amd/vulkan/radv_private.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index f5495d8acf8..70f62fe5e21 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -131,6 +131,7 @@ enum radv_secure_compile_type {
 	RADV_SC_TYPE_COMPILE_PIPELINE_FINISHED,
 	RADV_SC_TYPE_READ_DISK_CACHE,
 	RADV_SC_TYPE_WRITE_DISK_CACHE,
+	RADV_SC_TYPE_FORK_DEVICE,
 	RADV_SC_TYPE_DESTROY_DEVICE,
 	RADV_SC_TYPE_COUNT
 };
@@ -736,10 +737,19 @@ struct radv_bo_list {
 };
 
 struct radv_secure_compile_process {
-	/* Secure process file descriptors */
+	/* Secure process file descriptors. Used to communicate between the
+	 * user facing device and the idle forked device used to fork a clean
+	 * process for each new pipeline compile.
+	 */
 	int fd_secure_input;
 	int fd_secure_output;
 
+	/* FIFO file descriptors used to communicate between the user facing
+	 * device and the secure process that does the actual secure compile.
+	 */
+	int fd_server;
+	int fd_client;
+
 	/* Secure compile process id */
 	pid_t sc_pid;
 
@@ -751,6 +761,9 @@ struct radv_secure_compile_state {
 	struct radv_secure_compile_process *secure_compile_processes;
 	uint32_t secure_compile_thread_counter;
 	mtx_t secure_compile_mutex;
+
+	/* Unique process ID used to build name for FIFO file descriptor */
+	char *uid;
 };
 
 struct radv_device {




More information about the mesa-commit mailing list