	.file	"extr_evergreen_dma.c_evergreen_copy_dma.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"radeon: moving bo (%d).\n"
	.text
	.p2align 4
	.globl	evergreen_copy_dma
	.type	evergreen_copy_dma, @function
evergreen_copy_dma:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR 8[rsp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	movsx	rdx, DWORD PTR [rax]
	mov	rax, QWORD PTR [rdi]
	lea	rbp, [rax+rdx*4]
	lea	rax, 44[rsp]
	mov	rdi, rax
	mov	QWORD PTR 24[rsp], rax
	call	radeon_sync_create@PLT
	mov	ecx, DWORD PTR RADEON_GPU_PAGE_SHIFT[rip]
	mov	r9d, r13d
	mov	esi, 1048575
	sal	r9d, cl
	shr	r9d, 2
	mov	edi, r9d
	mov	r15d, r9d
	call	DIV_ROUND_UP@PLT
	mov	rsi, rbp
	mov	rdi, r14
	lea	edx, 11[rax+rax*4]
	mov	DWORD PTR 20[rsp], eax
	call	radeon_ring_lock@PLT
	mov	r8, QWORD PTR 8[rsp]
	test	eax, eax
	mov	r13d, eax
	jne	.L11
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdx, r8
	xor	ecx, ecx
	mov	rdi, r14
	call	radeon_sync_resv@PLT
	mov	edx, DWORD PTR 0[rbp]
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r14
	call	radeon_sync_rings@PLT
	mov	eax, DWORD PTR 20[rsp]
	test	eax, eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	r15d, 1048575
	mov	edx, 1048575
	mov	edi, DWORD PTR DMA_PACKET_COPY[rip]
	cmovle	edx, r15d
	xor	esi, esi
	add	r13d, 1
	mov	DWORD PTR 8[rsp], edx
	sub	r15d, edx
	call	DMA_PACKET@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	radeon_ring_write@PLT
	mov	esi, r12d
	mov	rdi, rbp
	and	esi, -4
	call	radeon_ring_write@PLT
	mov	esi, ebx
	mov	rdi, rbp
	and	esi, -4
	call	radeon_ring_write@PLT
	mov	edi, r12d
	call	upper_32_bits@PLT
	mov	rdi, rbp
	movzx	esi, al
	call	radeon_ring_write@PLT
	mov	edi, ebx
	call	upper_32_bits@PLT
	mov	rdi, rbp
	movzx	esi, al
	call	radeon_ring_write@PLT
	mov	edx, DWORD PTR 8[rsp]
	sal	edx, 2
	add	ebx, edx
	add	r12d, edx
	cmp	DWORD PTR 20[rsp], r13d
	jne	.L5
.L4:
	mov	edx, DWORD PTR 0[rbp]
	lea	rsi, 48[rsp]
	mov	rdi, r14
	call	radeon_fence_emit@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, r14
	call	radeon_ring_unlock_commit@PLT
	mov	rdx, QWORD PTR 48[rsp]
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r14
	call	radeon_sync_free@PLT
	mov	rax, QWORD PTR 48[rsp]
.L1:
	mov	rcx, QWORD PTR 56[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L13
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rsi, rbp
	mov	rdi, r14
	call	radeon_ring_unlock_undo@PLT
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r14
	xor	edx, edx
	call	radeon_sync_free@PLT
	mov	edi, r12d
	call	ERR_PTR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	esi, eax
	lea	rdi, .LC0[rip]
	call	DRM_ERROR@PLT
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r14
	xor	edx, edx
	call	radeon_sync_free@PLT
	mov	edi, r13d
	call	ERR_PTR@PLT
	jmp	.L1
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	evergreen_copy_dma, .-evergreen_copy_dma
	.comm	RADEON_GPU_PAGE_SHIFT,4,4
	.comm	DMA_PACKET_COPY,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_evergreen_dma.c_evergreen_copy_dma.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"radeon: moving bo (%d).\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	evergreen_copy_dma
	.syntax unified
	.arm
	.fpu softvfp
	.type	evergreen_copy_dma, %function
evergreen_copy_dma:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r0
	mov	r5, r3
	ldr	r3, [r0, #4]
	sub	sp, sp, #36
	ldr	r4, [r3]
	ldr	r8, [r10]
	mov	r7, r2
	ldr	r2, .L14
	add	r0, sp, #24
	ldr	r2, [r2]
	str	r2, [sp, #28]
	mov	r2,#0
	mov	r6, r1
	str	r4, [sp, #4]
	str	r8, [sp, #8]
	ldr	fp, [sp, #72]
	bl	radeon_sync_create
	ldr	r3, .L14+4
	ldr	r1, .L14+8
	ldr	r3, [r3]
	add	r4, r8, r4, lsl #2
	lsl	r5, r5, r3
	lsr	r5, r5, #2
	mov	r0, r5
	bl	DIV_ROUND_UP
	add	r2, r0, r0, lsl #2
	mov	r9, r0
	mov	r1, r4
	mov	r0, r10
	add	r2, r2, #11
	bl	radeon_ring_lock
	subs	r8, r0, #0
	bne	.L11
	mov	r2, fp
	mov	r3, r8
	add	r1, sp, #24
	mov	r0, r10
	bl	radeon_sync_resv
	ldmib	sp, {r2, r3}
	mov	r0, r10
	ldr	r2, [r3, r2, lsl #2]
	add	r1, sp, #24
	bl	radeon_sync_rings
	cmp	r9, #0
	ble	.L4
	str	r10, [sp, #12]
	mov	r10, r5
	mov	r5, r9
	ldr	fp, .L14+8
.L5:
	cmp	r10, fp
	movlt	r9, r10
	movge	r9, fp
	ldr	r3, .L14+12
	mov	r2, r9
	ldr	r0, [r3]
	mov	r1, #0
	bl	DMA_PACKET
	mov	r1, r0
	mov	r0, r4
	bl	radeon_ring_write
	bic	r1, r7, #3
	mov	r0, r4
	bl	radeon_ring_write
	bic	r1, r6, #3
	mov	r0, r4
	bl	radeon_ring_write
	mov	r0, r7
	bl	upper_32_bits
	mov	r1, r0
	mov	r0, r4
	and	r1, r1, #255
	bl	radeon_ring_write
	mov	r0, r6
	bl	upper_32_bits
	add	r8, r8, #1
	and	r1, r0, #255
	mov	r0, r4
	bl	radeon_ring_write
	cmp	r5, r8
	sub	r10, r10, r9
	add	r7, r7, r9, lsl #2
	add	r6, r6, r9, lsl #2
	bne	.L5
	ldr	r10, [sp, #12]
.L4:
	ldmib	sp, {r2, r3}
	mov	r0, r10
	ldr	r2, [r3, r2, lsl #2]
	add	r1, sp, #20
	bl	radeon_fence_emit
	subs	r5, r0, #0
	bne	.L12
	mov	r2, r5
	mov	r1, r4
	mov	r0, r10
	bl	radeon_ring_unlock_commit
	mov	r0, r10
	ldr	r2, [sp, #20]
	add	r1, sp, #24
	bl	radeon_sync_free
	ldr	r0, [sp, #20]
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	mov	r1, r4
	mov	r0, r10
	bl	radeon_ring_unlock_undo
	mov	r0, r10
	mov	r2, #0
	add	r1, sp, #24
	bl	radeon_sync_free
	mov	r0, r5
	bl	ERR_PTR
	b	.L1
.L11:
	mov	r1, r8
	ldr	r0, .L14+16
	bl	DRM_ERROR
	mov	r0, r10
	mov	r2, #0
	add	r1, sp, #24
	bl	radeon_sync_free
	mov	r0, r8
	bl	ERR_PTR
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC1
	.word	RADEON_GPU_PAGE_SHIFT
	.word	1048575
	.word	DMA_PACKET_COPY
	.word	.LC0
	.size	evergreen_copy_dma, .-evergreen_copy_dma
	.comm	RADEON_GPU_PAGE_SHIFT,4,4
	.comm	DMA_PACKET_COPY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
