drm/amdgpu:reduce wb to 512 slot
Subsystems (2)
PATCH 1/6 drm/amdgpu:reduce wb to 512 slot
with current WB usage we only use 57 slots, so 512 is extreamly sufficient, and reduce to 512 can make WB fit into one page.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -1155,7 +1155,7 @@ static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p,/* * Writeback */ -#define AMDGPU_MAX_WB 1024/* Reserve at most 1024 WB slots for amdgpu-owned rings. */ +#define AMDGPU_MAX_WB 512/* Reserve at most 512 WB slots for amdgpu-owned rings. */ struct amdgpu_wb {struct amdgpu_bo *wb_obj;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1508316505-8506-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
PATCH 2/6 drm/amdgpu:fix regression on KIQ enable
previously a path moves ucode_init_bo to amdgpu_device_init but this cause regression:
the regression that MEC enabling will fail after gpu reset, the reason is after gpu reset (at least from VF FLR) the firmware buf that MEC use is somehow changed by PSP hw, so without calling this ucode_init_bo again in psp_hw_init() the MEC ucode won't get upload succesfully thus lead to MEC fail.
now add back the ucode_init_bo in psp hw_init to fix that problem
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -0
@@ -412,6 +412,8 @@ static int psp_hw_init(void *handle)mutex_lock (&adev->firmware.mutex); +amdgpu_ucode_init_bo (adev); + ret =psp_load_fw (adev);if (ret) {DRM_ERROR ("PSP firmware loading failed\n" );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/6 drm/amdgpu/sriov:now must reinit psp
In reply to a message not in the archiveotherwise after VF FLR the KIQ cannot work
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
@@ -1964,6 +1964,7 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)static enum amd_ip_block_type ip_order[] = {AMD_IP_BLOCK_TYPE_SMC , +AMD_IP_BLOCK_TYPE_PSP ,AMD_IP_BLOCK_TYPE_DCE ,AMD_IP_BLOCK_TYPE_GFX ,AMD_IP_BLOCK_TYPE_SDMA ,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1508316505-8506-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byRe: [PATCH 3/6] drm/amdgpu/sriov:now must reinit psp
Quoted 4 lines · Monk Liu
otherwise after VF FLR the KIQ cannot work
Change-Id Icb18e794b5e4dccfd70c811c138c7102df874203Signed-off-by Monk Liu <[email protected]>
Quoted 19 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -1964,6 +1964,7 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)static enum amd_ip_block_type ip_order[] = {AMD_IP_BLOCK_TYPE_SMC , +AMD_IP_BLOCK_TYPE_PSP ,AMD_IP_BLOCK_TYPE_DCE ,AMD_IP_BLOCK_TYPE_GFX ,AMD_IP_BLOCK_TYPE_SDMA , --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu:fix duplicated setting job's vram_lost
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -1
@@ -172,7 +172,6 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)if (ret) goto free_all_kdata; - p->job->vram_lost_counter =atomic_read (&p->adev->vram_lost_counter);if (p->ctx->vram_lost_counter != p->job->vram_lost_counter) { ret = -ECANCELED ; goto free_all_kdata;
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -1
@@ -61,11 +61,11 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, (*job)->vm = vm; (*job)->ibs = (void *)&(*job)[1 ]; (*job)->num_ibs = num_ibs; - (*job)->vram_lost_counter =atomic_read (&adev->vram_lost_counter);amdgpu_sync_create (&(*job)->sync);amdgpu_sync_create (&(*job)->dep_sync);amdgpu_sync_create (&(*job)->sched_sync); + (*job)->vram_lost_counter =atomic_read (&adev->vram_lost_counter);return 0 ; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1508316505-8506-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byRe: [PATCH 4/6] drm/amdgpu:fix duplicated setting job's vram_lost
Am 18.10.2017 um 10:48 schrieb Monk Liu:
Quoted 2 lines
Change-Id I7a29e1533fb3deb476bc0f3dba0f8b2e25baf8c1Signed-off-by Monk Liu <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1@@ -172,7 +172,6 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)if (ret) goto free_all_kdata; - p->job->vram_lost_counter =atomic_read (&p->adev->vram_lost_counter);if (p->ctx->vram_lost_counter != p->job->vram_lost_counter) { ret = -ECANCELED ; goto free_all_kdata;drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +0
-0@@ -61,11 +61,11 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, (*job)->vm = vm; (*job)->ibs = (void *)&(*job)[1 ];
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, · line 71
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1(*job)->num_ibs = num_ibs; - (*job)->vram_lost_counter =atomic_read (&adev->vram_lost_counter);amdgpu_sync_create (&(*job)->sync);amdgpu_sync_create (&(*job)->dep_sync);amdgpu_sync_create (&(*job)->sched_sync); + (*job)->vram_lost_counter =atomic_read (&adev->vram_lost_counter);return 0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amdgpu:fix vf_error_put
In reply to a message not in the archiveit should not work on non-SR-IOV case
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++---- drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c | 7 ++++++- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -4
@@ -2057,6 +2057,9 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)if (amdgpu_atombios_has_gpu_virtualization_table (adev)) adev->virt.caps |=AMDGPU_SRIOV_CAPS_SRIOV_VBIOS ; } + +if (!(adev->virt.caps &AMDGPU_SRIOV_CAPS_SRIOV_VBIOS )) +amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_NO_VBIOS ,0 ,0 ); }bool amdgpu_device_asic_has_dc_support (enum amd_asic_type asic_type)
@@ -2268,7 +2271,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,if (amdgpu_vpost_needed (adev)) {if (!adev->bios) {dev_err (adev->dev,"no vBIOS found\n" ); -amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_NO_VBIOS ,0 ,0 ); r = -EINVAL ; goto failed; }
@@ -2276,7 +2278,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, r =amdgpu_atom_asic_init (adev->mode_info.atom_context);if (r) {dev_err (adev->dev,"gpu post error!\n" ); -amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_GPU_POST_ERROR ,0 ,0 ); goto failed; } }else {
@@ -3101,7 +3102,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev) } }else {dev_err (adev->dev,"asic resume failed (%d).\n" , r); -amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_ASIC_RESUME_FAIL ,0 , r);for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) {if (adev->rings[i] && adev->rings[i]->sched.thread) {kthread_unpark (adev->rings[i]->sched.thread);
@@ -3119,7 +3119,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)if (r) {/* bad news, how to tell it to userspace ? */ dev_info (adev->dev,"GPU reset failed\n" ); -amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_GPU_RESET_FAIL ,0 , r); }else {dev_info (adev->dev,"GPU reset successed!\n" );
drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c +6 -1
@@ -31,7 +31,12 @@ void amdgpu_vf_error_put(struct amdgpu_device *adev, uint64_t error_data) {int index; -uint16_t error_code =AMDGIM_ERROR_CODE (AMDGIM_ERROR_CATEGORY_VF , sub_error_code); +uint16_t error_code; + +if (!amdgpu_sriov_vf (adev)) +return ; + + error_code =AMDGIM_ERROR_CODE (AMDGIM_ERROR_CATEGORY_VF , sub_error_code);mutex_lock (&adev->virt.vf_errors.lock); index = adev->virt.vf_errors.write_count %AMDGPU_VF_ERROR_ENTRY_SIZE ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu:don't check soft_reset for sriov
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -2699,6 +2699,9 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device *adev)int i;bool asic_hang = false; +if (amdgpu_sriov_vf (adev)) +return true; +for (i =0 ; i < adev->num_ip_blocks; i++) {if (!adev->ip_blocks[i].status.valid)continue ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1508316505-8506-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 6/6] drm/amdgpu:don't check soft_reset for sriov
Am 18.10.2017 um 10:48 schrieb Monk Liu:
Quoted 2 lines
Change-Id Iafe294aea66ae0c140af062ec78321c22a74e615Signed-off-by Monk Liu <[email protected]>
#1 and #4 in this series have my rb.
Can't say much about the rest, but feel free to add my Acked-by to them.
Regards,
Christian.
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static bool amdgpu_check_soft_reset(struct amdgpu_device *adev) · line 2707
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-0@@ -2699,6 +2699,9 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device *adev)int i;bool asic_hang = false; +if (amdgpu_sriov_vf (adev)) +return true; +for (i =0 ; i < adev->num_ip_blocks; i++) {if (!adev->ip_blocks[i].status.valid)continue ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Reviewed-byAm 18.10.2017 um 10:48 schrieb Monk Liu:
Quoted 6 lines
with current WB usage we only use 57 slots, so 512 is extreamly sufficient, and reduce to 512 can make WB fit into one page.
Change-Id I4261630731f132b9bec91b0037e914030b5c031fSigned-off-by Monk Liu <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu.h static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p, · line 1161
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1@@ -1155,7 +1155,7 @@ static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p,/* * Writeback */ -#define AMDGPU_MAX_WB 1024/* Reserve at most 1024 WB slots for amdgpu-owned rings. */ +#define AMDGPU_MAX_WB 512/* Reserve at most 512 WB slots for amdgpu-owned rings. */ struct amdgpu_wb {struct amdgpu_bo *wb_obj;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx