diff options
author | Rob Clark <rob@ti.com> | 2012-03-05 16:48:31 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-07 21:38:06 (GMT) |
commit | a890e6623ae024d28f855d672e72649fa2cb511e (patch) | |
tree | 1dadf19d5f4824bc68416baf31a327f4e440e24b /drivers/staging/omapdrm/omap_fb.c | |
parent | dbf717fd9a0d5fddd2dae3314a1e14842f4dc182 (diff) | |
download | linux-fsl-qoriq-a890e6623ae024d28f855d672e72649fa2cb511e.tar.xz |
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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/omapdrm/omap_fb.c b/drivers/staging/omapdrm/omap_fb.c index d021a7e..116a8ff 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; |