	.file	"extr_i915_gem.c_i915_gem_object_pin.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"bo is already pinned in ggtt with incorrect alignment: offset=%08x, req.alignment=%llx, req.map_and_fenceable=%d, vma->map_and_fenceable=%d\n"
	.text
	.p2align 4
	.globl	i915_gem_object_pin
	.type	i915_gem_object_pin, @function
i915_gem_object_pin:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, r8d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, r9d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rdi, QWORD PTR 8[rdi]
	mov	QWORD PTR [rsp], rsi
	call	to_i915@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	rbx, rax
	call	lockdep_assert_held@PLT
	mov	rdi, rbp
	call	i915_gem_object_never_bind_ggtt@PLT
	mov	edi, DWORD PTR ENODEV[rip]
	mov	rsi, QWORD PTR [rsp]
	neg	edi
	test	rax, rax
	jne	.L40
	test	DWORD PTR PIN_MAPPABLE[rip], r13d
	je	.L3
	test	r12, r12
	je	.L4
	mov	rax, QWORD PTR I915_GGTT_VIEW_NORMAL[rip]
	cmp	QWORD PTR [r12], rax
	je	.L4
.L3:
	mov	rdx, r12
	mov	rdi, rbp
	call	i915_vma_instance@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	rax, rax
	je	.L44
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L44:
	.cfi_restore_state
	mov	ecx, r13d
	mov	edx, r14d
	mov	esi, r15d
	mov	rdi, r12
	call	i915_vma_misplaced@PLT
	test	rax, rax
	je	.L7
	test	DWORD PTR PIN_NONBLOCK[rip], r13d
	je	.L8
	mov	rdi, r12
	call	i915_vma_is_pinned@PLT
	test	rax, rax
	jne	.L42
	mov	rdi, r12
	call	i915_vma_is_active@PLT
	test	rax, rax
	jne	.L42
	test	DWORD PTR PIN_MAPPABLE[rip], r13d
	je	.L8
	mov	edx, DWORD PTR [rbx]
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR [r12], eax
	jg	.L42
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r12
	call	i915_vma_is_map_and_fenceable@PLT
	xor	r8d, r8d
	test	DWORD PTR PIN_MAPPABLE[rip], r13d
	mov	rdi, r12
	setne	r8b
	mov	DWORD PTR 12[rsp], eax
	mov	DWORD PTR [rsp], r8d
	call	i915_ggtt_offset@PLT
	mov	rdi, r12
	mov	ebx, eax
	call	i915_vma_is_pinned@PLT
	mov	r9d, DWORD PTR 12[rsp]
	mov	r8d, DWORD PTR [rsp]
	mov	edx, ebx
	mov	rdi, rax
	mov	ecx, r14d
	lea	rsi, .LC0[rip]
	call	WARN@PLT
	mov	rdi, r12
	call	i915_vma_unbind@PLT
	test	eax, eax
	jne	.L41
.L7:
	cmp	QWORD PTR 16[r12], 0
	je	.L11
	mov	rdi, rbp
	call	i915_gem_object_is_tiled@PLT
	test	eax, eax
	je	.L45
.L11:
	mov	ecx, r13d
	mov	edx, r14d
	mov	esi, r15d
	mov	rdi, r12
	call	i915_vma_pin@PLT
	test	eax, eax
	je	.L1
.L41:
	mov	edi, eax
.L40:
	add	rsp, 24
	.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
	jmp	ERR_PTR@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	edi, DWORD PTR E2BIG[rip]
	mov	edx, DWORD PTR 0[rbp]
	mov	eax, DWORD PTR [rbx]
	neg	edi
	cmp	edx, eax
	jg	.L40
	test	DWORD PTR PIN_NONBLOCK[rip], r13d
	je	.L3
	mov	ecx, eax
	shr	ecx, 31
	add	eax, ecx
	sar	eax
	cmp	edx, eax
	jle	.L3
.L42:
	mov	edi, DWORD PTR ENOSPC[rip]
	neg	edi
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L45:
	mov	rdi, QWORD PTR 8[r12]
	call	mutex_lock@PLT
	mov	rdi, r12
	call	i915_vma_revoke_fence@PLT
	mov	rdi, QWORD PTR 8[r12]
	mov	ebp, eax
	call	mutex_unlock@PLT
	mov	edi, ebp
	test	ebp, ebp
	je	.L11
	jmp	.L40
	.cfi_endproc
.LFE0:
	.size	i915_gem_object_pin, .-i915_gem_object_pin
	.comm	PIN_NONBLOCK,4,4
	.comm	PIN_MAPPABLE,4,4
	.comm	I915_GGTT_VIEW_NORMAL,8,8
	.comm	ENOSPC,4,4
	.comm	ENODEV,4,4
	.comm	E2BIG,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_i915_gem.c_i915_gem_object_pin.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"bo is already pinned in ggtt with incorrect alignme"
	.ascii	"nt: offset=%08x, req.alignment=%llx, req.map_and_fe"
	.ascii	"nceable=%d, vma->map_and_fenceable=%d\012\000"
	.text
	.align	2
	.global	i915_gem_object_pin
	.syntax unified
	.arm
	.fpu softvfp
	.type	i915_gem_object_pin, %function
