mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
drm/xe/uapi: Split xe_sync types from flags
Let's continue on the uapi clean-up with more splits with stuff into their own exclusive fields instead of reusing stuff. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
This commit is contained in:
parent
60a6a849fc
commit
37d078e51b
3 changed files with 16 additions and 24 deletions
|
@ -17,8 +17,6 @@
|
||||||
#include "xe_macros.h"
|
#include "xe_macros.h"
|
||||||
#include "xe_sched_job_types.h"
|
#include "xe_sched_job_types.h"
|
||||||
|
|
||||||
#define SYNC_FLAGS_TYPE_MASK 0x3
|
|
||||||
|
|
||||||
struct user_fence {
|
struct user_fence {
|
||||||
struct xe_device *xe;
|
struct xe_device *xe;
|
||||||
struct kref refcount;
|
struct kref refcount;
|
||||||
|
@ -109,15 +107,13 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
|
||||||
if (copy_from_user(&sync_in, sync_user, sizeof(*sync_user)))
|
if (copy_from_user(&sync_in, sync_user, sizeof(*sync_user)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (XE_IOCTL_DBG(xe, sync_in.flags &
|
if (XE_IOCTL_DBG(xe, sync_in.flags & ~DRM_XE_SYNC_FLAG_SIGNAL) ||
|
||||||
~(SYNC_FLAGS_TYPE_MASK | DRM_XE_SYNC_FLAG_SIGNAL)) ||
|
|
||||||
XE_IOCTL_DBG(xe, sync_in.pad) ||
|
|
||||||
XE_IOCTL_DBG(xe, sync_in.reserved[0] || sync_in.reserved[1]))
|
XE_IOCTL_DBG(xe, sync_in.reserved[0] || sync_in.reserved[1]))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
signal = sync_in.flags & DRM_XE_SYNC_FLAG_SIGNAL;
|
signal = sync_in.flags & DRM_XE_SYNC_FLAG_SIGNAL;
|
||||||
switch (sync_in.flags & SYNC_FLAGS_TYPE_MASK) {
|
switch (sync_in.type) {
|
||||||
case DRM_XE_SYNC_FLAG_SYNCOBJ:
|
case DRM_XE_SYNC_TYPE_SYNCOBJ:
|
||||||
if (XE_IOCTL_DBG(xe, in_lr_mode && signal))
|
if (XE_IOCTL_DBG(xe, in_lr_mode && signal))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
@ -135,7 +131,7 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ:
|
case DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ:
|
||||||
if (XE_IOCTL_DBG(xe, in_lr_mode && signal))
|
if (XE_IOCTL_DBG(xe, in_lr_mode && signal))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
@ -165,12 +161,7 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRM_XE_SYNC_FLAG_DMA_BUF:
|
case DRM_XE_SYNC_TYPE_USER_FENCE:
|
||||||
if (XE_IOCTL_DBG(xe, "TODO"))
|
|
||||||
return -EINVAL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DRM_XE_SYNC_FLAG_USER_FENCE:
|
|
||||||
if (XE_IOCTL_DBG(xe, !signal))
|
if (XE_IOCTL_DBG(xe, !signal))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
@ -192,6 +183,7 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync->type = sync_in.type;
|
||||||
sync->flags = sync_in.flags;
|
sync->flags = sync_in.flags;
|
||||||
sync->timeline_value = sync_in.timeline_value;
|
sync->timeline_value = sync_in.timeline_value;
|
||||||
|
|
||||||
|
@ -252,8 +244,7 @@ void xe_sync_entry_signal(struct xe_sync_entry *sync, struct xe_sched_job *job,
|
||||||
user_fence_put(sync->ufence);
|
user_fence_put(sync->ufence);
|
||||||
dma_fence_put(fence);
|
dma_fence_put(fence);
|
||||||
}
|
}
|
||||||
} else if ((sync->flags & SYNC_FLAGS_TYPE_MASK) ==
|
} else if (sync->type == DRM_XE_SYNC_TYPE_USER_FENCE) {
|
||||||
DRM_XE_SYNC_FLAG_USER_FENCE) {
|
|
||||||
job->user_fence.used = true;
|
job->user_fence.used = true;
|
||||||
job->user_fence.addr = sync->addr;
|
job->user_fence.addr = sync->addr;
|
||||||
job->user_fence.value = sync->timeline_value;
|
job->user_fence.value = sync->timeline_value;
|
||||||
|
|
|
@ -21,6 +21,7 @@ struct xe_sync_entry {
|
||||||
struct user_fence *ufence;
|
struct user_fence *ufence;
|
||||||
u64 addr;
|
u64 addr;
|
||||||
u64 timeline_value;
|
u64 timeline_value;
|
||||||
|
u32 type;
|
||||||
u32 flags;
|
u32 flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -947,15 +947,15 @@ struct drm_xe_sync {
|
||||||
/** @extensions: Pointer to the first extension struct, if any */
|
/** @extensions: Pointer to the first extension struct, if any */
|
||||||
__u64 extensions;
|
__u64 extensions;
|
||||||
|
|
||||||
#define DRM_XE_SYNC_FLAG_SYNCOBJ 0x0
|
#define DRM_XE_SYNC_TYPE_SYNCOBJ 0x0
|
||||||
#define DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ 0x1
|
#define DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ 0x1
|
||||||
#define DRM_XE_SYNC_FLAG_DMA_BUF 0x2
|
#define DRM_XE_SYNC_TYPE_USER_FENCE 0x2
|
||||||
#define DRM_XE_SYNC_FLAG_USER_FENCE 0x3
|
/** @type: Type of the this sync object */
|
||||||
#define DRM_XE_SYNC_FLAG_SIGNAL 0x10
|
__u32 type;
|
||||||
__u32 flags;
|
|
||||||
|
|
||||||
/** @pad: MBZ */
|
#define DRM_XE_SYNC_FLAG_SIGNAL (1 << 0)
|
||||||
__u32 pad;
|
/** @flags: Sync Flags */
|
||||||
|
__u32 flags;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
__u32 handle;
|
__u32 handle;
|
||||||
|
|
Loading…
Add table
Reference in a new issue