Skip to contentSkip to conversation

add compute performance count control

RFC PATCH In review James Zhu 2 participants 7 messages Mar 4 – Mar 9

Subsystems (2)
lore
Share & tools
lore

James Zhu

author
#0 lore raw

cover add compute performance count control

in user mode queue properties. New user moded queue command AMDGPU_USERQ_OP_MODIFY supports update queue properties at runtime.

James Zhu (5):
drm/amdgpu: add MQD update on cu_flags drm/amdgpu/gfx10: add compute performance count control drm/amdgpu/gfx11: add compute performance count control drm/amdgpu/gfx12: add compute performance count control drm/amdgpu/gfx12.1: add compute performance count control

 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 ++
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c     | 3 +++
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c     | 3 +++
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c     | 3 +++
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c     | 3 +++
 drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 ++
 6 files changed, 16 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

RFC PATCH 1/5 drm/amdgpu: add MQD update on cu_flags

pass queue properties flags at runtime, add new MQD update flag to control performance count enable.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 ++
 drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 ++
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 -0
index 116e509e7bed..4e9513cbe7f6 100644
@@ -796,6 +796,8 @@ enum amdgpu_mqd_update_flag {
        AMDGPU_UPDATE_FLAG_DBG_WA_ENABLE = 1,
        AMDGPU_UPDATE_FLAG_DBG_WA_DISABLE = 2,
        AMDGPU_UPDATE_FLAG_IS_GWS = 4, /* quirk for gfx9 IP */
+       AMDGPU_UPDATE_FLAG_PERFCOUNT_ENABLE = 5,
+       AMDGPU_UPDATE_FLAG_PERFCOUNT_DISABLE = 6,
 };
 
 struct amdgpu_mqd_prop {
drivers/gpu/drm/amd/amdgpu/mes_userqueue.c +2 -0
index 412c00ecd97f..173fd09b5650 100644
@@ -389,6 +389,7 @@ static int amdgpu_userq_set_compute_mqd(struct amdgpu_usermode_queue *queue,
 		props->cu_mask = cu_mask;
 		props->cu_mask_count = count;
 		props->is_user_cu_masked = (cu_mask != NULL);
+
 	}
 
 	/* Parse HQD priority and other compute properties */
@@ -623,6 +624,7 @@ static int mes_userq_mqd_update(struct amdgpu_usermode_queue *queue, struct drm_
 
 	userq_props->queue_size = args_in->queue_size;
 	userq_props->hqd_base_gpu_addr = args_in->queue_va;
+	userq_props->cu_flags = args_in->flags;
 
 	retval = mqd_hw_default->init_mqd(adev, (void *)queue->mqd.cpu_ptr, userq_props);
 
Signature · 1 line
2.34.1
author
#2 lore raw

RFC PATCH 2/5 drm/amdgpu/gfx10: add compute performance count control

In reply to James Zhu

through amdgpu IOCTL AMDGPU_USERQ/AMDGPU_USERQ_OP_MODIFY.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
index 1893ceeeb26c..d44dafe1f4ce 100644
@@ -7017,6 +7017,9 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
 
 	mqd->cp_hqd_active = prop->hqd_active;
 
+	mqd->compute_perfcount_enable =
+		(prop->cu_flags == AMDGPU_UPDATE_FLAG_PERFCOUNT_ENABLE) ? 1 : 0;
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
author
#3 lore raw

RFC PATCH 3/5 drm/amdgpu/gfx11: add compute performance count control

In reply to James Zhu

through amdgpu IOCTL AMDGPU_USERQ/AMDGPU_USERQ_OP_MODIFY.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
index b1a1b8a10a08..231404bb6799 100644
@@ -4406,6 +4406,9 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
 	/* set CU mask */
 	gfx_v11_0_compute_mqd_set_cu_mask(adev, mqd, prop);
 
+	mqd->compute_perfcount_enable =
+		(prop->cu_flags == AMDGPU_UPDATE_FLAG_PERFCOUNT_ENABLE) ? 1 : 0;
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
author
#4 lore raw

RFC PATCH 4/5 drm/amdgpu/gfx12: add compute performance count control

In reply to James Zhu

through amdgpu IOCTL AMDGPU_USERQ/AMDGPU_USERQ_OP_MODIFY.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +3 -0
index b9c43738bd86..410fbeea4111 100644
@@ -3293,6 +3293,9 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
 		mqd->cp_hqd_wg_state_offset = prop->ctl_stack_size;
 	}
 
+	mqd->compute_perfcount_enable =
+		(prop->cu_flags == AMDGPU_UPDATE_FLAG_PERFCOUNT_ENABLE) ? 1 : 0;
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
author
#5 lore raw

RFC PATCH 5/5 drm/amdgpu/gfx12.1: add compute performance count control

In reply to James Zhu

through amdgpu IOCTL AMDGPU_USERQ/AMDGPU_USERQ_OP_MODIFY.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +3 -0
index eb9725ae1607..faedaa3aa5f9 100644
@@ -2240,6 +2240,9 @@ static int gfx_v12_1_compute_mqd_init(struct amdgpu_device *adev, void *m,
 
 	mqd->cp_hqd_active = prop->hqd_active;
 
+	mqd->compute_perfcount_enable =
+		(prop->cu_flags == AMDGPU_UPDATE_FLAG_PERFCOUNT_ENABLE) ? 1 : 0;
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
#6 lore raw
In reply to James Zhu

Ping ...

Thanks!

James Zhu

Quoted 18 lines · James Zhu

in user mode queue properties. New user moded queue command AMDGPU_USERQ_OP_MODIFY supports update queue properties at runtime.

James Zhu (5):
drm/amdgpu: add MQD update on cu_flags drm/amdgpu/gfx10: add compute performance count control drm/amdgpu/gfx11: add compute performance count control drm/amdgpu/gfx12: add compute performance count control drm/amdgpu/gfx12.1: add compute performance count control

  drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 ++
  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c     | 3 +++
  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c     | 3 +++
  drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c     | 3 +++
  drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c     | 3 +++
  drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 ++
  6 files changed, 16 insertions(+)