	.file	"extr_uvd_v6_0.c_uvd_v6_0_hw_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"amdgpu: ring failed to lock UVD ring (%d).\n"
	.align 8
.LC1:
	.string	"UVD and UVD ENC initialized successfully.\n"
	.align 8
.LC2:
	.string	"UVD initialized successfully.\n"
	.text
	.p2align 4
	.type	uvd_v6_0_hw_init, @function
uvd_v6_0_hw_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	edx, 10000
	mov	esi, 10000
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rax, QWORD PTR 8[rdi]
	mov	rbp, rdi
	lea	r12, 8[rax]
	call	amdgpu_asic_set_uvd_clocks@PLT
	mov	esi, DWORD PTR AMD_CG_STATE_UNGATE[rip]
	mov	rdi, rbp
	call	uvd_v6_0_set_clockgating_state@PLT
	mov	esi, 1
	mov	rdi, rbp
	call	uvd_v6_0_enable_mgcg@PLT
	mov	rdi, r12
	call	amdgpu_ring_test_helper@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L14
.L1:
	mov	eax, r13d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	esi, 10
	mov	rdi, r12
	call	amdgpu_ring_alloc@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L15
	mov	edi, DWORD PTR mmUVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL[rip]
	xor	esi, esi
	call	PACKET0@PLT
	mov	rdi, r12
	mov	esi, eax
	call	amdgpu_ring_write@PLT
	mov	esi, 1048575
	mov	rdi, r12
	call	amdgpu_ring_write@PLT
	mov	edi, DWORD PTR mmUVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL[rip]
	xor	esi, esi
	call	PACKET0@PLT
	mov	rdi, r12
	mov	esi, eax
	call	amdgpu_ring_write@PLT
	mov	esi, 1048575
	mov	rdi, r12
	call	amdgpu_ring_write@PLT
	mov	edi, DWORD PTR mmUVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL[rip]
	xor	esi, esi
	call	PACKET0@PLT
	mov	rdi, r12
	mov	esi, eax
	call	amdgpu_ring_write@PLT
	mov	esi, 1048575
	mov	rdi, r12
	call	amdgpu_ring_write@PLT
	mov	edi, DWORD PTR mmUVD_SEMA_TIMEOUT_STATUS[rip]
	xor	esi, esi
	call	PACKET0@PLT
	mov	rdi, r12
	mov	esi, eax
	call	amdgpu_ring_write@PLT
	mov	esi, 8
	mov	rdi, r12
	call	amdgpu_ring_write@PLT
	mov	edi, DWORD PTR mmUVD_SEMA_CNTL[rip]
	xor	esi, esi
	call	PACKET0@PLT
	mov	rdi, r12
	mov	esi, eax
	call	amdgpu_ring_write@PLT
	mov	esi, 3
	mov	rdi, r12
	call	amdgpu_ring_write@PLT
	mov	rdi, r12
	call	amdgpu_ring_commit@PLT
	mov	rdi, rbp
	call	uvd_v6_0_enc_support@PLT
	test	rax, rax
	je	.L4
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L4
	xor	r12d, r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	add	r12, 1
	cmp	DWORD PTR 0[rbp], r12d
	jle	.L4
