const int num_ovls;
const enum omap_display_type *supported_displays;
const enum omap_dss_output_id *supported_outputs;
- const enum omap_color_mode *supported_color_modes;
+ const enum omap_color_mode **supported_color_modes;
const enum omap_overlay_caps *overlay_caps;
const struct dss_param_range *dss_params;
OMAP_DSS_OUTPUT_DSI2,
};
-static const enum omap_color_mode omap2_dss_supported_color_modes[] = {
+#define COLOR_ARRAY(arr...) (const enum omap_color_mode[]) { arr, 0 }
+
+static const enum omap_color_mode *omap2_dss_supported_color_modes[] = {
+
/* OMAP_DSS_GFX */
- OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 |
- OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_RGB16,
+ OMAP_DSS_COLOR_RGB24U, OMAP_DSS_COLOR_RGB24P),
/* OMAP_DSS_VIDEO1 */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 |
- OMAP_DSS_COLOR_UYVY,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2,
+ OMAP_DSS_COLOR_UYVY),
/* OMAP_DSS_VIDEO2 */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 |
- OMAP_DSS_COLOR_UYVY,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2,
+ OMAP_DSS_COLOR_UYVY),
};
-static const enum omap_color_mode omap3_dss_supported_color_modes[] = {
+static const enum omap_color_mode *omap3_dss_supported_color_modes[] = {
/* OMAP_DSS_GFX */
- OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16,
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_ARGB32,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32),
/* OMAP_DSS_VIDEO1 */
- OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P |
- OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 |
- OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB24U, OMAP_DSS_COLOR_RGB24P,
+ OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_RGB16,
+ OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_UYVY),
/* OMAP_DSS_VIDEO2 */
- OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 |
- OMAP_DSS_COLOR_UYVY | OMAP_DSS_COLOR_ARGB32 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16,
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2,
+ OMAP_DSS_COLOR_UYVY, OMAP_DSS_COLOR_ARGB32,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32),
};
-static const enum omap_color_mode omap4_dss_supported_color_modes[] = {
+static const enum omap_color_mode *omap4_dss_supported_color_modes[] = {
/* OMAP_DSS_GFX */
- OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 |
- OMAP_DSS_COLOR_ARGB16_1555 | OMAP_DSS_COLOR_RGBX16 |
- OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_XRGB16_1555,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16,
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_ARGB32,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32,
+ OMAP_DSS_COLOR_ARGB16_1555, OMAP_DSS_COLOR_RGBX16,
+ OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_XRGB16_1555),
/* OMAP_DSS_VIDEO1 */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
- OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
- OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
- OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
- OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
- OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U,
+ OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12,
+ OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY,
+ OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555,
+ OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16,
+ OMAP_DSS_COLOR_RGBX32),
/* OMAP_DSS_VIDEO2 */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
- OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
- OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
- OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
- OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
- OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U,
+ OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12,
+ OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY,
+ OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555,
+ OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16,
+ OMAP_DSS_COLOR_RGBX32),
/* OMAP_DSS_VIDEO3 */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
- OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
- OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
- OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
- OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
- OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U,
+ OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12,
+ OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY,
+ OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555,
+ OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16,
+ OMAP_DSS_COLOR_RGBX32),
/* OMAP_DSS_WB */
- OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
- OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
- OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
- OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
- OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
- OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
- OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
- OMAP_DSS_COLOR_RGBX32,
+ COLOR_ARRAY(
+ OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U,
+ OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555,
+ OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12,
+ OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U,
+ OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY,
+ OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555,
+ OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16,
+ OMAP_DSS_COLOR_RGBX32),
};
static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
return omap_current_dss_features->supported_outputs[channel];
}
-enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane_id plane)
+const enum omap_color_mode *dss_feat_get_supported_color_modes(enum omap_plane_id plane)
{
return omap_current_dss_features->supported_color_modes[plane];
}
bool dss_feat_color_mode_supported(enum omap_plane_id plane,
enum omap_color_mode color_mode)
{
- return omap_current_dss_features->supported_color_modes[plane] &
- color_mode;
+ const enum omap_color_mode *modes;
+ unsigned int i;
+
+ modes = omap_current_dss_features->supported_color_modes[plane];
+
+ for (i = 0; modes[i]; ++i) {
+ if (modes[i] == color_mode)
+ return true;
+ }
+
+ return false;
}
u32 dss_feat_get_buffer_size_unit(void)