diff options
author | Amber Jain <amber@ti.com> | 2011-05-19 10:17:50 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-23 01:29:47 -0400 |
commit | f20e42205ab172cfd449c10e5183e2e371a629d6 (patch) | |
tree | 2d5652fcf8eed5a7e55cd75ef40ed9ab465fe72a | |
parent | ad44cc3298872c4d4f4b034df9163c3944ae8c1c (diff) |
OMAP: DSS2: Add new color formats for OMAP4
Add new color formats supported by OMAP4: NV12, RGBA16, RGBX16,
ARGB16_1555, XRGB16_1555.
NV12 color format is defined here, its support in DSS will be added separately.
Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 109 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 35 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 7 | ||||
-rw-r--r-- | include/video/omapdss.h | 5 |
4 files changed, 122 insertions, 34 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 1a2d835000f8..79c1c0a44f81 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -796,38 +796,78 @@ static void _dispc_set_color_mode(enum omap_plane plane, | |||
796 | enum omap_color_mode color_mode) | 796 | enum omap_color_mode color_mode) |
797 | { | 797 | { |
798 | u32 m = 0; | 798 | u32 m = 0; |
799 | 799 | if (plane != OMAP_DSS_GFX) { | |
800 | switch (color_mode) { | 800 | switch (color_mode) { |
801 | case OMAP_DSS_COLOR_CLUT1: | 801 | case OMAP_DSS_COLOR_NV12: |
802 | m = 0x0; break; | 802 | m = 0x0; break; |
803 | case OMAP_DSS_COLOR_CLUT2: | 803 | case OMAP_DSS_COLOR_RGB12U: |
804 | m = 0x1; break; | 804 | m = 0x1; break; |
805 | case OMAP_DSS_COLOR_CLUT4: | 805 | case OMAP_DSS_COLOR_RGBA16: |
806 | m = 0x2; break; | 806 | m = 0x2; break; |
807 | case OMAP_DSS_COLOR_CLUT8: | 807 | case OMAP_DSS_COLOR_RGBX16: |
808 | m = 0x3; break; | 808 | m = 0x4; break; |
809 | case OMAP_DSS_COLOR_RGB12U: | 809 | case OMAP_DSS_COLOR_ARGB16: |
810 | m = 0x4; break; | 810 | m = 0x5; break; |
811 | case OMAP_DSS_COLOR_ARGB16: | 811 | case OMAP_DSS_COLOR_RGB16: |
812 | m = 0x5; break; | 812 | m = 0x6; break; |
813 | case OMAP_DSS_COLOR_RGB16: | 813 | case OMAP_DSS_COLOR_ARGB16_1555: |
814 | m = 0x6; break; | 814 | m = 0x7; break; |
815 | case OMAP_DSS_COLOR_RGB24U: | 815 | case OMAP_DSS_COLOR_RGB24U: |
816 | m = 0x8; break; | 816 | m = 0x8; break; |
817 | case OMAP_DSS_COLOR_RGB24P: | 817 | case OMAP_DSS_COLOR_RGB24P: |
818 | m = 0x9; break; | 818 | m = 0x9; break; |
819 | case OMAP_DSS_COLOR_YUV2: | 819 | case OMAP_DSS_COLOR_YUV2: |
820 | m = 0xa; break; | 820 | m = 0xa; break; |
821 | case OMAP_DSS_COLOR_UYVY: | 821 | case OMAP_DSS_COLOR_UYVY: |
822 | m = 0xb; break; | 822 | m = 0xb; break; |
823 | case OMAP_DSS_COLOR_ARGB32: | 823 | case OMAP_DSS_COLOR_ARGB32: |
824 | m = 0xc; break; | 824 | m = 0xc; break; |
825 | case OMAP_DSS_COLOR_RGBA32: | 825 | case OMAP_DSS_COLOR_RGBA32: |
826 | m = 0xd; break; | 826 | m = 0xd; break; |
827 | case OMAP_DSS_COLOR_RGBX32: | 827 | case OMAP_DSS_COLOR_RGBX32: |
828 | m = 0xe; break; | 828 | m = 0xe; break; |
829 | default: | 829 | case OMAP_DSS_COLOR_XRGB16_1555: |
830 | BUG(); break; | 830 | m = 0xf; break; |
831 | default: | ||
832 | BUG(); break; | ||
833 | } | ||
834 | } else { | ||
835 | switch (color_mode) { | ||
836 | case OMAP_DSS_COLOR_CLUT1: | ||
837 | m = 0x0; break; | ||
838 | case OMAP_DSS_COLOR_CLUT2: | ||
839 | m = 0x1; break; | ||
840 | case OMAP_DSS_COLOR_CLUT4: | ||
841 | m = 0x2; break; | ||
842 | case OMAP_DSS_COLOR_CLUT8: | ||
843 | m = 0x3; break; | ||
844 | case OMAP_DSS_COLOR_RGB12U: | ||
845 | m = 0x4; break; | ||
846 | case OMAP_DSS_COLOR_ARGB16: | ||
847 | m = 0x5; break; | ||
848 | case OMAP_DSS_COLOR_RGB16: | ||
849 | m = 0x6; break; | ||
850 | case OMAP_DSS_COLOR_ARGB16_1555: | ||
851 | m = 0x7; break; | ||
852 | case OMAP_DSS_COLOR_RGB24U: | ||
853 | m = 0x8; break; | ||
854 | case OMAP_DSS_COLOR_RGB24P: | ||
855 | m = 0x9; break; | ||
856 | case OMAP_DSS_COLOR_YUV2: | ||
857 | m = 0xa; break; | ||
858 | case OMAP_DSS_COLOR_UYVY: | ||
859 | m = 0xb; break; | ||
860 | case OMAP_DSS_COLOR_ARGB32: | ||
861 | m = 0xc; break; | ||
862 | case OMAP_DSS_COLOR_RGBA32: | ||
863 | m = 0xd; break; | ||
864 | case OMAP_DSS_COLOR_RGBX32: | ||
865 | m = 0xe; break; | ||
866 | case OMAP_DSS_COLOR_XRGB16_1555: | ||
867 | m = 0xf; break; | ||
868 | default: | ||
869 | BUG(); break; | ||
870 | } | ||
831 | } | 871 | } |
832 | 872 | ||
833 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); | 873 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); |
@@ -1203,12 +1243,17 @@ static int color_mode_to_bpp(enum omap_color_mode color_mode) | |||
1203 | case OMAP_DSS_COLOR_CLUT4: | 1243 | case OMAP_DSS_COLOR_CLUT4: |
1204 | return 4; | 1244 | return 4; |
1205 | case OMAP_DSS_COLOR_CLUT8: | 1245 | case OMAP_DSS_COLOR_CLUT8: |
1246 | case OMAP_DSS_COLOR_NV12: | ||
1206 | return 8; | 1247 | return 8; |
1207 | case OMAP_DSS_COLOR_RGB12U: | 1248 | case OMAP_DSS_COLOR_RGB12U: |
1208 | case OMAP_DSS_COLOR_RGB16: | 1249 | case OMAP_DSS_COLOR_RGB16: |
1209 | case OMAP_DSS_COLOR_ARGB16: | 1250 | case OMAP_DSS_COLOR_ARGB16: |
1210 | case OMAP_DSS_COLOR_YUV2: | 1251 | case OMAP_DSS_COLOR_YUV2: |
1211 | case OMAP_DSS_COLOR_UYVY: | 1252 | case OMAP_DSS_COLOR_UYVY: |
1253 | case OMAP_DSS_COLOR_RGBA16: | ||
1254 | case OMAP_DSS_COLOR_RGBX16: | ||
1255 | case OMAP_DSS_COLOR_ARGB16_1555: | ||
1256 | case OMAP_DSS_COLOR_XRGB16_1555: | ||
1212 | return 16; | 1257 | return 16; |
1213 | case OMAP_DSS_COLOR_RGB24P: | 1258 | case OMAP_DSS_COLOR_RGB24P: |
1214 | return 24; | 1259 | return 24; |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 81abad3603b9..6d88a6323229 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -177,6 +177,37 @@ static const enum omap_color_mode omap3_dss_supported_color_modes[] = { | |||
177 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, | 177 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, |
178 | }; | 178 | }; |
179 | 179 | ||
180 | static const enum omap_color_mode omap4_dss_supported_color_modes[] = { | ||
181 | /* OMAP_DSS_GFX */ | ||
182 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | | ||
183 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | | ||
184 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | | ||
185 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | | ||
186 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | | ||
187 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 | | ||
188 | OMAP_DSS_COLOR_ARGB16_1555, | ||
189 | |||
190 | /* OMAP_DSS_VIDEO1 */ | ||
191 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | | ||
192 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 | | ||
193 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 | | ||
194 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U | | ||
195 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY | | ||
196 | OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 | | ||
197 | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 | | ||
198 | OMAP_DSS_COLOR_RGBX32, | ||
199 | |||
200 | /* OMAP_DSS_VIDEO2 */ | ||
201 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | | ||
202 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 | | ||
203 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 | | ||
204 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U | | ||
205 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY | | ||
206 | OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 | | ||
207 | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 | | ||
208 | OMAP_DSS_COLOR_RGBX32, | ||
209 | }; | ||
210 | |||
180 | static const char * const omap2_dss_clk_source_names[] = { | 211 | static const char * const omap2_dss_clk_source_names[] = { |
181 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "N/A", | 212 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "N/A", |
182 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "N/A", | 213 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "N/A", |
@@ -301,7 +332,7 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = { | |||
301 | .num_mgrs = 3, | 332 | .num_mgrs = 3, |
302 | .num_ovls = 3, | 333 | .num_ovls = 3, |
303 | .supported_displays = omap4_dss_supported_displays, | 334 | .supported_displays = omap4_dss_supported_displays, |
304 | .supported_color_modes = omap3_dss_supported_color_modes, | 335 | .supported_color_modes = omap4_dss_supported_color_modes, |
305 | .clksrc_names = omap4_dss_clk_source_names, | 336 | .clksrc_names = omap4_dss_clk_source_names, |
306 | .dss_params = omap4_dss_param_range, | 337 | .dss_params = omap4_dss_param_range, |
307 | }; | 338 | }; |
@@ -321,7 +352,7 @@ static const struct omap_dss_features omap4_dss_features = { | |||
321 | .num_mgrs = 3, | 352 | .num_mgrs = 3, |
322 | .num_ovls = 3, | 353 | .num_ovls = 3, |
323 | .supported_displays = omap4_dss_supported_displays, | 354 | .supported_displays = omap4_dss_supported_displays, |
324 | .supported_color_modes = omap3_dss_supported_color_modes, | 355 | .supported_color_modes = omap4_dss_supported_color_modes, |
325 | .clksrc_names = omap4_dss_clk_source_names, | 356 | .clksrc_names = omap4_dss_clk_source_names, |
326 | .dss_params = omap4_dss_param_range, | 357 | .dss_params = omap4_dss_param_range, |
327 | }; | 358 | }; |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index ee38ca2cfaa8..b40fe3dc9875 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -775,10 +775,17 @@ static int configure_overlay(enum omap_plane plane) | |||
775 | } | 775 | } |
776 | 776 | ||
777 | switch (c->color_mode) { | 777 | switch (c->color_mode) { |
778 | case OMAP_DSS_COLOR_NV12: | ||
779 | bpp = 8; | ||
780 | break; | ||
778 | case OMAP_DSS_COLOR_RGB16: | 781 | case OMAP_DSS_COLOR_RGB16: |
779 | case OMAP_DSS_COLOR_ARGB16: | 782 | case OMAP_DSS_COLOR_ARGB16: |
780 | case OMAP_DSS_COLOR_YUV2: | 783 | case OMAP_DSS_COLOR_YUV2: |
781 | case OMAP_DSS_COLOR_UYVY: | 784 | case OMAP_DSS_COLOR_UYVY: |
785 | case OMAP_DSS_COLOR_RGBA16: | ||
786 | case OMAP_DSS_COLOR_RGBX16: | ||
787 | case OMAP_DSS_COLOR_ARGB16_1555: | ||
788 | case OMAP_DSS_COLOR_XRGB16_1555: | ||
782 | bpp = 16; | 789 | bpp = 16; |
783 | break; | 790 | break; |
784 | 791 | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index e62674599b3d..5658b4b83db8 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -86,6 +86,11 @@ enum omap_color_mode { | |||
86 | OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */ | 86 | OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */ |
87 | OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */ | 87 | OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */ |
88 | OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */ | 88 | OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */ |
89 | OMAP_DSS_COLOR_NV12 = 1 << 14, /* NV12 format: YUV 4:2:0 */ | ||
90 | OMAP_DSS_COLOR_RGBA16 = 1 << 15, /* RGBA16 - 4444 */ | ||
91 | OMAP_DSS_COLOR_RGBX16 = 1 << 16, /* RGBx16 - 4444 */ | ||
92 | OMAP_DSS_COLOR_ARGB16_1555 = 1 << 17, /* ARGB16 - 1555 */ | ||
93 | OMAP_DSS_COLOR_XRGB16_1555 = 1 << 18, /* xRGB16 - 1555 */ | ||
89 | }; | 94 | }; |
90 | 95 | ||
91 | enum omap_lcd_display_type { | 96 | enum omap_lcd_display_type { |