Commit 6ea48430 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: Don't call .set_timings() operation recursively

Instead of calling the .set_timings() operation recursively from the
display device backwards, iterate over the devices manually in the DRM
encoder code. This moves the complexity to a single central location and
simplifies the logic in omap_dss_device drivers.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent d8dbe791
...@@ -73,22 +73,12 @@ static void tvc_disable(struct omap_dss_device *dssdev) ...@@ -73,22 +73,12 @@ static void tvc_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void tvc_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static const struct omap_dss_device_ops tvc_ops = { static const struct omap_dss_device_ops tvc_ops = {
.connect = tvc_connect, .connect = tvc_connect,
.disconnect = tvc_disconnect, .disconnect = tvc_disconnect,
.enable = tvc_enable, .enable = tvc_enable,
.disable = tvc_disable, .disable = tvc_disable,
.set_timings = tvc_set_timings,
}; };
static int tvc_probe(struct platform_device *pdev) static int tvc_probe(struct platform_device *pdev)
......
...@@ -78,14 +78,6 @@ static void dvic_disable(struct omap_dss_device *dssdev) ...@@ -78,14 +78,6 @@ static void dvic_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void dvic_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static int dvic_ddc_read(struct i2c_adapter *adapter, static int dvic_ddc_read(struct i2c_adapter *adapter,
unsigned char *buf, u16 count, u8 offset) unsigned char *buf, u16 count, u8 offset)
{ {
...@@ -192,8 +184,6 @@ static const struct omap_dss_device_ops dvic_ops = { ...@@ -192,8 +184,6 @@ static const struct omap_dss_device_ops dvic_ops = {
.enable = dvic_enable, .enable = dvic_enable,
.disable = dvic_disable, .disable = dvic_disable,
.set_timings = dvic_set_timings,
.read_edid = dvic_read_edid, .read_edid = dvic_read_edid,
.detect = dvic_detect, .detect = dvic_detect,
......
...@@ -79,14 +79,6 @@ static void hdmic_disable(struct omap_dss_device *dssdev) ...@@ -79,14 +79,6 @@ static void hdmic_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void hdmic_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static bool hdmic_detect(struct omap_dss_device *dssdev) static bool hdmic_detect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
...@@ -124,8 +116,6 @@ static const struct omap_dss_device_ops hdmic_ops = { ...@@ -124,8 +116,6 @@ static const struct omap_dss_device_ops hdmic_ops = {
.enable = hdmic_enable, .enable = hdmic_enable,
.disable = hdmic_disable, .disable = hdmic_disable,
.set_timings = hdmic_set_timings,
.detect = hdmic_detect, .detect = hdmic_detect,
.register_hpd_cb = hdmic_register_hpd_cb, .register_hpd_cb = hdmic_register_hpd_cb,
.unregister_hpd_cb = hdmic_unregister_hpd_cb, .unregister_hpd_cb = hdmic_unregister_hpd_cb,
......
...@@ -85,22 +85,11 @@ static void opa362_disable(struct omap_dss_device *dssdev) ...@@ -85,22 +85,11 @@ static void opa362_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void opa362_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
dev_dbg(dssdev->dev, "set_timings\n");
src->ops->set_timings(src, vm);
}
static const struct omap_dss_device_ops opa362_ops = { static const struct omap_dss_device_ops opa362_ops = {
.connect = opa362_connect, .connect = opa362_connect,
.disconnect = opa362_disconnect, .disconnect = opa362_disconnect,
.enable = opa362_enable, .enable = opa362_enable,
.disable = opa362_disable, .disable = opa362_disable,
.set_timings = opa362_set_timings,
}; };
static int opa362_probe(struct platform_device *pdev) static int opa362_probe(struct platform_device *pdev)
......
...@@ -76,20 +76,11 @@ static void tfp410_disable(struct omap_dss_device *dssdev) ...@@ -76,20 +76,11 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void tfp410_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static const struct omap_dss_device_ops tfp410_ops = { static const struct omap_dss_device_ops tfp410_ops = {
.connect = tfp410_connect, .connect = tfp410_connect,
.disconnect = tfp410_disconnect, .disconnect = tfp410_disconnect,
.enable = tfp410_enable, .enable = tfp410_enable,
.disable = tfp410_disable, .disable = tfp410_disable,
.set_timings = tfp410_set_timings,
}; };
static int tfp410_probe(struct platform_device *pdev) static int tfp410_probe(struct platform_device *pdev)
......
...@@ -91,14 +91,6 @@ static void tpd_disable(struct omap_dss_device *dssdev) ...@@ -91,14 +91,6 @@ static void tpd_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void tpd_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static bool tpd_detect(struct omap_dss_device *dssdev) static bool tpd_detect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
...@@ -134,7 +126,6 @@ static const struct omap_dss_device_ops tpd_ops = { ...@@ -134,7 +126,6 @@ static const struct omap_dss_device_ops tpd_ops = {
.disconnect = tpd_disconnect, .disconnect = tpd_disconnect,
.enable = tpd_enable, .enable = tpd_enable,
.disable = tpd_disable, .disable = tpd_disable,
.set_timings = tpd_set_timings,
.detect = tpd_detect, .detect = tpd_detect,
.register_hpd_cb = tpd_register_hpd_cb, .register_hpd_cb = tpd_register_hpd_cb,
.unregister_hpd_cb = tpd_unregister_hpd_cb, .unregister_hpd_cb = tpd_unregister_hpd_cb,
......
...@@ -93,14 +93,6 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) ...@@ -93,14 +93,6 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void panel_dpi_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void panel_dpi_get_timings(struct omap_dss_device *dssdev, static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -116,7 +108,6 @@ static const struct omap_dss_device_ops panel_dpi_ops = { ...@@ -116,7 +108,6 @@ static const struct omap_dss_device_ops panel_dpi_ops = {
.enable = panel_dpi_enable, .enable = panel_dpi_enable,
.disable = panel_dpi_disable, .disable = panel_dpi_disable,
.set_timings = panel_dpi_set_timings,
.get_timings = panel_dpi_get_timings, .get_timings = panel_dpi_get_timings,
}; };
......
...@@ -163,14 +163,6 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) ...@@ -163,14 +163,6 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void lb035q02_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void lb035q02_get_timings(struct omap_dss_device *dssdev, static void lb035q02_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -186,7 +178,6 @@ static const struct omap_dss_device_ops lb035q02_ops = { ...@@ -186,7 +178,6 @@ static const struct omap_dss_device_ops lb035q02_ops = {
.enable = lb035q02_enable, .enable = lb035q02_enable,
.disable = lb035q02_disable, .disable = lb035q02_disable,
.set_timings = lb035q02_set_timings,
.get_timings = lb035q02_get_timings, .get_timings = lb035q02_get_timings,
}; };
......
...@@ -156,14 +156,6 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) ...@@ -156,14 +156,6 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void nec_8048_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void nec_8048_get_timings(struct omap_dss_device *dssdev, static void nec_8048_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -179,7 +171,6 @@ static const struct omap_dss_device_ops nec_8048_ops = { ...@@ -179,7 +171,6 @@ static const struct omap_dss_device_ops nec_8048_ops = {
.enable = nec_8048_enable, .enable = nec_8048_enable,
.disable = nec_8048_disable, .disable = nec_8048_disable,
.set_timings = nec_8048_set_timings,
.get_timings = nec_8048_get_timings, .get_timings = nec_8048_get_timings,
}; };
......
...@@ -126,14 +126,6 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) ...@@ -126,14 +126,6 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void sharp_ls_get_timings(struct omap_dss_device *dssdev, static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -149,7 +141,6 @@ static const struct omap_dss_device_ops sharp_ls_ops = { ...@@ -149,7 +141,6 @@ static const struct omap_dss_device_ops sharp_ls_ops = {
.enable = sharp_ls_enable, .enable = sharp_ls_enable,
.disable = sharp_ls_disable, .disable = sharp_ls_disable,
.set_timings = sharp_ls_set_timings,
.get_timings = sharp_ls_get_timings, .get_timings = sharp_ls_get_timings,
}; };
......
...@@ -629,14 +629,6 @@ static void acx565akm_disable(struct omap_dss_device *dssdev) ...@@ -629,14 +629,6 @@ static void acx565akm_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void acx565akm_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void acx565akm_get_timings(struct omap_dss_device *dssdev, static void acx565akm_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -652,7 +644,6 @@ static const struct omap_dss_device_ops acx565akm_ops = { ...@@ -652,7 +644,6 @@ static const struct omap_dss_device_ops acx565akm_ops = {
.enable = acx565akm_enable, .enable = acx565akm_enable,
.disable = acx565akm_disable, .disable = acx565akm_disable,
.set_timings = acx565akm_set_timings,
.get_timings = acx565akm_get_timings, .get_timings = acx565akm_get_timings,
}; };
......
...@@ -295,14 +295,6 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) ...@@ -295,14 +295,6 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -318,7 +310,6 @@ static const struct omap_dss_device_ops td028ttec1_ops = { ...@@ -318,7 +310,6 @@ static const struct omap_dss_device_ops td028ttec1_ops = {
.enable = td028ttec1_panel_enable, .enable = td028ttec1_panel_enable,
.disable = td028ttec1_panel_disable, .disable = td028ttec1_panel_disable,
.set_timings = td028ttec1_panel_set_timings,
.get_timings = td028ttec1_panel_get_timings, .get_timings = td028ttec1_panel_get_timings,
}; };
......
...@@ -369,14 +369,6 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) ...@@ -369,14 +369,6 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
{
struct omap_dss_device *src = dssdev->src;
src->ops->set_timings(src, vm);
}
static void tpo_td043_get_timings(struct omap_dss_device *dssdev, static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
...@@ -392,7 +384,6 @@ static const struct omap_dss_device_ops tpo_td043_ops = { ...@@ -392,7 +384,6 @@ static const struct omap_dss_device_ops tpo_td043_ops = {
.enable = tpo_td043_enable, .enable = tpo_td043_enable,
.disable = tpo_td043_disable, .disable = tpo_td043_disable,
.set_timings = tpo_td043_set_timings,
.get_timings = tpo_td043_get_timings, .get_timings = tpo_td043_get_timings,
}; };
......
...@@ -477,8 +477,6 @@ static void dpi_set_timings(struct omap_dss_device *dssdev, ...@@ -477,8 +477,6 @@ static void dpi_set_timings(struct omap_dss_device *dssdev,
dpi->vm = *vm; dpi->vm = *vm;
dss_mgr_set_timings(&dpi->output, vm);
mutex_unlock(&dpi->lock); mutex_unlock(&dpi->lock);
} }
......
...@@ -259,8 +259,6 @@ static void hdmi_display_set_timings(struct omap_dss_device *dssdev, ...@@ -259,8 +259,6 @@ static void hdmi_display_set_timings(struct omap_dss_device *dssdev,
dispc_set_tv_pclk(hdmi->dss->dispc, vm->pixelclock); dispc_set_tv_pclk(hdmi->dss->dispc, vm->pixelclock);
dss_mgr_set_timings(&hdmi->output, vm);
mutex_unlock(&hdmi->lock); mutex_unlock(&hdmi->lock);
} }
......
...@@ -258,8 +258,6 @@ static void hdmi_display_set_timings(struct omap_dss_device *dssdev, ...@@ -258,8 +258,6 @@ static void hdmi_display_set_timings(struct omap_dss_device *dssdev,
dispc_set_tv_pclk(hdmi->dss->dispc, vm->pixelclock); dispc_set_tv_pclk(hdmi->dss->dispc, vm->pixelclock);
dss_mgr_set_timings(&hdmi->output, vm);
mutex_unlock(&hdmi->lock); mutex_unlock(&hdmi->lock);
} }
......
...@@ -218,8 +218,6 @@ static void sdi_set_timings(struct omap_dss_device *dssdev, ...@@ -218,8 +218,6 @@ static void sdi_set_timings(struct omap_dss_device *dssdev,
struct sdi_device *sdi = dssdev_to_sdi(dssdev); struct sdi_device *sdi = dssdev_to_sdi(dssdev);
sdi->vm = *vm; sdi->vm = *vm;
dss_mgr_set_timings(&sdi->output, vm);
} }
static int sdi_check_timings(struct omap_dss_device *dssdev, static int sdi_check_timings(struct omap_dss_device *dssdev,
......
...@@ -593,8 +593,6 @@ static void venc_set_timings(struct omap_dss_device *dssdev, ...@@ -593,8 +593,6 @@ static void venc_set_timings(struct omap_dss_device *dssdev,
dispc_set_tv_pclk(venc->dss->dispc, 13500000); dispc_set_tv_pclk(venc->dss->dispc, 13500000);
dss_mgr_set_timings(&venc->output, vm);
mutex_unlock(&venc->venc_lock); mutex_unlock(&venc->venc_lock);
} }
......
...@@ -58,7 +58,6 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, ...@@ -58,7 +58,6 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *display = omap_encoder->display;
struct drm_connector *connector; struct drm_connector *connector;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
struct videomode vm = { 0 }; struct videomode vm = { 0 };
...@@ -104,18 +103,15 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, ...@@ -104,18 +103,15 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
} }
} }
/* /* Set timings for all devices in the display pipeline. */
* HACK: Call the .set_timings() operation if available, this will dss_mgr_set_timings(omap_encoder->output, &vm);
* eventually store timings in the CRTC. Otherwise (for DSI outputs)
* store the timings directly. for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) {
* if (dssdev->ops->set_timings)
* All outputs should be brought in sync to operate similarly. dssdev->ops->set_timings(dssdev, &vm);
*/ }
if (display->ops->set_timings)
display->ops->set_timings(display, &vm);
else
*omap_crtc_timings(encoder->crtc) = vm;
/* Set the HDMI mode and HDMI infoframe if applicable. */
hdmi_mode = false; hdmi_mode = false;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) { if (connector->encoder == encoder) {
......
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