drm/omap: use u32 instead of enum omap_color_mode
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 4 May 2017 08:19:12 +0000 (11:19 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 2 Jun 2017 07:57:24 +0000 (10:57 +0300)
In this step we drop 'enum omap_color_mode', and use u32 instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/dss/dispc.c
drivers/gpu/drm/omapdrm/dss/dss_features.c
drivers/gpu/drm/omapdrm/dss/dss_features.h
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_drv.h
drivers/gpu/drm/omapdrm/omap_fb.c

index 5836756a23a989783666ee5fea9a74cbba8a671d..c935a83bbe8936e08da338d91998a751d092b591 100644 (file)
@@ -77,7 +77,7 @@ struct dispc_features {
        int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
                const struct videomode *vm,
                u16 width, u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode, bool *five_taps,
+               u32 color_mode, bool *five_taps,
                int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
                u16 pos_x, unsigned long *core_clk, bool mem_to_mem);
        unsigned long (*calc_core_clk) (unsigned long pclk,
@@ -906,7 +906,7 @@ static void dispc_ovl_set_row_inc(enum omap_plane_id plane, s32 inc)
 }
 
 static void dispc_ovl_set_color_mode(enum omap_plane_id plane,
-               enum omap_color_mode color_mode)
+               u32 color_mode)
 {
        u32 m = 0;
        if (plane != OMAP_DSS_GFX) {
@@ -978,7 +978,7 @@ static void dispc_ovl_set_color_mode(enum omap_plane_id plane,
        REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1);
 }
 
-static bool format_is_yuv(enum omap_color_mode color_mode)
+static bool format_is_yuv(u32 color_mode)
 {
        switch (color_mode) {
        case OMAP_DSS_COLOR_YUV2:
@@ -1140,7 +1140,7 @@ static u32 dispc_ovl_get_burst_size(enum omap_plane_id plane)
        return unit * 8;
 }
 
-static const enum omap_color_mode *dispc_ovl_get_color_modes(enum omap_plane_id plane)
+static const u32 *dispc_ovl_get_color_modes(enum omap_plane_id plane)
 {
        return dss_feat_get_supported_color_modes(plane);
 }
@@ -1562,7 +1562,7 @@ static void dispc_ovl_set_scale_param(enum omap_plane_id plane,
 
 static void dispc_ovl_set_accu_uv(enum omap_plane_id plane,
                u16 orig_width, u16 orig_height, u16 out_width, u16 out_height,
-               bool ilace, enum omap_color_mode color_mode, u8 rotation)
+               bool ilace, u32 color_mode, u8 rotation)
 {
        int h_accu2_0, h_accu2_1;
        int v_accu2_0, v_accu2_1;
@@ -1652,7 +1652,7 @@ static void dispc_ovl_set_scaling_common(enum omap_plane_id plane,
                u16 orig_width, u16 orig_height,
                u16 out_width, u16 out_height,
                bool ilace, bool five_taps,
-               bool fieldmode, enum omap_color_mode color_mode,
+               bool fieldmode, u32 color_mode,
                u8 rotation)
 {
        int accu0 = 0;
@@ -1706,7 +1706,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane_id plane,
                u16 orig_width, u16 orig_height,
                u16 out_width, u16 out_height,
                bool ilace, bool five_taps,
-               bool fieldmode, enum omap_color_mode color_mode,
+               bool fieldmode, u32 color_mode,
                u8 rotation)
 {
        int scale_x = out_width != orig_width;
@@ -1785,7 +1785,7 @@ static void dispc_ovl_set_scaling(enum omap_plane_id plane,
                u16 orig_width, u16 orig_height,
                u16 out_width, u16 out_height,
                bool ilace, bool five_taps,
-               bool fieldmode, enum omap_color_mode color_mode,
+               bool fieldmode, u32 color_mode,
                u8 rotation)
 {
        BUG_ON(plane == OMAP_DSS_GFX);
@@ -1807,7 +1807,7 @@ static void dispc_ovl_set_scaling(enum omap_plane_id plane,
 
 static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
                enum omap_dss_rotation_type rotation_type,
-               bool mirroring, enum omap_color_mode color_mode)
+               bool mirroring, u32 color_mode)
 {
        bool row_repeat = false;
        int vidrot = 0;
@@ -1878,7 +1878,7 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
        }
 }
 
-static int color_mode_to_bpp(enum omap_color_mode color_mode)
+static int color_mode_to_bpp(u32 color_mode)
 {
        switch (color_mode) {
        case OMAP_DSS_COLOR_NV12:
@@ -1920,7 +1920,7 @@ static s32 pixinc(int pixels, u8 ps)
 }
 
 static void calc_offset(u16 screen_width, u16 width,
-               enum omap_color_mode color_mode, bool fieldmode,
+               u32 color_mode, bool fieldmode,
                unsigned int field_offset, unsigned *offset0, unsigned *offset1,
                s32 *row_inc, s32 *pix_inc, int x_predecim, int y_predecim)
 {
@@ -2007,7 +2007,7 @@ static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk,
 static unsigned long calc_core_clk_five_taps(unsigned long pclk,
                const struct videomode *vm, u16 width,
                u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode)
+               u32 color_mode)
 {
        u32 core_clk = 0;
        u64 tmp;
@@ -2100,7 +2100,7 @@ static unsigned long calc_core_clk_44xx(unsigned long pclk, u16 width,
 static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk,
                const struct videomode *vm,
                u16 width, u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode, bool *five_taps,
+               u32 color_mode, bool *five_taps,
                int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
                u16 pos_x, unsigned long *core_clk, bool mem_to_mem)
 {
@@ -2146,7 +2146,7 @@ static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk,
 static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk,
                const struct videomode *vm,
                u16 width, u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode, bool *five_taps,
+               u32 color_mode, bool *five_taps,
                int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
                u16 pos_x, unsigned long *core_clk, bool mem_to_mem)
 {
@@ -2231,7 +2231,7 @@ again:
 static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
                const struct videomode *vm,
                u16 width, u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode, bool *five_taps,
+               u32 color_mode, bool *five_taps,
                int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
                u16 pos_x, unsigned long *core_clk, bool mem_to_mem)
 {
@@ -2296,7 +2296,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
                enum omap_overlay_caps caps,
                const struct videomode *vm,
                u16 width, u16 height, u16 out_width, u16 out_height,
-               enum omap_color_mode color_mode, bool *five_taps,
+               u32 color_mode, bool *five_taps,
                int *x_predecim, int *y_predecim, u16 pos_x,
                enum omap_dss_rotation_type rotation_type, bool mem_to_mem)
 {
@@ -2371,7 +2371,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
 static int dispc_ovl_setup_common(enum omap_plane_id plane,
                enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr,
                u16 screen_width, int pos_x, int pos_y, u16 width, u16 height,
-               u16 out_width, u16 out_height, enum omap_color_mode color_mode,
+               u16 out_width, u16 out_height, u32 color_mode,
                u8 rotation, bool mirror, u8 zorder, u8 pre_mult_alpha,
                u8 global_alpha, enum omap_dss_rotation_type rotation_type,
                bool replication, const struct videomode *vm,
index f9b0324cc263d545f3141f44c6b8d7683f16b154..5fef78e637db186232be1826d23b8b673cedd1a8 100644 (file)
@@ -47,7 +47,7 @@ struct omap_dss_features {
        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 u32 **supported_color_modes;
        const enum omap_overlay_caps *overlay_caps;
        const struct dss_param_range *dss_params;
 
@@ -229,9 +229,9 @@ static const enum omap_dss_output_id omap5_dss_supported_outputs[] = {
        OMAP_DSS_OUTPUT_DSI2,
 };
 
-#define COLOR_ARRAY(arr...) (const enum omap_color_mode[]) { arr, 0 }
+#define COLOR_ARRAY(arr...) (const u32[]) { arr, 0 }
 
-static const enum omap_color_mode *omap2_dss_supported_color_modes[] = {
+static const u32 *omap2_dss_supported_color_modes[] = {
 
        /* OMAP_DSS_GFX */
        COLOR_ARRAY(
@@ -251,7 +251,7 @@ static const enum omap_color_mode *omap2_dss_supported_color_modes[] = {
        OMAP_DSS_COLOR_UYVY),
 };
 
-static const enum omap_color_mode *omap3_dss_supported_color_modes[] = {
+static const u32 *omap3_dss_supported_color_modes[] = {
        /* OMAP_DSS_GFX */
        COLOR_ARRAY(
        OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16,
@@ -274,7 +274,7 @@ static const enum omap_color_mode *omap3_dss_supported_color_modes[] = {
        OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32),
 };
 
-static const enum omap_color_mode *omap4_dss_supported_color_modes[] = {
+static const u32 *omap4_dss_supported_color_modes[] = {
        /* OMAP_DSS_GFX */
        COLOR_ARRAY(
        OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16,
@@ -797,7 +797,7 @@ enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel
        return omap_current_dss_features->supported_outputs[channel];
 }
 
-const enum omap_color_mode *dss_feat_get_supported_color_modes(enum omap_plane_id plane)
+const u32 *dss_feat_get_supported_color_modes(enum omap_plane_id plane)
 {
        return omap_current_dss_features->supported_color_modes[plane];
 }
@@ -808,9 +808,9 @@ enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane_id plane)
 }
 
 bool dss_feat_color_mode_supported(enum omap_plane_id plane,
-               enum omap_color_mode color_mode)
+               u32 color_mode)
 {
-       const enum omap_color_mode *modes;
+       const u32 *modes;
        unsigned int i;
 
        modes = omap_current_dss_features->supported_color_modes[plane];
index 190cf62537b0e16139171ae2caffd67305ade87c..8f48dc097717dcc88ec87a36672decac38340c60 100644 (file)
@@ -90,7 +90,7 @@ unsigned long dss_feat_get_param_min(enum dss_range_param param);
 unsigned long dss_feat_get_param_max(enum dss_range_param param);
 enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane_id plane);
 bool dss_feat_color_mode_supported(enum omap_plane_id plane,
-               enum omap_color_mode color_mode);
+               u32 color_mode);
 
 u32 dss_feat_get_buffer_size_unit(void);       /* in bytes */
 u32 dss_feat_get_burst_size_unit(void);                /* in bytes */
@@ -104,6 +104,6 @@ enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel
 
 int dss_feat_get_num_mgrs(void);
 int dss_feat_get_num_ovls(void);
-const enum omap_color_mode *dss_feat_get_supported_color_modes(enum omap_plane_id plane);
+const u32 *dss_feat_get_supported_color_modes(enum omap_plane_id plane);
 
 #endif
index 83be1f57fdb5557084c0eff332e5966a8f2f9043..a3294fe356d962c6b2b60293d50a435d693f4cec 100644 (file)
@@ -282,7 +282,7 @@ struct omap_overlay_info {
        u16 screen_width;
        u16 width;
        u16 height;
-       enum omap_color_mode color_mode;
+       u32 color_mode;
        u8 rotation;
        enum omap_dss_rotation_type rotation_type;
        bool mirror;
@@ -330,7 +330,7 @@ struct omap_dss_writeback_info {
        u16 buf_width;
        u16 width;
        u16 height;
-       enum omap_color_mode color_mode;
+       u32 color_mode;
        u8 rotation;
        enum omap_dss_rotation_type rotation_type;
        bool mirror;
@@ -734,7 +734,7 @@ struct dispc_ops {
                        const struct videomode *vm, bool mem_to_mem,
                        enum omap_channel channel);
 
-       const enum omap_color_mode *(*ovl_get_color_modes)(enum omap_plane_id plane);
+       const u32 *(*ovl_get_color_modes)(enum omap_plane_id plane);
 };
 
 void dispc_set_ops(const struct dispc_ops *o);
index ef061a53e2319ef34c3ba43b5b89603312c039f1..d78b3ff94a077e675bf2c3fcc085a7427b9f1fce 100644 (file)
@@ -151,7 +151,7 @@ struct drm_encoder *omap_connector_attached_encoder(
 bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
 
 uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats,
-               uint32_t max_formats, const enum omap_color_mode *supported_modes);
+               uint32_t max_formats, const u32 *supported_modes);
 struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
                struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
index 6fb25d35bc0a07f6a90344029525fa61ccc268a0..71b3f25e61c2ad548a2f789e5787f7c1f84b20d8 100644 (file)
@@ -31,7 +31,7 @@
 
 /* DSS to DRM formats mapping */
 static const struct {
-       enum omap_color_mode dss_format;
+       u32 dss_format;
        uint32_t pixel_format;
 } formats[] = {
        /* 16bpp [A]RGB: */
@@ -57,7 +57,7 @@ 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, const enum omap_color_mode *supported_modes)
+               uint32_t max_formats, const u32 *supported_modes)
 {
        uint32_t nformats = 0;
        int i = 0;
@@ -91,7 +91,7 @@ struct omap_framebuffer {
        struct drm_framebuffer base;
        int pin_count;
        const struct drm_format_info *format;
-       enum omap_color_mode dss_format;
+       u32 dss_format;
        struct plane planes[2];
        /* lock for pinning (pin_count and planes.dma_addr) */
        struct mutex lock;
@@ -395,7 +395,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
        const struct drm_format_info *format = NULL;
        struct omap_framebuffer *omap_fb = NULL;
        struct drm_framebuffer *fb = NULL;
-       enum omap_color_mode dss_format = 0;
+       u32 dss_format = 0;
        unsigned int pitch = mode_cmd->pitches[0];
        int ret, i;