aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-19 08:57:11 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-07 10:05:57 -0500
commitf9b719b6c25c0609c528ccc1e881b42373ba1ba3 (patch)
tree706a7c27872576d05d9befd9daa84d4ebcc9a624 /drivers/video
parent96e2e6374385d2219b9011f6bfd0de7221a591d4 (diff)
OMAPDSS: DISPC: add dispc_ovl_check()
This patch adds a new function, dispc_ovl_check(), which can be used to verify scaling configuration for an overlay. The function gets both the overlay and overlay manager as parameters, so that the caller does not need to configure the hardware before using this function. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c40
-rw-r--r--drivers/video/omap2/dss/dss.h4
2 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 80314bd3427d..67548839ff51 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2320,6 +2320,46 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
2320 return 0; 2320 return 0;
2321} 2321}
2322 2322
2323int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
2324 const struct omap_overlay_info *oi,
2325 const struct omap_video_timings *timings,
2326 int *x_predecim, int *y_predecim)
2327{
2328 enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
2329 bool five_taps = true;
2330 bool fieldmode = 0;
2331 u16 in_height = oi->height;
2332 u16 in_width = oi->width;
2333 bool ilace = timings->interlace;
2334 u16 out_width, out_height;
2335 int pos_x = oi->pos_x;
2336 unsigned long pclk = dispc_mgr_pclk_rate(channel);
2337 unsigned long lclk = dispc_mgr_lclk_rate(channel);
2338
2339 out_width = oi->out_width == 0 ? oi->width : oi->out_width;
2340 out_height = oi->out_height == 0 ? oi->height : oi->out_height;
2341
2342 if (ilace && oi->height == out_height)
2343 fieldmode = 1;
2344
2345 if (ilace) {
2346 if (fieldmode)
2347 in_height /= 2;
2348 out_height /= 2;
2349
2350 DSSDBG("adjusting for ilace: height %d, out_height %d\n",
2351 in_height, out_height);
2352 }
2353
2354 if (!dss_feat_color_mode_supported(plane, oi->color_mode))
2355 return -EINVAL;
2356
2357 return dispc_ovl_calc_scaling(pclk, lclk, caps, timings, in_width,
2358 in_height, out_width, out_height, oi->color_mode,
2359 &five_taps, x_predecim, y_predecim, pos_x,
2360 oi->rotation_type, false);
2361}
2362
2323static int dispc_ovl_setup_common(enum omap_plane plane, 2363static int dispc_ovl_setup_common(enum omap_plane plane,
2324 enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr, 2364 enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr,
2325 u16 screen_width, int pos_x, int pos_y, u16 width, u16 height, 2365 u16 screen_width, int pos_x, int pos_y, u16 width, u16 height,
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 2754bcb231d6..180b381fd120 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -423,6 +423,10 @@ int dispc_ovl_enable(enum omap_plane plane, bool enable);
423bool dispc_ovl_enabled(enum omap_plane plane); 423bool dispc_ovl_enabled(enum omap_plane plane);
424void dispc_ovl_set_channel_out(enum omap_plane plane, 424void dispc_ovl_set_channel_out(enum omap_plane plane,
425 enum omap_channel channel); 425 enum omap_channel channel);
426int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
427 const struct omap_overlay_info *oi,
428 const struct omap_video_timings *timings,
429 int *x_predecim, int *y_predecim);
426 430
427u32 dispc_mgr_get_vsync_irq(enum omap_channel channel); 431u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
428u32 dispc_mgr_get_framedone_irq(enum omap_channel channel); 432u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);