blob: 6ffc4b61e63ae117fa5f50f6adf2d3b79b2ed33d [file] [log] [blame]
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -07001/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _SDE_HW_DSPP_H
14#define _SDE_HW_DSPP_H
15
16struct sde_hw_dspp;
17
18/**
19 * struct sde_hw_dspp_ops - interface to the dspp hardware driver functions
20 * Caller must call the init function to get the dspp context for each dspp
21 * Assumption is these functions will be called after clocks are enabled
22 */
23struct sde_hw_dspp_ops {
24 /**
25 * setup_histogram - setup dspp histogram
26 * @ctx: Pointer to dspp context
27 * @cfg: Pointer to configuration
28 */
29 void (*setup_histogram)(struct sde_hw_dspp *ctx, void *cfg);
30
31 /**
32 * read_histogram - read dspp histogram
33 * @ctx: Pointer to dspp context
34 * @cfg: Pointer to configuration
35 */
36 void (*read_histogram)(struct sde_hw_dspp *ctx, void *cfg);
37
38 /**
39 * update_igc - update dspp igc
40 * @ctx: Pointer to dspp context
41 * @cfg: Pointer to configuration
42 */
43 void (*update_igc)(struct sde_hw_dspp *ctx, void *cfg);
44
45 /**
46 * setup_pa - setup dspp pa
47 * @ctx: Pointer to dspp context
48 * @cfg: Pointer to configuration
49 */
50 void (*setup_pa)(struct sde_hw_dspp *dspp, void *cfg);
51
52 /**
53 * setup_pcc - setup dspp pcc
54 * @ctx: Pointer to dspp context
55 * @cfg: Pointer to configuration
56 */
57 void (*setup_pcc)(struct sde_hw_dspp *ctx, void *cfg);
58
59 /**
60 * setup_sharpening - setup dspp sharpening
61 * @ctx: Pointer to dspp context
62 * @cfg: Pointer to configuration
63 */
64 void (*setup_sharpening)(struct sde_hw_dspp *ctx, void *cfg);
65
66 /**
67 * setup_pa_memcolor - setup dspp memcolor
68 * @ctx: Pointer to dspp context
69 * @cfg: Pointer to configuration
70 */
71 void (*setup_pa_memcolor)(struct sde_hw_dspp *ctx, void *cfg);
72
73 /**
74 * setup_sixzone - setup dspp six zone
75 * @ctx: Pointer to dspp context
76 * @cfg: Pointer to configuration
77 */
78 void (*setup_sixzone)(struct sde_hw_dspp *dspp);
79
80 /**
81 * setup_danger_safe - setup danger safe LUTS
82 * @ctx: Pointer to dspp context
83 * @cfg: Pointer to configuration
84 */
85 void (*setup_danger_safe)(struct sde_hw_dspp *ctx, void *cfg);
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -070086
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070087 /**
88 * setup_dither - setup dspp dither
89 * @ctx: Pointer to dspp context
90 * @cfg: Pointer to configuration
91 */
92 void (*setup_dither)(struct sde_hw_dspp *ctx, void *cfg);
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -070093
94 /**
95 * setup_hue - setup dspp PA hue
96 * @ctx: Pointer to dspp context
97 * @cfg: Pointer to configuration
98 */
99 void (*setup_hue)(struct sde_hw_dspp *ctx, void *cfg);
100
101 /**
102 * setup_sat - setup dspp PA saturation
103 * @ctx: Pointer to dspp context
104 * @cfg: Pointer to configuration
105 */
106 void (*setup_sat)(struct sde_hw_dspp *ctx, void *cfg);
107
108 /**
109 * setup_val - setup dspp PA value
110 * @ctx: Pointer to dspp context
111 * @cfg: Pointer to configuration
112 */
113 void (*setup_val)(struct sde_hw_dspp *ctx, void *cfg);
114
115 /**
116 * setup_cont - setup dspp PA contrast
117 * @ctx: Pointer to dspp context
118 * @cfg: Pointer to configuration
119 */
120 void (*setup_cont)(struct sde_hw_dspp *ctx, void *cfg);
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700121
122 /**
123 * setup_vlut - setup dspp PA VLUT
124 * @ctx: Pointer to dspp context
125 * @cfg: Pointer to configuration
126 */
127 void (*setup_vlut)(struct sde_hw_dspp *ctx, void *cfg);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700128};
129
130/**
131 * struct sde_hw_dspp - dspp description
132 * @base_off: MDP register mapped offset
133 * @blk_off: DSPP offset relative to mdss offset
134 * @length Length of register block offset
135 * @hwversion Mdss hw version number
136 * @idx: DSPP index
137 * @dspp_hw_cap: Pointer to layer_cfg
138 * @highest_bank_bit:
139 * @ops: Pointer to operations possible for this dspp
140 */
141struct sde_hw_dspp {
142 /* base */
143 struct sde_hw_blk_reg_map hw;
144
145 /* dspp */
146 enum sde_dspp idx;
147 const struct sde_dspp_cfg *cap;
148
149 /* Ops */
150 struct sde_hw_dspp_ops ops;
151};
152
153/**
154 * sde_hw_dspp_init - initializes the dspp hw driver object.
155 * should be called once before accessing every dspp.
156 * @idx: DSPP index for which driver object is required
157 * @addr: Mapped register io address of MDP
158 */
159struct sde_hw_dspp *sde_hw_dspp_init(enum sde_dspp idx,
160 void __iomem *addr,
161 struct sde_mdss_cfg *m);
162
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400163/**
164 * sde_hw_dspp_destroy(): Destroys DSPP driver context
165 * @dspp: Pointer to DSPP driver context
166 */
167void sde_hw_dspp_destroy(struct sde_hw_dspp *dspp);
168
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700169#endif /*_SDE_HW_DSPP_H */