hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
....@@ -107,6 +107,12 @@
107107 ROCKCHIP_COLOR_BAR_VERTICAL = 2,
108108 };
109109
110
+enum rockchip_drm_split_area {
111
+ ROCKCHIP_DRM_SPLIT_UNSET = 0,
112
+ ROCKCHIP_DRM_SPLIT_LEFT_SIDE = 1,
113
+ ROCKCHIP_DRM_SPLIT_RIGHT_SIDE = 2,
114
+};
115
+
110116 struct rockchip_drm_sub_dev {
111117 struct list_head list;
112118 struct drm_connector *connector;
....@@ -184,6 +190,37 @@
184190 u16 target_bits_per_pixel_x16;
185191 };
186192
193
+#define ACM_GAIN_LUT_HY_LENGTH (9*17)
194
+#define ACM_GAIN_LUT_HY_TOTAL_LENGTH (ACM_GAIN_LUT_HY_LENGTH * 3)
195
+#define ACM_GAIN_LUT_HS_LENGTH (13*17)
196
+#define ACM_GAIN_LUT_HS_TOTAL_LENGTH (ACM_GAIN_LUT_HS_LENGTH * 3)
197
+#define ACM_DELTA_LUT_H_LENGTH 65
198
+#define ACM_DELTA_LUT_H_TOTAL_LENGTH (ACM_DELTA_LUT_H_LENGTH * 3)
199
+
200
+struct post_acm {
201
+ s16 delta_lut_h[ACM_DELTA_LUT_H_TOTAL_LENGTH];
202
+ s16 gain_lut_hy[ACM_GAIN_LUT_HY_TOTAL_LENGTH];
203
+ s16 gain_lut_hs[ACM_GAIN_LUT_HS_TOTAL_LENGTH];
204
+ u16 y_gain;
205
+ u16 h_gain;
206
+ u16 s_gain;
207
+ u16 acm_enable;
208
+};
209
+
210
+struct post_csc {
211
+ u16 hue;
212
+ u16 saturation;
213
+ u16 contrast;
214
+ u16 brightness;
215
+ u16 r_gain;
216
+ u16 g_gain;
217
+ u16 b_gain;
218
+ u16 r_offset;
219
+ u16 g_offset;
220
+ u16 b_offset;
221
+ u16 csc_enable;
222
+};
223
+
187224 struct rockchip_crtc_state {
188225 struct drm_crtc_state base;
189226 int vp_id;
....@@ -227,6 +264,7 @@
227264 int afbdc_win_yoffset;
228265 int dsp_layer_sel;
229266 u32 output_if;
267
+ u32 output_if_left_panel;
230268 u32 bus_format;
231269 u32 bus_flags;
232270 int yuv_overlay;
....@@ -255,6 +293,7 @@
255293 struct drm_property_blob *hdr_ext_data;
256294 struct drm_property_blob *acm_lut_data;
257295 struct drm_property_blob *post_csc_data;
296
+ struct drm_property_blob *cubic_lut_data;
258297
259298 int request_refresh_rate;
260299 int max_refresh_rate;
....@@ -399,7 +438,7 @@
399438 * @wait_vact_end: wait the last active line.
400439 */
401440 struct rockchip_crtc_funcs {
402
- int (*loader_protect)(struct drm_crtc *crtc, bool on);
441
+ int (*loader_protect)(struct drm_crtc *crtc, bool on, void *data);
403442 int (*enable_vblank)(struct drm_crtc *crtc);
404443 void (*disable_vblank)(struct drm_crtc *crtc);
405444 size_t (*bandwidth)(struct drm_crtc *crtc,
....@@ -452,6 +491,8 @@
452491 struct drm_property *aclk_prop;
453492 struct drm_property *bg_prop;
454493 struct drm_property *line_flag_prop;
494
+ struct drm_property *cubic_lut_prop;
495
+ struct drm_property *cubic_lut_size_prop;
455496
456497 /* private plane prop */
457498 struct drm_property *eotf_prop;
....@@ -461,6 +502,7 @@
461502
462503 /* private connector prop */
463504 struct drm_property *connector_id_prop;
505
+ struct drm_property *split_area_prop;
464506
465507 const struct rockchip_crtc_funcs *crtc_funcs[ROCKCHIP_MAX_CRTC];
466508
....@@ -525,6 +567,7 @@
525567 uint32_t rockchip_drm_of_find_possible_crtcs(struct drm_device *dev,
526568 struct device_node *port);
527569 uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info);
570
+uint32_t rockchip_drm_get_cycles_per_pixel(uint32_t bus_format);
528571 int rockchip_drm_get_yuv422_format(struct drm_connector *connector,
529572 struct edid *edid);
530573 int rockchip_drm_parse_cea_ext(struct rockchip_drm_dsc_cap *dsc_cap,