xref: /linux/drivers/gpu/drm/i915/display/intel_parent.c (revision 55fc11ce96e92dbae2aab1d692735f7a9b96fefd)
1 // SPDX-License-Identifier: MIT
2 /* Copyright © 2025 Intel Corporation */
3 
4 /*
5  * Convenience wrapper functions to call the parent interface functions:
6  *
7  * - display->parent->SUBSTRUCT->FUNCTION()
8  * - display->parent->FUNCTION()
9  *
10  * All functions here should be named accordingly:
11  *
12  * - intel_parent_SUBSTRUCT_FUNCTION()
13  * - intel_parent_FUNCTION()
14  *
15  * These functions may use display driver specific types for parameters and
16  * return values, translating them to and from the generic types used in the
17  * function pointer interface.
18  */
19 
20 #include <drm/intel/display_parent_interface.h>
21 
22 #include "intel_display_core.h"
23 #include "intel_parent.h"
24 
25 bool intel_parent_irq_enabled(struct intel_display *display)
26 {
27 	return display->parent->irq->enabled(display->drm);
28 }
29 
30 void intel_parent_irq_synchronize(struct intel_display *display)
31 {
32 	display->parent->irq->synchronize(display->drm);
33 }
34 
35 bool intel_parent_rps_available(struct intel_display *display)
36 {
37 	return display->parent->rps;
38 }
39 
40 void intel_parent_rps_boost_if_not_started(struct intel_display *display, struct dma_fence *fence)
41 {
42 	if (display->parent->rps)
43 		display->parent->rps->boost_if_not_started(fence);
44 }
45 
46 void intel_parent_rps_mark_interactive(struct intel_display *display, bool interactive)
47 {
48 	if (display->parent->rps)
49 		display->parent->rps->mark_interactive(display->drm, interactive);
50 }
51 
52 void intel_parent_rps_ilk_irq_handler(struct intel_display *display)
53 {
54 	if (display->parent->rps)
55 		display->parent->rps->ilk_irq_handler(display->drm);
56 }
57 
58 bool intel_parent_vgpu_active(struct intel_display *display)
59 {
60 	return display->parent->vgpu_active && display->parent->vgpu_active(display->drm);
61 }
62 
63 bool intel_parent_has_fenced_regions(struct intel_display *display)
64 {
65 	return display->parent->has_fenced_regions && display->parent->has_fenced_regions(display->drm);
66 }
67 
68 void intel_parent_fence_priority_display(struct intel_display *display, struct dma_fence *fence)
69 {
70 	if (display->parent->fence_priority_display)
71 		display->parent->fence_priority_display(fence);
72 }
73