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