diff options
author | Archit Taneja <archit@ti.com> | 2012-04-26 15:52:28 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-09 06:44:07 -0400 |
commit | 228b21349db4ca5636ec1efdb3b3d54fe18092de (patch) | |
tree | 61e933b8f50ec5225e91fe2bf6bbfbb11a26c1af /drivers/video/omap2/dss | |
parent | 5dd747e8892a63a5d4cc1d2765c0f533a5d74cfd (diff) |
OMAPDSS: APPLY: Remove display dependency from overlay and manager checks
In order to check the validity of overlay and manager info, there was a need to
use the omap_dss_device struct to get the panel resolution. The manager's
private data in APPLY now contains the manager timings. Hence, we don't need to
rely on the display resolution any more.
Pass the manager's timings in private data to dss_mgr_check(). Remove the need
to pass omap_dss_device structs in the functions which check for the validity
of overlay and manager parameters.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 24 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 7 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/overlay.c | 10 |
4 files changed, 22 insertions, 25 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index ad349b3083c1..0ffe4e101c56 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -181,7 +181,7 @@ static bool mgr_manual_update(struct omap_overlay_manager *mgr) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | static int dss_check_settings_low(struct omap_overlay_manager *mgr, | 183 | static int dss_check_settings_low(struct omap_overlay_manager *mgr, |
184 | struct omap_dss_device *dssdev, bool applying) | 184 | bool applying) |
185 | { | 185 | { |
186 | struct omap_overlay_info *oi; | 186 | struct omap_overlay_info *oi; |
187 | struct omap_overlay_manager_info *mi; | 187 | struct omap_overlay_manager_info *mi; |
@@ -214,26 +214,24 @@ static int dss_check_settings_low(struct omap_overlay_manager *mgr, | |||
214 | ois[ovl->id] = oi; | 214 | ois[ovl->id] = oi; |
215 | } | 215 | } |
216 | 216 | ||
217 | return dss_mgr_check(mgr, dssdev, mi, ois); | 217 | return dss_mgr_check(mgr, mi, &mp->timings, ois); |
218 | } | 218 | } |
219 | 219 | ||
220 | /* | 220 | /* |
221 | * check manager and overlay settings using overlay_info from data->info | 221 | * check manager and overlay settings using overlay_info from data->info |
222 | */ | 222 | */ |
223 | static int dss_check_settings(struct omap_overlay_manager *mgr, | 223 | static int dss_check_settings(struct omap_overlay_manager *mgr) |
224 | struct omap_dss_device *dssdev) | ||
225 | { | 224 | { |
226 | return dss_check_settings_low(mgr, dssdev, false); | 225 | return dss_check_settings_low(mgr, false); |
227 | } | 226 | } |
228 | 227 | ||
229 | /* | 228 | /* |
230 | * check manager and overlay settings using overlay_info from ovl->info if | 229 | * check manager and overlay settings using overlay_info from ovl->info if |
231 | * dirty and from data->info otherwise | 230 | * dirty and from data->info otherwise |
232 | */ | 231 | */ |
233 | static int dss_check_settings_apply(struct omap_overlay_manager *mgr, | 232 | static int dss_check_settings_apply(struct omap_overlay_manager *mgr) |
234 | struct omap_dss_device *dssdev) | ||
235 | { | 233 | { |
236 | return dss_check_settings_low(mgr, dssdev, true); | 234 | return dss_check_settings_low(mgr, true); |
237 | } | 235 | } |
238 | 236 | ||
239 | static bool need_isr(void) | 237 | static bool need_isr(void) |
@@ -687,7 +685,7 @@ static void dss_write_regs(void) | |||
687 | if (!mp->enabled || mgr_manual_update(mgr) || mp->busy) | 685 | if (!mp->enabled || mgr_manual_update(mgr) || mp->busy) |
688 | continue; | 686 | continue; |
689 | 687 | ||
690 | r = dss_check_settings(mgr, mgr->device); | 688 | r = dss_check_settings(mgr); |
691 | if (r) { | 689 | if (r) { |
692 | DSSERR("cannot write registers for manager %s: " | 690 | DSSERR("cannot write registers for manager %s: " |
693 | "illegal configuration\n", mgr->name); | 691 | "illegal configuration\n", mgr->name); |
@@ -754,7 +752,7 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr) | |||
754 | 752 | ||
755 | WARN_ON(mp->updating); | 753 | WARN_ON(mp->updating); |
756 | 754 | ||
757 | r = dss_check_settings(mgr, mgr->device); | 755 | r = dss_check_settings(mgr); |
758 | if (r) { | 756 | if (r) { |
759 | DSSERR("cannot start manual update: illegal configuration\n"); | 757 | DSSERR("cannot start manual update: illegal configuration\n"); |
760 | spin_unlock_irqrestore(&data_lock, flags); | 758 | spin_unlock_irqrestore(&data_lock, flags); |
@@ -901,7 +899,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
901 | 899 | ||
902 | spin_lock_irqsave(&data_lock, flags); | 900 | spin_lock_irqsave(&data_lock, flags); |
903 | 901 | ||
904 | r = dss_check_settings_apply(mgr, mgr->device); | 902 | r = dss_check_settings_apply(mgr); |
905 | if (r) { | 903 | if (r) { |
906 | spin_unlock_irqrestore(&data_lock, flags); | 904 | spin_unlock_irqrestore(&data_lock, flags); |
907 | DSSERR("failed to apply settings: illegal configuration.\n"); | 905 | DSSERR("failed to apply settings: illegal configuration.\n"); |
@@ -1094,7 +1092,7 @@ int dss_mgr_enable(struct omap_overlay_manager *mgr) | |||
1094 | 1092 | ||
1095 | mp->enabled = true; | 1093 | mp->enabled = true; |
1096 | 1094 | ||
1097 | r = dss_check_settings(mgr, mgr->device); | 1095 | r = dss_check_settings(mgr); |
1098 | if (r) { | 1096 | if (r) { |
1099 | DSSERR("failed to enable manager %d: check_settings failed\n", | 1097 | DSSERR("failed to enable manager %d: check_settings failed\n", |
1100 | mgr->id); | 1098 | mgr->id); |
@@ -1466,7 +1464,7 @@ int dss_ovl_enable(struct omap_overlay *ovl) | |||
1466 | 1464 | ||
1467 | op->enabling = true; | 1465 | op->enabling = true; |
1468 | 1466 | ||
1469 | r = dss_check_settings(ovl->manager, ovl->manager->device); | 1467 | r = dss_check_settings(ovl->manager); |
1470 | if (r) { | 1468 | if (r) { |
1471 | DSSERR("failed to enable overlay %d: check_settings failed\n", | 1469 | DSSERR("failed to enable overlay %d: check_settings failed\n", |
1472 | ovl->id); | 1470 | ovl->id); |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index a13b3055a447..f3fa4454446e 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -179,6 +179,7 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr, | |||
179 | int dss_mgr_unset_device(struct omap_overlay_manager *mgr); | 179 | int dss_mgr_unset_device(struct omap_overlay_manager *mgr); |
180 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, | 180 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, |
181 | struct omap_video_timings *timings); | 181 | struct omap_video_timings *timings); |
182 | const struct omap_video_timings *dss_mgr_get_timings(struct omap_overlay_manager *mgr); | ||
182 | 183 | ||
183 | bool dss_ovl_is_enabled(struct omap_overlay *ovl); | 184 | bool dss_ovl_is_enabled(struct omap_overlay *ovl); |
184 | int dss_ovl_enable(struct omap_overlay *ovl); | 185 | int dss_ovl_enable(struct omap_overlay *ovl); |
@@ -211,8 +212,8 @@ int dss_mgr_simple_check(struct omap_overlay_manager *mgr, | |||
211 | int dss_mgr_check_timings(struct omap_overlay_manager *mgr, | 212 | int dss_mgr_check_timings(struct omap_overlay_manager *mgr, |
212 | const struct omap_video_timings *timings); | 213 | const struct omap_video_timings *timings); |
213 | int dss_mgr_check(struct omap_overlay_manager *mgr, | 214 | int dss_mgr_check(struct omap_overlay_manager *mgr, |
214 | struct omap_dss_device *dssdev, | ||
215 | struct omap_overlay_manager_info *info, | 215 | struct omap_overlay_manager_info *info, |
216 | const struct omap_video_timings *mgr_timings, | ||
216 | struct omap_overlay_info **overlay_infos); | 217 | struct omap_overlay_info **overlay_infos); |
217 | 218 | ||
218 | /* overlay */ | 219 | /* overlay */ |
@@ -222,8 +223,8 @@ void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr); | |||
222 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); | 223 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); |
223 | int dss_ovl_simple_check(struct omap_overlay *ovl, | 224 | int dss_ovl_simple_check(struct omap_overlay *ovl, |
224 | const struct omap_overlay_info *info); | 225 | const struct omap_overlay_info *info); |
225 | int dss_ovl_check(struct omap_overlay *ovl, | 226 | int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info, |
226 | struct omap_overlay_info *info, struct omap_dss_device *dssdev); | 227 | const struct omap_video_timings *mgr_timings); |
227 | 228 | ||
228 | /* DSS */ | 229 | /* DSS */ |
229 | int dss_init_platform_driver(void); | 230 | int dss_init_platform_driver(void); |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 566fbba16774..0cbcde4c688a 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -666,8 +666,8 @@ int dss_mgr_check_timings(struct omap_overlay_manager *mgr, | |||
666 | } | 666 | } |
667 | 667 | ||
668 | int dss_mgr_check(struct omap_overlay_manager *mgr, | 668 | int dss_mgr_check(struct omap_overlay_manager *mgr, |
669 | struct omap_dss_device *dssdev, | ||
670 | struct omap_overlay_manager_info *info, | 669 | struct omap_overlay_manager_info *info, |
670 | const struct omap_video_timings *mgr_timings, | ||
671 | struct omap_overlay_info **overlay_infos) | 671 | struct omap_overlay_info **overlay_infos) |
672 | { | 672 | { |
673 | struct omap_overlay *ovl; | 673 | struct omap_overlay *ovl; |
@@ -679,7 +679,7 @@ int dss_mgr_check(struct omap_overlay_manager *mgr, | |||
679 | return r; | 679 | return r; |
680 | } | 680 | } |
681 | 681 | ||
682 | r = dss_mgr_check_timings(mgr, &dssdev->panel.timings); | 682 | r = dss_mgr_check_timings(mgr, mgr_timings); |
683 | if (r) | 683 | if (r) |
684 | return r; | 684 | return r; |
685 | 685 | ||
@@ -692,7 +692,7 @@ int dss_mgr_check(struct omap_overlay_manager *mgr, | |||
692 | if (oi == NULL) | 692 | if (oi == NULL) |
693 | continue; | 693 | continue; |
694 | 694 | ||
695 | r = dss_ovl_check(ovl, oi, dssdev); | 695 | r = dss_ovl_check(ovl, oi, mgr_timings); |
696 | if (r) | 696 | if (r) |
697 | return r; | 697 | return r; |
698 | } | 698 | } |
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index 6e821810deec..0da5eb654ae9 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c | |||
@@ -631,16 +631,14 @@ int dss_ovl_simple_check(struct omap_overlay *ovl, | |||
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
634 | int dss_ovl_check(struct omap_overlay *ovl, | 634 | int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info, |
635 | struct omap_overlay_info *info, struct omap_dss_device *dssdev) | 635 | const struct omap_video_timings *mgr_timings) |
636 | { | 636 | { |
637 | u16 outw, outh; | 637 | u16 outw, outh; |
638 | u16 dw, dh; | 638 | u16 dw, dh; |
639 | 639 | ||
640 | if (dssdev == NULL) | 640 | dw = mgr_timings->x_res; |
641 | return 0; | 641 | dh = mgr_timings->y_res; |
642 | |||
643 | dssdev->driver->get_resolution(dssdev, &dw, &dh); | ||
644 | 642 | ||
645 | if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { | 643 | if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { |
646 | outw = info->width; | 644 | outw = info->width; |