	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i965_update_wm
_i965_update_wm:                        ## @i965_update_wm
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_single_enabled_crtc
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rcx
	movl	16(%rax), %edi
	movq	(%rax), %rax
	movl	(%rax), %eax
	leal	7(%rax), %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$3, %r15d
	imull	$1000, 12(%rcx), %eax           ## imm = 0x3E8
	cltd
	idivl	8(%rcx)
	movl	%eax, %ecx
	cltq
	cmpq	$12000, %rax                    ## imm = 0x2EE0
	ja	LBB0_2
## %bb.3:
	movl	$12000, %eax                    ## imm = 0x2EE0
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_4
LBB0_6:
	movq	%r14, %rdi
	callq	_IS_CRESTLINE
	movl	$1, %ebx
	movl	$16, %r15d
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	_FW_BLC_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r14d, %edi
	callq	_I915_READ
	movq	_FW_BLC_SELF_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	%r14d, %edi
	jmp	LBB0_8
LBB0_2:
	xorl	%eax, %eax
LBB0_4:
	addl	$1000, %eax                     ## imm = 0x3E8
	movzwl	%ax, %eax
	shrl	$3, %eax
	imull	$8389, %eax, %eax               ## imm = 0x20C5
	shrl	$20, %eax
	imull	%eax, %r15d
	imull	%r15d, %edi
	movq	_I915_FIFO_LINE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
	movq	_I965_FIFO_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	subl	%eax, %ecx
	movl	%ecx, %edx
	andl	$511, %edx                      ## imm = 0x1FF
	testl	%ecx, %ecx
	movl	$1, %ebx
	cmovnsl	%edx, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	shll	$6, %r15d
	movq	_i965_cursor_wm_info@GOTPCREL(%rip), %r12
	movl	12(%r12), %esi
	movl	%r15d, %edi
	callq	_DIV_ROUND_UP
	addl	4(%r12), %eax
	movl	(%r12), %r15d
	subl	%eax, %r15d
	movl	8(%r12), %eax
	cmpl	%eax, %r15d
	cmovgel	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	%r14, %rdi
	callq	_IS_CRESTLINE
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	_FW_BLC_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_FW_BLC_SELF_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_8:
	callq	_I915_WRITE
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	_DSPFW1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DSPFW_SR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	$526344, %ebx                   ## imm = 0x80808
	movl	%ebx, %esi
	callq	_I915_WRITE
	movq	_DSPFW2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2056, %esi                     ## imm = 0x808
	callq	_I915_WRITE
	movq	_DSPFW3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DSPFW_CURSOR_SR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movl	%r15d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_FIFO_LINE_SIZE,4,2        ## @I915_FIFO_LINE_SIZE
	.comm	_I965_FIFO_SIZE,4,2             ## @I965_FIFO_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"self-refresh entries: %d, wm: %d\n"

	.comm	_i965_cursor_wm_info,16,2       ## @i965_cursor_wm_info
L_.str.1:                               ## @.str.1
	.asciz	"self-refresh watermark: display plane %d cursor %d\n"

	.comm	_FW_BLC_SELF,4,2                ## @FW_BLC_SELF
	.comm	_FW_BLC_SELF_EN,4,2             ## @FW_BLC_SELF_EN
L_.str.2:                               ## @.str.2
	.asciz	"Setting FIFO watermarks - A: 8, B: 8, C: 8, SR %d\n"

	.comm	_DSPFW1,4,2                     ## @DSPFW1
	.comm	_DSPFW_SR_SHIFT,4,2             ## @DSPFW_SR_SHIFT
	.comm	_DSPFW2,4,2                     ## @DSPFW2
	.comm	_DSPFW3,4,2                     ## @DSPFW3
	.comm	_DSPFW_CURSOR_SR_SHIFT,4,2      ## @DSPFW_CURSOR_SR_SHIFT
	.no_dead_strip	_i965_update_wm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i965_update_wm
_i965_update_wm:                        ; @i965_update_wm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_single_enabled_crtc
	cbz	x0, LBB0_3
