diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-11 09:12:31 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 07:31:28 -0500 |
commit | 446f7bff703f5f82560afde90fb22b7a1d366bbc (patch) | |
tree | 6ed3d56bbe170c8491e77734822fbcd8f07fbe0c /drivers | |
parent | 225b650d41e7cdbf5cd322a461b04493caabed09 (diff) |
OMAP: DSS2: move set/get_update_mode()
Move set/get_update_mode() from omap_dss_device to omap_dss_driver.
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')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 16 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 27 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 115 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 17 | ||||
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 26 | ||||
-rw-r--r-- | drivers/video/omap2/dss/venc.c | 27 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 13 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 27 |
9 files changed, 80 insertions, 194 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index af4b0b03b745..4ccb583b7b67 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -995,6 +995,20 @@ err: | |||
995 | queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD); | 995 | queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD); |
996 | } | 996 | } |
997 | 997 | ||
998 | static int taal_set_update_mode(struct omap_dss_device *dssdev, | ||
999 | enum omap_dss_update_mode mode) | ||
1000 | { | ||
1001 | if (mode != OMAP_DSS_UPDATE_MANUAL) | ||
1002 | return -EINVAL; | ||
1003 | return 0; | ||
1004 | } | ||
1005 | |||
1006 | static enum omap_dss_update_mode taal_get_update_mode( | ||
1007 | struct omap_dss_device *dssdev) | ||
1008 | { | ||
1009 | return OMAP_DSS_UPDATE_MANUAL; | ||
1010 | } | ||
1011 | |||
998 | static struct omap_dss_driver taal_driver = { | 1012 | static struct omap_dss_driver taal_driver = { |
999 | .probe = taal_probe, | 1013 | .probe = taal_probe, |
1000 | .remove = taal_remove, | 1014 | .remove = taal_remove, |
@@ -1005,6 +1019,8 @@ static struct omap_dss_driver taal_driver = { | |||
1005 | .resume = taal_resume, | 1019 | .resume = taal_resume, |
1006 | 1020 | ||
1007 | .setup_update = taal_setup_update, | 1021 | .setup_update = taal_setup_update, |
1022 | .set_update_mode = taal_set_update_mode, | ||
1023 | .get_update_mode = taal_get_update_mode, | ||
1008 | .get_resolution = taal_get_resolution, | 1024 | .get_resolution = taal_get_resolution, |
1009 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, | 1025 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, |
1010 | 1026 | ||
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 383a8c82dae8..86996d8d65be 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -69,8 +69,8 @@ static ssize_t display_upd_mode_show(struct device *dev, | |||
69 | { | 69 | { |
70 | struct omap_dss_device *dssdev = to_dss_device(dev); | 70 | struct omap_dss_device *dssdev = to_dss_device(dev); |
71 | enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO; | 71 | enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO; |
72 | if (dssdev->get_update_mode) | 72 | if (dssdev->driver->get_update_mode) |
73 | mode = dssdev->get_update_mode(dssdev); | 73 | mode = dssdev->driver->get_update_mode(dssdev); |
74 | return snprintf(buf, PAGE_SIZE, "%d\n", mode); | 74 | return snprintf(buf, PAGE_SIZE, "%d\n", mode); |
75 | } | 75 | } |
76 | 76 | ||
@@ -94,7 +94,7 @@ static ssize_t display_upd_mode_store(struct device *dev, | |||
94 | return -EINVAL; | 94 | return -EINVAL; |
95 | } | 95 | } |
96 | 96 | ||
97 | r = dssdev->set_update_mode(dssdev, mode); | 97 | r = dssdev->driver->set_update_mode(dssdev, mode); |
98 | if (r) | 98 | if (r) |
99 | return r; | 99 | return r; |
100 | 100 | ||
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 77b95577ab30..48ff7ea470aa 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include "dss.h" | 36 | #include "dss.h" |
37 | 37 | ||
38 | static struct { | 38 | static struct { |
39 | int update_enabled; | ||
40 | struct regulator *vdds_dsi_reg; | 39 | struct regulator *vdds_dsi_reg; |
41 | } dpi; | 40 | } dpi; |
42 | 41 | ||
@@ -376,30 +375,6 @@ static void dpi_get_timings(struct omap_dss_device *dssdev, | |||
376 | *timings = dssdev->panel.timings; | 375 | *timings = dssdev->panel.timings; |
377 | } | 376 | } |
378 | 377 | ||
379 | static int dpi_display_set_update_mode(struct omap_dss_device *dssdev, | ||
380 | enum omap_dss_update_mode mode) | ||
381 | { | ||
382 | if (mode == OMAP_DSS_UPDATE_MANUAL) | ||
383 | return -EINVAL; | ||
384 | |||
385 | if (mode == OMAP_DSS_UPDATE_DISABLED) { | ||
386 | dssdev->manager->disable(dssdev->manager); | ||
387 | dpi.update_enabled = 0; | ||
388 | } else { | ||
389 | dssdev->manager->enable(dssdev->manager); | ||
390 | dpi.update_enabled = 1; | ||
391 | } | ||
392 | |||
393 | return 0; | ||
394 | } | ||
395 | |||
396 | static enum omap_dss_update_mode dpi_display_get_update_mode( | ||
397 | struct omap_dss_device *dssdev) | ||
398 | { | ||
399 | return dpi.update_enabled ? OMAP_DSS_UPDATE_AUTO : | ||
400 | OMAP_DSS_UPDATE_DISABLED; | ||
401 | } | ||
402 | |||
403 | int dpi_init_display(struct omap_dss_device *dssdev) | 378 | int dpi_init_display(struct omap_dss_device *dssdev) |
404 | { | 379 | { |
405 | DSSDBG("init_display\n"); | 380 | DSSDBG("init_display\n"); |
@@ -411,8 +386,6 @@ int dpi_init_display(struct omap_dss_device *dssdev) | |||
411 | dssdev->set_timings = dpi_set_timings; | 386 | dssdev->set_timings = dpi_set_timings; |
412 | dssdev->check_timings = dpi_check_timings; | 387 | dssdev->check_timings = dpi_check_timings; |
413 | dssdev->get_timings = dpi_get_timings; | 388 | dssdev->get_timings = dpi_get_timings; |
414 | dssdev->set_update_mode = dpi_display_set_update_mode; | ||
415 | dssdev->get_update_mode = dpi_display_get_update_mode; | ||
416 | 389 | ||
417 | return 0; | 390 | return 0; |
418 | } | 391 | } |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 697a78b85807..b9fa62027f67 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -243,8 +243,6 @@ static struct | |||
243 | struct dsi_update_region active_update_region; | 243 | struct dsi_update_region active_update_region; |
244 | struct completion update_completion; | 244 | struct completion update_completion; |
245 | 245 | ||
246 | enum omap_dss_update_mode user_update_mode; | ||
247 | enum omap_dss_update_mode update_mode; | ||
248 | bool te_enabled; | 246 | bool te_enabled; |
249 | bool use_ext_te; | 247 | bool use_ext_te; |
250 | 248 | ||
@@ -345,9 +343,6 @@ static void dsi_perf_show(const char *name) | |||
345 | if (!dsi_perf) | 343 | if (!dsi_perf) |
346 | return; | 344 | return; |
347 | 345 | ||
348 | if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED) | ||
349 | return; | ||
350 | |||
351 | t = ktime_get(); | 346 | t = ktime_get(); |
352 | 347 | ||
353 | setup_time = ktime_sub(dsi.perf_start_time, dsi.perf_setup_time); | 348 | setup_time = ktime_sub(dsi.perf_start_time, dsi.perf_setup_time); |
@@ -1704,9 +1699,8 @@ static int dsi_force_tx_stop_mode_io(void) | |||
1704 | 1699 | ||
1705 | static int dsi_vc_enable(int channel, bool enable) | 1700 | static int dsi_vc_enable(int channel, bool enable) |
1706 | { | 1701 | { |
1707 | if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO) | 1702 | DSSDBG("dsi_vc_enable channel %d, enable %d\n", |
1708 | DSSDBG("dsi_vc_enable channel %d, enable %d\n", | 1703 | channel, enable); |
1709 | channel, enable); | ||
1710 | 1704 | ||
1711 | enable = enable ? 1 : 0; | 1705 | enable = enable ? 1 : 0; |
1712 | 1706 | ||
@@ -1886,8 +1880,7 @@ static u16 dsi_vc_flush_receive_data(int channel) | |||
1886 | 1880 | ||
1887 | static int dsi_vc_send_bta(int channel) | 1881 | static int dsi_vc_send_bta(int channel) |
1888 | { | 1882 | { |
1889 | if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO && | 1883 | if (dsi.debug_write || dsi.debug_read) |
1890 | (dsi.debug_write || dsi.debug_read)) | ||
1891 | DSSDBG("dsi_vc_send_bta %d\n", channel); | 1884 | DSSDBG("dsi_vc_send_bta %d\n", channel); |
1892 | 1885 | ||
1893 | WARN_ON(!dsi_bus_is_locked()); | 1886 | WARN_ON(!dsi_bus_is_locked()); |
@@ -2740,9 +2733,8 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, | |||
2740 | 2733 | ||
2741 | use_te_trigger = dsi.te_enabled && !dsi.use_ext_te; | 2734 | use_te_trigger = dsi.te_enabled && !dsi.use_ext_te; |
2742 | 2735 | ||
2743 | if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO) | 2736 | DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", |
2744 | DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", | 2737 | x, y, w, h); |
2745 | x, y, w, h); | ||
2746 | 2738 | ||
2747 | bytespp = dssdev->ctrl.pixel_size / 8; | 2739 | bytespp = dssdev->ctrl.pixel_size / 8; |
2748 | bytespl = w * bytespp; | 2740 | bytespl = w * bytespp; |
@@ -2840,45 +2832,6 @@ static void dsi_set_update_region(struct omap_dss_device *dssdev, | |||
2840 | 2832 | ||
2841 | } | 2833 | } |
2842 | 2834 | ||
2843 | static int dsi_set_update_mode(struct omap_dss_device *dssdev, | ||
2844 | enum omap_dss_update_mode mode) | ||
2845 | { | ||
2846 | int r = 0; | ||
2847 | int i; | ||
2848 | |||
2849 | WARN_ON(!dsi_bus_is_locked()); | ||
2850 | |||
2851 | if (dsi.update_mode != mode) { | ||
2852 | dsi.update_mode = mode; | ||
2853 | |||
2854 | /* Mark the overlays dirty, and do apply(), so that we get the | ||
2855 | * overlays configured properly after update mode change. */ | ||
2856 | for (i = 0; i < omap_dss_get_num_overlays(); ++i) { | ||
2857 | struct omap_overlay *ovl; | ||
2858 | ovl = omap_dss_get_overlay(i); | ||
2859 | if (ovl->manager == dssdev->manager) | ||
2860 | ovl->info_dirty = true; | ||
2861 | } | ||
2862 | |||
2863 | r = dssdev->manager->apply(dssdev->manager); | ||
2864 | |||
2865 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE && | ||
2866 | mode == OMAP_DSS_UPDATE_AUTO) { | ||
2867 | u16 w, h; | ||
2868 | |||
2869 | DSSDBG("starting auto update\n"); | ||
2870 | |||
2871 | dssdev->driver->get_resolution(dssdev, &w, &h); | ||
2872 | |||
2873 | dsi_set_update_region(dssdev, 0, 0, w, h); | ||
2874 | |||
2875 | wake_up(&dsi.waitqueue); | ||
2876 | } | ||
2877 | } | ||
2878 | |||
2879 | return r; | ||
2880 | } | ||
2881 | |||
2882 | static void dsi_handle_framedone(void) | 2835 | static void dsi_handle_framedone(void) |
2883 | { | 2836 | { |
2884 | int r; | 2837 | int r; |
@@ -2887,8 +2840,7 @@ static void dsi_handle_framedone(void) | |||
2887 | 2840 | ||
2888 | use_te_trigger = dsi.te_enabled && !dsi.use_ext_te; | 2841 | use_te_trigger = dsi.te_enabled && !dsi.use_ext_te; |
2889 | 2842 | ||
2890 | if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO) | 2843 | DSSDBG("FRAMEDONE\n"); |
2891 | DSSDBG("FRAMEDONE\n"); | ||
2892 | 2844 | ||
2893 | if (use_te_trigger) { | 2845 | if (use_te_trigger) { |
2894 | /* enable LP_RX_TO again after the TE */ | 2846 | /* enable LP_RX_TO again after the TE */ |
@@ -2927,9 +2879,7 @@ static int dsi_update_thread(void *data) | |||
2927 | 2879 | ||
2928 | while (1) { | 2880 | while (1) { |
2929 | wait_event_interruptible(dsi.waitqueue, | 2881 | wait_event_interruptible(dsi.waitqueue, |
2930 | dsi.update_mode == OMAP_DSS_UPDATE_AUTO || | 2882 | dsi.update_region.dirty == true || |
2931 | (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL && | ||
2932 | dsi.update_region.dirty == true) || | ||
2933 | kthread_should_stop()); | 2883 | kthread_should_stop()); |
2934 | 2884 | ||
2935 | if (kthread_should_stop()) | 2885 | if (kthread_should_stop()) |
@@ -2937,8 +2887,7 @@ static int dsi_update_thread(void *data) | |||
2937 | 2887 | ||
2938 | dsi_bus_lock(); | 2888 | dsi_bus_lock(); |
2939 | 2889 | ||
2940 | if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED || | 2890 | if (kthread_should_stop()) { |
2941 | kthread_should_stop()) { | ||
2942 | dsi_bus_unlock(); | 2891 | dsi_bus_unlock(); |
2943 | break; | 2892 | break; |
2944 | } | 2893 | } |
@@ -2960,9 +2909,8 @@ static int dsi_update_thread(void *data) | |||
2960 | 2909 | ||
2961 | if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) { | 2910 | if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) { |
2962 | 2911 | ||
2963 | if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL) | 2912 | dss_setup_partial_planes(device, |
2964 | dss_setup_partial_planes(device, | 2913 | &x, &y, &w, &h); |
2965 | &x, &y, &w, &h); | ||
2966 | 2914 | ||
2967 | dispc_set_lcd_size(w, h); | 2915 | dispc_set_lcd_size(w, h); |
2968 | } | 2916 | } |
@@ -3254,8 +3202,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev) | |||
3254 | 3202 | ||
3255 | dsi.use_ext_te = dssdev->phy.dsi.ext_te; | 3203 | dsi.use_ext_te = dssdev->phy.dsi.ext_te; |
3256 | 3204 | ||
3257 | dsi_set_update_mode(dssdev, dsi.user_update_mode); | ||
3258 | |||
3259 | dsi_bus_unlock(); | 3205 | dsi_bus_unlock(); |
3260 | mutex_unlock(&dsi.lock); | 3206 | mutex_unlock(&dsi.lock); |
3261 | 3207 | ||
@@ -3286,7 +3232,6 @@ static void dsi_display_disable(struct omap_dss_device *dssdev) | |||
3286 | dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) | 3232 | dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) |
3287 | goto end; | 3233 | goto end; |
3288 | 3234 | ||
3289 | dsi.update_mode = OMAP_DSS_UPDATE_DISABLED; | ||
3290 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | 3235 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; |
3291 | 3236 | ||
3292 | dsi_display_uninit_dispc(dssdev); | 3237 | dsi_display_uninit_dispc(dssdev); |
@@ -3313,7 +3258,6 @@ static int dsi_display_suspend(struct omap_dss_device *dssdev) | |||
3313 | dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) | 3258 | dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) |
3314 | goto end; | 3259 | goto end; |
3315 | 3260 | ||
3316 | dsi.update_mode = OMAP_DSS_UPDATE_DISABLED; | ||
3317 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | 3261 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; |
3318 | 3262 | ||
3319 | dsi_display_uninit_dispc(dssdev); | 3263 | dsi_display_uninit_dispc(dssdev); |
@@ -3363,8 +3307,6 @@ static int dsi_display_resume(struct omap_dss_device *dssdev) | |||
3363 | 3307 | ||
3364 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 3308 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
3365 | 3309 | ||
3366 | dsi_set_update_mode(dssdev, dsi.user_update_mode); | ||
3367 | |||
3368 | dsi_bus_unlock(); | 3310 | dsi_bus_unlock(); |
3369 | mutex_unlock(&dsi.lock); | 3311 | mutex_unlock(&dsi.lock); |
3370 | 3312 | ||
@@ -3392,9 +3334,6 @@ static int dsi_display_update(struct omap_dss_device *dssdev, | |||
3392 | 3334 | ||
3393 | mutex_lock(&dsi.lock); | 3335 | mutex_lock(&dsi.lock); |
3394 | 3336 | ||
3395 | if (dsi.update_mode != OMAP_DSS_UPDATE_MANUAL) | ||
3396 | goto end; | ||
3397 | |||
3398 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | 3337 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) |
3399 | goto end; | 3338 | goto end; |
3400 | 3339 | ||
@@ -3436,8 +3375,7 @@ static int dsi_display_sync(struct omap_dss_device *dssdev) | |||
3436 | mutex_lock(&dsi.lock); | 3375 | mutex_lock(&dsi.lock); |
3437 | dsi_bus_lock(); | 3376 | dsi_bus_lock(); |
3438 | 3377 | ||
3439 | if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL && | 3378 | if (dsi.update_region.dirty) { |
3440 | dsi.update_region.dirty) { | ||
3441 | INIT_COMPLETION(dsi.update_completion); | 3379 | INIT_COMPLETION(dsi.update_completion); |
3442 | wait = true; | 3380 | wait = true; |
3443 | } else { | 3381 | } else { |
@@ -3454,32 +3392,6 @@ static int dsi_display_sync(struct omap_dss_device *dssdev) | |||
3454 | return 0; | 3392 | return 0; |
3455 | } | 3393 | } |
3456 | 3394 | ||
3457 | static int dsi_display_set_update_mode(struct omap_dss_device *dssdev, | ||
3458 | enum omap_dss_update_mode mode) | ||
3459 | { | ||
3460 | int r = 0; | ||
3461 | |||
3462 | DSSDBGF("%d", mode); | ||
3463 | |||
3464 | mutex_lock(&dsi.lock); | ||
3465 | dsi_bus_lock(); | ||
3466 | |||
3467 | dsi.user_update_mode = mode; | ||
3468 | r = dsi_set_update_mode(dssdev, mode); | ||
3469 | |||
3470 | dsi_bus_unlock(); | ||
3471 | mutex_unlock(&dsi.lock); | ||
3472 | |||
3473 | return r; | ||
3474 | } | ||
3475 | |||
3476 | static enum omap_dss_update_mode dsi_display_get_update_mode( | ||
3477 | struct omap_dss_device *dssdev) | ||
3478 | { | ||
3479 | return dsi.update_mode; | ||
3480 | } | ||
3481 | |||
3482 | |||
3483 | int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable) | 3395 | int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable) |
3484 | { | 3396 | { |
3485 | dsi.te_enabled = enable; | 3397 | dsi.te_enabled = enable; |
@@ -3510,8 +3422,6 @@ int dsi_init_display(struct omap_dss_device *dssdev) | |||
3510 | dssdev->resume = dsi_display_resume; | 3422 | dssdev->resume = dsi_display_resume; |
3511 | dssdev->update = dsi_display_update; | 3423 | dssdev->update = dsi_display_update; |
3512 | dssdev->sync = dsi_display_sync; | 3424 | dssdev->sync = dsi_display_sync; |
3513 | dssdev->set_update_mode = dsi_display_set_update_mode; | ||
3514 | dssdev->get_update_mode = dsi_display_get_update_mode; | ||
3515 | 3425 | ||
3516 | /* XXX these should be figured out dynamically */ | 3426 | /* XXX these should be figured out dynamically */ |
3517 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 3427 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
@@ -3562,9 +3472,6 @@ int dsi_init(struct platform_device *pdev) | |||
3562 | dsi.te_timer.data = 0; | 3472 | dsi.te_timer.data = 0; |
3563 | #endif | 3473 | #endif |
3564 | 3474 | ||
3565 | dsi.update_mode = OMAP_DSS_UPDATE_DISABLED; | ||
3566 | dsi.user_update_mode = OMAP_DSS_UPDATE_DISABLED; | ||
3567 | |||
3568 | dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS); | 3475 | dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS); |
3569 | if (!dsi.base) { | 3476 | if (!dsi.base) { |
3570 | DSSERR("can't ioremap DSI\n"); | 3477 | DSSERR("can't ioremap DSI\n"); |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 4ede519c0a31..913142d4cab1 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -522,17 +522,18 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) | |||
522 | u32 irq; | 522 | u32 irq; |
523 | int r; | 523 | int r; |
524 | int i; | 524 | int i; |
525 | struct omap_dss_device *dssdev = mgr->device; | ||
525 | 526 | ||
526 | if (!mgr->device) | 527 | if (!dssdev) |
527 | return 0; | 528 | return 0; |
528 | 529 | ||
529 | if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) { | 530 | if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) { |
530 | irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; | 531 | irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; |
531 | channel = OMAP_DSS_CHANNEL_DIGIT; | 532 | channel = OMAP_DSS_CHANNEL_DIGIT; |
532 | } else { | 533 | } else { |
533 | if (mgr->device->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { | 534 | if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { |
534 | enum omap_dss_update_mode mode; | 535 | enum omap_dss_update_mode mode; |
535 | mode = mgr->device->get_update_mode(mgr->device); | 536 | mode = dssdev->driver->get_update_mode(dssdev); |
536 | if (mode != OMAP_DSS_UPDATE_AUTO) | 537 | if (mode != OMAP_DSS_UPDATE_AUTO) |
537 | return 0; | 538 | return 0; |
538 | 539 | ||
@@ -605,7 +606,7 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) | |||
605 | } else { | 606 | } else { |
606 | if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { | 607 | if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { |
607 | enum omap_dss_update_mode mode; | 608 | enum omap_dss_update_mode mode; |
608 | mode = dssdev->get_update_mode(dssdev); | 609 | mode = dssdev->driver->get_update_mode(dssdev); |
609 | if (mode != OMAP_DSS_UPDATE_AUTO) | 610 | if (mode != OMAP_DSS_UPDATE_AUTO) |
610 | return 0; | 611 | return 0; |
611 | 612 | ||
@@ -1209,7 +1210,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
1209 | 1210 | ||
1210 | oc->manual_update = | 1211 | oc->manual_update = |
1211 | dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && | 1212 | dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && |
1212 | dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO; | 1213 | dssdev->driver->get_update_mode(dssdev) != |
1214 | OMAP_DSS_UPDATE_AUTO; | ||
1213 | 1215 | ||
1214 | ++num_planes_enabled; | 1216 | ++num_planes_enabled; |
1215 | } | 1217 | } |
@@ -1250,7 +1252,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
1250 | 1252 | ||
1251 | mc->manual_update = | 1253 | mc->manual_update = |
1252 | dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && | 1254 | dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && |
1253 | dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO; | 1255 | dssdev->driver->get_update_mode(dssdev) != |
1256 | OMAP_DSS_UPDATE_AUTO; | ||
1254 | } | 1257 | } |
1255 | 1258 | ||
1256 | /* XXX TODO: Try to get fifomerge working. The problem is that it | 1259 | /* XXX TODO: Try to get fifomerge working. The problem is that it |
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 5f852edd4cbc..6bd9b0cf76a8 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -213,30 +213,6 @@ err: | |||
213 | return r; | 213 | return r; |
214 | } | 214 | } |
215 | 215 | ||
216 | static int sdi_display_set_update_mode(struct omap_dss_device *dssdev, | ||
217 | enum omap_dss_update_mode mode) | ||
218 | { | ||
219 | if (mode == OMAP_DSS_UPDATE_MANUAL) | ||
220 | return -EINVAL; | ||
221 | |||
222 | if (mode == OMAP_DSS_UPDATE_DISABLED) { | ||
223 | dssdev->manager->disable(dssdev->manager); | ||
224 | sdi.update_enabled = 0; | ||
225 | } else { | ||
226 | dssdev->manager->enable(dssdev->manager); | ||
227 | sdi.update_enabled = 1; | ||
228 | } | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | static enum omap_dss_update_mode sdi_display_get_update_mode( | ||
234 | struct omap_dss_device *dssdev) | ||
235 | { | ||
236 | return sdi.update_enabled ? OMAP_DSS_UPDATE_AUTO : | ||
237 | OMAP_DSS_UPDATE_DISABLED; | ||
238 | } | ||
239 | |||
240 | static void sdi_get_timings(struct omap_dss_device *dssdev, | 216 | static void sdi_get_timings(struct omap_dss_device *dssdev, |
241 | struct omap_video_timings *timings) | 217 | struct omap_video_timings *timings) |
242 | { | 218 | { |
@@ -251,8 +227,6 @@ int sdi_init_display(struct omap_dss_device *dssdev) | |||
251 | dssdev->disable = sdi_display_disable; | 227 | dssdev->disable = sdi_display_disable; |
252 | dssdev->suspend = sdi_display_suspend; | 228 | dssdev->suspend = sdi_display_suspend; |
253 | dssdev->resume = sdi_display_resume; | 229 | dssdev->resume = sdi_display_resume; |
254 | dssdev->set_update_mode = sdi_display_set_update_mode; | ||
255 | dssdev->get_update_mode = sdi_display_get_update_mode; | ||
256 | dssdev->get_timings = sdi_get_timings; | 230 | dssdev->get_timings = sdi_get_timings; |
257 | 231 | ||
258 | return 0; | 232 | return 0; |
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index d13071dd46e5..0d0dc94417fc 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
@@ -450,6 +450,20 @@ static int venc_panel_resume(struct omap_dss_device *dssdev) | |||
450 | return venc_panel_enable(dssdev); | 450 | return venc_panel_enable(dssdev); |
451 | } | 451 | } |
452 | 452 | ||
453 | static enum omap_dss_update_mode venc_get_update_mode( | ||
454 | struct omap_dss_device *dssdev) | ||
455 | { | ||
456 | return OMAP_DSS_UPDATE_AUTO; | ||
457 | } | ||
458 | |||
459 | static int venc_set_update_mode(struct omap_dss_device *dssdev, | ||
460 | enum omap_dss_update_mode mode) | ||
461 | { | ||
462 | if (mode != OMAP_DSS_UPDATE_AUTO) | ||
463 | return -EINVAL; | ||
464 | return 0; | ||
465 | } | ||
466 | |||
453 | static struct omap_dss_driver venc_driver = { | 467 | static struct omap_dss_driver venc_driver = { |
454 | .probe = venc_panel_probe, | 468 | .probe = venc_panel_probe, |
455 | .remove = venc_panel_remove, | 469 | .remove = venc_panel_remove, |
@@ -462,6 +476,9 @@ static struct omap_dss_driver venc_driver = { | |||
462 | .get_resolution = omapdss_default_get_resolution, | 476 | .get_resolution = omapdss_default_get_resolution, |
463 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, | 477 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, |
464 | 478 | ||
479 | .set_update_mode = venc_set_update_mode, | ||
480 | .get_update_mode = venc_get_update_mode, | ||
481 | |||
465 | .driver = { | 482 | .driver = { |
466 | .name = "venc", | 483 | .name = "venc", |
467 | .owner = THIS_MODULE, | 484 | .owner = THIS_MODULE, |
@@ -717,15 +734,6 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss) | |||
717 | return 0; | 734 | return 0; |
718 | } | 735 | } |
719 | 736 | ||
720 | static enum omap_dss_update_mode venc_display_get_update_mode( | ||
721 | struct omap_dss_device *dssdev) | ||
722 | { | ||
723 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
724 | return OMAP_DSS_UPDATE_AUTO; | ||
725 | else | ||
726 | return OMAP_DSS_UPDATE_DISABLED; | ||
727 | } | ||
728 | |||
729 | int venc_init_display(struct omap_dss_device *dssdev) | 737 | int venc_init_display(struct omap_dss_device *dssdev) |
730 | { | 738 | { |
731 | DSSDBG("init_display\n"); | 739 | DSSDBG("init_display\n"); |
@@ -739,7 +747,6 @@ int venc_init_display(struct omap_dss_device *dssdev) | |||
739 | dssdev->check_timings = venc_check_timings; | 747 | dssdev->check_timings = venc_check_timings; |
740 | dssdev->get_wss = venc_get_wss; | 748 | dssdev->get_wss = venc_get_wss; |
741 | dssdev->set_wss = venc_set_wss; | 749 | dssdev->set_wss = venc_set_wss; |
742 | dssdev->get_update_mode = venc_display_get_update_mode; | ||
743 | 750 | ||
744 | return 0; | 751 | return 0; |
745 | } | 752 | } |
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index cb2e3432618d..4f68cb0d59de 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c | |||
@@ -202,7 +202,7 @@ static int omapfb_set_update_mode(struct fb_info *fbi, | |||
202 | enum omap_dss_update_mode um; | 202 | enum omap_dss_update_mode um; |
203 | int r; | 203 | int r; |
204 | 204 | ||
205 | if (!display || !display->set_update_mode) | 205 | if (!display || !display->driver->set_update_mode) |
206 | return -EINVAL; | 206 | return -EINVAL; |
207 | 207 | ||
208 | switch (mode) { | 208 | switch (mode) { |
@@ -222,7 +222,7 @@ static int omapfb_set_update_mode(struct fb_info *fbi, | |||
222 | return -EINVAL; | 222 | return -EINVAL; |
223 | } | 223 | } |
224 | 224 | ||
225 | r = display->set_update_mode(display, um); | 225 | r = display->driver->set_update_mode(display, um); |
226 | 226 | ||
227 | return r; | 227 | return r; |
228 | } | 228 | } |
@@ -233,10 +233,15 @@ static int omapfb_get_update_mode(struct fb_info *fbi, | |||
233 | struct omap_dss_device *display = fb2display(fbi); | 233 | struct omap_dss_device *display = fb2display(fbi); |
234 | enum omap_dss_update_mode m; | 234 | enum omap_dss_update_mode m; |
235 | 235 | ||
236 | if (!display || !display->get_update_mode) | 236 | if (!display) |
237 | return -EINVAL; | 237 | return -EINVAL; |
238 | 238 | ||
239 | m = display->get_update_mode(display); | 239 | if (!display->driver->get_update_mode) { |
240 | *mode = OMAPFB_AUTO_UPDATE; | ||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | m = display->driver->get_update_mode(display); | ||
240 | 245 | ||
241 | switch (m) { | 246 | switch (m) { |
242 | case OMAP_DSS_UPDATE_DISABLED: | 247 | case OMAP_DSS_UPDATE_DISABLED: |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index b0adfb5915c8..c720842341b2 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1226,8 +1226,8 @@ static int omapfb_blank(int blank, struct fb_info *fbi) | |||
1226 | if (display->resume) | 1226 | if (display->resume) |
1227 | r = display->resume(display); | 1227 | r = display->resume(display); |
1228 | 1228 | ||
1229 | if (r == 0 && display->get_update_mode && | 1229 | if (r == 0 && display->driver->get_update_mode && |
1230 | display->get_update_mode(display) == | 1230 | display->driver->get_update_mode(display) == |
1231 | OMAP_DSS_UPDATE_MANUAL) | 1231 | OMAP_DSS_UPDATE_MANUAL) |
1232 | do_update = 1; | 1232 | do_update = 1; |
1233 | 1233 | ||
@@ -2193,6 +2193,7 @@ static int omapfb_probe(struct platform_device *pdev) | |||
2193 | } | 2193 | } |
2194 | 2194 | ||
2195 | if (def_display) { | 2195 | if (def_display) { |
2196 | struct omap_dss_driver *dssdrv = def_display->driver; | ||
2196 | #ifndef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE | 2197 | #ifndef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE |
2197 | u16 w, h; | 2198 | u16 w, h; |
2198 | #endif | 2199 | #endif |
@@ -2206,25 +2207,25 @@ static int omapfb_probe(struct platform_device *pdev) | |||
2206 | /* set the update mode */ | 2207 | /* set the update mode */ |
2207 | if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { | 2208 | if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { |
2208 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE | 2209 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE |
2209 | if (def_display->driver->enable_te) | 2210 | if (dssdrv->enable_te) |
2210 | def_display->driver->enable_te(def_display, 1); | 2211 | dssdrv->enable_te(def_display, 1); |
2211 | if (def_display->set_update_mode) | 2212 | if (dssdrv->set_update_mode) |
2212 | def_display->set_update_mode(def_display, | 2213 | dssdrv->set_update_mode(def_display, |
2213 | OMAP_DSS_UPDATE_AUTO); | 2214 | OMAP_DSS_UPDATE_AUTO); |
2214 | #else /* MANUAL_UPDATE */ | 2215 | #else /* MANUAL_UPDATE */ |
2215 | if (def_display->driver->enable_te) | 2216 | if (dssdrv->enable_te) |
2216 | def_display->driver->enable_te(def_display, 0); | 2217 | dssdrv->enable_te(def_display, 0); |
2217 | if (def_display->set_update_mode) | 2218 | if (dssdrv->set_update_mode) |
2218 | def_display->set_update_mode(def_display, | 2219 | dssdrv->set_update_mode(def_display, |
2219 | OMAP_DSS_UPDATE_MANUAL); | 2220 | OMAP_DSS_UPDATE_MANUAL); |
2220 | 2221 | ||
2221 | def_display->driver->get_resolution(def_display, | 2222 | dssdrv->get_resolution(def_display, |
2222 | &w, &h); | 2223 | &w, &h); |
2223 | def_display->update(def_display, 0, 0, w, h); | 2224 | def_display->update(def_display, 0, 0, w, h); |
2224 | #endif | 2225 | #endif |
2225 | } else { | 2226 | } else { |
2226 | if (def_display->set_update_mode) | 2227 | if (dssdrv->set_update_mode) |
2227 | def_display->set_update_mode(def_display, | 2228 | dssdrv->set_update_mode(def_display, |
2228 | OMAP_DSS_UPDATE_AUTO); | 2229 | OMAP_DSS_UPDATE_AUTO); |
2229 | } | 2230 | } |
2230 | } | 2231 | } |