summaryrefslogtreecommitdiff
path: root/drivers/staging/omapdrm/omap_fb.c
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-03-05 10:48:31 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-07 13:38:06 -0800
commita890e6623ae024d28f855d672e72649fa2cb511e (patch)
tree1dadf19d5f4824bc68416baf31a327f4e440e24b /drivers/staging/omapdrm/omap_fb.c
parentdbf717fd9a0d5fddd2dae3314a1e14842f4dc182 (diff)
staging: drm/omap: get supported color formats from ovl
Get the supported formats for a plane from ovl's supported_modes bitmask. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm/omap_fb.c')
-rw-r--r--drivers/staging/omapdrm/omap_fb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/omapdrm/omap_fb.c b/drivers/staging/omapdrm/omap_fb.c
index d021a7ec58df..116a8ff315ac 100644
--- a/drivers/staging/omapdrm/omap_fb.c
+++ b/drivers/staging/omapdrm/omap_fb.c
@@ -59,6 +59,20 @@ static const struct format formats[] = {
{ OMAP_DSS_COLOR_UYVY, DRM_FORMAT_UYVY, {{2, 1}}, true },
};
+/* convert from overlay's pixel formats bitmask to an array of fourcc's */
+uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats,
+ uint32_t max_formats, enum omap_color_mode supported_modes)
+{
+ uint32_t nformats = 0;
+ int i = 0;
+
+ for (i = 0; i < ARRAY_SIZE(formats) && nformats < max_formats; i++)
+ if (formats[i].dss_format & supported_modes)
+ pixel_formats[nformats++] = formats[i].pixel_format;
+
+ return nformats;
+}
+
/* per-plane info for the fb: */
struct plane {
struct drm_gem_object *bo;