[RFC PATCH 18/29] drm/xe: Drop EXEC_QUEUE_FLAG_UMD_SUBMISSION flag
Matthew Brost
matthew.brost at intel.com
Mon Nov 18 23:37:46 UTC 2024
Use xe_exec_queue_is_usermap helper instead.
Signed-off-by: Matthew Brost <matthew.brost at 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(-)
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index c8d45133eb59..a22f089ccec6 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -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;
}
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.h b/drivers/gpu/drm/xe/xe_exec_queue.h
index 90c7f73eab88..a4a1dbf5b977 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue.h
@@ -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);
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
index b30b5ee910fa..26ce85b8d163 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
@@ -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
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index c226c7b3245d..59d2e08797f5 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -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)
diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
index 8d5a65724c04..e8675624966d 100644
--- a/drivers/gpu/drm/xe/xe_lrc.c
+++ b/drivers/gpu/drm/xe/xe_lrc.c
@@ -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 ?
--
2.34.1
More information about the dri-devel
mailing list