@@ -486,7 +486,7 @@ static int exec_queue_user_ext_usermap(struct xe_device *xe,
if (XE_IOCTL_DBG(xe, xe_vm_in_lr_mode(q->vm)))
return -EOPNOTSUPP;
- if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_UMD_SUBMISSION))
+ if (XE_IOCTL_DBG(xe, xe_exec_queue_is_usermap(q)))
return -EINVAL;
err = __copy_from_user(&ext, address, sizeof(ext));
@@ -519,7 +519,6 @@ static int exec_queue_user_ext_usermap(struct xe_device *xe,
q->usermap->ring_addr = ext.ring_addr;
xe_pm_runtime_get_noresume(xe);
- q->flags |= EXEC_QUEUE_FLAG_UMD_SUBMISSION;
return 0;
}
@@ -57,6 +57,11 @@ static inline bool xe_exec_queue_is_parallel(struct xe_exec_queue *q)
return q->width > 1;
}
+static inline bool xe_exec_queue_is_usermap(struct xe_exec_queue *q)
+{
+ return !!q->usermap;
+}
+
bool xe_exec_queue_is_lr(struct xe_exec_queue *q);
bool xe_exec_queue_ring_full(struct xe_exec_queue *q);
@@ -93,8 +93,6 @@ struct xe_exec_queue {
#define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD BIT(3)
/* kernel exec_queue only, set priority to highest level */
#define EXEC_QUEUE_FLAG_HIGH_PRIORITY BIT(4)
-/* queue used for UMD submission */
-#define EXEC_QUEUE_FLAG_UMD_SUBMISSION BIT(5)
/**
* @flags: flags for this exec queue, should statically setup aside from ban
@@ -1522,7 +1522,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
xe_sched_stop(sched);
q->guc->db.id = -1;
- if (q->flags & EXEC_QUEUE_FLAG_UMD_SUBMISSION) {
+ if (xe_exec_queue_is_usermap(q)) {
db_id = xe_guc_db_mgr_reserve_id_locked(&guc->dbm);
if (db_id < 0) {
err = db_id;
@@ -1532,7 +1532,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
mutex_unlock(&guc->submission_state.lock);
- if (q->flags & EXEC_QUEUE_FLAG_UMD_SUBMISSION) {
+ if (xe_exec_queue_is_usermap(q)) {
q->guc->db.id = db_id;
err = create_doorbell(guc, q);
if (err)
@@ -18,7 +18,7 @@
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_drm_client.h"
-#include "xe_exec_queue_types.h"
+#include "xe_exec_queue.h"
#include "xe_gt.h"
#include "xe_gt_printk.h"
#include "xe_hw_fence.h"
@@ -912,7 +912,7 @@ static int xe_lrc_init(struct xe_lrc *lrc, struct xe_exec_queue *q,
void *init_data = NULL;
u32 arb_enable;
u32 lrc_size;
- bool user_queue = q && q->flags & EXEC_QUEUE_FLAG_UMD_SUBMISSION;
+ bool user_queue = q && xe_exec_queue_is_usermap(q);;
enum ttm_bo_type submit_type = user_queue ? ttm_bo_type_device :
ttm_bo_type_kernel;
unsigned int submit_flags = user_queue ?
Use xe_exec_queue_is_usermap helper instead. Signed-off-by: Matthew Brost <matthew.brost@intel.com> --- drivers/gpu/drm/xe/xe_exec_queue.c | 3 +-- drivers/gpu/drm/xe/xe_exec_queue.h | 5 +++++ drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 -- drivers/gpu/drm/xe/xe_guc_submit.c | 4 ++-- drivers/gpu/drm/xe/xe_lrc.c | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-)