diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-01-10 21:12:38 +0100 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2019-03-11 10:01:41 -0700 |
commit | 65e0e790548d3ef65f26d0fc6b1b370d93c577fb (patch) | |
tree | 0e5978f3414059c7b6b572df94496bb799683339 /src/freedreno/vulkan/tu_device.c | |
parent | 871349965753ae7df897e2db488f22743b1bf1c5 (diff) |
turnip: Add msm queue support.
Diffstat (limited to 'src/freedreno/vulkan/tu_device.c')
-rw-r--r-- | src/freedreno/vulkan/tu_device.c | 17 |
1 files changed, 16 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 |