1 /* SPDX-License-Identifier: MIT */ 2 /* Copyright © 2025 Intel Corporation x*/ 3 4 #ifndef __DISPLAY_PARENT_INTERFACE_H__ 5 #define __DISPLAY_PARENT_INTERFACE_H__ 6 7 #include <linux/types.h> 8 9 struct dma_fence; 10 struct drm_crtc; 11 struct drm_device; 12 struct drm_scanout_buffer; 13 struct intel_hdcp_gsc_context; 14 struct intel_panic; 15 struct intel_stolen_node; 16 struct ref_tracker; 17 18 /* Keep struct definitions sorted */ 19 20 struct intel_display_hdcp_interface { 21 ssize_t (*gsc_msg_send)(struct intel_hdcp_gsc_context *gsc_context, 22 void *msg_in, size_t msg_in_len, 23 void *msg_out, size_t msg_out_len); 24 bool (*gsc_check_status)(struct drm_device *drm); 25 struct intel_hdcp_gsc_context *(*gsc_context_alloc)(struct drm_device *drm); 26 void (*gsc_context_free)(struct intel_hdcp_gsc_context *gsc_context); 27 }; 28 29 struct intel_display_initial_plane_interface { 30 void (*vblank_wait)(struct drm_crtc *crtc); 31 void (*config)(struct drm_device *drm); 32 }; 33 34 struct intel_display_irq_interface { 35 bool (*enabled)(struct drm_device *drm); 36 void (*synchronize)(struct drm_device *drm); 37 }; 38 39 struct intel_display_panic_interface { 40 struct intel_panic *(*alloc)(void); 41 int (*setup)(struct intel_panic *panic, struct drm_scanout_buffer *sb); 42 void (*finish)(struct intel_panic *panic); 43 }; 44 45 struct intel_display_pc8_interface { 46 void (*block)(struct drm_device *drm); 47 void (*unblock)(struct drm_device *drm); 48 }; 49 50 struct intel_display_rpm_interface { 51 struct ref_tracker *(*get)(const struct drm_device *drm); 52 struct ref_tracker *(*get_raw)(const struct drm_device *drm); 53 struct ref_tracker *(*get_if_in_use)(const struct drm_device *drm); 54 struct ref_tracker *(*get_noresume)(const struct drm_device *drm); 55 56 void (*put)(const struct drm_device *drm, struct ref_tracker *wakeref); 57 void (*put_raw)(const struct drm_device *drm, struct ref_tracker *wakeref); 58 void (*put_unchecked)(const struct drm_device *drm); 59 60 bool (*suspended)(const struct drm_device *drm); 61 void (*assert_held)(const struct drm_device *drm); 62 void (*assert_block)(const struct drm_device *drm); 63 void (*assert_unblock)(const struct drm_device *drm); 64 }; 65 66 struct intel_display_rps_interface { 67 void (*boost_if_not_started)(struct dma_fence *fence); 68 void (*mark_interactive)(struct drm_device *drm, bool interactive); 69 void (*ilk_irq_handler)(struct drm_device *drm); 70 }; 71 72 struct intel_display_stolen_interface { 73 int (*insert_node_in_range)(struct intel_stolen_node *node, u64 size, 74 unsigned int align, u64 start, u64 end); 75 int (*insert_node)(struct intel_stolen_node *node, u64 size, unsigned int align); /* Optional */ 76 void (*remove_node)(struct intel_stolen_node *node); 77 bool (*initialized)(struct drm_device *drm); 78 bool (*node_allocated)(const struct intel_stolen_node *node); 79 u64 (*node_offset)(const struct intel_stolen_node *node); 80 u64 (*area_address)(struct drm_device *drm); /* Optional */ 81 u64 (*area_size)(struct drm_device *drm); /* Optional */ 82 u64 (*node_address)(const struct intel_stolen_node *node); 83 u64 (*node_size)(const struct intel_stolen_node *node); 84 struct intel_stolen_node *(*node_alloc)(struct drm_device *drm); 85 void (*node_free)(const struct intel_stolen_node *node); 86 }; 87 88 /** 89 * struct intel_display_parent_interface - services parent driver provides to display 90 * 91 * The parent, or core, driver provides a pointer to this structure to display 92 * driver when calling intel_display_device_probe(). The display driver uses it 93 * to access services provided by the parent driver. The structure may contain 94 * sub-struct pointers to group function pointers by functionality. 95 * 96 * All function and sub-struct pointers must be initialized and callable unless 97 * explicitly marked as "optional" below. The display driver will only NULL 98 * check the optional pointers. 99 */ 100 struct intel_display_parent_interface { 101 /** @hdcp: HDCP GSC interface */ 102 const struct intel_display_hdcp_interface *hdcp; 103 104 /** @initial_plane: Initial plane interface */ 105 const struct intel_display_initial_plane_interface *initial_plane; 106 107 /** @irq: IRQ interface */ 108 const struct intel_display_irq_interface *irq; 109 110 /** @panic: Panic interface */ 111 const struct intel_display_panic_interface *panic; 112 113 /** @pc8: PC8 interface. Optional. */ 114 const struct intel_display_pc8_interface *pc8; 115 116 /** @rpm: Runtime PM functions */ 117 const struct intel_display_rpm_interface *rpm; 118 119 /** @rps: RPS interface. Optional. */ 120 const struct intel_display_rps_interface *rps; 121 122 /** @stolen: Stolen memory. */ 123 const struct intel_display_stolen_interface *stolen; 124 125 /* Generic independent functions */ 126 struct { 127 /** @fence_priority_display: Set display priority. Optional. */ 128 void (*fence_priority_display)(struct dma_fence *fence); 129 130 /** @has_auxccs: Are AuxCCS formats supported by the parent. Optional. */ 131 bool (*has_auxccs)(struct drm_device *drm); 132 133 /** @has_fenced_regions: Support legacy fencing? Optional. */ 134 bool (*has_fenced_regions)(struct drm_device *drm); 135 136 /** @vgpu_active: Is vGPU active? Optional. */ 137 bool (*vgpu_active)(struct drm_device *drm); 138 }; 139 }; 140 141 #endif 142