Skip to contentSkip to conversation

drm/amdgpu: change SH MEM alignment mode for gfx10

PATCH In review Likun Gao 4 participants 5 messages Apr 3, 2020 – Apr 16, 2020

Subsystems (2)
lore
Share & tools
lore

Likun Gao

author
#0 lore raw

PATCH 1/1 drm/amdgpu: change SH MEM alignment mode for gfx10

From: Likun Gao <[email protected]>

Change SH_MEM_CONFIG Alignment mode to Automatic, as:
1)OGL fn_amd_compute_shader will failed with unaligned mode. 2)The default alignment mode was defined to automatic on gfx10 specification.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index 5a67306..d8f0c0d 100644
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] =
 
 #define DEFAULT_SH_MEM_CONFIG \
 	((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
-	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
+	 (SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
 	 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
 	 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

Regards,
Hawking
-----Original Message-----
From: Gao, Likun <[email protected]>
Sent: Friday, April 3, 2020 18:20
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Gao, Likun <[email protected]>
Subject: [PATCH] drm/amdgpu: change SH MEM alignment mode for gfx10

From: Likun Gao <[email protected]>

Change SH_MEM_CONFIG Alignment mode to Automatic, as:
1)OGL fn_amd_compute_shader will failed with unaligned mode. 2)The default alignment mode was defined to automatic on gfx10 specification.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -1
index 5a67306..d8f0c0d 100644
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] =
 
 #define DEFAULT_SH_MEM_CONFIG \
 	((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
-	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
+	 (SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) 
+| \
 	 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
 	 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))

--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw
In reply to Likun Gao
Quoted 18 lines · Likun Gao

From: Likun Gao <[email protected]>

Change SH_MEM_CONFIG Alignment mode to Automatic, as:
1)OGL fn_amd_compute_shader will failed with unaligned mode. 2)The default alignment mode was defined to automatic on gfx10 specification.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index 5a67306..d8f0c0d 100644

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] = · line 285

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] =
 
 #define DEFAULT_SH_MEM_CONFIG \
 	((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
-	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
+	 (SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
 	 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
 	 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))
 

I bisected a bunch of piglit regressions (mostly half-float related, e.g. draw-vertices-half-float_gles2) with radeonsi on Navi 10 to this change.

Does radeonsi/LLVM need corresponding changes?

Signature · 6 lines
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

[AMD Official Use Only - Internal Distribution Only]

Quoted 41 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Michel Dänzer
Sent: Thursday, April 16, 2020 5:57 AM
To: Gao, Likun <[email protected]>; Marek Olšák <[email protected]>; Pierre-Eric Pelloux-Prayer <[email protected]>
Cc: [email protected]; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: change SH MEM alignment mode for gfx10

Quoted 20 lines · Likun Gao

From: Likun Gao <[email protected]>

Change SH_MEM_CONFIG Alignment mode to Automatic, as:
1)OGL fn_amd_compute_shader will failed with unaligned mode. 2)The default alignment mode was defined to automatic on gfx10 specification.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index 5a67306..d8f0c0d 100644
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden

golden_settings_gc_10_1_2_nv12[] =

Quoted 2 lines

#define DEFAULT_SH_MEM_CONFIG \
((SH_MEM_ADDRESS_MODE_64 <<

SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
-	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<

SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -0
+	 (SH_MEM_ALIGNMENT_MODE_DWORD <<
+SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
 	 (SH_MEM_RETRY_MODE_ALL <<

SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \

Quoted 8 lines
Quoted 3 lines

(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))

I bisected a bunch of piglit regressions (mostly half-float related, e.g. draw- vertices-half-float_gles2) with radeonsi on Navi 10 to this change.

Does radeonsi/LLVM need corresponding changes?

This change was reverted. The problem was in the Orca OpenGL shader compiler.

Alex
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw
Quoted 47 lines · Alexander

[AMD Official Use Only - Internal Distribution Only]

Quoted 45 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Michel Dänzer
Sent: Thursday, April 16, 2020 5:57 AM
To: Gao, Likun <[email protected]>; Marek Olšák <[email protected]>; Pierre-Eric Pelloux-Prayer <[email protected]>
Cc: [email protected]; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: change SH MEM alignment mode for gfx10

Quoted 20 lines · Likun Gao

From: Likun Gao <[email protected]>

Change SH_MEM_CONFIG Alignment mode to Automatic, as:
1)OGL fn_amd_compute_shader will failed with unaligned mode. 2)The default alignment mode was defined to automatic on gfx10 specification.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index 5a67306..d8f0c0d 100644
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden

golden_settings_gc_10_1_2_nv12[] =

Quoted 2 lines

#define DEFAULT_SH_MEM_CONFIG \
((SH_MEM_ADDRESS_MODE_64 <<

SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
-	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<

SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -0
+	 (SH_MEM_ALIGNMENT_MODE_DWORD <<
+SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
 	 (SH_MEM_RETRY_MODE_ALL <<

SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \

Quoted 3 lines

(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))

Quoted 6 lines
Quoted 4 lines

I bisected a bunch of piglit regressions (mostly half-float related, e.g. draw- vertices-half-float_gles2) with radeonsi on Navi 10 to this change.

Does radeonsi/LLVM need corresponding changes?

This change was reverted. The problem was in the Orca OpenGL shader compiler.

Ah, I see the revert now, thanks.

Signature · 6 lines
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx