drm/amdgpu:cleanup intent/format for gfx_v9_0.c
Subsystems (3)
PATCH 1/6 drm/amdgpu:cleanup intent/format for gfx_v9_0.c
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +18 -18
@@ -1271,7 +1271,7 @@ static void gfx_v9_0_init_compute_vmid(struct amdgpu_device *adev) sh_mem_config =SH_MEM_ADDRESS_MODE_64 |SH_MEM_ALIGNMENT_MODE_UNALIGNED << -SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ; +SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ;mutex_lock (&adev->srbm_mutex);for (i =FIRST_COMPUTE_VMID ; i <LAST_COMPUTE_VMID ; i++) {
@@ -1424,7 +1424,7 @@ static void gfx_v9_0_rlc_start(struct amdgpu_device *adev)* default is 0x9C4 to create a 100us interval */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_TIMER_INT_3,0x9C4 );/* RLC_GPM_GENERAL_12 : Minimum gap between wptr and rptr -* to disable the page fault retry interrupts, default is +* to disable the page fault retry interrupts, default is * 0x100 (256) */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_GENERAL_12,0x100 ); }
@@ -1763,7 +1763,7 @@ static int gfx_v9_0_cp_compute_load_microcode(struct amdgpu_device *adev) adev->gfx.mec.mec_fw_gpu_addr & 0xFFFFF000);WREG32_SOC15 (GC ,0 , mmCP_CPC_IC_BASE_HI,upper_32_bits (adev->gfx.mec.mec_fw_gpu_addr)); - +/* MEC1 */ WREG32_SOC15 (GC ,0 , mmCP_MEC_ME1_UCODE_ADDR, mec_hdr->jt_offset);
@@ -2873,27 +2873,27 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,struct amdgpu_ib *ib, unsigned vm_id, bool ctx_switch) { - u32 header, control = 0; + u32 header, control = 0; -if (ib->flags &AMDGPU_IB_FLAG_CE ) - header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); -else - header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); +if (ib->flags &AMDGPU_IB_FLAG_CE ) + header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); +else + header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); - control |= ib->length_dw | (vm_id <<24 ); + control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) - control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) + control |=INDIRECT_BUFFER_PRE_ENB (1 ); -amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ -amdgpu_ring_write (ring, +amdgpu_ring_write (ring, header); +BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +amdgpu_ring_write (ring, #ifdef __BIG_ENDIAN - (2 <<0 ) | + (2 <<0 ) | #endif -lower_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring, control); +lower_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring, control); }#define INDIRECT_BUFFER_VALID (1 << 23)
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): 1493892295-28221-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
PATCH 2/6 drm/amdgpu:unify gfx8/9 ce/de meta_data
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +12 -11
@@ -657,8 +657,8 @@ static void gfx_v8_0_set_gds_init(struct amdgpu_device *adev);static void gfx_v8_0_set_rlc_funcs (struct amdgpu_device *adev);static u32 gfx_v8_0_get_csb_size (struct amdgpu_device *adev);static void gfx_v8_0_get_cu_info (struct amdgpu_device *adev); -static void gfx_v8_0_ring_emit_ce_meta_init (struct amdgpu_ring *ring,uint64_t addr); -static void gfx_v8_0_ring_emit_de_meta_init (struct amdgpu_ring *ring,uint64_t addr); +static void gfx_v8_0_ring_emit_ce_meta (struct amdgpu_ring *ring); +static void gfx_v8_0_ring_emit_de_meta (struct amdgpu_ring *ring);static int gfx_v8_0_compute_mqd_sw_init (struct amdgpu_device *adev);static void gfx_v8_0_compute_mqd_sw_fini (struct amdgpu_device *adev);
@@ -6592,8 +6592,7 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)uint32_t dw2 =0 ;if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_ce_meta_init (ring, - (flags &AMDGPU_VM_DOMAIN ) ?AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr); +gfx_v8_0_ring_emit_ce_meta (ring); dw2 |=0x80000000 ;/* set load_enable otherwise this package is just NOPs */ if (flags &AMDGPU_HAVE_CTX_SWITCH ) {
@@ -6621,8 +6620,7 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)amdgpu_ring_write (ring,0 );if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_de_meta_init (ring, - (flags &AMDGPU_VM_DOMAIN ) ?AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr); +gfx_v8_0_ring_emit_de_meta (ring); }static unsigned gfx_v8_0_ring_emit_init_cond_exec (struct amdgpu_ring *ring)
@@ -7162,7 +7160,7 @@ const struct amdgpu_ip_block_version gfx_v8_1_ip_block = .funcs = &gfx_v8_0_ip_funcs, }; -static void gfx_v8_0_ring_emit_ce_meta_init (struct amdgpu_ring *ring,uint64_t csa_addr) +static void gfx_v8_0_ring_emit_ce_meta (struct amdgpu_ring *ring) {uint64_t ce_payload_addr;int cnt_ce;
@@ -7172,10 +7170,12 @@ static void gfx_v8_0_ring_emit_ce_meta_init(struct amdgpu_ring *ring, uint64_t c } ce_payload = {};if (ring->adev->virt.chained_ib_support) { - ce_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data_chained_ib , ce_payload); + ce_payload_addr =AMDGPU_VA_RESERVED_SIZE -2 *4096 + + offsetof(struct vi_gfx_meta_data_chained_ib , ce_payload); cnt_ce = (sizeof (ce_payload.chained) >>2 ) +4 -2 ; }else { - ce_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data , ce_payload); + ce_payload_addr =AMDGPU_VA_RESERVED_SIZE -2 *4096 + + offsetof(struct vi_gfx_meta_data , ce_payload); cnt_ce = (sizeof (ce_payload.regular) >>2 ) +4 -2 ; }
@@ -7189,15 +7189,16 @@ static void gfx_v8_0_ring_emit_ce_meta_init(struct amdgpu_ring *ring, uint64_t camdgpu_ring_write_multiple (ring, (void *)&ce_payload, cnt_ce -2 ); } -static void gfx_v8_0_ring_emit_de_meta_init (struct amdgpu_ring *ring,uint64_t csa_addr) +static void gfx_v8_0_ring_emit_de_meta (struct amdgpu_ring *ring) { -uint64_t de_payload_addr, gds_addr; +uint64_t de_payload_addr, gds_addr, csa_addr;int cnt_de;static union {struct vi_de_ib_state regular;struct vi_de_ib_state_chained_ib chained; } de_payload = {}; + csa_addr =AMDGPU_VA_RESERVED_SIZE -2 *4096 ; gds_addr = csa_addr +4096 ;if (ring->adev->virt.chained_ib_support) { de_payload.chained.gds_backup_addrlo =lower_32_bits (gds_addr);
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): 1493892295-28221-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 2/6] drm/amdgpu:unify gfx8/9 ce/de meta_data
Quoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Thursday, May 04, 2017 6:05 AM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 2/6] drm/amdgpu:unify gfx8/9 ce/demeta_dataChange-Id I9c9677b2931fa5f6ced8b4842fa336874483e02aSigned-off-by Monk Liu <[email protected]>
Quoted 107 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-2@@ -657,8 +657,8 @@ static void gfx_v8_0_set_gds_init(struct amdgpu_device *adev);static void gfx_v8_0_set_rlc_funcs (struct amdgpu_device *adev);static u32 gfx_v8_0_get_csb_size (struct amdgpu_device *adev);static void gfx_v8_0_get_cu_info (struct amdgpu_device *adev); -static void gfx_v8_0_ring_emit_ce_meta_init (struct amdgpu_ring *ring, uint64_t addr); -static void gfx_v8_0_ring_emit_de_meta_init (struct amdgpu_ring *ring, uint64_t addr); +static void gfx_v8_0_ring_emit_ce_meta (struct amdgpu_ring *ring); +static void gfx_v8_0_ring_emit_de_meta (struct amdgpu_ring *ring);static int
gfx_v8_0_compute_mqd_sw_init(struct amdgpu_device *adev); static voidgfx_v8_0_compute_mqd_sw_fini(struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-2@@ -6592,8 +6592,7 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) uint32_t dw2 = 0;if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_ce_meta_init (ring, - (flags &AMDGPU_VM_DOMAIN ) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr); +gfx_v8_0_ring_emit_ce_meta (ring);dw2 |=
0x80000000; /* setload_enableotherwise this package is just
NOPs */drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-2if (flags &AMDGPU_HAVE_CTX_SWITCH ) {@@ -6621,8 +6620,7 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) amdgpu_ring_write(ring, 0);if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_de_meta_init (ring, - (flags &AMDGPU_VM_DOMAIN ) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr); +gfx_v8_0_ring_emit_de_meta (ring); }static unsigned gfx_v8_0_ring_emit_init_cond_exec(struct
amdgpu_ring
*ring)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-0@@ -7162,7 +7160,7 @@ const struct amdgpu_ip_block_version
gfx_v8_1_ip_block=drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1.funcs = &gfx_v8_0_ip_funcs, }; -static void gfx_v8_0_ring_emit_ce_meta_init(struct amdgpu_ring *ring,
uint64_tcsa_addr)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-0+static void gfx_v8_0_ring_emit_ce_meta (struct amdgpu_ring *ring) {uint64_t ce_payload_addr;int cnt_ce;@@ -7172,10 +7170,12 @@ static voidgfx_v8_0_ring_emit_ce_meta_init(struct
amdgpu_ring*ring,uint64_tcdrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1} ce_payload = {};if (ring->adev->virt.chained_ib_support) { - ce_payload_addr = csa_addr + offsetof(struct
vi_gfx_meta_data_chained_ib,ce_payload);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +3
-0+ ce_payload_addr = AMDGPU_VA_RESERVED_SIZE - 2 * 4096 + + offsetof(struct
vi_gfx_meta_data_chained_ib,ce_payload);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1cnt_ce = (sizeof (ce_payload.chained) >>2 ) +4 -2 ; }else { - ce_payload_addr = csa_addr + offsetof(struct
vi_gfx_meta_data,ce_payload);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +3
-0+ ce_payload_addr = AMDGPU_VA_RESERVED_SIZE - 2 * 4096 + + offsetof(struct
vi_gfx_meta_data,ce_payload);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-0cnt_ce = (sizeof (ce_payload.regular) >>2 ) +4 -2 ; }@@ -7189,15 +7189,16 @@ static voidgfx_v8_0_ring_emit_ce_meta_init(struct
amdgpu_ring*ring,uint64_tcdrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1amdgpu_ring_write_multiple (ring, (void *)&ce_payload, cnt_ce -2 ); } -static void gfx_v8_0_ring_emit_de_meta_init(struct amdgpu_ring *ring,
uint64_tcsa_addr)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +3
-1+static void gfx_v8_0_ring_emit_de_meta (struct amdgpu_ring *ring) { -uint64_t de_payload_addr, gds_addr; +uint64_t de_payload_addr, gds_addr, csa_addr;int cnt_de;static union {struct vi_de_ib_state regular;struct vi_de_ib_state_chained_ib chained; } de_payload = {}; + csa_addr =AMDGPU_VA_RESERVED_SIZE -2 *4096 ; gds_addr = csa_addr +4096 ;if (ring->adev->virt.chained_ib_support) { de_payload.chained.gds_backup_addrlo =
lower_32_bits(gds_addr);
--
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 3/6 drm/amdgpu:change SR-IOV DMAframe scheme
In reply to a message not in the archiveAccording to CP/hw team requirment, to support PAL/CHAINED-IB MCBP, kernel driver must guarantee DE_META must be inserted right prior to the work_load DE IB (with PREEMPT flag), there cannot be any non-work_load DE IB between-in DE_META and work_load DE IB.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +++++---- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +5 -4
@@ -6407,9 +6407,13 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && ib->flags &AMDGPU_IB_FLAG_PREEMPT ) +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) { control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (!(ib->flags &AMDGPU_IB_FLAG_CE )) +gfx_v8_0_ring_emit_de_meta (ring); + } +amdgpu_ring_write (ring, header); amdgpu_ring_write(ring,#ifdef __BIG_ENDIAN
@@ -6618,9 +6622,6 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)amdgpu_ring_write (ring,PACKET3 (PACKET3_CONTEXT_CONTROL ,1 ));amdgpu_ring_write (ring, dw2);amdgpu_ring_write (ring,0 ); - -if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_de_meta (ring); }static unsigned gfx_v8_0_ring_emit_init_cond_exec (struct amdgpu_ring *ring)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -4
@@ -119,6 +119,7 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev, struct amdgpu_cu_info *cu_info);static uint64_t gfx_v9_0_get_gpu_clock_counter (struct amdgpu_device *adev);static void gfx_v9_0_select_se_sh (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 instance); +static void gfx_v9_0_ring_emit_de_meta (struct amdgpu_ring *ring);static void gfx_v9_0_init_golden_registers (struct amdgpu_device *adev) {
@@ -2882,9 +2883,13 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) { control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (!(ib->flags &AMDGPU_IB_FLAG_CE )) +gfx_v9_0_ring_emit_de_meta (ring); + } +amdgpu_ring_write (ring, header);BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring,
@@ -3124,9 +3129,6 @@ static void gfx_v9_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)amdgpu_ring_write (ring,PACKET3 (PACKET3_CONTEXT_CONTROL ,1 ));amdgpu_ring_write (ring, dw2);amdgpu_ring_write (ring,0 ); - -if (amdgpu_sriov_vf (ring->adev)) -gfx_v9_0_ring_emit_de_meta (ring); }static unsigned gfx_v9_0_ring_emit_init_cond_exec (struct amdgpu_ring *ring)
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): 1493892295-28221-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 3/6] drm/amdgpu:change SR-IOV DMAframe scheme
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Thursday, May 04, 2017 6:05 AM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 3/6] drm/amdgpu:change SR-IOV DMAframe scheme
Quoted 8 lines
According to CP/hw team requirment, to support PAL/CHAINED-IB MCBP, kernel driver must guarantee
DE_METAmust be inserted right prior to thework_loadDE IB (with PREEMPT flag), there cannot be any non-work_load DE IB between-inDE_METAandwork_loadDE IB.Change-Id Ie060f1a39effa1edd5e3bf10c08624ffc82dfa44Signed-off-by Monk Liu <[email protected]>
Quoted 91 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +++++---- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +5
-1@@ -6407,9 +6407,13 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && ib->flags & AMDGPU_IB_FLAG_PREEMPT) +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) { control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (!(ib->flags &AMDGPU_IB_FLAG_CE )) +gfx_v8_0_ring_emit_de_meta (ring); + } +drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3amdgpu_ring_write (ring, header); amdgpu_ring_write(ring,#ifdef __BIG_ENDIAN@@ -6618,9 +6622,6 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) amdgpu_ring_write(ring, PACKET3(PACKET3_CONTEXT_CONTROL, 1));amdgpu_ring_write (ring, dw2);amdgpu_ring_write (ring,0 ); - -if (amdgpu_sriov_vf (ring->adev)) -gfx_v8_0_ring_emit_de_meta (ring); }static unsigned gfx_v8_0_ring_emit_init_cond_exec(struct
amdgpu_ring
*ring)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-0@@ -119,6 +119,7 @@ static int gfx_v9_0_get_cu_info(structamdgpu_device *adev, struct amdgpu_cu_info *cu_info);static uint64_t gfx_v9_0_get_gpu_clock_counter (struct amdgpu_device *adev);static void gfx_v9_0_select_se_sh (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 instance); +static void gfx_v9_0_ring_emit_de_meta (struct amdgpu_ring *ring);static void
gfx_v9_0_init_golden_registers(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5
-1@@ -2882,9 +2883,13 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) { control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (!(ib->flags &AMDGPU_IB_FLAG_CE )) +gfx_v9_0_ring_emit_de_meta (ring); + } +drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-3amdgpu_ring_write (ring, header);BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring,@@ -3124,9 +3129,6 @@ static void gfx_v9_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) amdgpu_ring_write(ring, PACKET3(PACKET3_CONTEXT_CONTROL, 1));amdgpu_ring_write (ring, dw2);amdgpu_ring_write (ring,0 ); - -if (amdgpu_sriov_vf (ring->adev)) -gfx_v9_0_ring_emit_de_meta (ring); }static unsigned gfx_v9_0_ring_emit_init_cond_exec(struct
amdgpu_ring
*ring)
--
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:new PM4 entry for VI/AI
In reply to a message not in the archiveTMZ package will be used for VULKAN/CHAINED-IB MCBP
--- drivers/gpu/drm/amd/amdgpu/soc15d.h | 7 +++++++ drivers/gpu/drm/amd/amdgpu/vid.h | 6 ++++++ 2 files changed, 13 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc15d.h +7 -0
@@ -259,6 +259,13 @@#define PACKET3_WAIT_ON_CE_COUNTER 0x86#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88#define PACKET3_SWITCH_BUFFER 0x8B +#define PACKET3_FRAME_CONTROL 0x90 +# define FRAME_CMD (x) ((x) << 28) +/* +* x=0: tmz_begin +* x=1: tmz_end +*/ +#define PACKET3_SET_RESOURCES 0xA0#define PACKET3_MAP_QUEUES 0xA2
drivers/gpu/drm/amd/amdgpu/vid.h +6 -0
@@ -361,6 +361,12 @@#define PACKET3_WAIT_ON_CE_COUNTER 0x86#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88#define PACKET3_SWITCH_BUFFER 0x8B +#define PACKET3_FRAME_CONTROL 0x90 +# define FRAME_CMD (x) ((x) << 28) +/* +* x=0: tmz_begin +* x=1: tmz_end +*/ #define PACKET3_SET_RESOURCES 0xA0/* 1. header * 2. CONTROL
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): 1493892295-28221-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 4/6] drm/amdgpu:new PM4 entry for VI/AI
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Thursday, May 04, 2017 6:05 AM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 4/6] drm/amdgpu:new PM4 entry for VI/AI
Quoted 4 lines
TMZ package will be used for VULKAN/CHAINED-IB MCBP
Change-Id I25b82e753d078a2e3eed53a36a40798cb74d71f9Signed-off-by Monk Liu <[email protected]>
Quoted 47 lines
--- drivers/gpu/drm/amd/amdgpu/soc15d.h | 7 +++++++ drivers/gpu/drm/amd/amdgpu/vid.h | 6 ++++++ 2 files changed, 13 insertions(+)drivers/gpu/drm/amd/amdgpu/soc15d.h +7
-0@@ -259,6 +259,13 @@#define PACKET3_WAIT_ON_CE_COUNTER 0x86#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88#define PACKET3_SWITCH_BUFFER 0x8B +#define PACKET3_FRAME_CONTROL 0x90 +# define FRAME_CMD (x) ((x) << 28) +/* +* x=0: tmz_begin +* x=1: tmz_end +*/ +#define PACKET3_SET_RESOURCES 0xA0#define PACKET3_MAP_QUEUES 0xA2drivers/gpu/drm/amd/amdgpu/vid.h +6
-0@@ -361,6 +361,12 @@#define PACKET3_WAIT_ON_CE_COUNTER 0x86#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88#define PACKET3_SWITCH_BUFFER 0x8B +#define PACKET3_FRAME_CONTROL 0x90 +# define FRAME_CMD (x) ((x) << 28) +/* +* x=0: tmz_begin +* x=1: tmz_end +*/ #define PACKET3_SET_RESOURCES 0xA0/* 1. header * 2. CONTROL
--
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 5/6 drm/amdgpu:use FRAME_CNTL for new GFX ucode
In reply to a message not in the archiveVI/AI affected:
CP/HW team requires KMD insert FRAME_CONTROL(end) after the last IB and before the fence of this DMAframe.
this is to make sure the cache are flushed, and it's a must change no matter MCBP/SR-IOV or bare-metal case because new CP hw won't do the cache flush for each IB anymore, it just leaves it to KMD now.
with this patch, certain MCBP hang issue when rendering vulkan/chained-ib are resolved.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 11 +++++++++++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++++++ include/uapi/drm/amdgpu_drm.h | 2 ++ 5 files changed, 28 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +3 -0
@@ -201,6 +201,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */continue ; +if (i == num_ibs -1 ) + ib->flags |=AMDGPU_IB_FLAG_LAST ; +amdgpu_ring_emit_ib (ring, ib, job ? job->vm_id :0 , need_ctx_switch); need_ctx_switch = false;
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1 -0
@@ -143,6 +143,7 @@ struct amdgpu_ring_funcs {void (*emit_cntxcntl) (struct amdgpu_ring *ring,uint32_t flags);void (*emit_rreg)(struct amdgpu_ring *ring,uint32_t reg);void (*emit_wreg)(struct amdgpu_ring *ring,uint32_t reg,uint32_t val); +void (*emit_tmz)(struct amdgpu_ring *ring,bool start); };struct amdgpu_ring {
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +11 -0
@@ -6422,6 +6422,10 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, (ib->gpu_addr & 0xFFFFFFFC));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr) &0xFFFF );amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); } static void gfx_v8_0_ring_emit_ib_compute(struct amdgpu_ring *ring,
@@ -6651,6 +6655,12 @@ static void gfx_v8_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size >>2 ) - offset + cur; } +static void gfx_v8_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v8_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {
@@ -6932,6 +6942,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, .init_cond_exec = gfx_v8_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v8_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v8_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11 -0
@@ -2899,6 +2899,10 @@ BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ lower_32_bits(ib->gpu_addr));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr));amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); }#define INDIRECT_BUFFER_VALID (1 << 23)
@@ -3156,6 +3160,12 @@ static void gfx_v9_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size>>2 ) - offset + cur; } +static void gfx_v9_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v9_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {struct amdgpu_device *adev = ring->adev;
@@ -3490,6 +3500,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v9_ring_emit_cntxcntl, .init_cond_exec = gfx_v9_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v9_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v9_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
include/uapi/drm/amdgpu_drm.h +2 -0
@@ -478,6 +478,8 @@ union drm_amdgpu_cs {/* Preempt flag, IB should set Pre_enb bit if PREEMPT flag detected */ #define AMDGPU_IB_FLAG_PREEMPT (1<<2) +#define AMDGPU_IB_FLAG_LAST (1<<3) +struct drm_amdgpu_cs_chunk_ib {__u32 _pad;/** AMDGPU_IB_FLAG_* */
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): 1493892295-28221-5-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 5/6] drm/amdgpu:use FRAME_CNTL for new GFX ucode
Quoted 28 lines · Monk Liu
VI/AI affected:
CP/HW team requires KMD insert
FRAME_CONTROL(end)after the last IB and before the fence of this DMAframe.this is to make sure the cache are flushed, and it's a must change no matter MCBP/SR-IOV or bare-metal case because new CP hw won't do the cache flush for each IB anymore, it just leaves it to KMD now.
with this patch, certain MCBP hang issue when rendering vulkan/chained-ib are resolved.
Change-Id I34ee7528aa32e704b2850bc6d50774b24c29b840Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 11 +++++++++++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++++++ include/uapi/drm/amdgpu_drm.h | 2 ++ 5 files changed, 28 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 205
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2
-0@@ -201,6 +201,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */continue ; +if (i == num_ibs -1 ) + ib->flags |=AMDGPU_IB_FLAG_LAST ;
We can wrap the ring func like amdgpu_ring_emit_tmz(), and add it before emit fence. Or how about to insert it to gfx emit fence?
Regards,
David Zhou
Quoted 93 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0+amdgpu_ring_emit_ib (ring, ib, job ? job->vm_id :0 , need_ctx_switch); need_ctx_switch = false;drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1
-0@@ -143,6 +143,7 @@ struct amdgpu_ring_funcs {void (*emit_cntxcntl) (struct amdgpu_ring *ring,uint32_t flags);void (*emit_rreg)(struct amdgpu_ring *ring,uint32_t reg);void (*emit_wreg)(struct amdgpu_ring *ring,uint32_t reg,uint32_t val); +void (*emit_tmz)(struct amdgpu_ring *ring,bool start); };struct amdgpu_ring {drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +11
-0@@ -6422,6 +6422,10 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, (ib->gpu_addr & 0xFFFFFFFC));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr) &0xFFFF );amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); } static void gfx_v8_0_ring_emit_ib_compute(struct amdgpu_ring *ring,@@ -6651,6 +6655,12 @@ static void gfx_v8_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size >>2 ) - offset + cur; } +static void gfx_v8_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v8_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {@@ -6932,6 +6942,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, .init_cond_exec = gfx_v8_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v8_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v8_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11
-0@@ -2899,6 +2899,10 @@ BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ lower_32_bits(ib->gpu_addr));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr));amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); }#define INDIRECT_BUFFER_VALID (1 << 23)@@ -3156,6 +3160,12 @@ static void gfx_v9_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size>>2 ) - offset + cur; } +static void gfx_v9_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v9_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {struct amdgpu_device *adev = ring->adev;@@ -3490,6 +3500,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v9_ring_emit_cntxcntl, .init_cond_exec = gfx_v9_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v9_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v9_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {include/uapi/drm/amdgpu_drm.h +0
-0
include/uapi/drm/amdgpu_drm.h union drm_amdgpu_cs { · line 485
Quoted 8 lines
include/uapi/drm/amdgpu_drm.h +2
-0@@ -478,6 +478,8 @@ union drm_amdgpu_cs {/* Preempt flag, IB should set Pre_enb bit if PREEMPT flag detected */ #define AMDGPU_IB_FLAG_PREEMPT (1<<2) +#define AMDGPU_IB_FLAG_LAST (1<<3) +struct drm_amdgpu_cs_chunk_ib {__u32 _pad;/** AMDGPU_IB_FLAG_* */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 5/6] drm/amdgpu:use FRAME_CNTL for new GFX ucode
In reply to a message not in the archiveQuoted 28 lines · Monk Liu
VI/AI affected:
CP/HW team requires KMD insert
FRAME_CONTROL(end)after the last IB and before the fence of this DMAframe.this is to make sure the cache are flushed, and it's a must change no matter MCBP/SR-IOV or bare-metal case because new CP hw won't do the cache flush for each IB anymore, it just leaves it to KMD now.
with this patch, certain MCBP hang issue when rendering vulkan/chained-ib are resolved.
Change-Id I34ee7528aa32e704b2850bc6d50774b24c29b840Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 11 +++++++++++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 11 +++++++++++ include/uapi/drm/amdgpu_drm.h | 2 ++ 5 files changed, 28 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 205
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2
-0@@ -201,6 +201,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */continue ; +if (i == num_ibs -1 ) + ib->flags |=AMDGPU_IB_FLAG_LAST ;
We can wrap the ring func like amdgpu_ring_emit_tmz(), and add it before emit fence.
Regards,
David Zhou
Quoted 93 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0+amdgpu_ring_emit_ib (ring, ib, job ? job->vm_id :0 , need_ctx_switch); need_ctx_switch = false;drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1
-0@@ -143,6 +143,7 @@ struct amdgpu_ring_funcs {void (*emit_cntxcntl) (struct amdgpu_ring *ring,uint32_t flags);void (*emit_rreg)(struct amdgpu_ring *ring,uint32_t reg);void (*emit_wreg)(struct amdgpu_ring *ring,uint32_t reg,uint32_t val); +void (*emit_tmz)(struct amdgpu_ring *ring,bool start); };struct amdgpu_ring {drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +11
-0@@ -6422,6 +6422,10 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, (ib->gpu_addr & 0xFFFFFFFC));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr) &0xFFFF );amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); } static void gfx_v8_0_ring_emit_ib_compute(struct amdgpu_ring *ring,@@ -6651,6 +6655,12 @@ static void gfx_v8_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size >>2 ) - offset + cur; } +static void gfx_v8_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v8_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {@@ -6932,6 +6942,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, .init_cond_exec = gfx_v8_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v8_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v8_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11
-0@@ -2899,6 +2899,10 @@ BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ lower_32_bits(ib->gpu_addr));amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr));amdgpu_ring_write (ring, control); + +/* insert FRAME_CONTROL (end) after the last IB */ +if (ib->flags &AMDGPU_IB_FLAG_LAST && ring->funcs->emit_tmz) + ring->funcs->emit_tmz (ring, false); }#define INDIRECT_BUFFER_VALID (1 << 23)@@ -3156,6 +3160,12 @@ static void gfx_v9_0_ring_emit_patch_cond_exec(struct amdgpu_ring *ring, unsigne ring->ring[offset] = (ring->ring_size>>2 ) - offset + cur; } +static void gfx_v9_0_ring_emit_tmz (struct amdgpu_ring *ring,bool start) +{ +amdgpu_ring_write (ring,PACKET3 (PACKET3_FRAME_CONTROL ,0 )); +amdgpu_ring_write (ring,FRAME_CMD (start ?0 :1 ));/* frame_end */ +} +static void gfx_v9_0_ring_emit_rreg (struct amdgpu_ring *ring,uint32_t reg) {struct amdgpu_device *adev = ring->adev;@@ -3490,6 +3500,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v9_ring_emit_cntxcntl, .init_cond_exec = gfx_v9_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v9_0_ring_emit_patch_cond_exec, + .emit_tmz = gfx_v9_0_ring_emit_tmz, };static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {include/uapi/drm/amdgpu_drm.h +0
-0
include/uapi/drm/amdgpu_drm.h union drm_amdgpu_cs { · line 485
Quoted 8 lines
include/uapi/drm/amdgpu_drm.h +2
-0@@ -478,6 +478,8 @@ union drm_amdgpu_cs {/* Preempt flag, IB should set Pre_enb bit if PREEMPT flag detected */ #define AMDGPU_IB_FLAG_PREEMPT (1<<2) +#define AMDGPU_IB_FLAG_LAST (1<<3) +struct drm_amdgpu_cs_chunk_ib {__u32 _pad;/** AMDGPU_IB_FLAG_* */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu:cleanup flag not used
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 -- 2 files changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -1
@@ -1124,7 +1124,6 @@ struct amdgpu_cs_parser {#define AMDGPU_PREAMBLE_IB_PRESENT (1 << 0)/* bit set means command submit involves a preamble IB */ #define AMDGPU_PREAMBLE_IB_PRESENT_FIRST (1 << 1)/* bit set means preamble IB is first presented in belonging context */ #define AMDGPU_HAVE_CTX_SWITCH (1 << 2)/* bit set means context switch occured */ -#define AMDGPU_VM_DOMAIN (1 << 3)/* bit set means in virtual memory context */ struct amdgpu_job {struct amd_sched_job base;
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -2
@@ -186,8 +186,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, status |=AMDGPU_HAVE_CTX_SWITCH ; status |= job->preamble_status; -if (vm) - status |=AMDGPU_VM_DOMAIN ;amdgpu_ring_emit_cntxcntl (ring, status); }
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): 1493892295-28221-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 6/6] drm/amdgpu:cleanup flag not used
Quoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Thursday, May 04, 2017 6:05 AM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 6/6] drm/amdgpu:cleanup flag not usedChange-Id I0f1727595983f144cae2d3e6d860635371c125f0Signed-off-by Monk Liu <[email protected]>
Quoted 40 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 -- 2 files changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0@@ -1124,7 +1124,6 @@ struct amdgpu_cs_parser {#define AMDGPU_PREAMBLE_IB_PRESENT (1 << 0)/* bit set means command submit involves a preamble IB */
#defineAMDGPU_PREAMBLE_IB_PRESENT_FIRST(1 << 1) /* bit set means
preamble IB is first presented in belonging context */
#defineAMDGPU_HAVE_CTX_SWITCH(1 << 2) /* bit set means
context switch occured */
-#defineAMDGPU_VM_DOMAIN(1 << 3) /* bit set means in
virtual memory context */struct
amdgpu_job{drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0struct amd_sched_job base;drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0
-3@@ -186,8 +186,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring,unsigned num_ibs, status |= AMDGPU_HAVE_CTX_SWITCH; status |= job->preamble_status; -if (vm) - status |=AMDGPU_VM_DOMAIN ;amdgpu_ring_emit_cntxcntl (ring, status); } --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
Am 04.05.2017 um 12:04 schrieb Monk Liu:
Quoted 2 lines
Change-Id I5207135ce1356317efd43b65d9edb172a92f6374Signed-off-by Monk Liu <[email protected]>
Patches #1 - #4 and #6 are Reviewed-by: Christian König <[email protected]>
For patch #5: better call this directly from amdgpu_ib_schedule.
Regards,
Christian.
Quoted 68 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +15
-15@@ -1271,7 +1271,7 @@ static void gfx_v9_0_init_compute_vmid(struct amdgpu_device *adev) sh_mem_config =SH_MEM_ADDRESS_MODE_64 |SH_MEM_ALIGNMENT_MODE_UNALIGNED << -SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ; +SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ;mutex_lock (&adev->srbm_mutex);for (i =FIRST_COMPUTE_VMID ; i <LAST_COMPUTE_VMID ; i++) {@@ -1424,7 +1424,7 @@ static void gfx_v9_0_rlc_start(struct amdgpu_device *adev)* default is 0x9C4 to create a 100us interval */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_TIMER_INT_3,0x9C4 );/* RLC_GPM_GENERAL_12 : Minimum gap between wptr and rptr -* to disable the page fault retry interrupts, default is +* to disable the page fault retry interrupts, default is * 0x100 (256) */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_GENERAL_12,0x100 ); }@@ -1763,7 +1763,7 @@ static int gfx_v9_0_cp_compute_load_microcode(struct amdgpu_device *adev) adev->gfx.mec.mec_fw_gpu_addr & 0xFFFFF000);WREG32_SOC15 (GC ,0 , mmCP_CPC_IC_BASE_HI,upper_32_bits (adev->gfx.mec.mec_fw_gpu_addr)); - +/* MEC1 */ WREG32_SOC15 (GC ,0 , mmCP_MEC_ME1_UCODE_ADDR, mec_hdr->jt_offset);@@ -2873,27 +2873,27 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,struct amdgpu_ib *ib, unsigned vm_id, bool ctx_switch) { - u32 header, control = 0; + u32 header, control = 0; -if (ib->flags &AMDGPU_IB_FLAG_CE ) - header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); -else - header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); +if (ib->flags &AMDGPU_IB_FLAG_CE ) + header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); +else + header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); - control |= ib->length_dw | (vm_id <<24 ); + control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) - control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) + control |=INDIRECT_BUFFER_PRE_ENB (1 ); -amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ - amdgpu_ring_write(ring, +amdgpu_ring_write (ring, header); +BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ + amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN - (2 << 0) | + (2 << 0) |
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, · line 2899
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-3#endif - lower_32_bits(ib->gpu_addr)); -amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring, control); + lower_32_bits(ib->gpu_addr)); +amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring, control); }#define INDIRECT_BUFFER_VALID (1 << 23)
_______________________________________________
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): 3d118149-8188-a6b3-db17-0553499ce132-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Okay, changed as you and David suggest
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Thursday, May 04, 2017 6:17 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH 1/6] drm/amdgpu:cleanup intent/format for gfx_v9_0.c
Am 04.05.2017 um 12:04 schrieb Monk Liu:
Quoted 2 lines
Change-Id I5207135ce1356317efd43b65d9edb172a92f6374Signed-off-by Monk Liu <[email protected]>
Patches #1 - #4 and #6 are Reviewed-by: Christian König <[email protected]>
For patch #5: better call this directly from amdgpu_ib_schedule.
Regards,
Christian.
Quoted 70 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -1271,7 +1271,7 @@ static void gfx_v9_0_init_compute_vmid(struct amdgpu_device *adev) sh_mem_config =SH_MEM_ADDRESS_MODE_64 |SH_MEM_ALIGNMENT_MODE_UNALIGNED << -SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ; +SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ;mutex_lock (&adev->srbm_mutex);for (i =
FIRST_COMPUTE_VMID; i <LAST_COMPUTE_VMID; i++) { @@
-1424,7 +1424,7 @@ static voidgfx_v9_0_rlc_start(struct amdgpu_device *adev)
* default is0x9C4to create a 100us interval */
WREG32_SOC15(GC, 0, mmRLC_GPM_TIMER_INT_3, 0x9C4); /*RLC_GPM_GENERAL_12: Minimum gap between wptr and rptrdrivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +14
-14-* to disable the page fault retry interrupts, default is +* to disable the page fault retry interrupts, default is * 0x100 (256) */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_GENERAL_12,0x100 ); }@@ -1763,7 +1763,7 @@ static int gfx_v9_0_cp_compute_load_microcode(struct amdgpu_device *adev) adev->gfx.mec.mec_fw_gpu_addr & 0xFFFFF000);WREG32_SOC15 (GC ,0 , mmCP_CPC_IC_BASE_HI,upper_32_bits (adev->gfx.mec.mec_fw_gpu_addr)); - +/* MEC1 */ WREG32_SOC15 (GC ,0 , mmCP_MEC_ME1_UCODE_ADDR, mec_hdr->jt_offset);@@ -2873,27 +2873,27 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,struct amdgpu_ib *ib, unsigned vm_id, bool ctx_switch) { - u32 header, control = 0; + u32 header, control = 0; -if (ib->flags &AMDGPU_IB_FLAG_CE ) - header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); -else - header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); +if (ib->flags &AMDGPU_IB_FLAG_CE ) + header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); +else + header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); - control |= ib->length_dw | (vm_id <<24 ); + control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) - control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) + control |=INDIRECT_BUFFER_PRE_ENB (1 ); -amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ - amdgpu_ring_write(ring, +amdgpu_ring_write (ring, header); +BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ + amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN - (2 << 0) | + (2 << 0) |
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, · line 2899
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-3#endif - lower_32_bits(ib->gpu_addr)); -amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring, control); + lower_32_bits(ib->gpu_addr)); +amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring, control); }#define INDIRECT_BUFFER_VALID (1 << 23)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Thursday, May 04, 2017 6:05 AM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 1/6] drm/amdgpu:cleanup intent/format forgfx_v9_0.cChange-Id I5207135ce1356317efd43b65d9edb172a92f6374Signed-off-by Monk Liu <[email protected]>
Quoted 86 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 36 +++++++++++++++++------- ----------- 1 file changed, 18 insertions(+), 18 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -1271,7 +1271,7 @@ static void gfx_v9_0_init_compute_vmid(struct amdgpu_device *adev) sh_mem_config =SH_MEM_ADDRESS_MODE_64 |SH_MEM_ALIGNMENT_MODE_UNALIGNED << -SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ; +SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT ;mutex_lock (&adev->srbm_mutex);drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0
-0for (i =FIRST_COMPUTE_VMID ; i <LAST_COMPUTE_VMID ; i++) {@@ -1424,7 +1424,7 @@ static void gfx_v9_0_rlc_start(structamdgpu_device *adev) * default is 0x9C4 to create a 100us interval */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_TIMER_INT_3,0x9C4 );/* RLC_GPM_GENERAL_12 : Minimum gap between wptr and rptr
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-2-* to disable the page fault retry interrupts, default is +* to disable the page fault retry interrupts, default is * 0x100 (256) */ WREG32_SOC15 (GC ,0 , mmRLC_GPM_GENERAL_12,0x100 ); }@@ -1763,7 +1763,7 @@ static int gfx_v9_0_cp_compute_load_microcode(struct amdgpu_device *adev) adev->gfx.mec.mec_fw_gpu_addr & 0xFFFFF000);WREG32_SOC15 (GC ,0 , mmCP_CPC_IC_BASE_HI,upper_32_bits (adev->gfx.mec.mec_fw_gpu_addr)); - +/* MEC1 */ WREG32_SOC15(GC, 0, mmCP_MEC_ME1_UCODE_ADDR,drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +15
-15mec_hdr->jt_offset);@@ -2873,27 +2873,27 @@ static void gfx_v9_0_ring_emit_ib_gfx(structamdgpu_ring *ring, struct amdgpu_ib *ib, unsigned vm_id, bool ctx_switch) { - u32 header, control = 0; + u32 header, control = 0; -if (ib->flags &AMDGPU_IB_FLAG_CE ) - header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); -else - header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); +if (ib->flags &AMDGPU_IB_FLAG_CE ) + header =PACKET3 (PACKET3_INDIRECT_BUFFER_CONST ,2 ); +else + header =PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ); - control |= ib->length_dw | (vm_id <<24 ); + control |= ib->length_dw | (vm_id <<24 ); -if (amdgpu_sriov_vf (ring->adev) && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) - control |=INDIRECT_BUFFER_PRE_ENB (1 ); +if (amdgpu_sriov_vf (ring->adev) && (ib->flags &AMDGPU_IB_FLAG_PREEMPT )) + control |=INDIRECT_BUFFER_PRE_ENB (1 ); -amdgpu_ring_write (ring ,header ); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ -amdgpu_ring_write (ring, +amdgpu_ring_write (ring, header); +BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +amdgpu_ring_write (ring, #ifdef __BIG_ENDIAN - (2 <<0 ) | + (2 <<0 ) | #endif -lower_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); -amdgpu_ring_write (ring, control); +lower_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring,upper_32_bits (ib->gpu_addr)); +amdgpu_ring_write (ring, control);}
Quoted 8 lines
#define
INDIRECT_BUFFER_VALID(1 << 23)
--
2.7.4_______________________________________________
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