summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2019-01-10 21:12:38 +0100
committerChia-I Wu <[email protected]>2019-03-11 10:01:41 -0700
commit65e0e790548d3ef65f26d0fc6b1b370d93c577fb (patch)
tree0e5978f3414059c7b6b572df94496bb799683339
parent871349965753ae7df897e2db488f22743b1bf1c5 (diff)
turnip: Add msm queue support.
-rw-r--r--src/freedreno/vulkan/tu_device.c17
-rw-r--r--src/freedreno/vulkan/tu_private.h2
2 files changed, 18 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index f7dcaf0c318..ec3fa4ceff6 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -949,7 +949,7 @@ tu_GetPhysicalDeviceMemoryProperties2(
physicalDevice, &pMemoryProperties->memoryProperties);
}
-static int
+static VkResult
tu_queue_init(struct tu_device *device,
struct tu_queue *queue,
uint32_t queue_family_index,
@@ -962,12 +962,27 @@ tu_queue_init(struct tu_device *device,
queue->queue_idx = idx;
queue->flags = flags;
+ struct drm_msm_submitqueue req = {
+ .flags = 0,
+ .prio = 0,
+ };
+
+ int ret = drmCommandWriteRead(device->physical_device->local_fd,
+ DRM_MSM_SUBMITQUEUE_NEW,
+ &req, sizeof(req));
+ if (ret)
+ return VK_ERROR_INITIALIZATION_FAILED;
+
+ queue->msm_queue_id = req.id;
return VK_SUCCESS;
}
static void
tu_queue_finish(struct tu_queue *queue)
{
+ drmCommandWrite(queue->device->physical_device->local_fd,
+ DRM_MSM_SUBMITQUEUE_CLOSE,
+ &queue->msm_queue_id, sizeof(uint32_t));
}
static int
diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h
index 2a09d5b14a0..a6310189cdb 100644
--- a/src/freedreno/vulkan/tu_private.h
+++ b/src/freedreno/vulkan/tu_private.h
@@ -401,6 +401,8 @@ struct tu_queue
uint32_t queue_family_index;
int queue_idx;
VkDeviceQueueCreateFlags flags;
+
+ uint32_t msm_queue_id;
};
struct tu_device