aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dispc.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2010-11-25 07:28:10 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2011-01-10 04:09:54 -0500
commit8dad2ab6727f4dd9fdef06b890d736d7c6d1a725 (patch)
tree59ddbe8f875cc91824447b36afade883fe9516a3 /drivers/video/omap2/dss/dispc.c
parentac1427e13b114f0c394fbc9bb7616f47d03bdba2 (diff)
OMAP: DSS2: Clean up DISPC color mode validation checks
The supported set of color modes varies for different DISPC pipelines(plane) and omap version. This makes the checks for validation of a color mode more complicated as new omap versions are added. A dss_feature function is created which tells if a color_mode is supported for a plane on the current omap revision. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r--drivers/video/omap2/dss/dispc.c53
1 files changed, 5 insertions, 48 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 54ba8d3ad31..4e9ebdecc43 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1550,29 +1550,12 @@ static int _dispc_setup_plane(enum omap_plane plane,
1550 height, pos_y, out_height); 1550 height, pos_y, out_height);
1551 } 1551 }
1552 1552
1553 if (!dss_feat_color_mode_supported(plane, color_mode))
1554 return -EINVAL;
1555
1553 if (plane == OMAP_DSS_GFX) { 1556 if (plane == OMAP_DSS_GFX) {
1554 if (width != out_width || height != out_height) 1557 if (width != out_width || height != out_height)
1555 return -EINVAL; 1558 return -EINVAL;
1556
1557 switch (color_mode) {
1558 case OMAP_DSS_COLOR_ARGB16:
1559 case OMAP_DSS_COLOR_ARGB32:
1560 case OMAP_DSS_COLOR_RGBA32:
1561 if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
1562 return -EINVAL;
1563 case OMAP_DSS_COLOR_RGBX32:
1564 if (cpu_is_omap24xx())
1565 return -EINVAL;
1566 /* fall through */
1567 case OMAP_DSS_COLOR_RGB12U:
1568 case OMAP_DSS_COLOR_RGB16:
1569 case OMAP_DSS_COLOR_RGB24P:
1570 case OMAP_DSS_COLOR_RGB24U:
1571 break;
1572
1573 default:
1574 return -EINVAL;
1575 }
1576 } else { 1559 } else {
1577 /* video plane */ 1560 /* video plane */
1578 1561
@@ -1586,35 +1569,9 @@ static int _dispc_setup_plane(enum omap_plane plane,
1586 out_height > height * 8) 1569 out_height > height * 8)
1587 return -EINVAL; 1570 return -EINVAL;
1588 1571
1589 switch (color_mode) { 1572 if (color_mode == OMAP_DSS_COLOR_YUV2 ||
1590 case OMAP_DSS_COLOR_RGBX32: 1573 color_mode == OMAP_DSS_COLOR_UYVY)
1591 case OMAP_DSS_COLOR_RGB12U:
1592 if (cpu_is_omap24xx())
1593 return -EINVAL;
1594 /* fall through */
1595 case OMAP_DSS_COLOR_RGB16:
1596 case OMAP_DSS_COLOR_RGB24P:
1597 case OMAP_DSS_COLOR_RGB24U:
1598 break;
1599
1600 case OMAP_DSS_COLOR_ARGB16:
1601 case OMAP_DSS_COLOR_ARGB32:
1602 case OMAP_DSS_COLOR_RGBA32:
1603 if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
1604 return -EINVAL;
1605 if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) &&
1606 plane == OMAP_DSS_VIDEO1)
1607 return -EINVAL;
1608 break;
1609
1610 case OMAP_DSS_COLOR_YUV2:
1611 case OMAP_DSS_COLOR_UYVY:
1612 cconv = 1; 1574 cconv = 1;
1613 break;
1614
1615 default:
1616 return -EINVAL;
1617 }
1618 1575
1619 /* Must use 5-tap filter? */ 1576 /* Must use 5-tap filter? */
1620 five_taps = height > out_height * 2; 1577 five_taps = height > out_height * 2;