	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_crtc_atomic_disable
_vc4_crtc_atomic_disable:               ## @vc4_crtc_atomic_disable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_to_vc4_dev
	movq	%r15, %rdi
	callq	_to_vc4_crtc
	movl	(%rax), %r12d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_require_hvs_enabled
	movq	%r15, %rdi
	callq	_drm_crtc_vblank_off
	movq	_PV_V_CONTROL@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movl	%ebx, %edi
	callq	_CRTC_READ
	movq	_PV_VCONTROL_VIDEN@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	notl	%esi
	andl	%eax, %esi
	movl	%ebx, %edi
	callq	_CRTC_WRITE
	movl	(%r13), %edi
	callq	_CRTC_READ
	xorl	%edi, %edi
	andl	(%r14), %eax
	sete	%dil
	movl	$1, %esi
	callq	_wait_for
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_WARN_ONCE
	movl	%r12d, %edi
	callq	_SCALER_DISPCTRLX
	movl	%eax, %edi
	callq	_HVS_READ
	movq	_SCALER_DISPCTRLX_ENABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	%r12d, %edi
	callq	_SCALER_DISPCTRLX
	movq	_SCALER_DISPCTRLX_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_HVS_WRITE
	movl	%r12d, %edi
	callq	_SCALER_DISPCTRLX
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HVS_WRITE
LBB0_2:
	movl	%r12d, %edi
	callq	_SCALER_DISPCTRLX
	movl	%eax, %edi
	callq	_HVS_READ
	movq	_SCALER_DISPCTRLX_RESET@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, %edi
	callq	_WARN_ON_ONCE
	movl	%r12d, %edi
	callq	_SCALER_DISPSTATX
	movl	%eax, %edi
	callq	_HVS_READ
	movq	_SCALER_DISPSTATX_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_VC4_GET_FIELD
	movq	_SCALER_DISPSTATX_MODE_DISABLED@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON_ONCE
	movl	%r12d, %edi
	callq	_SCALER_DISPSTATX
	movl	%eax, %edi
	callq	_HVS_READ
	movq	_SCALER_DISPSTATX_FULL@GOTPCREL(%rip), %rcx
	movq	_SCALER_DISPSTATX_EMPTY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	(%rcx), %ecx
	orl	%edx, %ecx
	andl	%eax, %ecx
	xorl	%edi, %edi
	cmpl	%edx, %ecx
	setne	%dil
	callq	_WARN_ON_ONCE
	movq	(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.4:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	(%r15), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_drm_crtc_send_vblank_event
	movq	(%r15), %rax
	movq	$0, (%rax)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PV_V_CONTROL,4,2               ## @PV_V_CONTROL
	.comm	_PV_VCONTROL_VIDEN,4,2          ## @PV_VCONTROL_VIDEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for !PV_VCONTROL_VIDEN\n"

	.comm	_SCALER_DISPCTRLX_ENABLE,4,2    ## @SCALER_DISPCTRLX_ENABLE
	.comm	_SCALER_DISPCTRLX_RESET,4,2     ## @SCALER_DISPCTRLX_RESET
	.comm	_SCALER_DISPSTATX_MODE,4,2      ## @SCALER_DISPSTATX_MODE
	.comm	_SCALER_DISPSTATX_MODE_DISABLED,8,3 ## @SCALER_DISPSTATX_MODE_DISABLED
	.comm	_SCALER_DISPSTATX_FULL,4,2      ## @SCALER_DISPSTATX_FULL
	.comm	_SCALER_DISPSTATX_EMPTY,4,2     ## @SCALER_DISPSTATX_EMPTY
	.no_dead_strip	_vc4_crtc_atomic_disable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_crtc_atomic_disable
_vc4_crtc_atomic_disable:               ; @vc4_crtc_atomic_disable
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_to_vc4_dev
	mov	x0, x20
	bl	_to_vc4_crtc
	ldr	w21, [x0]
	mov	x0, x19
	bl	_require_hvs_enabled
	mov	x0, x20
	bl	_drm_crtc_vblank_off
Lloh0:
	adrp	x23, _PV_V_CONTROL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PV_V_CONTROL@GOTPAGEOFF]
	ldr	w22, [x23]
	mov	x0, x22
	bl	_CRTC_READ
Lloh2:
	adrp	x24, _PV_VCONTROL_VIDEN@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PV_VCONTROL_VIDEN@GOTPAGEOFF]
	ldr	w8, [x24]
	bic	w1, w0, w8
	mov	x0, x22
	bl	_CRTC_WRITE
	ldr	w0, [x23]
	bl	_CRTC_READ
	ldr	w8, [x24]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1
	bl	_wait_for
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN_ONCE
	mov	x0, x21
	bl	_SCALER_DISPCTRLX
	bl	_HVS_READ
Lloh6:
	adrp	x8, _SCALER_DISPCTRLX_ENABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SCALER_DISPCTRLX_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x22, _SCALER_DISPCTRLX_RESET@GOTPAGE
Lloh10:
	ldr	x22, [x22, _SCALER_DISPCTRLX_RESET@GOTPAGEOFF]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_SCALER_DISPCTRLX
	ldr	w1, [x22]
	bl	_HVS_WRITE
	mov	x0, x21
	bl	_SCALER_DISPCTRLX
	mov	w1, #0
	bl	_HVS_WRITE
LBB0_2:
	mov	x0, x21
	bl	_SCALER_DISPCTRLX
	bl	_HVS_READ
	ldr	w8, [x22]
	and	w0, w8, w0
	bl	_WARN_ON_ONCE
	mov	x0, x21
	bl	_SCALER_DISPSTATX
	bl	_HVS_READ
Lloh11:
	adrp	x8, _SCALER_DISPSTATX_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SCALER_DISPSTATX_MODE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_VC4_GET_FIELD
Lloh14:
	adrp	x8, _SCALER_DISPSTATX_MODE_DISABLED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SCALER_DISPSTATX_MODE_DISABLED@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, ne
	bl	_WARN_ON_ONCE
	mov	x0, x21
	bl	_SCALER_DISPSTATX
	bl	_HVS_READ
Lloh17:
	adrp	x8, _SCALER_DISPSTATX_FULL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SCALER_DISPSTATX_FULL@GOTPAGEOFF]
Lloh19:
	adrp	x9, _SCALER_DISPSTATX_EMPTY@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SCALER_DISPSTATX_EMPTY@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
	and	w8, w8, w0
	cmp	w8, w9
	cset	w0, ne
	bl	_WARN_ON_ONCE
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x20]
	ldr	x1, [x8]
	mov	x0, x20
	bl	_drm_crtc_send_vblank_event
	ldr	x8, [x20]
	str	xzr, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PV_V_CONTROL,4,2               ; @PV_V_CONTROL
	.comm	_PV_VCONTROL_VIDEN,4,2          ; @PV_VCONTROL_VIDEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for !PV_VCONTROL_VIDEN\n"

	.comm	_SCALER_DISPCTRLX_ENABLE,4,2    ; @SCALER_DISPCTRLX_ENABLE
	.comm	_SCALER_DISPCTRLX_RESET,4,2     ; @SCALER_DISPCTRLX_RESET
	.comm	_SCALER_DISPSTATX_MODE,4,2      ; @SCALER_DISPSTATX_MODE
	.comm	_SCALER_DISPSTATX_MODE_DISABLED,8,3 ; @SCALER_DISPSTATX_MODE_DISABLED
	.comm	_SCALER_DISPSTATX_FULL,4,2      ; @SCALER_DISPSTATX_FULL
	.comm	_SCALER_DISPSTATX_EMPTY,4,2     ; @SCALER_DISPSTATX_EMPTY
	.no_dead_strip	_vc4_crtc_atomic_disable
.subsections_via_symbols