; %bb.1:
	ldp	w8, w9, [x0, #8]
	ldr	w10, [x0, #16]
	ldr	x11, [x0]
	ldr	w11, [x11]
	add	w12, w11, #7
	cmp	w11, #0
	csel	w11, w12, w11, lt
	asr	w11, w11, #3
	mov	w12, #1000
	mul	w9, w9, w12
	sdiv	w8, w9, w8
	sxtw	x8, w8
	mov	w9, #12000
	udiv	x8, x9, x8
	add	w8, w8, #1000
	lsr	w8, w8, #3
	mov	w9, #8389
	mul	w8, w8, w9
	lsr	w8, w8, #20
	mul	w21, w11, w8
	mul	w0, w21, w10
Lloh0:
	adrp	x8, _I915_FIFO_LINE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_FIFO_LINE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_DIV_ROUND_UP
	mov	x1, x0
Lloh3:
	adrp	x8, _I965_FIFO_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I965_FIFO_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sub	w8, w8, w0
	and	w9, w8, #0x1ff
	cmp	w8, #0
	csinc	w20, w9, wzr, ge
	str	x20, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	lsl	w0, w21, #6
Lloh8:
	adrp	x21, _i965_cursor_wm_info@GOTPAGE
Lloh9:
	ldr	x21, [x21, _i965_cursor_wm_info@GOTPAGEOFF]
	ldr	w1, [x21, #12]
	bl	_DIV_ROUND_UP
	ldp	w8, w9, [x21]
	add	w9, w0, w9
	sub	w8, w8, w9
	ldr	w9, [x21, #8]
	cmp	w8, w9
	csel	w21, w8, w9, lt
	str	x21, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DRM_DEBUG_KMS
	mov	x0, x19
	bl	_IS_CRESTLINE
	cbz	x0, LBB0_6
; %bb.2:
Lloh12:
	adrp	x8, _FW_BLC_SELF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FW_BLC_SELF@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _FW_BLC_SELF_EN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FW_BLC_SELF_EN@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_I915_WRITE
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_IS_CRESTLINE
	cbz	x0, LBB0_5
; %bb.4:
Lloh18:
	adrp	x8, _FW_BLC_SELF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FW_BLC_SELF@GOTPAGEOFF]
Lloh20:
	ldr	w19, [x8]
	mov	x0, x19
	bl	_I915_READ
Lloh21:
	adrp	x8, _FW_BLC_SELF_EN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _FW_BLC_SELF_EN@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	bic	w1, w0, w8
	mov	x0, x19
	bl	_I915_WRITE
LBB0_5:
	mov	w20, #1
	mov	w21, #16
LBB0_6:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_DRM_DEBUG_KMS
Lloh26:
	adrp	x8, _DSPFW1@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DSPFW1@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x8, _DSPFW_SR_SHIFT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DSPFW_SR_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	lsl	w8, w20, w8
	mov	w9, #2056
	movk	w9, #8, lsl #16
	orr	w1, w8, w9
	bl	_I915_WRITE
Lloh32:
	adrp	x8, _DSPFW2@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DSPFW2@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	mov	w1, #2056
	bl	_I915_WRITE
Lloh35:
	adrp	x8, _DSPFW3@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DSPFW3@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
Lloh38:
	adrp	x8, _DSPFW_CURSOR_SR_SHIFT@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DSPFW_CURSOR_SR_SHIFT@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	lsl	w1, w21, w8
	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
	add	sp, sp, #64
	b	_I915_WRITE
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_FIFO_LINE_SIZE,4,2        ; @I915_FIFO_LINE_SIZE
	.comm	_I965_FIFO_SIZE,4,2             ; @I965_FIFO_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"self-refresh entries: %d, wm: %d\n"

	.comm	_i965_cursor_wm_info,16,2       ; @i965_cursor_wm_info
l_.str.1:                               ; @.str.1
	.asciz	"self-refresh watermark: display plane %d cursor %d\n"

	.comm	_FW_BLC_SELF,4,2                ; @FW_BLC_SELF
	.comm	_FW_BLC_SELF_EN,4,2             ; @FW_BLC_SELF_EN
l_.str.2:                               ; @.str.2
	.asciz	"Setting FIFO watermarks - A: 8, B: 8, C: 8, SR %d\n"

	.comm	_DSPFW1,4,2                     ; @DSPFW1
	.comm	_DSPFW_SR_SHIFT,4,2             ; @DSPFW_SR_SHIFT
	.comm	_DSPFW2,4,2                     ; @DSPFW2
	.comm	_DSPFW3,4,2                     ; @DSPFW3
	.comm	_DSPFW_CURSOR_SR_SHIFT,4,2      ; @DSPFW_CURSOR_SR_SHIFT
	.no_dead_strip	_i965_update_wm
.subsections_via_symbols
