summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/omap_fb.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-05-04 10:27:53 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-06-02 10:57:23 +0300
commit18c0d6217a4898b9cae1b999e0dd37f8239ba0ae (patch)
tree4570f702f9937ad113d06d3e8684e78c2e3c3018 /drivers/gpu/drm/omapdrm/omap_fb.c
parent22245f531a769164402f4e63f1f1e18de981aff3 (diff)
drm/omap: change supported_modes to an array
enum omap_color_mode is a bitmask, so at the moment we present the supported color modes as mask. To be able to move to fourccs, we need to use an array to present the supported color modes. As a first step towards fourccs, this patch changes the code to use an array to store the enums. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 1d2a94df7054..6fb25d35bc0a 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -57,14 +57,22 @@ static const struct {
/* 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 max_formats, const 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)
+ for (i = 0; i < ARRAY_SIZE(formats) && nformats < max_formats; i++) {
+ unsigned int t;
+
+ for (t = 0; supported_modes[t]; ++t) {
+ if (supported_modes[t] != formats[i].dss_format)
+ continue;
+
pixel_formats[nformats++] = formats[i].pixel_format;
+ break;
+ }
+ }
return nformats;
}