Commit 9c39d17e authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: use u32 instead of enum omap_color_mode

In this step we drop 'enum omap_color_mode', and use u32 instead.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 18c0d621
......@@ -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 @@ static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk,
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,
......
......@@ -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];
......
......@@ -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
......@@ -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);
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment