Skip to contentSkip to conversation

Revert "drm/amdgpu/userq: implement support for query status"

PATCH In review Prike Liang 2 participants 3 messages Dec 10, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "drm/amdgpu/userq: implement support for query status"

This reverts commit 4784bc14c0977d1c23c182c60c172f72025880ba.

Hold this patch untill the mesa implements the AMDGPU_USERQ_OP_QUERY_STATUS.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 37 +----------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h |  1 -
 include/uapi/drm/amdgpu_drm.h             |  2 --
 3 files changed, 1 insertion(+), 39 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -36
index bff39dcb4068..2f97f35e0af5 100644
@@ -719,7 +719,6 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	queue->queue_type = args->in.ip_type;
 	queue->vm = &fpriv->vm;
 	queue->priority = priority;
-	queue->generation = amdgpu_vm_generation(adev, &fpriv->vm);
 
 	db_info.queue_type = queue->queue_type;
 	db_info.doorbell_handle = queue->doorbell_handle;
@@ -822,36 +821,6 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	return r;
 }
 
-static int
-amdgpu_userq_query_status(struct drm_file *filp, union drm_amdgpu_userq *args)
-{
-	struct amdgpu_fpriv *fpriv = filp->driver_priv;
-	struct amdgpu_userq_mgr *uq_mgr = &fpriv->userq_mgr;
-	struct amdgpu_device *adev = uq_mgr->adev;
-	struct amdgpu_usermode_queue *queue;
-	int queue_id = args->in.queue_id;
-
-	mutex_lock(&uq_mgr->userq_mutex);
-
-	queue = amdgpu_userq_find(uq_mgr, queue_id);
-	if (!queue) {
-		dev_dbg(adev->dev, "Invalid queue id to query\n");
-		mutex_unlock(&uq_mgr->userq_mutex);
-		return -EINVAL;
-	}
-	args->out_qs.flags = 0;
-	if (queue->state == AMDGPU_USERQ_STATE_HUNG)
-		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_HUNG;
-	if (queue->generation != amdgpu_vm_generation(adev, &fpriv->vm))
-		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_VRAMLOST;
-
-	if (queue->state == AMDGPU_USERQ_STATE_INVALID_VA)
-		args->out_qs.flags |= AMDGPU_USERQ_QUERY_STATUS_FLAGS_INVALID_VA;
-	mutex_unlock(&uq_mgr->userq_mutex);
-
-	return 0;
-}
-
 static int amdgpu_userq_input_args_validate(struct drm_device *dev,
 					union drm_amdgpu_userq *args,
 					struct drm_file *filp)
@@ -932,11 +901,7 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
 		if (r)
 			drm_file_err(filp, "Failed to destroy usermode queue\n");
 		break;
