mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 06:00:10 +01:00
anv: Move execute_simple_batch() and queue_exec_locked() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
This commit is contained in:
parent
0c8d8ae13c
commit
f331bab884
6 changed files with 76 additions and 32 deletions
|
|
@ -37,8 +37,6 @@
|
|||
|
||||
#include "util/perf/u_trace.h"
|
||||
|
||||
#include "i915/anv_batch_chain.h"
|
||||
|
||||
/** \file anv_batch_chain.c
|
||||
*
|
||||
* This file contains functions related to anv_cmd_buffer as a data
|
||||
|
|
@ -1214,7 +1212,7 @@ anv_cmd_buffer_exec_batch_debug(struct anv_queue *queue,
|
|||
* pool resize only rarely happen, this will almost never be contended so
|
||||
* taking a lock isn't really an expensive operation in this case.
|
||||
*/
|
||||
static VkResult
|
||||
static inline VkResult
|
||||
anv_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
|
|
@ -1225,10 +1223,12 @@ anv_queue_exec_locked(struct anv_queue *queue,
|
|||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass)
|
||||
{
|
||||
return anv_i915_queue_exec_locked(queue, wait_count, waits,
|
||||
cmd_buffer_count, cmd_buffers,
|
||||
signal_count, signals,
|
||||
perf_query_pool, perf_query_pass);
|
||||
struct anv_device *device = queue->device;
|
||||
return device->kmd_backend->queue_exec_locked(queue, wait_count, waits,
|
||||
cmd_buffer_count,
|
||||
cmd_buffers, signal_count,
|
||||
signals, perf_query_pool,
|
||||
perf_query_pass);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
|
@ -1389,7 +1389,8 @@ anv_queue_submit_simple_batch(struct anv_queue *queue,
|
|||
batch_bo->offset, false);
|
||||
}
|
||||
|
||||
result = anv_i915_execute_simple_batch(queue, batch_bo, batch_size);
|
||||
result = device->kmd_backend->execute_simple_batch(queue, batch_bo,
|
||||
batch_size);
|
||||
|
||||
anv_bo_pool_free(&device->batch_bo_pool, batch_bo);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,28 @@ stub_gem_mmap(struct anv_device *device, struct anv_bo *bo, uint64_t offset,
|
|||
offset);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
stub_execute_simple_batch(struct anv_queue *queue,
|
||||
struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size)
|
||||
{
|
||||
return VK_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
stub_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass)
|
||||
{
|
||||
return VK_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
void *
|
||||
anv_gem_mmap(struct anv_device *device, struct anv_bo *bo, uint64_t offset,
|
||||
uint64_t size, VkMemoryPropertyFlags property_flags)
|
||||
|
|
@ -134,6 +156,8 @@ const struct anv_kmd_backend *anv_stub_kmd_backend_get(void)
|
|||
.gem_create = stub_gem_create,
|
||||
.gem_close = stub_gem_close,
|
||||
.gem_mmap = stub_gem_mmap,
|
||||
.execute_simple_batch = stub_execute_simple_batch,
|
||||
.queue_exec_locked = stub_queue_exec_locked,
|
||||
};
|
||||
return &stub_backend;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,17 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "vulkan/vulkan_core.h"
|
||||
#include "vk_sync.h"
|
||||
|
||||
#include "dev/intel_device_info.h"
|
||||
#include "dev/intel_kmd.h"
|
||||
|
||||
struct anv_bo;
|
||||
enum anv_bo_alloc_flags;
|
||||
struct anv_cmd_buffer;
|
||||
struct anv_device;
|
||||
struct anv_queue;
|
||||
struct anv_query_pool;
|
||||
|
||||
struct anv_kmd_backend {
|
||||
/*
|
||||
|
|
@ -48,6 +52,18 @@ struct anv_kmd_backend {
|
|||
void *(*gem_mmap)(struct anv_device *device, struct anv_bo *bo,
|
||||
uint64_t offset, uint64_t size,
|
||||
VkMemoryPropertyFlags property_flags);
|
||||
VkResult (*execute_simple_batch)(struct anv_queue *queue,
|
||||
struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size);
|
||||
VkResult (*queue_exec_locked)(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass);
|
||||
};
|
||||
|
||||
const struct anv_kmd_backend *anv_kmd_backend_get(enum intel_kmd_type type);
|
||||
|
|
|
|||
|
|
@ -551,15 +551,15 @@ anv_queue_exec_utrace_locked(struct anv_queue *queue,
|
|||
}
|
||||
|
||||
VkResult
|
||||
anv_i915_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass)
|
||||
i915_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass)
|
||||
{
|
||||
struct anv_device *device = queue->device;
|
||||
struct anv_utrace_flush_copy *utrace_flush_data = NULL;
|
||||
|
|
@ -739,9 +739,8 @@ anv_i915_queue_exec_locked(struct anv_queue *queue,
|
|||
}
|
||||
|
||||
VkResult
|
||||
anv_i915_execute_simple_batch(struct anv_queue *queue,
|
||||
struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size)
|
||||
i915_execute_simple_batch(struct anv_queue *queue, struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size)
|
||||
{
|
||||
struct anv_device *device = queue->device;
|
||||
struct anv_execbuf execbuf = {
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@ struct anv_bo;
|
|||
struct anv_cmd_buffer;
|
||||
struct anv_query_pool;
|
||||
|
||||
VkResult anv_i915_execute_simple_batch(struct anv_queue *queue,
|
||||
struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size);
|
||||
VkResult
|
||||
anv_i915_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass);
|
||||
i915_execute_simple_batch(struct anv_queue *queue, struct anv_bo *batch_bo,
|
||||
uint32_t batch_bo_size);
|
||||
VkResult
|
||||
i915_queue_exec_locked(struct anv_queue *queue,
|
||||
uint32_t wait_count,
|
||||
const struct vk_sync_wait *waits,
|
||||
uint32_t cmd_buffer_count,
|
||||
struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t signal_count,
|
||||
const struct vk_sync_signal *signals,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
#include "anv_private.h"
|
||||
|
||||
#include "i915/anv_batch_chain.h"
|
||||
|
||||
#include "drm-uapi/i915_drm.h"
|
||||
|
||||
static uint32_t
|
||||
|
|
@ -154,6 +156,8 @@ anv_i915_kmd_backend_get(void)
|
|||
.gem_create = i915_gem_create,
|
||||
.gem_close = i915_gem_close,
|
||||
.gem_mmap = i915_gem_mmap,
|
||||
.execute_simple_batch = i915_execute_simple_batch,
|
||||
.queue_exec_locked = i915_queue_exec_locked
|
||||
};
|
||||
return &i915_backend;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue