	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_drm_crtc_atomic_flush
_ingenic_drm_crtc_atomic_flush:         ## @ingenic_drm_crtc_atomic_flush
	.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
	callq	_drm_crtc_get_priv
	movq	%rax, %r12
	movq	8(%r15), %rax
	movq	16(%r15), %rbx
	movq	(%rbx), %r14
	movq	(%rax), %rax
	movq	(%rax), %r13
	movq	%rbx, %rdi
	callq	_drm_atomic_crtc_needs_modeset
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rax
	movl	(%rax), %edi
	callq	_drm_format_info
	movq	%rax, %r13
	leaq	12(%rbx), %rsi
	movq	%r12, %rdi
	callq	_ingenic_drm_crtc_update_timings
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ingenic_drm_crtc_update_ctrl
	movl	12(%r12), %edi
	imull	$1000, 8(%rbx), %esi            ## imm = 0x3E8
	callq	_clk_set_rate
	movl	8(%r12), %edi
	movq	_JZ_REG_LCD_DA0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movl	(%rax), %edx
	callq	_regmap_write
LBB0_2:
	testq	%r14, %r14
	je	LBB0_7
## %bb.3:
	movq	$0, (%rbx)
	movq	(%r15), %rdi
	callq	_spin_lock_irq
	movq	%r15, %rdi
	callq	_drm_crtc_vblank_get
	movq	%r15, %rdi
	movq	%r14, %rsi
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	callq	_drm_crtc_send_vblank_event
	jmp	LBB0_6
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	_drm_crtc_arm_vblank_event
LBB0_6:
	movq	(%r15), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irq                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ_REG_LCD_DA0,4,2             ## @JZ_REG_LCD_DA0
	.no_dead_strip	_ingenic_drm_crtc_atomic_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ingenic_drm_crtc_atomic_flush
_ingenic_drm_crtc_atomic_flush:         ; @ingenic_drm_crtc_atomic_flush
	.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	x19, x0
	bl	_drm_crtc_get_priv
	mov	x22, x0
	ldp	x8, x21, [x19, #8]
	ldr	x20, [x21]
	ldr	x8, [x8]
	ldr	x23, [x8]
	mov	x0, x21
	bl	_drm_atomic_crtc_needs_modeset
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x23]
	ldr	w0, [x8]
	bl	_drm_format_info
	mov	x23, x0
	add	x1, x21, #12
	mov	x0, x22
	bl	_ingenic_drm_crtc_update_timings
	mov	x0, x22
	mov	x1, x23
	bl	_ingenic_drm_crtc_update_ctrl
	ldr	w0, [x22, #12]
	ldr	w8, [x21, #8]
	mov	w9, #1000
	mul	w1, w8, w9
	bl	_clk_set_rate
	ldr	w0, [x22, #8]
Lloh0:
	adrp	x8, _JZ_REG_LCD_DA0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ_REG_LCD_DA0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	x8, [x22]
	ldr	w2, [x8]
	bl	_regmap_write
LBB0_2:
	cbz	x20, LBB0_5
; %bb.3:
	str	xzr, [x21]
	ldr	x0, [x19]
	bl	_spin_lock_irq
	mov	x0, x19
	bl	_drm_crtc_vblank_get
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_drm_crtc_send_vblank_event
	b	LBB0_7
LBB0_5:
	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
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_drm_crtc_arm_vblank_event
LBB0_7:
	ldr	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_irq
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ_REG_LCD_DA0,4,2             ; @JZ_REG_LCD_DA0
	.no_dead_strip	_ingenic_drm_crtc_atomic_flush
.subsections_via_symbols
