forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
....@@ -1,19 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
34 * Copyright (C) 2013 Red Hat
45 * Author: Rob Clark <robdclark@gmail.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published by
8
- * the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
14
- *
15
- * You should have received a copy of the GNU General Public License along with
16
- * this program. If not, see <http://www.gnu.org/licenses/>.
176 */
187
198 #ifndef __DPU_ENCODER_H__
....@@ -32,45 +21,36 @@
3221 /**
3322 * Encoder functions and data types
3423 * @intfs: Interfaces this encoder is using, INTF_MODE_NONE if unused
35
- * @needs_cdm: Encoder requests a CDM based on pixel format conversion needs
36
- * @display_num_of_h_tiles: Number of horizontal tiles in case of split
37
- * interface
38
- * @topology: Topology of the display
3924 */
4025 struct dpu_encoder_hw_resources {
4126 enum dpu_intf_mode intfs[INTF_MAX];
42
- bool needs_cdm;
43
- u32 display_num_of_h_tiles;
44
-};
45
-
46
-/**
47
- * dpu_encoder_kickoff_params - info encoder requires at kickoff
48
- * @affected_displays: bitmask, bit set means the ROI of the commit lies within
49
- * the bounds of the physical display at the bit index
50
- */
51
-struct dpu_encoder_kickoff_params {
52
- unsigned long affected_displays;
5327 };
5428
5529 /**
5630 * dpu_encoder_get_hw_resources - Populate table of required hardware resources
5731 * @encoder: encoder pointer
5832 * @hw_res: resource table to populate with encoder required resources
59
- * @conn_state: report hw reqs based on this proposed connector state
6033 */
6134 void dpu_encoder_get_hw_resources(struct drm_encoder *encoder,
62
- struct dpu_encoder_hw_resources *hw_res,
63
- struct drm_connector_state *conn_state);
35
+ struct dpu_encoder_hw_resources *hw_res);
6436
6537 /**
66
- * dpu_encoder_register_vblank_callback - provide callback to encoder that
67
- * will be called on the next vblank.
38
+ * dpu_encoder_assign_crtc - Link the encoder to the crtc it's assigned to
6839 * @encoder: encoder pointer
69
- * @cb: callback pointer, provide NULL to deregister and disable IRQs
70
- * @data: user data provided to callback
40
+ * @crtc: crtc pointer
7141 */
72
-void dpu_encoder_register_vblank_callback(struct drm_encoder *encoder,
73
- void (*cb)(void *), void *data);
42
+void dpu_encoder_assign_crtc(struct drm_encoder *encoder,
43
+ struct drm_crtc *crtc);
44
+
45
+/**
46
+ * dpu_encoder_toggle_vblank_for_crtc - Toggles vblank interrupts on or off if
47
+ * the encoder is assigned to the given crtc
48
+ * @encoder: encoder pointer
49
+ * @crtc: crtc pointer
50
+ * @enable: true if vblank should be enabled
51
+ */
52
+void dpu_encoder_toggle_vblank_for_crtc(struct drm_encoder *encoder,
53
+ struct drm_crtc *crtc, bool enable);
7454
7555 /**
7656 * dpu_encoder_register_frame_event_callback - provide callback to encoder that
....@@ -88,10 +68,8 @@
8868 * Immediately: if no previous commit is outstanding.
8969 * Delayed: Block until next trigger can be issued.
9070 * @encoder: encoder pointer
91
- * @params: kickoff time parameters
9271 */
93
-void dpu_encoder_prepare_for_kickoff(struct drm_encoder *encoder,
94
- struct dpu_encoder_kickoff_params *params);
72
+void dpu_encoder_prepare_for_kickoff(struct drm_encoder *encoder);
9573
9674 /**
9775 * dpu_encoder_trigger_kickoff_pending - Clear the flush bits from previous
....@@ -106,6 +84,11 @@
10684 * @encoder: encoder pointer
10785 */
10886 void dpu_encoder_kickoff(struct drm_encoder *encoder);
87
+
88
+/**
89
+ * dpu_encoder_wakeup_time - get the time of the next vsync
90
+ */
91
+int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, ktime_t *wakeup_time);
10992
11093 /**
11194 * dpu_encoder_wait_for_event - Waits for encoder events
....@@ -134,10 +117,10 @@
134117 enum dpu_intf_mode dpu_encoder_get_intf_mode(struct drm_encoder *encoder);
135118
136119 /**
137
- * dpu_encoder_virt_restore - restore the encoder configs
120
+ * dpu_encoder_virt_runtime_resume - pm runtime resume the encoder configs
138121 * @encoder: encoder pointer
139122 */
140
-void dpu_encoder_virt_restore(struct drm_encoder *encoder);
123
+void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder);
141124
142125 /**
143126 * dpu_encoder_init - initialize virtual encoder object