xref: /linux/drivers/gpu/drm/xe/display/xe_display.h (revision e49a3eac9207e9575337f70feeb29430f6f16bb7)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_DISPLAY_H_
7 #define _XE_DISPLAY_H_
8 
9 #include "xe_device.h"
10 
11 struct drm_driver;
12 
13 #if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
14 
15 bool xe_display_driver_probe_defer(struct pci_dev *pdev);
16 void xe_display_driver_set_hooks(struct drm_driver *driver);
17 
18 int xe_display_create(struct xe_device *xe);
19 
20 int xe_display_probe(struct xe_device *xe);
21 
22 int xe_display_init_early(struct xe_device *xe);
23 int xe_display_init(struct xe_device *xe);
24 
25 void xe_display_register(struct xe_device *xe);
26 void xe_display_unregister(struct xe_device *xe);
27 
28 void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl);
29 void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir);
30 void xe_display_irq_reset(struct xe_device *xe);
31 void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt);
32 
33 void xe_display_pm_suspend(struct xe_device *xe);
34 void xe_display_pm_shutdown(struct xe_device *xe);
35 void xe_display_pm_suspend_late(struct xe_device *xe);
36 void xe_display_pm_shutdown_late(struct xe_device *xe);
37 void xe_display_pm_resume_early(struct xe_device *xe);
38 void xe_display_pm_resume(struct xe_device *xe);
39 void xe_display_pm_runtime_suspend(struct xe_device *xe);
40 void xe_display_pm_runtime_suspend_late(struct xe_device *xe);
41 void xe_display_pm_runtime_resume(struct xe_device *xe);
42 
43 #else
44 
45 static inline int xe_display_driver_probe_defer(struct pci_dev *pdev) { return 0; }
46 static inline void xe_display_driver_set_hooks(struct drm_driver *driver) { }
47 static inline void xe_display_driver_remove(struct xe_device *xe) {}
48 
49 static inline int xe_display_create(struct xe_device *xe) { return 0; }
50 
51 static inline int xe_display_probe(struct xe_device *xe) { return 0; }
52 
53 static inline int xe_display_init_early(struct xe_device *xe) { return 0; }
54 static inline int xe_display_init(struct xe_device *xe) { return 0; }
55 
56 static inline void xe_display_register(struct xe_device *xe) {}
57 static inline void xe_display_unregister(struct xe_device *xe) {}
58 
59 static inline void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl) {}
60 static inline void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir) {}
61 static inline void xe_display_irq_reset(struct xe_device *xe) {}
62 static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {}
63 
64 static inline void xe_display_pm_suspend(struct xe_device *xe) {}
65 static inline void xe_display_pm_shutdown(struct xe_device *xe) {}
66 static inline void xe_display_pm_suspend_late(struct xe_device *xe) {}
67 static inline void xe_display_pm_shutdown_late(struct xe_device *xe) {}
68 static inline void xe_display_pm_resume_early(struct xe_device *xe) {}
69 static inline void xe_display_pm_resume(struct xe_device *xe) {}
70 static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {}
71 static inline void xe_display_pm_runtime_suspend_late(struct xe_device *xe) {}
72 static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {}
73 
74 #endif /* CONFIG_DRM_XE_DISPLAY */
75 #endif /* _XE_DISPLAY_H_ */
76