	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_crtc_wait_for_frame_done
__dpu_crtc_wait_for_frame_done:         ## @_dpu_crtc_wait_for_frame_done
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	callq	_to_dpu_crtc
	movq	%rax, %rbx
	leaq	4(%rax), %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPU_ATRACE_BEGIN
	movq	_DPU_CRTC_FRAME_DONE_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPU_ATRACE_END
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DPU_DEBUG
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no frames pending\n"

L_.str.1:                               ## @.str.1
	.asciz	"frame done completion wait"

	.comm	_DPU_CRTC_FRAME_DONE_TIMEOUT_MS,4,2 ## @DPU_CRTC_FRAME_DONE_TIMEOUT_MS
L_.str.2:                               ## @.str.2
	.asciz	"frame done wait timed out, ret:%d\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	__dpu_crtc_wait_for_frame_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_crtc_wait_for_frame_done
__dpu_crtc_wait_for_frame_done:         ; @_dpu_crtc_wait_for_frame_done
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_to_dpu_crtc
	mov	x19, x0
	add	x0, x0, #4
	bl	_atomic_read
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_ATRACE_BEGIN
Lloh2:
	adrp	x8, _DPU_CRTC_FRAME_DONE_TIMEOUT_MS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DPU_CRTC_FRAME_DONE_TIMEOUT_MS@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x19
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_4
; %bb.2:
	mov	w19, #0
	b	LBB0_5
LBB0_3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_DEBUG
	mov	w19, #0
	b	LBB0_6
LBB0_4:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w1, #0
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_5:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_ATRACE_END
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no frames pending\n"

l_.str.1:                               ; @.str.1
	.asciz	"frame done completion wait"

	.comm	_DPU_CRTC_FRAME_DONE_TIMEOUT_MS,4,2 ; @DPU_CRTC_FRAME_DONE_TIMEOUT_MS
l_.str.2:                               ; @.str.2
	.asciz	"frame done wait timed out, ret:%d\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	__dpu_crtc_wait_for_frame_done
.subsections_via_symbols
