anv/xe: de-duplicate xe_exec_fill_sync()

I had accidentally hardcoded an alternative implementation in
xe_vm_bind_op().

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28792>
This commit is contained in:
Paulo Zanoni 2024-03-27 16:56:02 -07:00 committed by Marge Bot
parent 5346442e74
commit 1c9b13119e
3 changed files with 14 additions and 25 deletions

View File

@ -87,7 +87,7 @@ exec_error:
#define TYPE_SIGNAL true
#define TYPE_WAIT false
static void
void
xe_exec_fill_sync(struct drm_xe_sync *xe_sync, struct vk_sync *vk_sync,
uint64_t value, bool signal)
{

View File

@ -25,6 +25,7 @@
#include <stdint.h>
#include "drm-uapi/xe_drm.h"
#include "vulkan/vulkan_core.h"
#include "vk_sync.h"
@ -59,3 +60,7 @@ xe_queue_exec_locked(struct anv_queue *queue,
VkResult
xe_queue_exec_utrace_locked(struct anv_queue *queue,
struct anv_utrace_submit *utrace_submit);
void
xe_exec_fill_sync(struct drm_xe_sync *xe_sync, struct vk_sync *vk_sync,
uint64_t value, bool signal);

View File

@ -185,32 +185,16 @@ xe_vm_bind_op(struct anv_device *device,
int sync_idx = 0;
for (int s = 0; s < submit->wait_count; s++) {
const struct vk_drm_syncobj *syncobj =
vk_sync_as_drm_syncobj(submit->waits[s].sync);
assert(syncobj);
uint64_t val = submit->waits[s].wait_value;
xe_syncs[sync_idx++] = (struct drm_xe_sync) {
.type = val ? DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ :
DRM_XE_SYNC_TYPE_SYNCOBJ,
.flags = 0,
.handle = syncobj->syncobj,
.timeline_value = val,
};
xe_exec_fill_sync(&xe_syncs[sync_idx++],
submit->waits[s].sync,
submit->waits[s].wait_value,
false);
}
for (int s = 0; s < submit->signal_count; s++) {
const struct vk_drm_syncobj *syncobj =
vk_sync_as_drm_syncobj(submit->signals[s].sync);
assert(syncobj);
uint64_t val = submit->signals[s].signal_value;
xe_syncs[sync_idx++] = (struct drm_xe_sync) {
.type = val ? DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ :
DRM_XE_SYNC_TYPE_SYNCOBJ,
.flags = DRM_XE_SYNC_FLAG_SIGNAL,
.handle = syncobj->syncobj,
.timeline_value = val,
};
xe_exec_fill_sync(&xe_syncs[sync_idx++],
submit->signals[s].sync,
submit->signals[s].signal_value,
true);
}
if (signal_bind_timeline) {
xe_syncs[sync_idx++] = (struct drm_xe_sync) {