All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/amdgpu: set emit fence flag for multi fence
@ 2020-07-07 13:15 Likun Gao
  2020-07-07 13:24 ` Zhang, Hawking
  0 siblings, 1 reply; 5+ messages in thread
From: Likun Gao @ 2020-07-07 13:15 UTC (permalink / raw)
  To: amd-gfx; +Cc: Likun Gao, Hawking Zhang

From: Likun Gao <Likun.Gao@amd.com>

Set AMDGPU_IB_FLAG_EMIT_MEM_SYNC flag for specific ASIC when test multi
fence.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Change-Id: I41e5cb19d9ca72c1d396cc28d1b54c31773fe4d5
---
 include/drm/amdgpu_drm.h   | 2 ++
 tests/amdgpu/basic_tests.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index 4fe35d60..8a4d7da9 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -586,6 +586,8 @@ union drm_amdgpu_cs {
  */
 #define AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID (1 << 4)
 
+#define AMDGPU_IB_FLAG_EMIT_MEM_SYNC  (1 << 6)
+
 struct drm_amdgpu_cs_chunk_ib {
 	__u32 _pad;
 	/** AMDGPU_IB_FLAG_* */
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 57496c82..c0f7ec33 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -45,6 +45,8 @@ static  amdgpu_device_handle device_handle;
 static  uint32_t  major_version;
 static  uint32_t  minor_version;
 static  uint32_t  family_id;
+static  uint32_t  chip_rev;
+static  uint32_t  chip_id;
 
 static void amdgpu_query_info_test(void);
 static void amdgpu_command_submission_gfx(void);
@@ -607,6 +609,8 @@ int suite_basic_tests_init(void)
 		return CUE_SINIT_FAILED;
 
 	family_id = gpu_info.family_id;
+	chip_rev = gpu_info.chip_rev;
+	chip_id = gpu_info.chip_external_rev;
 
 	return CUE_SUCCESS;
 }
@@ -1769,6 +1773,8 @@ static void amdgpu_command_submission_multi_fence_wait_all(bool wait_all)
 	ib_info[0].ib_mc_address = ib_result_ce_mc_address;
 	ib_info[0].size = i;
 	ib_info[0].flags = AMDGPU_IB_FLAG_CE;
+	if (chip_id == (chip_rev + 0x28))
+		ib_info[0].flags |= AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
 
 	/* IT_WAIT_ON_CE_COUNTER */
 	ptr = ib_result_cpu;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] tests/amdgpu: set emit fence flag for multi fence
  2020-07-07 13:15 [PATCH] tests/amdgpu: set emit fence flag for multi fence Likun Gao
@ 2020-07-07 13:24 ` Zhang, Hawking
  2020-07-07 13:40   ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Hawking @ 2020-07-07 13:24 UTC (permalink / raw)
  To: Gao, Likun, amd-gfx

[AMD Public Use]

It seems to me the kernel amdgpu_drm.h doesn't sync up with libdrm amdgpu_drm.h if your patch is based on drm-master.

I'd expect another patch to add AMDGPU_IB_FLAG_EMIT_MEM_SYNC flag in libdrm since kernel already has the flag for a while.

Other than that, the patch is Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: Gao, Likun <Likun.Gao@amd.com> 
Sent: Tuesday, July 7, 2020 21:15
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Gao, Likun <Likun.Gao@amd.com>
Subject: [PATCH] tests/amdgpu: set emit fence flag for multi fence

From: Likun Gao <Likun.Gao@amd.com>

