diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-12 07:16:41 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 07:31:28 -0500 |
commit | 18946f62c6cc8cf051bafca8b7fa72309e8a1067 (patch) | |
tree | f1e33d76a571ebc4580b15c1b7ba1bec8e441cf6 /drivers/video/omap2/displays | |
parent | 446f7bff703f5f82560afde90fb22b7a1d366bbc (diff) |
OMAP: DSS2: move update() and sync()
Move update() and sync() from omap_dss_device to omap_dss_driver.
Also, update was hardcoded to use virtual channel 0. This patch adds a
parameter that specifies the VC.
This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/displays')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 4ccb583b7b67..58293203fc05 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -725,10 +725,58 @@ static int taal_resume(struct omap_dss_device *dssdev) | |||
725 | return 0; | 725 | return 0; |
726 | } | 726 | } |
727 | 727 | ||
728 | static void taal_setup_update(struct omap_dss_device *dssdev, | 728 | static void taal_framedone_cb(int err, void *data) |
729 | { | ||
730 | struct omap_dss_device *dssdev = data; | ||
731 | dev_dbg(&dssdev->dev, "framedone, err %d\n", err); | ||
732 | dsi_bus_unlock(); | ||
733 | } | ||
734 | |||
735 | static int taal_update(struct omap_dss_device *dssdev, | ||
729 | u16 x, u16 y, u16 w, u16 h) | 736 | u16 x, u16 y, u16 w, u16 h) |
730 | { | 737 | { |
731 | taal_set_update_window(x, y, w, h); | 738 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
739 | int r; | ||
740 | |||
741 | dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h); | ||
742 | |||
743 | dsi_bus_lock(); | ||
744 | |||
745 | if (!td->enabled) { | ||
746 | r = 0; | ||
747 | goto err; | ||
748 | } | ||
749 | |||
750 | r = omap_dsi_prepare_update(dssdev, &x, &y, &w, &h); | ||
751 | if (r) | ||
752 | goto err; | ||
753 | |||
754 | r = taal_set_update_window(x, y, w, h); | ||
755 | if (r) | ||
756 | goto err; | ||
757 | |||
758 | r = omap_dsi_update(dssdev, TCH, x, y, w, h, | ||
759 | taal_framedone_cb, dssdev); | ||
760 | if (r) | ||
761 | goto err; | ||
762 | |||
763 | /* note: no bus_unlock here. unlock is in framedone_cb */ | ||
764 | return 0; | ||
765 | err: | ||
766 | dsi_bus_unlock(); | ||
767 | return r; | ||
768 | } | ||
769 | |||
770 | static int taal_sync(struct omap_dss_device *dssdev) | ||
771 | { | ||
772 | dev_dbg(&dssdev->dev, "sync\n"); | ||
773 | |||
774 | dsi_bus_lock(); | ||
775 | dsi_bus_unlock(); | ||
776 | |||
777 | dev_dbg(&dssdev->dev, "sync done\n"); | ||
778 | |||
779 | return 0; | ||
732 | } | 780 | } |
733 | 781 | ||
734 | static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) | 782 | static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) |
@@ -762,24 +810,6 @@ static int taal_get_te(struct omap_dss_device *dssdev) | |||
762 | return td->te_enabled; | 810 | return td->te_enabled; |
763 | } | 811 | } |
764 | 812 | ||
765 | static int taal_wait_te(struct omap_dss_device *dssdev) | ||
766 | { | ||
767 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | ||
768 | long wait = msecs_to_jiffies(500); | ||
769 | |||
770 | if (!td->use_ext_te || !td->te_enabled) | ||
771 | return 0; | ||
772 | |||
773 | INIT_COMPLETION(td->te_completion); | ||
774 | wait = wait_for_completion_timeout(&td->te_completion, wait); | ||
775 | if (wait == 0) { | ||
776 | dev_err(&dssdev->dev, "timeout waiting TE\n"); | ||
777 | return -ETIME; | ||
778 | } | ||
779 | |||
780 | return 0; | ||
781 | } | ||
782 | |||
783 | static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) | 813 | static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) |
784 | { | 814 | { |
785 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 815 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
@@ -1018,15 +1048,17 @@ static struct omap_dss_driver taal_driver = { | |||
1018 | .suspend = taal_suspend, | 1048 | .suspend = taal_suspend, |
1019 | .resume = taal_resume, | 1049 | .resume = taal_resume, |
1020 | 1050 | ||
1021 | .setup_update = taal_setup_update, | ||
1022 | .set_update_mode = taal_set_update_mode, | 1051 | .set_update_mode = taal_set_update_mode, |
1023 | .get_update_mode = taal_get_update_mode, | 1052 | .get_update_mode = taal_get_update_mode, |
1053 | |||
1054 | .update = taal_update, | ||
1055 | .sync = taal_sync, | ||
1056 | |||
1024 | .get_resolution = taal_get_resolution, | 1057 | .get_resolution = taal_get_resolution, |
1025 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, | 1058 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, |
1026 | 1059 | ||
1027 | .enable_te = taal_enable_te, | 1060 | .enable_te = taal_enable_te, |
1028 | .get_te = taal_get_te, | 1061 | .get_te = taal_get_te, |
1029 | .wait_for_te = taal_wait_te, | ||
1030 | 1062 | ||
1031 | .set_rotate = taal_rotate, | 1063 | .set_rotate = taal_rotate, |
1032 | .get_rotate = taal_get_rotate, | 1064 | .get_rotate = taal_get_rotate, |