diff options
author | Archit Taneja <archit@ti.com> | 2011-03-02 00:49:50 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 08:46:26 -0500 |
commit | 87a7484b6a9ceaa9e7a9a238154b02ed4495f26a (patch) | |
tree | 0eee96ab17d68e5ef8dcf509b2e0f39ecf5403ae /drivers/video/omap2 | |
parent | 08a0a657949e723f0cbb6a33b1c706134d5a6d78 (diff) |
OMAP2PLUS: DSS2: FEATURES: DISPC overlay code cleanup
Add dss_features and register fields to incorporate changes in DISPC pipelines
between OMAP3 and OMAP4.
Register fields added: FEAT_REG_HORIZONTALACCU, FEAT_REG_VERTICALACCU
DSS Features added: FEAT_LINEBUFFERSPLIT, FEAT_ROWREPEATENABLE, FEAT_RESIZECONF
_dispc_set_scaling() and _dispc_set_rotation_attrs() have been cleaned up.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 52 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 30 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.h | 5 |
3 files changed, 66 insertions, 21 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 43f7091c71cb..aa6479712d4c 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -1130,10 +1130,16 @@ static void _dispc_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu) | |||
1130 | u32 val; | 1130 | u32 val; |
1131 | const struct dispc_reg ac0_reg[] = { DISPC_VID_ACCU0(0), | 1131 | const struct dispc_reg ac0_reg[] = { DISPC_VID_ACCU0(0), |
1132 | DISPC_VID_ACCU0(1) }; | 1132 | DISPC_VID_ACCU0(1) }; |
1133 | u8 hor_start, hor_end, vert_start, vert_end; | ||
1133 | 1134 | ||
1134 | BUG_ON(plane == OMAP_DSS_GFX); | 1135 | BUG_ON(plane == OMAP_DSS_GFX); |
1135 | 1136 | ||
1136 | val = FLD_VAL(vaccu, 25, 16) | FLD_VAL(haccu, 9, 0); | 1137 | dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end); |
1138 | dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end); | ||
1139 | |||
1140 | val = FLD_VAL(vaccu, vert_start, vert_end) | | ||
1141 | FLD_VAL(haccu, hor_start, hor_end); | ||
1142 | |||
1137 | dispc_write_reg(ac0_reg[plane-1], val); | 1143 | dispc_write_reg(ac0_reg[plane-1], val); |
1138 | } | 1144 | } |
1139 | 1145 | ||
@@ -1142,10 +1148,16 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu) | |||
1142 | u32 val; | 1148 | u32 val; |
1143 | const struct dispc_reg ac1_reg[] = { DISPC_VID_ACCU1(0), | 1149 | const struct dispc_reg ac1_reg[] = { DISPC_VID_ACCU1(0), |
1144 | DISPC_VID_ACCU1(1) }; | 1150 | DISPC_VID_ACCU1(1) }; |
1151 | u8 hor_start, hor_end, vert_start, vert_end; | ||
1145 | 1152 | ||
1146 | BUG_ON(plane == OMAP_DSS_GFX); | 1153 | BUG_ON(plane == OMAP_DSS_GFX); |
1147 | 1154 | ||
1148 | val = FLD_VAL(vaccu, 25, 16) | FLD_VAL(haccu, 9, 0); | 1155 | dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end); |
1156 | dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end); | ||
1157 | |||
1158 | val = FLD_VAL(vaccu, vert_start, vert_end) | | ||
1159 | FLD_VAL(haccu, hor_start, hor_end); | ||
1160 | |||
1149 | dispc_write_reg(ac1_reg[plane-1], val); | 1161 | dispc_write_reg(ac1_reg[plane-1], val); |
1150 | } | 1162 | } |
1151 | 1163 | ||
@@ -1183,16 +1195,25 @@ static void _dispc_set_scaling(enum omap_plane plane, | |||
1183 | _dispc_set_fir(plane, fir_hinc, fir_vinc); | 1195 | _dispc_set_fir(plane, fir_hinc, fir_vinc); |
1184 | 1196 | ||
1185 | l = dispc_read_reg(dispc_reg_att[plane]); | 1197 | l = dispc_read_reg(dispc_reg_att[plane]); |
1186 | l &= ~((0x0f << 5) | (0x3 << 21)); | ||
1187 | 1198 | ||
1199 | /* RESIZEENABLE and VERTICALTAPS */ | ||
1200 | l &= ~((0x3 << 5) | (0x1 << 21)); | ||
1188 | l |= fir_hinc ? (1 << 5) : 0; | 1201 | l |= fir_hinc ? (1 << 5) : 0; |
1189 | l |= fir_vinc ? (1 << 6) : 0; | 1202 | l |= fir_vinc ? (1 << 6) : 0; |
1203 | l |= five_taps ? (1 << 21) : 0; | ||
1190 | 1204 | ||
1191 | l |= hscaleup ? 0 : (1 << 7); | 1205 | /* VRESIZECONF and HRESIZECONF */ |
1192 | l |= vscaleup ? 0 : (1 << 8); | 1206 | if (dss_has_feature(FEAT_RESIZECONF)) { |
1207 | l &= ~(0x3 << 7); | ||
1208 | l |= hscaleup ? 0 : (1 << 7); | ||
1209 | l |= vscaleup ? 0 : (1 << 8); | ||
1210 | } | ||
1193 | 1211 | ||
1194 | l |= five_taps ? (1 << 21) : 0; | 1212 | /* LINEBUFFERSPLIT */ |
1195 | l |= five_taps ? (1 << 22) : 0; | 1213 | if (dss_has_feature(FEAT_LINEBUFFERSPLIT)) { |
1214 | l &= ~(0x1 << 22); | ||
1215 | l |= five_taps ? (1 << 22) : 0; | ||
1216 | } | ||
1196 | 1217 | ||
1197 | dispc_write_reg(dispc_reg_att[plane], l); | 1218 | dispc_write_reg(dispc_reg_att[plane], l); |
1198 | 1219 | ||
@@ -1216,9 +1237,11 @@ static void _dispc_set_scaling(enum omap_plane plane, | |||
1216 | static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation, | 1237 | static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation, |
1217 | bool mirroring, enum omap_color_mode color_mode) | 1238 | bool mirroring, enum omap_color_mode color_mode) |
1218 | { | 1239 | { |
1240 | bool row_repeat = false; | ||
1241 | int vidrot = 0; | ||
1242 | |||
1219 | if (color_mode == OMAP_DSS_COLOR_YUV2 || | 1243 | if (color_mode == OMAP_DSS_COLOR_YUV2 || |
1220 | color_mode == OMAP_DSS_COLOR_UYVY) { | 1244 | color_mode == OMAP_DSS_COLOR_UYVY) { |
1221 | int vidrot = 0; | ||
1222 | 1245 | ||
1223 | if (mirroring) { | 1246 | if (mirroring) { |
1224 | switch (rotation) { | 1247 | switch (rotation) { |
@@ -1252,16 +1275,15 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation, | |||
1252 | } | 1275 | } |
1253 | } | 1276 | } |
1254 | 1277 | ||
1255 | REG_FLD_MOD(dispc_reg_att[plane], vidrot, 13, 12); | ||
1256 | |||
1257 | if (rotation == OMAP_DSS_ROT_90 || rotation == OMAP_DSS_ROT_270) | 1278 | if (rotation == OMAP_DSS_ROT_90 || rotation == OMAP_DSS_ROT_270) |
1258 | REG_FLD_MOD(dispc_reg_att[plane], 0x1, 18, 18); | 1279 | row_repeat = true; |
1259 | else | 1280 | else |
1260 | REG_FLD_MOD(dispc_reg_att[plane], 0x0, 18, 18); | 1281 | row_repeat = false; |
1261 | } else { | ||
1262 | REG_FLD_MOD(dispc_reg_att[plane], 0, 13, 12); | ||
1263 | REG_FLD_MOD(dispc_reg_att[plane], 0, 18, 18); | ||
1264 | } | 1282 | } |
1283 | |||
1284 | REG_FLD_MOD(dispc_reg_att[plane], vidrot, 13, 12); | ||
1285 | if (dss_has_feature(FEAT_ROWREPEATENABLE)) | ||
1286 | REG_FLD_MOD(dispc_reg_att[plane], row_repeat ? 1 : 0, 18, 18); | ||
1265 | } | 1287 | } |
1266 | 1288 | ||
1267 | static int color_mode_to_bpp(enum omap_color_mode color_mode) | 1289 | static int color_mode_to_bpp(enum omap_color_mode color_mode) |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index fe22d11068bd..679be14b73a8 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -54,6 +54,8 @@ static const struct dss_reg_field omap2_dss_reg_fields[] = { | |||
54 | { FEAT_REG_FIFOLOWTHRESHOLD, 8, 0 }, | 54 | { FEAT_REG_FIFOLOWTHRESHOLD, 8, 0 }, |
55 | { FEAT_REG_FIFOHIGHTHRESHOLD, 24, 16 }, | 55 | { FEAT_REG_FIFOHIGHTHRESHOLD, 24, 16 }, |
56 | { FEAT_REG_FIFOSIZE, 8, 0 }, | 56 | { FEAT_REG_FIFOSIZE, 8, 0 }, |
57 | { FEAT_REG_HORIZONTALACCU, 9, 0 }, | ||
58 | { FEAT_REG_VERTICALACCU, 25, 16 }, | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | static const struct dss_reg_field omap3_dss_reg_fields[] = { | 61 | static const struct dss_reg_field omap3_dss_reg_fields[] = { |
@@ -62,6 +64,18 @@ static const struct dss_reg_field omap3_dss_reg_fields[] = { | |||
62 | { FEAT_REG_FIFOLOWTHRESHOLD, 11, 0 }, | 64 | { FEAT_REG_FIFOLOWTHRESHOLD, 11, 0 }, |
63 | { FEAT_REG_FIFOHIGHTHRESHOLD, 27, 16 }, | 65 | { FEAT_REG_FIFOHIGHTHRESHOLD, 27, 16 }, |
64 | { FEAT_REG_FIFOSIZE, 10, 0 }, | 66 | { FEAT_REG_FIFOSIZE, 10, 0 }, |
67 | { FEAT_REG_HORIZONTALACCU, 9, 0 }, | ||
68 | { FEAT_REG_VERTICALACCU, 25, 16 }, | ||
69 | }; | ||
70 | |||
71 | static const struct dss_reg_field omap4_dss_reg_fields[] = { | ||
72 | { FEAT_REG_FIRHINC, 12, 0 }, | ||
73 | { FEAT_REG_FIRVINC, 28, 16 }, | ||
74 | { FEAT_REG_FIFOLOWTHRESHOLD, 15, 0 }, | ||
75 | { FEAT_REG_FIFOHIGHTHRESHOLD, 31, 16 }, | ||
76 | { FEAT_REG_FIFOSIZE, 15, 0 }, | ||
77 | { FEAT_REG_HORIZONTALACCU, 10, 0 }, | ||
78 | { FEAT_REG_VERTICALACCU, 26, 16 }, | ||
65 | }; | 79 | }; |
66 | 80 | ||
67 | static const enum omap_display_type omap2_dss_supported_displays[] = { | 81 | static const enum omap_display_type omap2_dss_supported_displays[] = { |
@@ -149,7 +163,8 @@ static struct omap_dss_features omap2_dss_features = { | |||
149 | 163 | ||
150 | .has_feature = | 164 | .has_feature = |
151 | FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL | | 165 | FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL | |
152 | FEAT_PCKFREEENABLE | FEAT_FUNCGATED, | 166 | FEAT_PCKFREEENABLE | FEAT_FUNCGATED | |
167 | FEAT_ROWREPEATENABLE | FEAT_RESIZECONF, | ||
153 | 168 | ||
154 | .num_mgrs = 2, | 169 | .num_mgrs = 2, |
155 | .num_ovls = 3, | 170 | .num_ovls = 3, |
@@ -165,7 +180,8 @@ static struct omap_dss_features omap3430_dss_features = { | |||
165 | .has_feature = | 180 | .has_feature = |
166 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | | 181 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | |
167 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | | 182 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
168 | FEAT_FUNCGATED, | 183 | FEAT_FUNCGATED | FEAT_ROWREPEATENABLE | |
184 | FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF, | ||
169 | 185 | ||
170 | .num_mgrs = 2, | 186 | .num_mgrs = 2, |
171 | .num_ovls = 3, | 187 | .num_ovls = 3, |
@@ -180,7 +196,9 @@ static struct omap_dss_features omap3630_dss_features = { | |||
180 | .has_feature = | 196 | .has_feature = |
181 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | | 197 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | |
182 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | | 198 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
183 | FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED, | 199 | FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED | |
200 | FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT | | ||
201 | FEAT_RESIZECONF, | ||
184 | 202 | ||
185 | .num_mgrs = 2, | 203 | .num_mgrs = 2, |
186 | .num_ovls = 3, | 204 | .num_ovls = 3, |
@@ -190,12 +208,12 @@ static struct omap_dss_features omap3630_dss_features = { | |||
190 | 208 | ||
191 | /* OMAP4 DSS Features */ | 209 | /* OMAP4 DSS Features */ |
192 | static struct omap_dss_features omap4_dss_features = { | 210 | static struct omap_dss_features omap4_dss_features = { |
193 | .reg_fields = omap3_dss_reg_fields, | 211 | .reg_fields = omap4_dss_reg_fields, |
194 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), | 212 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
195 | 213 | ||
196 | .has_feature = | 214 | .has_feature = |
197 | FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA | | 215 | FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA | |
198 | FEAT_MGR_LCD2, | 216 | FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1, |
199 | 217 | ||
200 | .num_mgrs = 3, | 218 | .num_mgrs = 3, |
201 | .num_ovls = 3, | 219 | .num_ovls = 3, |
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index b9c70be92588..b3f81415507c 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h | |||
@@ -33,6 +33,9 @@ enum dss_feat_id { | |||
33 | FEAT_PCKFREEENABLE = 1 << 5, | 33 | FEAT_PCKFREEENABLE = 1 << 5, |
34 | FEAT_FUNCGATED = 1 << 6, | 34 | FEAT_FUNCGATED = 1 << 6, |
35 | FEAT_MGR_LCD2 = 1 << 7, | 35 | FEAT_MGR_LCD2 = 1 << 7, |
36 | FEAT_LINEBUFFERSPLIT = 1 << 8, | ||
37 | FEAT_ROWREPEATENABLE = 1 << 9, | ||
38 | FEAT_RESIZECONF = 1 << 10, | ||
36 | }; | 39 | }; |
37 | 40 | ||
38 | /* DSS register field id */ | 41 | /* DSS register field id */ |
@@ -42,6 +45,8 @@ enum dss_feat_reg_field { | |||
42 | FEAT_REG_FIFOHIGHTHRESHOLD, | 45 | FEAT_REG_FIFOHIGHTHRESHOLD, |
43 | FEAT_REG_FIFOLOWTHRESHOLD, | 46 | FEAT_REG_FIFOLOWTHRESHOLD, |
44 | FEAT_REG_FIFOSIZE, | 47 | FEAT_REG_FIFOSIZE, |
48 | FEAT_REG_HORIZONTALACCU, | ||
49 | FEAT_REG_VERTICALACCU, | ||
45 | }; | 50 | }; |
46 | 51 | ||
47 | /* DSS Feature Functions */ | 52 | /* DSS Feature Functions */ |