i915_gem_object_pin:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	sub	sp, sp, #12
	ldr	r0, [r0, #4]
	mov	fp, r1
	mov	r5, r2
	mov	r6, r3
	ldr	r10, [sp, #48]
	ldr	r8, [sp, #52]
	bl	to_i915
	mov	r7, r0
	ldr	r0, [r4, #4]
	bl	lockdep_assert_held
	mov	r0, r4
	bl	i915_gem_object_never_bind_ggtt
	cmp	r0, #0
	bne	.L46
	ldr	r9, .L50
	ldr	r3, [r9]
	tst	r8, r3
	beq	.L3
	cmp	r5, #0
	beq	.L4
	ldr	r3, .L50+4
	ldr	r2, [r5]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L4
.L3:
	mov	r2, r5
	mov	r1, fp
	mov	r0, r4
	bl	i915_vma_instance
	mov	r5, r0
	bl	IS_ERR
	cmp	r0, #0
	beq	.L47
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L47:
	mov	r3, r8
	mov	r2, r10
	mov	r1, r6
	mov	r0, r5
	bl	i915_vma_misplaced
	cmp	r0, #0
	beq	.L7
	ldr	r3, .L50+8
	ldr	r3, [r3]
	tst	r8, r3
	beq	.L8
	mov	r0, r5
	bl	i915_vma_is_pinned
	cmp	r0, #0
	bne	.L44
	mov	r0, r5
	bl	i915_vma_is_active
	cmp	r0, #0
	bne	.L44
	ldr	r3, [r9]
	tst	r8, r3
	beq	.L8
	ldr	r3, [r7]
	ldr	r2, [r5]
	add	r3, r3, r3, lsr #31
	cmp	r2, r3, asr #1
	bgt	.L44
.L8:
	mov	r0, r5
	bl	i915_vma_is_pinned
	mov	r7, r0
	mov	r0, r5
	bl	i915_ggtt_offset
	mov	r2, r0
	ldr	r3, [r9]
	mov	r0, r5
	tst	r8, r3
	movne	fp, #1
	moveq	fp, #0
	mov	r9, r2
	bl	i915_vma_is_map_and_fenceable
	mov	r3, r0
	mov	r2, r9
	ldr	r1, .L50+12
	str	r3, [sp, #4]
	mov	r0, r7
	mov	r3, r10
	str	fp, [sp]
	bl	WARN
	mov	r0, r5
	bl	i915_vma_unbind
	cmp	r0, #0
	bne	.L43
.L7:
	ldr	r3, [r5, #8]
	cmp	r3, #0
	beq	.L11
	mov	r0, r4
	bl	i915_gem_object_is_tiled
	cmp	r0, #0
	beq	.L48
.L11:
	mov	r3, r8
	mov	r2, r10
	mov	r1, r6
	mov	r0, r5
	bl	i915_vma_pin
	cmp	r0, #0
	beq	.L1
.L43:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ERR_PTR
.L4:
	ldr	r2, [r4]
	ldr	r3, [r7]
	cmp	r2, r3
	bgt	.L49
	ldr	r1, .L50+8
	ldr	r1, [r1]
	tst	r8, r1
	beq	.L3
	add	r3, r3, r3, lsr #31
	cmp	r2, r3, asr #1
	ble	.L3
.L44:
	ldr	r3, .L50+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L43
.L46:
	ldr	r3, .L50+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ERR_PTR
.L49:
	ldr	r3, .L50+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L43
.L48:
	ldr	r0, [r5, #4]
	bl	mutex_lock
	mov	r0, r5
	bl	i915_vma_revoke_fence
	mov	r4, r0
	ldr	r0, [r5, #4]
	bl	mutex_unlock
	cmp	r4, #0
	movne	r0, r4
	beq	.L11
	b	.L43
.L51:
	.align	2
.L50:
	.word	PIN_MAPPABLE
	.word	I915_GGTT_VIEW_NORMAL
	.word	PIN_NONBLOCK
	.word	.LC0
	.word	ENOSPC
	.word	ENODEV
	.word	E2BIG
	.size	i915_gem_object_pin, .-i915_gem_object_pin
	.comm	PIN_NONBLOCK,4,4
	.comm	PIN_MAPPABLE,4,4
	.comm	I915_GGTT_VIEW_NORMAL,4,4
	.comm	ENOSPC,4,4
	.comm	ENODEV,4,4
	.comm	E2BIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
