diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 47 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 3 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.h | 2 |
5 files changed, 37 insertions, 23 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index d6a4b31fa0b..7a65eb07a2c 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -983,21 +983,13 @@ static void dispc_ovl_enable_replication(enum omap_plane plane, bool enable) | |||
983 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable, shift, shift); | 983 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable, shift, shift); |
984 | } | 984 | } |
985 | 985 | ||
986 | static void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, | 986 | static void dispc_mgr_set_size(enum omap_channel channel, u16 width, |
987 | u16 height) | 987 | u16 height) |
988 | { | 988 | { |
989 | u32 val; | 989 | u32 val; |
990 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); | ||
991 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); | ||
992 | dispc_write_reg(DISPC_SIZE_MGR(channel), val); | ||
993 | } | ||
994 | 990 | ||
995 | static void dispc_mgr_set_digit_size(u16 width, u16 height) | ||
996 | { | ||
997 | u32 val; | ||
998 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); | ||
999 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); | 991 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); |
1000 | dispc_write_reg(DISPC_SIZE_MGR(OMAP_DSS_CHANNEL_DIGIT), val); | 992 | dispc_write_reg(DISPC_SIZE_MGR(channel), val); |
1001 | } | 993 | } |
1002 | 994 | ||
1003 | static void dispc_read_plane_fifo_sizes(void) | 995 | static void dispc_read_plane_fifo_sizes(void) |
@@ -2286,6 +2278,12 @@ void dispc_mgr_enable_stallmode(enum omap_channel channel, bool enable) | |||
2286 | REG_FLD_MOD(DISPC_CONTROL, enable, 11, 11); | 2278 | REG_FLD_MOD(DISPC_CONTROL, enable, 11, 11); |
2287 | } | 2279 | } |
2288 | 2280 | ||
2281 | static bool _dispc_mgr_size_ok(u16 width, u16 height) | ||
2282 | { | ||
2283 | return width <= dss_feat_get_param_max(FEAT_PARAM_MGR_WIDTH) && | ||
2284 | height <= dss_feat_get_param_max(FEAT_PARAM_MGR_HEIGHT); | ||
2285 | } | ||
2286 | |||
2289 | static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | 2287 | static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, |
2290 | int vsw, int vfp, int vbp) | 2288 | int vsw, int vfp, int vbp) |
2291 | { | 2289 | { |
@@ -2310,11 +2308,20 @@ static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | |||
2310 | return true; | 2308 | return true; |
2311 | } | 2309 | } |
2312 | 2310 | ||
2313 | bool dispc_lcd_timings_ok(struct omap_video_timings *timings) | 2311 | bool dispc_mgr_timings_ok(enum omap_channel channel, |
2312 | struct omap_video_timings *timings) | ||
2314 | { | 2313 | { |
2315 | return _dispc_lcd_timings_ok(timings->hsw, timings->hfp, | 2314 | bool timings_ok; |
2316 | timings->hbp, timings->vsw, | 2315 | |
2317 | timings->vfp, timings->vbp); | 2316 | timings_ok = _dispc_mgr_size_ok(timings->x_res, timings->y_res); |
2317 | |||
2318 | if (dispc_mgr_is_lcd(channel)) | ||
2319 | timings_ok = timings_ok && _dispc_lcd_timings_ok(timings->hsw, | ||
2320 | timings->hfp, timings->hbp, | ||
2321 | timings->vsw, timings->vfp, | ||
2322 | timings->vbp); | ||
2323 | |||
2324 | return timings_ok; | ||
2318 | } | 2325 | } |
2319 | 2326 | ||
2320 | static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, | 2327 | static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, |
@@ -2350,16 +2357,14 @@ void dispc_mgr_set_timings(enum omap_channel channel, | |||
2350 | DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, | 2357 | DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, |
2351 | timings->y_res); | 2358 | timings->y_res); |
2352 | 2359 | ||
2353 | if (dispc_mgr_is_lcd(channel)) { | 2360 | if (!dispc_mgr_timings_ok(channel, timings)) |
2354 | if (!dispc_lcd_timings_ok(timings)) | 2361 | BUG(); |
2355 | BUG(); | ||
2356 | 2362 | ||
2363 | if (dispc_mgr_is_lcd(channel)) { | ||
2357 | _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, | 2364 | _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, |
2358 | timings->hbp, timings->vsw, timings->vfp, | 2365 | timings->hbp, timings->vsw, timings->vfp, |
2359 | timings->vbp); | 2366 | timings->vbp); |
2360 | 2367 | ||
2361 | dispc_mgr_set_lcd_size(channel, timings->x_res, timings->y_res); | ||
2362 | |||
2363 | xtot = timings->x_res + timings->hfp + timings->hsw + | 2368 | xtot = timings->x_res + timings->hfp + timings->hsw + |
2364 | timings->hbp; | 2369 | timings->hbp; |
2365 | ytot = timings->y_res + timings->vfp + timings->vsw + | 2370 | ytot = timings->y_res + timings->vfp + timings->vsw + |
@@ -2374,9 +2379,9 @@ void dispc_mgr_set_timings(enum omap_channel channel, | |||
2374 | timings->vsw, timings->vfp, timings->vbp); | 2379 | timings->vsw, timings->vfp, timings->vbp); |
2375 | 2380 | ||
2376 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); | 2381 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); |
2377 | } else { | ||
2378 | dispc_mgr_set_digit_size(timings->x_res, timings->y_res); | ||
2379 | } | 2382 | } |
2383 | |||
2384 | dispc_mgr_set_size(channel, timings->x_res, timings->y_res); | ||
2380 | } | 2385 | } |
2381 | 2386 | ||
2382 | static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, | 2387 | static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, |
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 7dd7f9d2590..cec11668436 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c | |||
@@ -312,7 +312,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev, | |||
312 | unsigned long pck; | 312 | unsigned long pck; |
313 | struct dispc_clock_info dispc_cinfo; | 313 | struct dispc_clock_info dispc_cinfo; |
314 | 314 | ||
315 | if (!dispc_lcd_timings_ok(timings)) | 315 | if (!dispc_mgr_timings_ok(dssdev->manager->id, timings)) |
316 | return -EINVAL; | 316 | return -EINVAL; |
317 | 317 | ||
318 | if (timings->pixel_clock == 0) | 318 | if (timings->pixel_clock == 0) |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index da91822b596..1dc336b8bb6 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -411,7 +411,8 @@ void dispc_enable_fifomerge(bool enable); | |||
411 | void dispc_enable_gamma_table(bool enable); | 411 | void dispc_enable_gamma_table(bool enable); |
412 | void dispc_set_loadmode(enum omap_dss_load_mode mode); | 412 | void dispc_set_loadmode(enum omap_dss_load_mode mode); |
413 | 413 | ||
414 | bool dispc_lcd_timings_ok(struct omap_video_timings *timings); | 414 | bool dispc_mgr_timings_ok(enum omap_channel channel, |
415 | struct omap_video_timings *timings); | ||
415 | unsigned long dispc_fclk_rate(void); | 416 | unsigned long dispc_fclk_rate(void); |
416 | void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck, | 417 | void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck, |
417 | struct dispc_clock_info *cinfo); | 418 | struct dispc_clock_info *cinfo); |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index ce14aa6dd67..1d10a014bc5 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -311,6 +311,8 @@ static const struct dss_param_range omap2_dss_param_range[] = { | |||
311 | * scaler cannot scale a image with width more than 768. | 311 | * scaler cannot scale a image with width more than 768. |
312 | */ | 312 | */ |
313 | [FEAT_PARAM_LINEWIDTH] = { 1, 768 }, | 313 | [FEAT_PARAM_LINEWIDTH] = { 1, 768 }, |
314 | [FEAT_PARAM_MGR_WIDTH] = { 1, 2048 }, | ||
315 | [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 }, | ||
314 | }; | 316 | }; |
315 | 317 | ||
316 | static const struct dss_param_range omap3_dss_param_range[] = { | 318 | static const struct dss_param_range omap3_dss_param_range[] = { |
@@ -324,6 +326,8 @@ static const struct dss_param_range omap3_dss_param_range[] = { | |||
324 | [FEAT_PARAM_DSIPLL_LPDIV] = { 1, (1 << 13) - 1}, | 326 | [FEAT_PARAM_DSIPLL_LPDIV] = { 1, (1 << 13) - 1}, |
325 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, | 327 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, |
326 | [FEAT_PARAM_LINEWIDTH] = { 1, 1024 }, | 328 | [FEAT_PARAM_LINEWIDTH] = { 1, 1024 }, |
329 | [FEAT_PARAM_MGR_WIDTH] = { 1, 2048 }, | ||
330 | [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 }, | ||
327 | }; | 331 | }; |
328 | 332 | ||
329 | static const struct dss_param_range omap4_dss_param_range[] = { | 333 | static const struct dss_param_range omap4_dss_param_range[] = { |
@@ -337,6 +341,8 @@ static const struct dss_param_range omap4_dss_param_range[] = { | |||
337 | [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 }, | 341 | [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 }, |
338 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, | 342 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, |
339 | [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, | 343 | [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, |
344 | [FEAT_PARAM_MGR_WIDTH] = { 1, 2048 }, | ||
345 | [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 }, | ||
340 | }; | 346 | }; |
341 | 347 | ||
342 | static const enum dss_feat_id omap2_dss_feat_list[] = { | 348 | static const enum dss_feat_id omap2_dss_feat_list[] = { |
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index c332e7ddfce..3736367089a 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h | |||
@@ -91,6 +91,8 @@ enum dss_range_param { | |||
91 | FEAT_PARAM_DSIPLL_LPDIV, | 91 | FEAT_PARAM_DSIPLL_LPDIV, |
92 | FEAT_PARAM_DOWNSCALE, | 92 | FEAT_PARAM_DOWNSCALE, |
93 | FEAT_PARAM_LINEWIDTH, | 93 | FEAT_PARAM_LINEWIDTH, |
94 | FEAT_PARAM_MGR_WIDTH, | ||
95 | FEAT_PARAM_MGR_HEIGHT, | ||
94 | }; | 96 | }; |
95 | 97 | ||
96 | /* DSS Feature Functions */ | 98 | /* DSS Feature Functions */ |