aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-06-25 05:28:48 -0400
committerArchit Taneja <archit@ti.com>2012-06-29 06:57:59 -0400
commit6c6f510afb86e3c77c351dfa20cbb8ca834abad9 (patch)
tree72188f07c300e04f30d059bf502f651d2cbeb829 /drivers/video/omap2
parentc47cdb3088581f9d744b03399e8b4e89a56a111b (diff)
OMAPDSS: OVERLAY: Clean up replication checking
Replication logic for an overlay depends on the color mode in which it is configured and the video port width of the manager it is connected to. video port width now held in dss_lcd_mgr_config in the manager's private data in APPLY. Use this instead of referring to the omap_dss_device connected to the manager. Replication is enabled in the case of TV manager, the video_port_width is set to a default value of 24 for TV manager. Make the replication checking an overlay function since it's more of an overlay characteristic than a display characteristic. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/apply.c2
-rw-r--r--drivers/video/omap2/dss/display.c34
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/overlay.c13
4 files changed, 16 insertions, 37 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index b237b575c70..0fefc68372b 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -571,7 +571,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
571 571
572 mp = get_mgr_priv(ovl->manager); 572 mp = get_mgr_priv(ovl->manager);
573 573
574 replication = dss_use_replication(ovl->manager->device, oi->color_mode); 574 replication = dss_ovl_use_replication(mp->lcd_config, oi->color_mode);
575 575
576 r = dispc_ovl_setup(ovl->id, oi, replication, &mp->timings); 576 r = dispc_ovl_setup(ovl->id, oi, replication, &mp->timings);
577 if (r) { 577 if (r) {
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 1a0c15f83d0..5bd957e8550 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -316,40 +316,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev,
316} 316}
317EXPORT_SYMBOL(omapdss_default_get_timings); 317EXPORT_SYMBOL(omapdss_default_get_timings);
318 318
319/* Checks if replication logic should be used. Only use for active matrix,
320 * when overlay is in RGB12U or RGB16 mode, and LCD interface is
321 * 18bpp or 24bpp */
322bool dss_use_replication(struct omap_dss_device *dssdev,
323 enum omap_color_mode mode)
324{
325 int bpp;
326
327 if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
328 return false;
329
330 switch (dssdev->type) {
331 case OMAP_DISPLAY_TYPE_DPI:
332 bpp = dssdev->phy.dpi.data_lines;
333 break;
334 case OMAP_DISPLAY_TYPE_HDMI:
335 case OMAP_DISPLAY_TYPE_VENC:
336 case OMAP_DISPLAY_TYPE_SDI:
337 bpp = 24;
338 break;
339 case OMAP_DISPLAY_TYPE_DBI:
340 bpp = dssdev->ctrl.pixel_size;
341 break;
342 case OMAP_DISPLAY_TYPE_DSI:
343 bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt);
344 break;
345 default:
346 BUG();
347 return false;
348 }
349
350 return bpp > 16;
351}
352
353void dss_init_device(struct platform_device *pdev, 319void dss_init_device(struct platform_device *pdev,
354 struct omap_dss_device *dssdev) 320 struct omap_dss_device *dssdev)
355{ 321{
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index f87a4318d56..f67afe76f21 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -231,8 +231,6 @@ void dss_init_device(struct platform_device *pdev,
231 struct omap_dss_device *dssdev); 231 struct omap_dss_device *dssdev);
232void dss_uninit_device(struct platform_device *pdev, 232void dss_uninit_device(struct platform_device *pdev,
233 struct omap_dss_device *dssdev); 233 struct omap_dss_device *dssdev);
234bool dss_use_replication(struct omap_dss_device *dssdev,
235 enum omap_color_mode mode);
236 234
237/* manager */ 235/* manager */
238int dss_init_overlay_managers(struct platform_device *pdev); 236int dss_init_overlay_managers(struct platform_device *pdev);
@@ -265,6 +263,8 @@ int dss_ovl_simple_check(struct omap_overlay *ovl,
265 const struct omap_overlay_info *info); 263 const struct omap_overlay_info *info);
266int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info, 264int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
267 const struct omap_video_timings *mgr_timings); 265 const struct omap_video_timings *mgr_timings);
266bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
267 enum omap_color_mode mode);
268 268
269/* DSS */ 269/* DSS */
270int dss_init_platform_driver(void) __init; 270int dss_init_platform_driver(void) __init;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index ec69325a118..952c6fad9a8 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -687,3 +687,16 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
687 687
688 return 0; 688 return 0;
689} 689}
690
691/*
692 * Checks if replication logic should be used. Only use when overlay is in
693 * RGB12U or RGB16 mode, and video port width interface is 18bpp or 24bpp
694 */
695bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
696 enum omap_color_mode mode)
697{
698 if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
699 return false;
700
701 return config.video_port_width > 16;
702}