-	case AMDGPU_USERQ_OP_QUERY_STATUS:
-		r = amdgpu_userq_query_status(filp, args);
-		if (r)
-			drm_file_err(filp, "Failed to query usermode queue status\n");
-		break;
+
 	default:
 		drm_dbg_driver(dev, "Invalid user queue op specified: %d\n", args->in.op);
 		return -EINVAL;
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h +0 -1
index 670d282ae158..1eaa94f8a291 100644
@@ -74,7 +74,6 @@ struct amdgpu_usermode_queue {
 	struct dentry		*debugfs_queue;
 
 	struct list_head	userq_va_list;
-	u64		generation;
 };
 
 struct amdgpu_userq_funcs {
include/uapi/drm/amdgpu_drm.h +0 -2
index 1284f026158b..986672e7378c 100644
@@ -352,8 +352,6 @@ union drm_amdgpu_ctx {
 #define AMDGPU_USERQ_QUERY_STATUS_FLAGS_HUNG    (1 << 0)
 /* indicate vram lost since queue was created */
 #define AMDGPU_USERQ_QUERY_STATUS_FLAGS_VRAMLOST (1 << 1)
-/* the invalid userq VA unmapped */
-#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_INVALID_VA (1 << 2)
 
 /*
  * This structure is a container to pass input configuration
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 Revert "drm/amdgpu: add UAPI for user queue query status"

This reverts commit cd4fcfed0dd7fb8d1eb2ec937ae1644534a307bd.

Hold this patch untill the mesa implements the AMDGPU_USERQ_OP_QUERY_STATUS.

---
 include/uapi/drm/amdgpu_drm.h | 14 --------------
 1 file changed, 14 deletions(-)
include/uapi/drm/amdgpu_drm.h +0 -14
index 986672e7378c..c1336ed4ff75 100644
@@ -334,7 +334,6 @@ union drm_amdgpu_ctx {
 /* user queue IOCTL operations */
 #define AMDGPU_USERQ_OP_CREATE	1
 #define AMDGPU_USERQ_OP_FREE	2
-#define AMDGPU_USERQ_OP_QUERY_STATUS	3
 
 /* queue priority levels */
 /* low < normal low < normal high < high */
@@ -347,12 +346,6 @@ union drm_amdgpu_ctx {
 /* for queues that need access to protected content */
 #define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE  (1 << 2)
 
-
-/* the queue is hung */
-#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_HUNG    (1 << 0)
-/* indicate vram lost since queue was created */
-#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_VRAMLOST (1 << 1)
-
 /*
  * This structure is a container to pass input configuration
  * info for all supported userqueue related operations.
@@ -434,16 +427,9 @@ struct drm_amdgpu_userq_out {
 	__u32 _pad;
 };
 
-/* The structure to carry output of userqueue ops */
-struct drm_amdgpu_userq_out_query_state {
-	__u32 flags;
-	__u32 _pad;
-};
-
 union drm_amdgpu_userq {
 	struct drm_amdgpu_userq_in in;
 	struct drm_amdgpu_userq_out out;
-	struct drm_amdgpu_userq_out_query_state out_qs;
 };
 
 /* GFX V11 IP specific MQD parameters */
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 2/2] Revert "drm/amdgpu: add UAPI for user queue query status"

Series is: Reviewed-by: Alex Deucher <[email protected]>

Quoted 55 lines · Prike Liang

This reverts commit cd4fcfed0dd7fb8d1eb2ec937ae1644534a307bd.

Hold this patch untill the mesa implements the AMDGPU_USERQ_OP_QUERY_STATUS.

---
 include/uapi/drm/amdgpu_drm.h | 14 --------------
 1 file changed, 14 deletions(-)
include/uapi/drm/amdgpu_drm.h +0 -15
index 986672e7378c..c1336ed4ff75 100644
@@ -334,7 +334,6 @@ union drm_amdgpu_ctx {
 /* user queue IOCTL operations */
 #define AMDGPU_USERQ_OP_CREATE 1
 #define AMDGPU_USERQ_OP_FREE   2
-#define AMDGPU_USERQ_OP_QUERY_STATUS   3
 
 /* queue priority levels */
 /* low < normal low < normal high < high */
@@ -347,12 +346,6 @@ union drm_amdgpu_ctx {
 /* for queues that need access to protected content */
 #define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE  (1 << 2)
 
-
-/* the queue is hung */
-#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_HUNG    (1 << 0)
-/* indicate vram lost since queue was created */
-#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_VRAMLOST (1 << 1)
-
 /*
  * This structure is a container to pass input configuration
  * info for all supported userqueue related operations.
@@ -434,16 +427,9 @@ struct drm_amdgpu_userq_out {
        __u32 _pad;
 };
 
-/* The structure to carry output of userqueue ops */
-struct drm_amdgpu_userq_out_query_state {
-       __u32 flags;
-       __u32 _pad;
-};
-
 union drm_amdgpu_userq {
        struct drm_amdgpu_userq_in in;
        struct drm_amdgpu_userq_out out;
-       struct drm_amdgpu_userq_out_query_state out_qs;
 };
 
 /* GFX V11 IP specific MQD parameters */
--

2.34.1