Set AMDGPU_IB_FLAG_EMIT_MEM_SYNC flag for specific ASIC when test multi fence.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Change-Id: I41e5cb19d9ca72c1d396cc28d1b54c31773fe4d5
---
 include/drm/amdgpu_drm.h   | 2 ++
 tests/amdgpu/basic_tests.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index 4fe35d60..8a4d7da9 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -586,6 +586,8 @@ union drm_amdgpu_cs {
  */
 #define AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID (1 << 4)
 
+#define AMDGPU_IB_FLAG_EMIT_MEM_SYNC  (1 << 6)
+
 struct drm_amdgpu_cs_chunk_ib {
 	__u32 _pad;
 	/** AMDGPU_IB_FLAG_* */
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 57496c82..c0f7ec33 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -45,6 +45,8 @@ static  amdgpu_device_handle device_handle;  static  uint32_t  major_version;  static  uint32_t  minor_version;  static  uint32_t  family_id;
+static  uint32_t  chip_rev;
+static  uint32_t  chip_id;
 
 static void amdgpu_query_info_test(void);  static void amdgpu_command_submission_gfx(void);
@@ -607,6 +609,8 @@ int suite_basic_tests_init(void)
 		return CUE_SINIT_FAILED;
 
 	family_id = gpu_info.family_id;
+	chip_rev = gpu_info.chip_rev;
+	chip_id = gpu_info.chip_external_rev;
 
 	return CUE_SUCCESS;
 }
@@ -1769,6 +1773,8 @@ static void amdgpu_command_submission_multi_fence_wait_all(bool wait_all)
 	ib_info[0].ib_mc_address = ib_result_ce_mc_address;
 	ib_info[0].size = i;
 	ib_info[0].flags = AMDGPU_IB_FLAG_CE;
+	if (chip_id == (chip_rev + 0x28))
+		ib_info[0].flags |= AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
 
 	/* IT_WAIT_ON_CE_COUNTER */
 	ptr = ib_result_cpu;
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/amdgpu: set emit fence flag for multi fence
  2020-07-07 13:24 ` Zhang, Hawking
@ 2020-07-07 13:40   ` Christian König
  2020-07-07 14:24     ` Michel Dänzer
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2020-07-07 13:40 UTC (permalink / raw)
  To: Zhang, Hawking, Gao, Likun, amd-gfx

There is a document about how the libdrm copy of the header is to be 
updated.

Can't find it of hand, but our userspace guys should be able to point 
out where it is.

One more comment below.

Am 07.07.20 um 15:24 schrieb Zhang, Hawking:
> [AMD Public Use]
>
> It seems to me the kernel amdgpu_drm.h doesn't sync up with libdrm amdgpu_drm.h if your patch is based on drm-master.
>
> I'd expect another patch to add AMDGPU_IB_FLAG_EMIT_MEM_SYNC flag in libdrm since kernel already has the flag for a while.
>
> Other than that, the patch is Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
>
> Regards,
> Hawking
> -----Original Message-----
> From: Gao, Likun <Likun.Gao@amd.com>
> Sent: Tuesday, July 7, 2020 21:15
> To: amd-gfx@lists.freedesktop.org
> Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Gao, Likun <Likun.Gao@amd.com>
> Subject: [PATCH] tests/amdgpu: set emit fence flag for multi fence
>
> From: Likun Gao <Likun.Gao@amd.com>
>
> Set AMDGPU_IB_FLAG_EMIT_MEM_SYNC flag for specific ASIC when test multi fence.
>
> Signed-off-by: Likun Gao <Likun.Gao@amd.com>
> Change-Id: I41e5cb19d9ca72c1d396cc28d1b54c31773fe4d5
> ---
>   include/drm/amdgpu_drm.h   | 2 ++
>   tests/amdgpu/basic_tests.c | 6 ++++++
>   2 files changed, 8 insertions(+)
>
> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index 4fe35d60..8a4d7da9 100644
> --- a/include/drm/amdgpu_drm.h
> +++ b/include/drm/amdgpu_drm.h
> @@ -586,6 +586,8 @@ union drm_amdgpu_cs {
>    */
>   #define AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID (1 << 4)
>   
> +#define AMDGPU_IB_FLAG_EMIT_MEM_SYNC  (1 << 6)
> +
>   struct drm_amdgpu_cs_chunk_ib {
>   	__u32 _pad;
>   	/** AMDGPU_IB_FLAG_* */
> diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 57496c82..c0f7ec33 100644
> --- a/tests/amdgpu/basic_tests.c
> +++ b/tests/amdgpu/basic_tests.c
> @@ -45,6 +45,8 @@ static  amdgpu_device_handle device_handle;  static  uint32_t  major_version;  static  uint32_t  minor_version;  static  uint32_t  family_id;
> +static  uint32_t  chip_rev;
> +static  uint32_t  chip_id;
>   
>   static void amdgpu_query_info_test(void);  static void amdgpu_command_submission_gfx(void);
> @@ -607,6 +609,8 @@ int suite_basic_tests_init(void)
>   		return CUE_SINIT_FAILED;
>   
>   	family_id = gpu_info.family_id;
> +	chip_rev = gpu_info.chip_rev;
> +	chip_id = gpu_info.chip_external_rev;
>   
>   	return CUE_SUCCESS;
>   }
> @@ -1769,6 +1773,8 @@ static void amdgpu_command_submission_multi_fence_wait_all(bool wait_all)
>   	ib_info[0].ib_mc_address = ib_result_ce_mc_address;
>   	ib_info[0].size = i;
>   	ib_info[0].flags = AMDGPU_IB_FLAG_CE;
> +	if (chip_id == (chip_rev + 0x28))

That probably needs an explanation or at least a comment.

Christian.

> +		ib_info[0].flags |= AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
>   
>   	/* IT_WAIT_ON_CE_COUNTER */
>   	ptr = ib_result_cpu;
> --
> 2.25.1
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/amdgpu: set emit fence flag for multi fence
  2020-07-07 13:40   ` Christian König
@ 2020-07-07 14:24     ` Michel Dänzer
  2020-07-07 15:07       ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2020-07-07 14:24 UTC (permalink / raw)
  To: christian.koenig, Zhang, Hawking, Gao, Likun; +Cc: amd-gfx

On 2020-07-07 3:40 p.m., Christian König wrote:
> There is a document about how the libdrm copy of the header is to be
> updated.
> 
> Can't find it of hand, but our userspace guys should be able to point
> out where it is.

https://gitlab.freedesktop.org/mesa/drm/-/blob/master/include/drm/README


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/amdgpu: set emit fence flag for multi fence
  2020-07-07 14:24     ` Michel Dänzer
@ 2020-07-07 15:07       ` Christian König
  0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2020-07-07 15:07 UTC (permalink / raw)
  To: Michel Dänzer, christian.koenig, Zhang, Hawking, Gao, Likun; +Cc: amd-gfx

Am 07.07.20 um 16:24 schrieb Michel Dänzer:
> On 2020-07-07 3:40 p.m., Christian König wrote:
>> There is a document about how the libdrm copy of the header is to be
>> updated.
>>
>> Can't find it of hand, but our userspace guys should be able to point
>> out where it is.
> https://gitlab.freedesktop.org/mesa/drm/-/blob/master/include/drm/README

Danke!
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-07 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 13:15 [PATCH] tests/amdgpu: set emit fence flag for multi fence Likun Gao
2020-07-07 13:24 ` Zhang, Hawking
2020-07-07 13:40   ` Christian König
2020-07-07 14:24     ` Michel Dänzer
2020-07-07 15:07       ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.