Commit e5cbb6e8 authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: convert dss_mgr_ops to use omap_channel

We are removing the use of 'struct omap_overlay_manager' from omapdrm.
This patch changes the function pointers in 'dss_mgr_ops' to get 'enum
omap_channel' parameter instead of 'struct omap_overlay_manager'.

The change is very straightforward, as we still use 'struct
omap_overlay_manager' inside the function implementations where needed.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 179df15f
...@@ -805,20 +805,23 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr) ...@@ -805,20 +805,23 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr)
} }
} }
static int dss_mgr_connect_compat(struct omap_overlay_manager *mgr, static int dss_mgr_connect_compat(enum omap_channel channel,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
return mgr->set_output(mgr, dst); return mgr->set_output(mgr, dst);
} }
static void dss_mgr_disconnect_compat(struct omap_overlay_manager *mgr, static void dss_mgr_disconnect_compat(enum omap_channel channel,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
mgr->unset_output(mgr); mgr->unset_output(mgr);
} }
static void dss_mgr_start_update_compat(struct omap_overlay_manager *mgr) static void dss_mgr_start_update_compat(enum omap_channel channel)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags; unsigned long flags;
int r; int r;
...@@ -1072,8 +1075,9 @@ static void dss_setup_fifos(void) ...@@ -1072,8 +1075,9 @@ static void dss_setup_fifos(void)
} }
} }
static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr) static int dss_mgr_enable_compat(enum omap_channel channel)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags; unsigned long flags;
int r; int r;
...@@ -1122,8 +1126,9 @@ static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr) ...@@ -1122,8 +1126,9 @@ static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
return r; return r;
} }
static void dss_mgr_disable_compat(struct omap_overlay_manager *mgr) static void dss_mgr_disable_compat(enum omap_channel channel)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
unsigned long flags; unsigned long flags;
...@@ -1261,9 +1266,10 @@ static void dss_apply_mgr_timings(struct omap_overlay_manager *mgr, ...@@ -1261,9 +1266,10 @@ static void dss_apply_mgr_timings(struct omap_overlay_manager *mgr,
mp->extra_info_dirty = true; mp->extra_info_dirty = true;
} }
static void dss_mgr_set_timings_compat(struct omap_overlay_manager *mgr, static void dss_mgr_set_timings_compat(enum omap_channel channel,
const struct omap_video_timings *timings) const struct omap_video_timings *timings)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
unsigned long flags; unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
...@@ -1289,9 +1295,10 @@ static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr, ...@@ -1289,9 +1295,10 @@ static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr,
mp->extra_info_dirty = true; mp->extra_info_dirty = true;
} }
static void dss_mgr_set_lcd_config_compat(struct omap_overlay_manager *mgr, static void dss_mgr_set_lcd_config_compat(enum omap_channel channel,
const struct dss_lcd_mgr_config *config) const struct dss_lcd_mgr_config *config)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
unsigned long flags; unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
...@@ -1554,9 +1561,10 @@ static int dss_ovl_disable(struct omap_overlay *ovl) ...@@ -1554,9 +1561,10 @@ static int dss_ovl_disable(struct omap_overlay *ovl)
return r; return r;
} }
static int dss_mgr_register_framedone_handler_compat(struct omap_overlay_manager *mgr, static int dss_mgr_register_framedone_handler_compat(enum omap_channel channel,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
if (mp->framedone_handler) if (mp->framedone_handler)
...@@ -1568,9 +1576,10 @@ static int dss_mgr_register_framedone_handler_compat(struct omap_overlay_manager ...@@ -1568,9 +1576,10 @@ static int dss_mgr_register_framedone_handler_compat(struct omap_overlay_manager
return 0; return 0;
} }
static void dss_mgr_unregister_framedone_handler_compat(struct omap_overlay_manager *mgr, static void dss_mgr_unregister_framedone_handler_compat(enum omap_channel channel,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr); struct mgr_priv_data *mp = get_mgr_priv(mgr);
WARN_ON(mp->framedone_handler != handler || WARN_ON(mp->framedone_handler != handler ||
......
...@@ -61,21 +61,21 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, ...@@ -61,21 +61,21 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel); enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
struct dss_mgr_ops { struct dss_mgr_ops {
int (*connect)(struct omap_overlay_manager *mgr, int (*connect)(enum omap_channel channel,
struct omap_dss_device *dst); struct omap_dss_device *dst);
void (*disconnect)(struct omap_overlay_manager *mgr, void (*disconnect)(enum omap_channel channel,
struct omap_dss_device *dst); struct omap_dss_device *dst);
void (*start_update)(struct omap_overlay_manager *mgr); void (*start_update)(enum omap_channel channel);
int (*enable)(struct omap_overlay_manager *mgr); int (*enable)(enum omap_channel channel);
void (*disable)(struct omap_overlay_manager *mgr); void (*disable)(enum omap_channel channel);
void (*set_timings)(struct omap_overlay_manager *mgr, void (*set_timings)(enum omap_channel channel,
const struct omap_video_timings *timings); const struct omap_video_timings *timings);
void (*set_lcd_config)(struct omap_overlay_manager *mgr, void (*set_lcd_config)(enum omap_channel channel,
const struct dss_lcd_mgr_config *config); const struct dss_lcd_mgr_config *config);
int (*register_framedone_handler)(struct omap_overlay_manager *mgr, int (*register_framedone_handler)(enum omap_channel channel,
void (*handler)(void *), void *data); void (*handler)(void *), void *data);
void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr, void (*unregister_framedone_handler)(enum omap_channel channel,
void (*handler)(void *), void *data); void (*handler)(void *), void *data);
}; };
......
...@@ -191,59 +191,59 @@ EXPORT_SYMBOL(dss_uninstall_mgr_ops); ...@@ -191,59 +191,59 @@ EXPORT_SYMBOL(dss_uninstall_mgr_ops);
int dss_mgr_connect(struct omap_overlay_manager *mgr, int dss_mgr_connect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
return dss_mgr_ops->connect(mgr, dst); return dss_mgr_ops->connect(mgr->id, dst);
} }
EXPORT_SYMBOL(dss_mgr_connect); EXPORT_SYMBOL(dss_mgr_connect);
void dss_mgr_disconnect(struct omap_overlay_manager *mgr, void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
dss_mgr_ops->disconnect(mgr, dst); dss_mgr_ops->disconnect(mgr->id, dst);
} }
EXPORT_SYMBOL(dss_mgr_disconnect); EXPORT_SYMBOL(dss_mgr_disconnect);
void dss_mgr_set_timings(struct omap_overlay_manager *mgr, void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings) const struct omap_video_timings *timings)
{ {
dss_mgr_ops->set_timings(mgr, timings); dss_mgr_ops->set_timings(mgr->id, timings);
} }
EXPORT_SYMBOL(dss_mgr_set_timings); EXPORT_SYMBOL(dss_mgr_set_timings);
void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
const struct dss_lcd_mgr_config *config) const struct dss_lcd_mgr_config *config)
{ {
dss_mgr_ops->set_lcd_config(mgr, config); dss_mgr_ops->set_lcd_config(mgr->id, config);
} }
EXPORT_SYMBOL(dss_mgr_set_lcd_config); EXPORT_SYMBOL(dss_mgr_set_lcd_config);
int dss_mgr_enable(struct omap_overlay_manager *mgr) int dss_mgr_enable(struct omap_overlay_manager *mgr)
{ {
return dss_mgr_ops->enable(mgr); return dss_mgr_ops->enable(mgr->id);
} }
EXPORT_SYMBOL(dss_mgr_enable); EXPORT_SYMBOL(dss_mgr_enable);
void dss_mgr_disable(struct omap_overlay_manager *mgr) void dss_mgr_disable(struct omap_overlay_manager *mgr)
{ {
dss_mgr_ops->disable(mgr); dss_mgr_ops->disable(mgr->id);
} }
EXPORT_SYMBOL(dss_mgr_disable); EXPORT_SYMBOL(dss_mgr_disable);
void dss_mgr_start_update(struct omap_overlay_manager *mgr) void dss_mgr_start_update(struct omap_overlay_manager *mgr)
{ {
dss_mgr_ops->start_update(mgr); dss_mgr_ops->start_update(mgr->id);
} }
EXPORT_SYMBOL(dss_mgr_start_update); EXPORT_SYMBOL(dss_mgr_start_update);
int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr, int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
return dss_mgr_ops->register_framedone_handler(mgr, handler, data); return dss_mgr_ops->register_framedone_handler(mgr->id, handler, data);
} }
EXPORT_SYMBOL(dss_mgr_register_framedone_handler); EXPORT_SYMBOL(dss_mgr_register_framedone_handler);
void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
dss_mgr_ops->unregister_framedone_handler(mgr, handler, data); dss_mgr_ops->unregister_framedone_handler(mgr->id, handler, data);
} }
EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler); EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler);
...@@ -99,16 +99,18 @@ static struct omap_crtc *omap_crtcs[8]; ...@@ -99,16 +99,18 @@ static struct omap_crtc *omap_crtcs[8];
static struct omap_dss_device *omap_crtc_output[8]; static struct omap_dss_device *omap_crtc_output[8];
/* we can probably ignore these until we support command-mode panels: */ /* we can probably ignore these until we support command-mode panels: */
static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr, static int omap_crtc_dss_connect(enum omap_channel channel,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
if (omap_crtc_output[mgr->id]) struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
if (omap_crtc_output[channel])
return -EINVAL; return -EINVAL;
if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0) if ((dispc_mgr_get_supported_outputs(channel) & dst->id) == 0)
return -EINVAL; return -EINVAL;
omap_crtc_output[mgr->id] = dst; omap_crtc_output[channel] = dst;
dst->manager = mgr; dst->manager = mgr;
mgr->output = dst; mgr->output = dst;
...@@ -116,16 +118,18 @@ static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr, ...@@ -116,16 +118,18 @@ static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr,
return 0; return 0;
} }
static void omap_crtc_dss_disconnect(struct omap_overlay_manager *mgr, static void omap_crtc_dss_disconnect(enum omap_channel channel,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
omap_crtc_output[mgr->id] = NULL; struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
omap_crtc_output[channel] = NULL;
mgr->output->manager = NULL; mgr->output->manager = NULL;
mgr->output = NULL; mgr->output = NULL;
} }
static void omap_crtc_dss_start_update(struct omap_overlay_manager *mgr) static void omap_crtc_dss_start_update(enum omap_channel channel)
{ {
} }
...@@ -192,9 +196,9 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable) ...@@ -192,9 +196,9 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
} }
static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr) static int omap_crtc_dss_enable(enum omap_channel channel)
{ {
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; struct omap_crtc *omap_crtc = omap_crtcs[channel];
struct omap_overlay_manager_info info; struct omap_overlay_manager_info info;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
...@@ -211,38 +215,38 @@ static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr) ...@@ -211,38 +215,38 @@ static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr)
return 0; return 0;
} }
static void omap_crtc_dss_disable(struct omap_overlay_manager *mgr) static void omap_crtc_dss_disable(enum omap_channel channel)
{ {
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; struct omap_crtc *omap_crtc = omap_crtcs[channel];
omap_crtc_set_enabled(&omap_crtc->base, false); omap_crtc_set_enabled(&omap_crtc->base, false);
} }
static void omap_crtc_dss_set_timings(struct omap_overlay_manager *mgr, static void omap_crtc_dss_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings) const struct omap_video_timings *timings)
{ {
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; struct omap_crtc *omap_crtc = omap_crtcs[channel];
DBG("%s", omap_crtc->name); DBG("%s", omap_crtc->name);
omap_crtc->timings = *timings; omap_crtc->timings = *timings;
} }
static void omap_crtc_dss_set_lcd_config(struct omap_overlay_manager *mgr, static void omap_crtc_dss_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config) const struct dss_lcd_mgr_config *config)
{ {
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; struct omap_crtc *omap_crtc = omap_crtcs[channel];
DBG("%s", omap_crtc->name); DBG("%s", omap_crtc->name);
dispc_mgr_set_lcd_config(omap_crtc->channel, config); dispc_mgr_set_lcd_config(omap_crtc->channel, config);
} }
static int omap_crtc_dss_register_framedone( static int omap_crtc_dss_register_framedone(
struct omap_overlay_manager *mgr, enum omap_channel channel,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
return 0; return 0;
} }
static void omap_crtc_dss_unregister_framedone( static void omap_crtc_dss_unregister_framedone(
struct omap_overlay_manager *mgr, enum omap_channel channel,
void (*handler)(void *), void *data) void (*handler)(void *), void *data)
{ {
} }
......
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