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: Tomi Valkeinen <tomi.valkeinen@ti.com>
}
}
-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_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
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_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
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);
unsigned long flags;
int r;
}
}
-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);
unsigned long flags;
int 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);
unsigned long flags;
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)
{
+ struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr);
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)
{
+ struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
unsigned long flags;
struct mgr_priv_data *mp = get_mgr_priv(mgr);
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)
{
+ struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);
if (mp->framedone_handler)
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)
{
+ struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
struct mgr_priv_data *mp = get_mgr_priv(mgr);
WARN_ON(mp->framedone_handler != handler ||
enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
struct dss_mgr_ops {
- int (*connect)(struct omap_overlay_manager *mgr,
+ int (*connect)(enum omap_channel channel,
struct omap_dss_device *dst);
- void (*disconnect)(struct omap_overlay_manager *mgr,
+ void (*disconnect)(enum omap_channel channel,
struct omap_dss_device *dst);
- void (*start_update)(struct omap_overlay_manager *mgr);
- int (*enable)(struct omap_overlay_manager *mgr);
- void (*disable)(struct omap_overlay_manager *mgr);
- void (*set_timings)(struct omap_overlay_manager *mgr,
+ void (*start_update)(enum omap_channel channel);
+ int (*enable)(enum omap_channel channel);
+ void (*disable)(enum omap_channel channel);
+ void (*set_timings)(enum omap_channel channel,
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);
- int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
+ int (*register_framedone_handler)(enum omap_channel channel,
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);
};
int dss_mgr_connect(struct omap_overlay_manager *mgr,
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);
void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst)
{
- dss_mgr_ops->disconnect(mgr, dst);
+ dss_mgr_ops->disconnect(mgr->id, dst);
}
EXPORT_SYMBOL(dss_mgr_disconnect);
void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
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);
void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
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);
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);
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);
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);
int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
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);
void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
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);
static struct omap_dss_device *omap_crtc_output[8];
/* 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)
{
- if (omap_crtc_output[mgr->id])
+ struct omap_overlay_manager *mgr = omap_dss_get_overlay_manager(channel);
+
+ if (omap_crtc_output[channel])
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;
- omap_crtc_output[mgr->id] = dst;
+ omap_crtc_output[channel] = dst;
dst->manager = mgr;
mgr->output = dst;
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)
{
- 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 = NULL;
}
-static void omap_crtc_dss_start_update(struct omap_overlay_manager *mgr)
+static void omap_crtc_dss_start_update(enum omap_channel channel)
{
}
}
-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;
memset(&info, 0, sizeof(info));
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);
}
-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)
{
- struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+ struct omap_crtc *omap_crtc = omap_crtcs[channel];
DBG("%s", omap_crtc->name);
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)
{
- struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+ struct omap_crtc *omap_crtc = omap_crtcs[channel];
DBG("%s", omap_crtc->name);
dispc_mgr_set_lcd_config(omap_crtc->channel, config);
}
static int omap_crtc_dss_register_framedone(
- struct omap_overlay_manager *mgr,
+ enum omap_channel channel,
void (*handler)(void *), void *data)
{
return 0;
}
static void omap_crtc_dss_unregister_framedone(
- struct omap_overlay_manager *mgr,
+ enum omap_channel channel,
void (*handler)(void *), void *data)
{
}