.L5:
	mov	rax, QWORD PTR 8[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rdi, [rax+r12*4]
	call	amdgpu_ring_test_helper@PLT
	test	eax, eax
	je	.L16
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbp
	call	uvd_v6_0_enc_support@PLT
	test	rax, rax
	je	.L6
	lea	rdi, .LC1[rip]
	call	DRM_INFO@PLT
	mov	eax, r13d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	lea	rdi, .LC2[rip]
	call	DRM_INFO@PLT
	mov	eax, r13d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	esi, eax
	lea	rdi, .LC0[rip]
	call	DRM_ERROR@PLT
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	uvd_v6_0_hw_init, .-uvd_v6_0_hw_init
	.comm	mmUVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_TIMEOUT_STATUS,4,4
	.comm	mmUVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_CNTL,4,4
	.comm	AMD_CG_STATE_UNGATE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_uvd_v6_0.c_uvd_v6_0_hw_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"amdgpu: ring failed to lock UVD ring (%d).\012\000"
	.align	2
.LC1:
	.ascii	"UVD and UVD ENC initialized successfully.\012\000"
	.align	2
.LC2:
	.ascii	"UVD initialized successfully.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	uvd_v6_0_hw_init, %function
uvd_v6_0_hw_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r2, .L17
	ldr	r6, [r0, #4]
	mov	r1, r2
	bl	amdgpu_asic_set_uvd_clocks
	ldr	r3, .L17+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	uvd_v6_0_set_clockgating_state
	add	r6, r6, #4
	mov	r1, #1
	mov	r0, r4
	bl	uvd_v6_0_enable_mgcg
	mov	r0, r6
	bl	amdgpu_ring_test_helper
	subs	r5, r0, #0
	beq	.L14
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L14:
	mov	r1, #10
	mov	r0, r6
	bl	amdgpu_ring_alloc
	subs	r5, r0, #0
	bne	.L15
	ldr	r3, .L17+8
	mov	r1, r5
	ldr	r0, [r3]
	bl	PACKET0
	mov	r1, r0
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r1, .L17+12
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r3, .L17+16
	mov	r1, r5
	ldr	r0, [r3]
	bl	PACKET0
	mov	r1, r0
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r1, .L17+12
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r3, .L17+20
	mov	r1, r5
	ldr	r0, [r3]
	bl	PACKET0
	mov	r1, r0
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r1, .L17+12
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r3, .L17+24
	mov	r1, r5
	ldr	r0, [r3]
	bl	PACKET0
	mov	r1, r0
	mov	r0, r6
	bl	amdgpu_ring_write
	mov	r1, #8
	mov	r0, r6
	bl	amdgpu_ring_write
	ldr	r3, .L17+28
	mov	r1, r5
	ldr	r0, [r3]
	bl	PACKET0
	mov	r1, r0
	mov	r0, r6
	bl	amdgpu_ring_write
	mov	r1, #3
	mov	r0, r6
	bl	amdgpu_ring_write
	mov	r0, r6
	bl	amdgpu_ring_commit
	mov	r0, r4
	bl	uvd_v6_0_enc_support
	cmp	r0, #0
	beq	.L4
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L4
	mov	r6, r5
	b	.L5
.L16:
	ldr	r3, [r4]
	cmp	r3, r6
	ble	.L4
.L5:
	ldr	r3, [r4, #4]
	ldr	r0, [r3]
	add	r0, r0, r6, lsl #2
	bl	amdgpu_ring_test_helper
	cmp	r0, #0
	add	r6, r6, #1
	beq	.L16
	mov	r5, r0
	b	.L1
.L4:
	mov	r0, r4
	bl	uvd_v6_0_enc_support
	subs	r3, r0, #0
	moveq	r5, r3
	ldrne	r0, .L17+32
	ldreq	r0, .L17+36
	bl	DRM_INFO
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L15:
	mov	r1, r5
	ldr	r0, .L17+40
	bl	DRM_ERROR
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L18:
	.align	2
.L17:
	.word	10000
	.word	AMD_CG_STATE_UNGATE
	.word	mmUVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL
	.word	1048575
	.word	mmUVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL
	.word	mmUVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL
	.word	mmUVD_SEMA_TIMEOUT_STATUS
	.word	mmUVD_SEMA_CNTL
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.size	uvd_v6_0_hw_init, .-uvd_v6_0_hw_init
	.comm	mmUVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_TIMEOUT_STATUS,4,4
	.comm	mmUVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL,4,4
	.comm	mmUVD_SEMA_CNTL,4,4
	.comm	AMD_CG_STATE_UNGATE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
