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_device; 11 struct ref_tracker; 12 13 struct intel_display_rpm_interface { 14 struct ref_tracker *(*get)(const struct drm_device *drm); 15 struct ref_tracker *(*get_raw)(const struct drm_device *drm); 16 struct ref_tracker *(*get_if_in_use)(const struct drm_device *drm); 17 struct ref_tracker *(*get_noresume)(const struct drm_device *drm); 18 19 void (*put)(const struct drm_device *drm, struct ref_tracker *wakeref); 20 void (*put_raw)(const struct drm_device *drm, struct ref_tracker *wakeref); 21 void (*put_unchecked)(const struct drm_device *drm); 22 23 bool (*suspended)(const struct drm_device *drm); 24 void (*assert_held)(const struct drm_device *drm); 25 void (*assert_block)(const struct drm_device *drm); 26 void (*assert_unblock)(const struct drm_device *drm); 27 }; 28 29 struct intel_display_irq_interface { 30 bool (*enabled)(struct drm_device *drm); 31 void (*synchronize)(struct drm_device *drm); 32 }; 33 34 struct intel_display_rps_interface { 35 void (*boost_if_not_started)(struct dma_fence *fence); 36 void (*mark_interactive)(struct drm_device *drm, bool interactive); 37 void (*ilk_irq_handler)(struct drm_device *drm); 38 }; 39 40 /** 41 * struct intel_display_parent_interface - services parent driver provides to display 42 * 43 * The parent, or core, driver provides a pointer to this structure to display 44 * driver when calling intel_display_device_probe(). The display driver uses it 45 * to access services provided by the parent driver. The structure may contain 46 * sub-struct pointers to group function pointers by functionality. 47 * 48 * All function and sub-struct pointers must be initialized and callable unless 49 * explicitly marked as "optional" below. The display driver will only NULL 50 * check the optional pointers. 51 */ 52 struct intel_display_parent_interface { 53 /** @rpm: Runtime PM functions */ 54 const struct intel_display_rpm_interface *rpm; 55 56 /** @irq: IRQ interface */ 57 const struct intel_display_irq_interface *irq; 58 59 /** @rpm: RPS interface. Optional. */ 60 const struct intel_display_rps_interface *rps; 61 62 /** @vgpu_active: Is vGPU active? Optional. */ 63 bool (*vgpu_active)(struct drm_device *drm); 64 65 /** @has_fenced_regions: Support legacy fencing? Optional. */ 66 bool (*has_fenced_regions)(struct drm_device *drm); 67 68 /** @fence_priority_display: Set display priority. Optional. */ 69 void (*fence_priority_display)(struct dma_fence *fence); 70 }; 71 72 #endif 73