1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
/**
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef SDE_SPLASH_H_
#define SDE_SPLASH_H_
#include "msm_kms.h"
#include "msm_mmu.h"
#include "sde_hw_mdss.h"
enum splash_connector_type {
SPLASH_DSI = 0,
SPLASH_HDMI,
};
struct splash_lm_hw {
u8 lm_id;
u8 ctl_id;
u32 lm_reg_value;
};
struct splash_ctl_top {
u32 value;
u8 intf_sel;
u8 ctl_lm_cnt;
struct splash_lm_hw lm[LM_MAX - LM_0];
};
struct splash_res_data {
struct splash_ctl_top top[CTL_MAX - CTL_0];
u8 ctl_ids[CTL_MAX - CTL_0];
u8 lm_ids[LM_MAX - LM_0];
u8 ctl_top_cnt;
u8 lm_cnt;
};
struct splash_reserved_pipe_info {
uint32_t pipe_id;
bool early_release;
};
struct splash_pipe_caps {
enum sde_sspp pipe;
u32 flush_bit;
u32 mixer_mask;
u32 mixer_ext_mask;
};
struct sde_splash_info {
/* handoff flag */
bool handoff;
/* current hw configuration */
struct splash_res_data res;
/* flag of display splash status */
bool display_splash_enabled;
/* to indicate LK is totally exited */
bool lk_is_exited;
/* flag of early display status */
bool early_display_enabled;
/* flag of early RVC status */
bool early_camera_enabled;
/* memory node used for display buffer */
uint32_t splash_mem_num;
/* physical address of memory node for display buffer */
phys_addr_t *splash_mem_paddr;
/* size of memory node */
size_t *splash_mem_size;
/* constructed gem objects for smmu mapping */
struct drm_gem_object **obj;
/* enabled statue of displays*/
uint32_t intf_sel_status;
/* DSI split enabled flag */
bool split_is_enabled;
/* registered hdmi connector count */
uint32_t hdmi_connector_cnt;
/* registered dsi connector count */
uint32_t dsi_connector_cnt;
/* reserved pipe info both for early RVC and early splash */
struct splash_reserved_pipe_info reserved_pipe_info[MAX_BLOCKS];
/* flush bits of reserved pipes */
uint32_t flush_bits;
/* layer mixer mask of reserved pipes */
uint32_t mixer_mask;
/* layer mixer extension mask of reserved pipes */
uint32_t mixer_ext_mask;
};
/* APIs for early splash handoff functions */
/**
* sde_splash_get_handoff_status.
*
* This function will read DISP_INTF_SEL regsiter to get
* the status of early splash.
*/
int sde_splash_get_handoff_status(struct msm_kms *kms);
/**
* sde_splash_init
*
* This function will do bandwidth vote and reserved memory
*/
int sde_splash_init(struct sde_power_handle *phandle, struct msm_kms *kms);
/**
*sde_splash_setup_connector_count
*
* To count connector numbers for DSI and HDMI respectively.
*/
void sde_splash_setup_connector_count(struct sde_splash_info *sinfo,
int connector_type, void *display,
bool connector_is_shared);
/**
* sde_splash_lk_stop_splash.
*
* Tell LK to stop display splash once one valid user commit arrives.
*/
int sde_splash_lk_stop_splash(struct msm_kms *kms,
struct drm_atomic_state *state);
/**
* sde_splash_free_resource.
*
* To free all LK's resource, including free reserved memory to system,
* withdraw data bus vote, disable MDP core power, send uevent to user
* to recycle pipe etc.
*/
int sde_splash_free_resource(struct msm_kms *kms,
struct sde_power_handle *phandle,
int connector_type, void *display,
bool connector_is_shared);
/**
* sde_splash_parse_memory_dt.
*
* Parse reserved memory block from DT for early splash.
*/
int sde_splash_parse_memory_dt(struct drm_device *dev);
/**
* sde_splash_parse_reserved_plane_dt
*
* Parse reserved plane information from DT for early RVC case.
*/
int sde_splash_parse_reserved_plane_dt(struct drm_device *dev,
struct sde_splash_info *splash_info,
struct sde_mdss_cfg *cfg);
/*
* sde_splash_query_plane_is_reserved
*
* Query plane is reserved in dt.
*/
bool sde_splash_query_plane_is_reserved(struct sde_splash_info *sinfo,
uint32_t pipe);
/**
* sde_splash_smmu_map.
*
* Map the physical memory LK visited into iommu driver.
*/
int sde_splash_smmu_map(struct drm_device *dev, struct msm_mmu *mmu,
struct sde_splash_info *sinfo);
/**
* sde_splash_destroy
*
* Destroy the resource in failed case.
*/
void sde_splash_destroy(struct sde_splash_info *sinfo,
struct sde_power_handle *phandle,
struct sde_power_client *pclient);
/**
* sde_splash_get_lk_complete_status
*
* Get LK's status to check if it has been stopped.
*/
bool sde_splash_get_lk_complete_status(struct msm_kms *kms);
/**
* sde_splash_setup_display_resource
*
* Setup display resource based on connector type.
*/
int sde_splash_setup_display_resource(struct sde_splash_info *sinfo,
void *disp, int connector_type,
bool display_is_shared);
/**
* sde_splash_decrease_connector_cnt()
*
* Decrease splash connector count when shared display configuration is enabled.
*/
void sde_splash_decrease_connector_cnt(struct drm_device *dev,
int connector_type,
bool splash_on);
/**
* sde_splash_get_mixer_mask
*
* Retrieve mixer mask and extension mask from splash_info structure.
*/
void sde_splash_get_mixer_mask(struct sde_splash_info *sinfo,
bool *splash_on, u32 *mixercfg, u32 *mixercfg_ext);
#endif
|