Lines Matching +full:0 +full:xe

33 /* Xe device functions */
35 static bool has_display(struct xe_device *xe) in has_display() argument
37 return HAS_DISPLAY(xe); in has_display()
50 return 0; in xe_display_driver_probe_defer()
71 static void unset_display_features(struct xe_device *xe) in unset_display_features() argument
73 xe->drm.driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC); in unset_display_features()
78 struct xe_device *xe = to_xe_device(dev); in display_destroy() local
80 destroy_workqueue(xe->display.hotplug.dp_wq); in display_destroy()
85 * @xe: XE device instance
90 * to the rest of xe and return it to be xe->display.
92 * Returns: 0 on success
94 int xe_display_create(struct xe_device *xe) in xe_display_create() argument
96 spin_lock_init(&xe->display.fb_tracking.lock); in xe_display_create()
98 xe->display.hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0); in xe_display_create()
100 return drmm_add_action_or_reset(&xe->drm, display_destroy, NULL); in xe_display_create()
105 struct xe_device *xe = to_xe_device(dev); in xe_display_fini_nommio() local
107 if (!xe->info.probe_display) in xe_display_fini_nommio()
110 intel_power_domains_cleanup(xe); in xe_display_fini_nommio()
113 int xe_display_init_nommio(struct xe_device *xe) in xe_display_init_nommio() argument
115 if (!xe->info.probe_display) in xe_display_init_nommio()
116 return 0; in xe_display_init_nommio()
119 spin_lock_init(&xe->uncore.lock); in xe_display_init_nommio()
122 intel_detect_pch(xe); in xe_display_init_nommio()
124 return drmm_add_action_or_reset(&xe->drm, xe_display_fini_nommio, xe); in xe_display_init_nommio()
129 struct xe_device *xe = arg; in xe_display_fini_noirq() local
130 struct intel_display *display = &xe->display; in xe_display_fini_noirq()
132 if (!xe->info.probe_display) in xe_display_fini_noirq()
135 intel_display_driver_remove_noirq(xe); in xe_display_fini_noirq()
139 int xe_display_init_noirq(struct xe_device *xe) in xe_display_init_noirq() argument
141 struct intel_display *display = &xe->display; in xe_display_init_noirq()
144 if (!xe->info.probe_display) in xe_display_init_noirq()
145 return 0; in xe_display_init_noirq()
147 intel_display_driver_early_probe(xe); in xe_display_init_noirq()
156 intel_dram_detect(xe); in xe_display_init_noirq()
158 intel_bw_init_hw(xe); in xe_display_init_noirq()
160 intel_display_device_info_runtime_init(xe); in xe_display_init_noirq()
162 err = intel_display_driver_probe_noirq(xe); in xe_display_init_noirq()
168 return devm_add_action_or_reset(xe->drm.dev, xe_display_fini_noirq, xe); in xe_display_init_noirq()
173 struct xe_device *xe = arg; in xe_display_fini_noaccel() local
175 if (!xe->info.probe_display) in xe_display_fini_noaccel()
178 intel_display_driver_remove_nogem(xe); in xe_display_fini_noaccel()
181 int xe_display_init_noaccel(struct xe_device *xe) in xe_display_init_noaccel() argument
185 if (!xe->info.probe_display) in xe_display_init_noaccel()
186 return 0; in xe_display_init_noaccel()
188 err = intel_display_driver_probe_nogem(xe); in xe_display_init_noaccel()
192 return devm_add_action_or_reset(xe->drm.dev, xe_display_fini_noaccel, xe); in xe_display_init_noaccel()
195 int xe_display_init(struct xe_device *xe) in xe_display_init() argument
197 if (!xe->info.probe_display) in xe_display_init()
198 return 0; in xe_display_init()
200 return intel_display_driver_probe(xe); in xe_display_init()
203 void xe_display_fini(struct xe_device *xe) in xe_display_fini() argument
205 if (!xe->info.probe_display) in xe_display_fini()
208 intel_hpd_poll_fini(xe); in xe_display_fini()
210 intel_hdcp_component_fini(xe); in xe_display_fini()
211 intel_audio_deinit(xe); in xe_display_fini()
214 void xe_display_register(struct xe_device *xe) in xe_display_register() argument
216 if (!xe->info.probe_display) in xe_display_register()
219 intel_display_driver_register(xe); in xe_display_register()
221 intel_power_domains_enable(xe); in xe_display_register()
224 void xe_display_unregister(struct xe_device *xe) in xe_display_unregister() argument
226 if (!xe->info.probe_display) in xe_display_unregister()
230 intel_power_domains_disable(xe); in xe_display_unregister()
231 intel_display_driver_unregister(xe); in xe_display_unregister()
234 void xe_display_driver_remove(struct xe_device *xe) in xe_display_driver_remove() argument
236 if (!xe->info.probe_display) in xe_display_driver_remove()
239 intel_display_driver_remove(xe); in xe_display_driver_remove()
244 void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl) in xe_display_irq_handler() argument
246 if (!xe->info.probe_display) in xe_display_irq_handler()
250 gen11_display_irq_handler(xe); in xe_display_irq_handler()
253 void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir) in xe_display_irq_enable() argument
255 struct intel_display *display = &xe->display; in xe_display_irq_enable()
257 if (!xe->info.probe_display) in xe_display_irq_enable()
264 void xe_display_irq_reset(struct xe_device *xe) in xe_display_irq_reset() argument
266 if (!xe->info.probe_display) in xe_display_irq_reset()
269 gen11_display_irq_reset(xe); in xe_display_irq_reset()
272 void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) in xe_display_irq_postinstall() argument
274 if (!xe->info.probe_display) in xe_display_irq_postinstall()
278 gen11_de_irq_postinstall(xe); in xe_display_irq_postinstall()
290 static void xe_display_flush_cleanup_work(struct xe_device *xe) in xe_display_flush_cleanup_work() argument
294 for_each_intel_crtc(&xe->drm, crtc) { in xe_display_flush_cleanup_work()
312 static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime) in __xe_display_pm_suspend() argument
314 struct intel_display *display = &xe->display; in __xe_display_pm_suspend()
316 if (!xe->info.probe_display) in __xe_display_pm_suspend()
323 intel_power_domains_disable(xe); in __xe_display_pm_suspend()
324 intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true); in __xe_display_pm_suspend()
325 if (!runtime && has_display(xe)) { in __xe_display_pm_suspend()
326 drm_kms_helper_poll_disable(&xe->drm); in __xe_display_pm_suspend()
327 intel_display_driver_disable_user_access(xe); in __xe_display_pm_suspend()
328 intel_display_driver_suspend(xe); in __xe_display_pm_suspend()
331 xe_display_flush_cleanup_work(xe); in __xe_display_pm_suspend()
333 intel_dp_mst_suspend(xe); in __xe_display_pm_suspend()
335 intel_hpd_cancel_work(xe); in __xe_display_pm_suspend()
337 if (!runtime && has_display(xe)) { in __xe_display_pm_suspend()
338 intel_display_driver_suspend_access(xe); in __xe_display_pm_suspend()
339 intel_encoder_suspend_all(&xe->display); in __xe_display_pm_suspend()
344 intel_dmc_suspend(xe); in __xe_display_pm_suspend()
346 if (runtime && has_display(xe)) in __xe_display_pm_suspend()
347 intel_hpd_poll_enable(xe); in __xe_display_pm_suspend()
350 void xe_display_pm_suspend(struct xe_device *xe) in xe_display_pm_suspend() argument
352 __xe_display_pm_suspend(xe, false); in xe_display_pm_suspend()
355 void xe_display_pm_runtime_suspend(struct xe_device *xe) in xe_display_pm_runtime_suspend() argument
357 if (!xe->info.probe_display) in xe_display_pm_runtime_suspend()
360 if (xe->d3cold.allowed) { in xe_display_pm_runtime_suspend()
361 __xe_display_pm_suspend(xe, true); in xe_display_pm_runtime_suspend()
365 intel_hpd_poll_enable(xe); in xe_display_pm_runtime_suspend()
368 void xe_display_pm_suspend_late(struct xe_device *xe) in xe_display_pm_suspend_late() argument
371 if (!xe->info.probe_display) in xe_display_pm_suspend_late()
374 intel_power_domains_suspend(xe, s2idle); in xe_display_pm_suspend_late()
376 intel_display_power_suspend_late(xe); in xe_display_pm_suspend_late()
379 void xe_display_pm_resume_early(struct xe_device *xe) in xe_display_pm_resume_early() argument
381 if (!xe->info.probe_display) in xe_display_pm_resume_early()
384 intel_display_power_resume_early(xe); in xe_display_pm_resume_early()
386 intel_power_domains_resume(xe); in xe_display_pm_resume_early()
389 static void __xe_display_pm_resume(struct xe_device *xe, bool runtime) in __xe_display_pm_resume() argument
391 struct intel_display *display = &xe->display; in __xe_display_pm_resume()
393 if (!xe->info.probe_display) in __xe_display_pm_resume()
396 intel_dmc_resume(xe); in __xe_display_pm_resume()
398 if (has_display(xe)) in __xe_display_pm_resume()
399 drm_mode_config_reset(&xe->drm); in __xe_display_pm_resume()
401 intel_display_driver_init_hw(xe); in __xe_display_pm_resume()
402 intel_hpd_init(xe); in __xe_display_pm_resume()
404 if (!runtime && has_display(xe)) in __xe_display_pm_resume()
405 intel_display_driver_resume_access(xe); in __xe_display_pm_resume()
408 intel_dp_mst_resume(xe); in __xe_display_pm_resume()
409 if (!runtime && has_display(xe)) { in __xe_display_pm_resume()
410 intel_display_driver_resume(xe); in __xe_display_pm_resume()
411 drm_kms_helper_poll_enable(&xe->drm); in __xe_display_pm_resume()
412 intel_display_driver_enable_user_access(xe); in __xe_display_pm_resume()
415 if (has_display(xe)) in __xe_display_pm_resume()
416 intel_hpd_poll_disable(xe); in __xe_display_pm_resume()
420 intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false); in __xe_display_pm_resume()
422 intel_power_domains_enable(xe); in __xe_display_pm_resume()
425 void xe_display_pm_resume(struct xe_device *xe) in xe_display_pm_resume() argument
427 __xe_display_pm_resume(xe, false); in xe_display_pm_resume()
430 void xe_display_pm_runtime_resume(struct xe_device *xe) in xe_display_pm_runtime_resume() argument
432 if (!xe->info.probe_display) in xe_display_pm_runtime_resume()
435 if (xe->d3cold.allowed) { in xe_display_pm_runtime_resume()
436 __xe_display_pm_resume(xe, true); in xe_display_pm_runtime_resume()
440 intel_hpd_init(xe); in xe_display_pm_runtime_resume()
441 intel_hpd_poll_disable(xe); in xe_display_pm_runtime_resume()
447 struct xe_device *xe = arg; in display_device_remove() local
449 intel_display_device_remove(xe); in display_device_remove()
452 int xe_display_probe(struct xe_device *xe) in xe_display_probe() argument
456 if (!xe->info.probe_display) in xe_display_probe()
459 intel_display_device_probe(xe); in xe_display_probe()
461 err = drmm_add_action_or_reset(&xe->drm, display_device_remove, xe); in xe_display_probe()
465 if (has_display(xe)) in xe_display_probe()
466 return 0; in xe_display_probe()
469 xe->info.probe_display = false; in xe_display_probe()
470 unset_display_features(xe); in xe_display_probe()
471 return 0; in xe_display_probe()