]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
OMAPDSS: OVERLAY: Clean up replication checking
authorArchit Taneja <archit@ti.com>
Mon, 25 Jun 2012 09:28:48 +0000 (14:58 +0530)
committerArchit Taneja <archit@ti.com>
Fri, 29 Jun 2012 10:57:59 +0000 (16:27 +0530)
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>
drivers/video/omap2/dss/apply.c
drivers/video/omap2/dss/display.c
drivers/video/omap2/dss/dss.h
drivers/video/omap2/dss/overlay.c

index b237b575c70b61738ff63a812757f627d079047b..0fefc68372b93ca326b9c194f4529fd201b6161c 100644 (file)
@@ -571,7 +571,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
 
        mp = get_mgr_priv(ovl->manager);
 
-       replication = dss_use_replication(ovl->manager->device, oi->color_mode);
+       replication = dss_ovl_use_replication(mp->lcd_config, oi->color_mode);
 
        r = dispc_ovl_setup(ovl->id, oi, replication, &mp->timings);
        if (r) {
index 1a0c15f83d0d0d17f8dc03142f1a3a76a2865afb..5bd957e85505465990301d4a78abf4dd2f8e05a4 100644 (file)
@@ -316,40 +316,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev,
 }
 EXPORT_SYMBOL(omapdss_default_get_timings);
 
-/* Checks if replication logic should be used. Only use for active matrix,
- * when overlay is in RGB12U or RGB16 mode, and LCD interface is
- * 18bpp or 24bpp */
-bool dss_use_replication(struct omap_dss_device *dssdev,
-               enum omap_color_mode mode)
-{
-       int bpp;
-
-       if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
-               return false;
-
-       switch (dssdev->type) {
-       case OMAP_DISPLAY_TYPE_DPI:
-               bpp = dssdev->phy.dpi.data_lines;
-               break;
-       case OMAP_DISPLAY_TYPE_HDMI:
-       case OMAP_DISPLAY_TYPE_VENC:
-       case OMAP_DISPLAY_TYPE_SDI:
-               bpp = 24;
-               break;
-       case OMAP_DISPLAY_TYPE_DBI:
-               bpp = dssdev->ctrl.pixel_size;
-               break;
-       case OMAP_DISPLAY_TYPE_DSI:
-               bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt);
-               break;
-       default:
-               BUG();
-               return false;
-       }
-
-       return bpp > 16;
-}
-
 void dss_init_device(struct platform_device *pdev,
                struct omap_dss_device *dssdev)
 {
index f87a4318d56436d4d84d3b4b94ad3dafac5e83e5..f67afe76f217f01c1aea097b49e26fefd0af0ce2 100644 (file)
@@ -231,8 +231,6 @@ void dss_init_device(struct platform_device *pdev,
                struct omap_dss_device *dssdev);
 void dss_uninit_device(struct platform_device *pdev,
                struct omap_dss_device *dssdev);
-bool dss_use_replication(struct omap_dss_device *dssdev,
-               enum omap_color_mode mode);
 
 /* manager */
 int dss_init_overlay_managers(struct platform_device *pdev);
@@ -265,6 +263,8 @@ int dss_ovl_simple_check(struct omap_overlay *ovl,
                const struct omap_overlay_info *info);
 int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
                const struct omap_video_timings *mgr_timings);
+bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
+               enum omap_color_mode mode);
 
 /* DSS */
 int dss_init_platform_driver(void) __init;
index ec69325a118a687f2eb0bc0363da7642e652763d..952c6fad9a8110393a3c2bdc15064aa4590e5367 100644 (file)
@@ -687,3 +687,16 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
 
        return 0;
 }
+
+/*
+ * Checks if replication logic should be used. Only use when overlay is in
+ * RGB12U or RGB16 mode, and video port width interface is 18bpp or 24bpp
+ */
+bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
+               enum omap_color_mode mode)
+{
+       if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
+               return false;
+
+       return config.video_port_width > 16;
+}