diff options
author | Dan Johansson <dan.johansson@stericsson.com> | 2010-07-01 15:11:24 +0200 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2010-09-02 22:45:50 -0600 |
commit | 574724fbbb1bd2f78ee1a626dfa18cf707c741ab (patch) | |
tree | b4984ed38c86b35e862c90bc1ac6acc8a9810381 /arch/arm/mach-ux500 | |
parent | 50a1ade75cf1e3c2ff203b6447c59909b1f6fb84 (diff) |
MCDE: V-sync on main and sub display using DSI BTA
* V-sync support for both primary and secondary display.
* V-sync is disabled by default. It is enabled in menuconfig
(System Type -> Display selection -> Enable v-sync for
primary / secondary display).
* DSI HS clock is set to 840 MHz, DSI esq clock 19.2 MHz.
* Enables VAUX1 if startup graphics is enabled.
ST Ericsson Change-Id: WP264234
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2154
Tested-by: Dan JOHANSSON <dan.johansson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Change-Id: I47f72cb9449e08f089f6bdb25988bd9958644899
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2809
Diffstat (limited to 'arch/arm/mach-ux500')
-rwxr-xr-x | arch/arm/mach-ux500/Kconfig-arch | 14 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-mcde.c | 68 | ||||
-rwxr-xr-x | arch/arm/mach-ux500/prcmu-fw.c | 8 |
3 files changed, 75 insertions, 15 deletions
diff --git a/arch/arm/mach-ux500/Kconfig-arch b/arch/arm/mach-ux500/Kconfig-arch index cbfdd4d3758..3e6d35c5c46 100755 --- a/arch/arm/mach-ux500/Kconfig-arch +++ b/arch/arm/mach-ux500/Kconfig-arch @@ -48,6 +48,13 @@ config DISPLAY_GENERIC_DSI_PRIMARY help Say yes here if main display exists +config DISPLAY_GENERIC_DSI_PRIMARY_VSYNC + bool "Enable v-sync for primary display" + depends on DISPLAY_GENERIC_DSI_PRIMARY + default n + help + Say yes to enable v-sync for primary display + config DISPLAY_GENERIC_DSI_SECONDARY bool "Sub display support" depends on MACH_U8500_MOP && FB_MCDE @@ -56,6 +63,13 @@ config DISPLAY_GENERIC_DSI_SECONDARY help Say yes here if sub display exists +config DISPLAY_GENERIC_DSI_SECONDARY_VSYNC + bool "Enable v-sync for secondary display" + depends on DISPLAY_GENERIC_DSI_SECONDARY + default n + help + Say yes to enable v-sync for secondary display + config DISPLAY_AB8500_TERTIARY bool "AB8500 TVout display support" depends on MACH_U8500_MOP && !AV8100_SDTV && FB_MCDE diff --git a/arch/arm/mach-ux500/board-mop500-mcde.c b/arch/arm/mach-ux500/board-mop500-mcde.c index 7fbb35caf22..ef1a7274161 100644 --- a/arch/arm/mach-ux500/board-mop500-mcde.c +++ b/arch/arm/mach-ux500/board-mop500-mcde.c @@ -17,12 +17,12 @@ #include <video/mcde_fb.h> #include <video/mcde_dss.h> -#define DSI_UNIT_INTERVAL_0 0xA -#define DSI_UNIT_INTERVAL_1 0xA -#define DSI_UNIT_INTERVAL_2 0x6 +#define DSI_UNIT_INTERVAL_0 0x9 +#define DSI_UNIT_INTERVAL_1 0x9 +#define DSI_UNIT_INTERVAL_2 0x6 static bool rotate_main = true; -static bool display_initialize_during_boot; +static bool display_initialized_during_boot; static int __init startup_graphics_setup(char *str) { @@ -32,14 +32,14 @@ static int __init startup_graphics_setup(char *str) switch (*str) { case '0': pr_info("No Startup graphics support\n"); - display_initialize_during_boot = false; + display_initialized_during_boot = false; break; case '1': pr_info("Startup graphics supported\n"); - display_initialize_during_boot = true; + display_initialized_during_boot = true; break; default: - display_initialize_during_boot = false; + display_initialized_during_boot = false; break; }; @@ -84,7 +84,11 @@ struct mcde_display_device generic_display0 = { .default_pixel_format = MCDE_OVLYPIXFMT_RGB565, .native_x_res = 864, .native_y_res = 480, +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_VSYNC + .synchronized_update = true, +#else .synchronized_update = false, +#endif /* TODO: Remove rotation buffers once ESRAM driver is completed */ .rotbuf1 = U8500_ESRAM_BASE + 0x20000 * 4, .rotbuf2 = U8500_ESRAM_BASE + 0x20000 * 4 + 0x10000, @@ -132,7 +136,11 @@ static struct mcde_display_device generic_subdisplay = { .default_pixel_format = MCDE_OVLYPIXFMT_RGB565, .native_x_res = 864, .native_y_res = 480, +#ifdef CONFIG_DISPLAY_GENERIC_DSI_SECONDARY_VSYNC + .synchronized_update = true, +#else .synchronized_update = false, +#endif .dev = { .platform_data = &generic_subdisplay_pdata, }, @@ -366,7 +374,6 @@ static int display_registered_callback(struct notifier_block *nb, struct mcde_display_device *ddev = dev; u16 width, height; bool rotate; - bool display_initialized; if (event != MCDE_DSS_EVENT_DISPLAY_REGISTERED) return 0; @@ -376,7 +383,6 @@ static int display_registered_callback(struct notifier_block *nb, mcde_dss_get_native_resolution(ddev, &width, &height); - display_initialized = (ddev->id == 0 && display_initialize_during_boot); rotate = (ddev->id == 0 && rotate_main); if (rotate) { u16 tmp = height; @@ -389,8 +395,7 @@ static int display_registered_callback(struct notifier_block *nb, width, height, width, height * 2, ddev->default_pixel_format, - rotate ? FB_ROTATE_CW : FB_ROTATE_UR, - display_initialized); + rotate ? FB_ROTATE_CW : FB_ROTATE_UR); if (IS_ERR(fbs[ddev->id])) pr_warning("Failed to create fb for display %s\n", ddev->name); else @@ -403,15 +408,56 @@ static struct notifier_block display_nb = { .notifier_call = display_registered_callback, }; +static int framebuffer_registered_callback(struct notifier_block *nb, + unsigned long event, void *data) +{ + int ret = 0; + struct fb_event *event_data = data; + struct fb_info *info; + struct fb_var_screeninfo var; + struct fb_fix_screeninfo fix; + + if (event == FB_EVENT_FB_REGISTERED && + !display_initialized_during_boot) { + if (event_data) { + u8 *addr; + info = event_data->info; + if (!lock_fb_info(info)) + return -ENODEV; + var = info->var; + fix = info->fix; + addr = ioremap(fix.smem_start, + var.yres_virtual * fix.line_length); + memset(addr, 0x00, + var.yres_virtual * fix.line_length); + var.yoffset = var.yoffset ? 0 : var.yres; + if (info->fbops->fb_pan_display) + ret = info->fbops->fb_pan_display(&var, info); + unlock_fb_info(info); + } + } + return ret; +} + +static struct notifier_block framebuffer_nb = { + .notifier_call = framebuffer_registered_callback, +}; + int __init init_display_devices(void) { int ret; + ret = fb_register_client(&framebuffer_nb); + if (ret) + pr_warning("Failed to register framebuffer notifier\n"); + ret = mcde_dss_register_notifier(&display_nb); if (ret) pr_warning("Failed to register dss notifier\n"); #ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY + if (display_initialized_during_boot) + generic_display0.power_mode = MCDE_DISPLAY_PM_STANDBY; ret = mcde_display_device_register(&generic_display0); if (ret) pr_warning("Failed to register generic display device 0\n"); diff --git a/arch/arm/mach-ux500/prcmu-fw.c b/arch/arm/mach-ux500/prcmu-fw.c index 8c98f2fa587..474cb919001 100755 --- a/arch/arm/mach-ux500/prcmu-fw.c +++ b/arch/arm/mach-ux500/prcmu-fw.c @@ -92,14 +92,14 @@ static int prcmu_set_hwacc_st(enum hw_acc_t hw_acc, enum hw_accst_t hw_accst); #define PRCMU_UNCLAMP_DSS_DSIPLL 0x00600C00 #define PRCMU_POWER_ON_DSI 0x00008000 -#define PRCMU_DSI_CLOCK_SETTING 0x00000145 -#define PRCMU_DSI_LP_CLOCK_SETTING 0x00000141 -#define PRCMU_PLLDSI_FREQ_SETTING 0x0004012B +#define PRCMU_DSI_CLOCK_SETTING 0x00000148 +#define PRCMU_DSI_LP_CLOCK_SETTING 0x00000F00 +#define PRCMU_PLLDSI_FREQ_SETTING 0x00020123 #define PRCMU_ENABLE_PLLDSI 0x00000001 #define PRCMU_RELEASE_RESET_DSS 0x0000400C #define PRCMU_DSI_PLLOUT_SEL_SETTING 0x00000202 -#define PRCMU_ENABLE_ESCAPE_CLOCK 0x07031717 +#define PRCMU_ENABLE_ESCAPE_CLOCK 0x07010101 #define PRCMU_DSI_RESET_SW 0x00000007 #define PRCMU_MCDE_DELAY 10 |