drm/amdgpu:add PSP block only load_type=PSP
Subsystems (2)
PATCH 1/6 drm/amdgpu:add PSP block only load_type=PSP
SRIOV currently only can load ucode directly, and PSP block is not supported by VF temporarily.
will remove this restrict and use PSP load all ucode even for SRIOV later
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -1
@@ -497,7 +497,8 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_ip_block_add (adev, &mmhub_v1_0_ip_block);amdgpu_ip_block_add (adev, &gmc_v9_0_ip_block);amdgpu_ip_block_add (adev, &vega10_ih_ip_block); -amdgpu_ip_block_add (adev, &psp_v3_1_ip_block); +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) +amdgpu_ip_block_add (adev, &psp_v3_1_ip_block);if (!amdgpu_sriov_vf (adev))amdgpu_ip_block_add (adev, &amdgpu_pp_ip_block);if (adev->enable_virtual_display ||amdgpu_sriov_vf (adev))
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): 1491383472-19477-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
PATCH 2/6 drm/amdgpu:no need to involv HDP in KIQ
1,KIQ won't touch VRAM so no need to involv HDP flush/invalidate at all. 2,According to CP hw designer KIQ better not use any PM4 package lead to wait behave.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 ---- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 -- 3 files changed, 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0 -4
@@ -122,9 +122,7 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg)mutex_lock (&adev->virt.lock_kiq);amdgpu_ring_alloc (ring,32 ); -amdgpu_ring_emit_hdp_flush (ring);amdgpu_ring_emit_rreg (ring, reg); -amdgpu_ring_emit_hdp_invalidate (ring);amdgpu_fence_emit (ring, &f);amdgpu_ring_commit (ring);mutex_unlock (&adev->virt.lock_kiq);
@@ -150,9 +148,7 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)mutex_lock (&adev->virt.lock_kiq);amdgpu_ring_alloc (ring,32 ); -amdgpu_ring_emit_hdp_flush (ring);amdgpu_ring_emit_wreg (ring, reg, v); -amdgpu_ring_emit_hdp_invalidate (ring);amdgpu_fence_emit (ring, &f);amdgpu_ring_commit (ring);mutex_unlock (&adev->virt.lock_kiq);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0 -2
@@ -6962,8 +6962,6 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_kiq = { .emit_ib_size = 4, /* gfx_v8_0_ring_emit_ib_compute */ .emit_ib = gfx_v8_0_ring_emit_ib_compute, .emit_fence = gfx_v8_0_ring_emit_fence_kiq, - .emit_hdp_flush = gfx_v8_0_ring_emit_hdp_flush, - .emit_hdp_invalidate = gfx_v8_0_ring_emit_hdp_invalidate, .test_ring = gfx_v8_0_ring_test_ring, .test_ib = gfx_v8_0_ring_test_ib, .insert_nop = amdgpu_ring_insert_nop,
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -2
@@ -3759,8 +3759,6 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = { .emit_ib_size = 4, /* gfx_v9_0_ring_emit_ib_compute */ .emit_ib = gfx_v9_0_ring_emit_ib_compute, .emit_fence = gfx_v9_0_ring_emit_fence_kiq, - .emit_hdp_flush = gfx_v9_0_ring_emit_hdp_flush, - .emit_hdp_invalidate = gfx_v9_0_ring_emit_hdp_invalidate, .test_ring = gfx_v9_0_ring_test_ring, .test_ib = gfx_v9_0_ring_test_ib, .insert_nop = amdgpu_ring_insert_nop,
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:fix typo for mxgpu_ai
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +2 -2
@@ -133,7 +133,7 @@ static int xgpu_ai_poll_ack(struct amdgpu_device *adev)return r; } -static int xgpu_vi_poll_msg (struct amdgpu_device *adev,enum idh_event event) +static int xgpu_ai_poll_msg (struct amdgpu_device *adev,enum idh_event event) {int r =0 , timeout =AI_MAILBOX_TIMEDOUT ;
@@ -172,7 +172,7 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev,if (req ==IDH_REQ_GPU_INIT_ACCESS || req ==IDH_REQ_GPU_FINI_ACCESS || req ==IDH_REQ_GPU_RESET_ACCESS ) { - r =xgpu_vi_poll_msg (adev,IDH_READY_TO_ACCESS_GPU ); + r =xgpu_ai_poll_msg (adev,IDH_READY_TO_ACCESS_GPU );if (r)return r; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu:implement the reset MB func for vega10
In reply to a message not in the archivethey are lack in the bringup stage, we need them for GPU reset feature.
--- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 133 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 5 ++ 2 files changed, 138 insertions(+)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +133 -0
@@ -28,6 +28,7 @@#include "vega10/GC/gc_9_0_offset.h" #include "vega10/GC/gc_9_0_sh_mask.h" #include "soc15.h" +#include "vega10_ih.h" #include "soc15_common.h" #include "mxgpu_ai.h"
@@ -180,6 +181,11 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev,return 0 ; } +static int xgpu_ai_request_reset (struct amdgpu_device *adev) +{ +return xgpu_ai_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +} +static int xgpu_ai_request_full_gpu_access (struct amdgpu_device *adev,bool init) {
@@ -201,7 +207,134 @@ static int xgpu_ai_release_full_gpu_access(struct amdgpu_device *adev,return r; } +static int xgpu_ai_mailbox_ack_irq (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +struct amdgpu_iv_entry *entry) +{ +DRM_DEBUG ("get ack intr and do nothing.\n" ); +return 0 ; +} + +static int xgpu_ai_set_mailbox_ack_irq (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +unsigned type, +enum amdgpu_interrupt_state state) +{ +u32 tmp =RREG32_NO_KIQ (SOC15_REG_OFFSET (NBIO ,0 , mmBIF_BX_PF0_MAILBOX_INT_CNTL)); + + tmp =REG_SET_FIELD (tmp,BIF_BX_PF0_MAILBOX_INT_CNTL ,ACK_INT_EN , + (state ==AMDGPU_IRQ_STATE_ENABLE ) ?1 :0 ); +WREG32_NO_KIQ (SOC15_REG_OFFSET (NBIO ,0 , mmBIF_BX_PF0_MAILBOX_INT_CNTL), tmp); + +return 0 ; +} + +static void xgpu_ai_mailbox_flr_work (struct work_struct *work) +{ + struct amdgpu_virt *virt = container_of(work, struct amdgpu_virt, flr_work); + struct amdgpu_device *adev = container_of(virt, struct amdgpu_device, virt); + +/* wait until RCV_MSG become 3 */ +if (xgpu_ai_poll_msg (adev,IDH_FLR_NOTIFICATION_CMPL )) { +pr_err ("failed to recieve FLR_CMPL\n" ); +return ; + } + +/* Trigger recovery due to world switch failure */ +amdgpu_sriov_gpu_reset (adev, false); +} + +static int xgpu_ai_set_mailbox_rcv_irq (struct amdgpu_device *adev, +struct amdgpu_irq_src *src, +unsigned type, +enum amdgpu_interrupt_state state) +{ +u32 tmp =RREG32_NO_KIQ (SOC15_REG_OFFSET (NBIO ,0 , mmBIF_BX_PF0_MAILBOX_INT_CNTL)); + + tmp =REG_SET_FIELD (tmp,BIF_BX_PF0_MAILBOX_INT_CNTL ,VALID_INT_EN , + (state ==AMDGPU_IRQ_STATE_ENABLE ) ?1 :0 ); +WREG32_NO_KIQ (SOC15_REG_OFFSET (NBIO ,0 , mmBIF_BX_PF0_MAILBOX_INT_CNTL), tmp); + +return 0 ; +} + +static int xgpu_ai_mailbox_rcv_irq (struct amdgpu_device *adev, +struct amdgpu_irq_src *source, +struct amdgpu_iv_entry *entry) +{ +int r; + +/* see what event we get */ + r =xgpu_ai_mailbox_rcv_msg (adev,IDH_FLR_NOTIFICATION ); + +/* only handle FLR_NOTIFY now */ +if (!r) +schedule_work (&adev->virt.flr_work); + +return 0 ; +} + +static const struct amdgpu_irq_src_funcs xgpu_ai_mailbox_ack_irq_funcs = { + .set = xgpu_ai_set_mailbox_ack_irq, + .process = xgpu_ai_mailbox_ack_irq, +}; + +static const struct amdgpu_irq_src_funcs xgpu_ai_mailbox_rcv_irq_funcs = { + .set = xgpu_ai_set_mailbox_rcv_irq, + .process = xgpu_ai_mailbox_rcv_irq, +}; + +void xgpu_ai_mailbox_set_irq_funcs (struct amdgpu_device *adev) +{ + adev->virt.ack_irq.num_types =1 ; + adev->virt.ack_irq.funcs = &xgpu_ai_mailbox_ack_irq_funcs; + adev->virt.rcv_irq.num_types =1 ; + adev->virt.rcv_irq.funcs = &xgpu_ai_mailbox_rcv_irq_funcs; +} + +int xgpu_ai_mailbox_add_irq_id (struct amdgpu_device *adev) +{ +int r; + + r =amdgpu_irq_add_id (adev,AMDGPU_IH_CLIENTID_LEGACY ,135 , &adev->virt.rcv_irq); +if (r) +return r; + + r =amdgpu_irq_add_id (adev,AMDGPU_IH_CLIENTID_LEGACY ,138 , &adev->virt.ack_irq); +if (r) { +amdgpu_irq_put (adev, &adev->virt.rcv_irq,0 ); +return r; + } + +return 0 ; +} + +int xgpu_ai_mailbox_get_irq (struct amdgpu_device *adev) +{ +int r; + + r =amdgpu_irq_get (adev, &adev->virt.rcv_irq,0 ); +if (r) +return r; + r =amdgpu_irq_get (adev, &adev->virt.ack_irq,0 ); +if (r) { +amdgpu_irq_put (adev, &adev->virt.rcv_irq,0 ); +return r; + } + +INIT_WORK (&adev->virt.flr_work, xgpu_ai_mailbox_flr_work); + +return 0 ; +} + +void xgpu_ai_mailbox_put_irq (struct amdgpu_device *adev) +{ +amdgpu_irq_put (adev, &adev->virt.ack_irq,0 ); +amdgpu_irq_put (adev, &adev->virt.rcv_irq,0 ); +} +const struct amdgpu_virt_ops xgpu_ai_virt_ops = { .req_full_gpu = xgpu_ai_request_full_gpu_access, .rel_full_gpu = xgpu_ai_release_full_gpu_access, + .reset_gpu = xgpu_ai_request_reset, };
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +5 -0
@@ -44,4 +44,9 @@ enum idh_event {extern const struct amdgpu_virt_ops xgpu_ai_virt_ops; +void xgpu_ai_mailbox_set_irq_funcs (struct amdgpu_device *adev); +int xgpu_ai_mailbox_add_irq_id (struct amdgpu_device *adev); +int xgpu_ai_mailbox_get_irq (struct amdgpu_device *adev); +void xgpu_ai_mailbox_put_irq (struct amdgpu_device *adev); +#endif
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amdgpu:timeout set to equal with VI
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +1 -1
@@ -24,7 +24,7 @@#ifndef __MXGPU_AI_H__#define __MXGPU_AI_H__ -#define AI_MAILBOX_TIMEDOUT 150000 +#define AI_MAILBOX_TIMEDOUT 5000enum idh_request { IDH_REQ_GPU_INIT_ACCESS = 1,
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:invoke new implemented AI MB func
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/soc15.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +19 -1
@@ -569,6 +569,7 @@ static int soc15_common_early_init(void *handle)if (amdgpu_sriov_vf (adev)) {amdgpu_virt_init_setting (adev); +xgpu_ai_mailbox_set_irq_funcs (adev); }/*
@@ -621,8 +622,23 @@ static int soc15_common_early_init(void *handle)return 0 ; } +static int soc15_common_late_init (void *handle) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)handle; + +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_get_irq (adev); + +return 0 ; +} +static int soc15_common_sw_init (void *handle) { +struct amdgpu_device *adev = (struct amdgpu_device *)handle; + +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_add_irq_id (adev); +return 0 ; }
@@ -653,6 +669,8 @@ static int soc15_common_hw_fini(void *handle)/* disable the doorbell aperture */ soc15_enable_doorbell_aperture (adev, false); +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_put_irq (adev);return 0 ; }
@@ -866,7 +884,7 @@ static int soc15_common_set_powergating_state(void *handle,const struct amd_ip_funcs soc15_common_ip_funcs = { .name ="soc15_common" , .early_init = soc15_common_early_init, - .late_init =NULL , + .late_init = soc15_common_late_init, .sw_init = soc15_common_sw_init, .sw_fini = soc15_common_sw_fini, .hw_init = soc15_common_hw_init,
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): 1491383472-19477-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byRe: [PATCH 6/6] drm/amdgpu:invoke new implemented AI MB func
Quoted 2 lines · Monk Liu
Change-Id I70035e7946e2f66804ae5c3bc846d148c633a057Signed-off-by Monk Liu <[email protected]>
Series is:
Quoted 61 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/soc15.c +19
-2@@ -569,6 +569,7 @@ static int soc15_common_early_init(void *handle)if (amdgpu_sriov_vf (adev)) {amdgpu_virt_init_setting (adev); +xgpu_ai_mailbox_set_irq_funcs (adev); }/* @@ -621,8 +622,23 @@ static int soc15_common_early_init(void *handle)return 0 ; } +static int soc15_common_late_init (void *handle) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)handle; + +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_get_irq (adev); + +return 0 ; +} +static int soc15_common_sw_init (void *handle) { +struct amdgpu_device *adev = (struct amdgpu_device *)handle; + +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_add_irq_id (adev); +return 0 ; }@@ -653,6 +669,8 @@ static int soc15_common_hw_fini(void *handle)/* disable the doorbell aperture */ soc15_enable_doorbell_aperture (adev, false); +if (amdgpu_sriov_vf (adev)) +xgpu_ai_mailbox_put_irq (adev);return 0 ; }@@ -866,7 +884,7 @@ static int soc15_common_set_powergating_state(void *handle,const struct amd_ip_funcs soc15_common_ip_funcs = { .name ="soc15_common" , .early_init = soc15_common_early_init, - .late_init =NULL , + .late_init = soc15_common_late_init, .sw_init = soc15_common_sw_init, .sw_fini = soc15_common_sw_fini, .hw_init = soc15_common_hw_init, --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
Christian König
Reviewed-byAm 05.04.2017 um 11:11 schrieb Monk Liu:
Quoted 8 lines
SRIOV currently only can load ucode directly, and PSP block is not supported by VF temporarily.
will remove this restrict and use PSP load all ucode even for SRIOV later
Change-Id I6df5c4088c7c72d01928d5af8bfe5520447619baSigned-off-by Monk Liu <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0
drivers/gpu/drm/amd/amdgpu/soc15.c int soc15_set_ip_blocks(struct amdgpu_device *adev) · line 504
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1@@ -497,7 +497,8 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_ip_block_add (adev, &mmhub_v1_0_ip_block);amdgpu_ip_block_add (adev, &gmc_v9_0_ip_block);amdgpu_ip_block_add (adev, &vega10_ih_ip_block); -amdgpu_ip_block_add (adev, &psp_v3_1_ip_block); +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) +amdgpu_ip_block_add (adev, &psp_v3_1_ip_block);if (!amdgpu_sriov_vf (adev))amdgpu_ip_block_add (adev, &amdgpu_pp_ip_block);if (adev->enable_virtual_display ||amdgpu_sriov_vf (adev))
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Yu, Xiangliang
Reviewed-by Xiangliang YuQuoted 38 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, April 05, 2017 5:11 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 1/6] drm/amdgpu:add PSP block only load_type=PSPSRIOV currently only can load ucode directly, and PSP block is not supported by VF temporarily.
will remove this restrict and use PSP load all ucode even for SRIOV later
Change-Id I6df5c4088c7c72d01928d5af8bfe5520447619baSigned-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1@@ -497,7 +497,8 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_ip_block_add (adev, &mmhub_v1_0_ip_block);amdgpu_ip_block_add (adev, &gmc_v9_0_ip_block);amdgpu_ip_block_add (adev, &vega10_ih_ip_block); -amdgpu_ip_block_add (adev, &psp_v3_1_ip_block); +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) +amdgpu_ip_block_add (adev, &psp_v3_1_ip_block);if (!amdgpu_sriov_vf (adev))amdgpu_ip_block_add (adev, &amdgpu_pp_ip_block);if (
adev->enable_virtual_display||amdgpu_sriov_vf(adev))
--
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