	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vlv_raw_plane_wm_compute
_vlv_raw_plane_wm_compute:              ## @vlv_raw_plane_wm_compute
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	callq	_to_intel_plane
	movq	%rax, %r12
	movl	(%rax), %r13d
	movl	8(%rax), %edi
	callq	_to_i915
	movl	%eax, %edi
	callq	_intel_wm_num_levels
	movl	%eax, %r15d
	movq	%r14, %rdi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_intel_wm_plane_visible
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%r15d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jle	LBB0_2
## %bb.4:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %r12
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_vlv_compute_wm_level
	movq	_PLANE_CURSOR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	movl	$511, %ecx                      ## imm = 0x1FF
	movl	$63, %edx
	cmovel	%edx, %ecx
	cmpl	%ecx, %eax
	jg	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r12,%rbx,8), %rcx
	xorl	%edx, %edx
	cmpl	%eax, (%rcx,%r13,4)
	setne	%dl
	orl	%edx, %r15d
	movl	%eax, (%rcx,%r13,4)
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_5
## %bb.7:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
LBB0_8:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_3:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_vlv_raw_plane_wm_set
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_11
	jmp	LBB0_12
LBB0_2:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
LBB0_9:
	movq	_USHRT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_vlv_raw_plane_wm_set
	movl	%eax, %ebx
	orl	%r15d, %ebx
	testl	%ebx, %ebx
	je	LBB0_12
LBB0_11:
	movl	4(%r12), %esi
	movq	(%r14), %rax
	movq	_VLV_WM_LEVEL_PM2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rcx
	movl	(%rcx,%r13,4), %edx
	movq	_VLV_WM_LEVEL_PM5@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rcx
	movl	(%rcx,%r13,4), %ecx
	movq	_VLV_WM_LEVEL_DDR_DVFS@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	(%rax,%rdi,8), %rax
	movl	(%rax,%r13,4), %r8d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLANE_CURSOR,4,2               ## @PLANE_CURSOR
	.comm	_USHRT_MAX,4,2                  ## @USHRT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s watermarks: PM2=%d, PM5=%d, DDR DVFS=%d\n"

	.comm	_VLV_WM_LEVEL_PM2,8,3           ## @VLV_WM_LEVEL_PM2
	.comm	_VLV_WM_LEVEL_PM5,8,3           ## @VLV_WM_LEVEL_PM5
	.comm	_VLV_WM_LEVEL_DDR_DVFS,8,3      ## @VLV_WM_LEVEL_DDR_DVFS
	.no_dead_strip	_vlv_raw_plane_wm_compute
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vlv_raw_plane_wm_compute
_vlv_raw_plane_wm_compute:              ; @vlv_raw_plane_wm_compute
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x1]
	bl	_to_intel_plane
	mov	x19, x0
	ldr	w21, [x0]
	ldr	w0, [x0, #8]
	bl	_to_i915
	bl	_intel_wm_num_levels
	mov	x23, x0
	mov	x0, x20
	mov	x1, x22
	bl	_intel_wm_plane_visible
	cbz	w0, LBB0_7
; %bb.1:
	mov	w25, w23
	cmp	w25, #1
	b.lt	LBB0_8
; %bb.2:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x23, #0
	mov	w24, #0
	mov	w27, #511
	mov	w28, #63
	lsl	x19, x21, #2
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x26, [x20]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_vlv_compute_wm_level
Lloh0:
	adrp	x8, _PLANE_CURSOR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PLANE_CURSOR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w21, w8
	csel	w8, w28, w27, eq
	cmp	w0, w8
	b.gt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26, x23, lsl #3]
	ldr	w9, [x8, x19]
	cmp	w9, w0
	cset	w9, ne
	orr	w24, w24, w9
	str	w0, [x8, x19]
	add	x23, x23, #1
	cmp	x25, x23
	b.ne	LBB0_3
; %bb.5:
	mov	x23, x25
LBB0_6:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	mov	w3, #0
	bl	_vlv_raw_plane_wm_set
	mov	x22, x0
	cbnz	w22, LBB0_10
	b	LBB0_11
LBB0_8:
	mov	w24, #0
	mov	w23, #0
LBB0_9:
Lloh3:
	adrp	x8, _USHRT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USHRT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	bl	_vlv_raw_plane_wm_set
	orr	w22, w0, w24
	cbz	w22, LBB0_11
LBB0_10:
	ldr	x8, [x20]
Lloh6:
	adrp	x9, _VLV_WM_LEVEL_PM2@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VLV_WM_LEVEL_PM2@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	lsl	x10, x21, #2
	ldr	w2, [x9, x10]
Lloh9:
	adrp	x9, _VLV_WM_LEVEL_PM5@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VLV_WM_LEVEL_PM5@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	ldr	w3, [x9, x10]
Lloh12:
	adrp	x9, _VLV_WM_LEVEL_DDR_DVFS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VLV_WM_LEVEL_DDR_DVFS@GOTPAGEOFF]
	ldr	w1, [x19, #4]
Lloh14:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w4, [x8, x10]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PLANE_CURSOR,4,2               ; @PLANE_CURSOR
	.comm	_USHRT_MAX,4,2                  ; @USHRT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s watermarks: PM2=%d, PM5=%d, DDR DVFS=%d\n"

	.comm	_VLV_WM_LEVEL_PM2,8,3           ; @VLV_WM_LEVEL_PM2
	.comm	_VLV_WM_LEVEL_PM5,8,3           ; @VLV_WM_LEVEL_PM5
	.comm	_VLV_WM_LEVEL_DDR_DVFS,8,3      ; @VLV_WM_LEVEL_DDR_DVFS
	.no_dead_strip	_vlv_raw_plane_wm_compute
.subsections_via_symbols
