Hi Tomi, Thank you for the patch. On Thursday 04 May 2017 13:23:27 Tomi Valkeinen wrote: > 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@xxxxxx> > --- > drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- > drivers/gpu/drm/omapdrm/dss/dss_features.c | 153 +++++++++++++++---------- > drivers/gpu/drm/omapdrm/dss/dss_features.h | 2 +- > drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +- > drivers/gpu/drm/omapdrm/omap_drv.h | 2 +- > drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++- > 6 files changed, 103 insertions(+), 72 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c > b/drivers/gpu/drm/omapdrm/dss/dispc.c index 9dfef8fdff67..dcd83efda3af > 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dispc.c > +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c > @@ -1140,7 +1140,7 @@ static u32 dispc_ovl_get_burst_size(enum omap_plane_id > plane) return unit * 8; > } > > -static enum omap_color_mode dispc_ovl_get_color_modes(enum omap_plane_id > plane) +static const enum omap_color_mode *dispc_ovl_get_color_modes(enum > omap_plane_id plane) { > return dss_feat_get_supported_color_modes(plane); > } > diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c > b/drivers/gpu/drm/omapdrm/dss/dss_features.c index > bdac1d645ef0..f9b0324cc263 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dss_features.c > +++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c [snip] > @@ -229,90 +229,104 @@ static const enum omap_dss_output_id > omap5_dss_supported_outputs[] = { 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 } I don't like this macro much, but I don't think I have a much better proposal beside just typing the cast out :-/, so Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > +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), > }; [snip] -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel