drm/amdgpu/gfx9: set gfx.funcs in early init
Subsystems (2)
Alex Deucher
maintainerPATCH 1/3 drm/amdgpu/gfx9: set gfx.funcs in early init
So the callbacks are set before we use them.
Fixes 0c9646e1a043 ("drm/amdgpu: switch to select_se_sh wrapper for gfx v9_0")
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -1921,8 +1921,6 @@ static int gfx_v9_0_gpu_early_init(struct amdgpu_device *adev)u32 gb_addr_config;int err; - adev->gfx.funcs = &gfx_v9_0_gfx_funcs; -switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (9 ,0 ,1 ): adev->gfx.config.max_hw_contexts =8 ;
@@ -4541,6 +4539,8 @@ static int gfx_v9_0_early_init(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; + adev->gfx.funcs = &gfx_v9_0_gfx_funcs; +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,1 ) || adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,2 )) adev->gfx.num_gfx_rings =0 ;
Signature · 1 line
2.37.3
Alex Deucher
maintainerPATCH 2/3 drm/amdgpu/gfx10: set gfx.funcs in early init
So the callbacks are set early in case we need them.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -2
@@ -4453,8 +4453,6 @@ static void gfx_v10_0_gpu_early_init(struct amdgpu_device *adev) {u32 gb_addr_config; - adev->gfx.funcs = &gfx_v10_0_gfx_funcs; -switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (10 ,1 ,10 ):case IP_VERSION (10 ,1 ,1 ):
@@ -7593,6 +7591,8 @@ static int gfx_v10_0_early_init(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; + adev->gfx.funcs = &gfx_v10_0_gfx_funcs; +switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (10 ,1 ,10 ):case IP_VERSION (10 ,1 ,1 ):
Signature · 1 line
2.37.3
Alex Deucher
maintainerPATCH 3/3 drm/amdgpu/gfx11: set gfx.funcs in early init
In reply to Alex DeucherSo the callbacks are set early in case we need them.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -1
@@ -843,7 +843,6 @@ static const struct amdgpu_gfx_funcs gfx_v11_0_gfx_funcs = {static int gfx_v11_0_gpu_early_init (struct amdgpu_device *adev) { - adev->gfx.funcs = &gfx_v11_0_gfx_funcs;switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (11 ,0 ,0 ):
@@ -4657,6 +4656,8 @@ static int gfx_v11_0_early_init(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; + adev->gfx.funcs = &gfx_v11_0_gfx_funcs; + adev->gfx.num_gfx_rings =GFX11_NUM_GFX_RINGS ; adev->gfx.num_compute_rings =min (amdgpu_gfx_get_num_kcq (adev),AMDGPU_MAX_COMPUTE_RINGS );
Signature · 1 line
2.37.3
Am 02.11.22 um 16:23 schrieb Alex Deucher:
Quoted 4 lines
So the callbacks are set before we use them.
Fixes 0c9646e1a043 ("drm/amdgpu: switch to select_se_sh wrapper for gfx v9_0")Signed-off-by Alex Deucher <[email protected]>
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2@@ -1921,8 +1921,6 @@ static int gfx_v9_0_gpu_early_init(struct amdgpu_device *adev)u32 gb_addr_config;int err; - adev->gfx.funcs = &gfx_v9_0_gfx_funcs; -switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (9 ,0 ,1 ): adev->gfx.config.max_hw_contexts =8 ;@@ -4541,6 +4539,8 @@ static int gfx_v9_0_early_init(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; + adev->gfx.funcs = &gfx_v9_0_gfx_funcs; +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,1 ) || adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,2 )) adev->gfx.num_gfx_rings =0 ;