	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdn_dp_encoder_enable
_cdn_dp_encoder_enable:                 ## @cdn_dp_encoder_enable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_encoder_to_dp
	movq	%rax, %r14
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_drm_of_encoder_active_endpoint_id
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	testl	%eax, %eax
	js	LBB0_16
## %bb.1:
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_DEV_DEBUG_KMS
	testl	%ebx, %ebx
	movq	_DP_SEL_VOP_LIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovnel	%edx, %ebx
	shll	$16, %edx
	orl	%ebx, %edx
	movq	_GRF_SOC_CON9@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cdn_dp_grf_write
	testl	%eax, %eax
	je	LBB0_2
## %bb.15:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_16:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DRM_DEV_ERROR                  ## TAILCALL
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_cdn_dp_enable
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	8(%r14), %rdi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_13
LBB0_4:
	movq	%r14, %rdi
	callq	_cdn_dp_check_link_status
	testl	%eax, %eax
	je	LBB0_5
LBB0_7:
	movq	_CONTROL_VIDEO_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cdn_dp_set_video_status
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	8(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_13
LBB0_5:
	movq	%r14, %rdi
	callq	_cdn_dp_train_link
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	8(%r14), %rdi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_13
LBB0_9:
	movq	%r14, %rdi
	callq	_cdn_dp_config_video
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movq	8(%r14), %rdi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_13
LBB0_11:
	movq	_CONTROL_VIDEO_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cdn_dp_set_video_status
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movq	8(%r14), %rdi
	leaq	L_.str.8(%rip), %rsi
LBB0_13:
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
LBB0_14:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not get vop id, %d"

L_.str.1:                               ## @.str.1
	.asciz	"vop %s output to cdn-dp\n"

L_.str.2:                               ## @.str.2
	.asciz	"LIT"

L_.str.3:                               ## @.str.3
	.asciz	"BIG"

	.comm	_DP_SEL_VOP_LIT,4,2             ## @DP_SEL_VOP_LIT
	.comm	_GRF_SOC_CON9,4,2               ## @GRF_SOC_CON9
L_.str.4:                               ## @.str.4
	.asciz	"Failed to enable encoder %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed link train %d\n"

	.comm	_CONTROL_VIDEO_IDLE,4,2         ## @CONTROL_VIDEO_IDLE
L_.str.6:                               ## @.str.6
	.asciz	"Failed to idle video %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to config video %d\n"

	.comm	_CONTROL_VIDEO_VALID,4,2        ## @CONTROL_VIDEO_VALID
L_.str.8:                               ## @.str.8
	.asciz	"Failed to valid video %d\n"

	.no_dead_strip	_cdn_dp_encoder_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdn_dp_encoder_enable
_cdn_dp_encoder_enable:                 ; @cdn_dp_encoder_enable
	.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
	mov	x20, x0
	bl	_encoder_to_dp
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_drm_of_encoder_active_endpoint_id
	mov	x20, x0
	ldr	x0, [x19, #8]
	tbnz	w20, #31, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, l_.str.2@PAGE
Lloh1:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh2:
	adrp	x9, l_.str.3@PAGE
Lloh3:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w20, #0
	csel	x2, x9, x8, eq
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_DEBUG_KMS
Lloh6:
	adrp	x8, _DP_SEL_VOP_LIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_SEL_VOP_LIT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w9, wzr, w8, eq
	orr	w2, w9, w8, lsl #16
Lloh9:
	adrp	x8, _GRF_SOC_CON9@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GRF_SOC_CON9@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cdn_dp_grf_write
	cbz	w0, LBB0_4
; %bb.2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_DRM_DEV_ERROR
LBB0_4:
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_cdn_dp_enable
	cbz	w0, LBB0_6
; %bb.5:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_6:
	mov	x0, x19
	bl	_cdn_dp_check_link_status
	cbz	w0, LBB0_9
LBB0_7:
Lloh16:
	adrp	x8, _CONTROL_VIDEO_IDLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CONTROL_VIDEO_IDLE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cdn_dp_set_video_status
	cbz	w0, LBB0_11
; %bb.8:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.6@PAGE
Lloh20:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_9:
	mov	x0, x19
	bl	_cdn_dp_train_link
	cbz	w0, LBB0_7
; %bb.10:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_11:
	mov	x0, x19
	bl	_cdn_dp_config_video
	cbz	w0, LBB0_13
; %bb.12:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh23:
	adrp	x1, l_.str.7@PAGE
Lloh24:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh25:
	adrp	x8, _CONTROL_VIDEO_VALID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CONTROL_VIDEO_VALID@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cdn_dp_set_video_status
	cbz	w0, LBB0_16
; %bb.14:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_15:
	bl	_DRM_DEV_ERROR
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not get vop id, %d"

l_.str.1:                               ; @.str.1
	.asciz	"vop %s output to cdn-dp\n"

l_.str.2:                               ; @.str.2
	.asciz	"LIT"

l_.str.3:                               ; @.str.3
	.asciz	"BIG"

	.comm	_DP_SEL_VOP_LIT,4,2             ; @DP_SEL_VOP_LIT
	.comm	_GRF_SOC_CON9,4,2               ; @GRF_SOC_CON9
l_.str.4:                               ; @.str.4
	.asciz	"Failed to enable encoder %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed link train %d\n"

	.comm	_CONTROL_VIDEO_IDLE,4,2         ; @CONTROL_VIDEO_IDLE
l_.str.6:                               ; @.str.6
	.asciz	"Failed to idle video %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to config video %d\n"

	.comm	_CONTROL_VIDEO_VALID,4,2        ; @CONTROL_VIDEO_VALID
l_.str.8:                               ; @.str.8
	.asciz	"Failed to valid video %d\n"

	.no_dead_strip	_cdn_dp_encoder_enable
.subsections_via_symbols
