summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2012-03-30 14:10:49 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:04:29 +0200
commitb7086e0a1dec82bf7e8e96e17738151f0aee82fc (patch)
tree45b1a7dec3be9f0014231144efd701767cbfbc52
parent39f287c01ef6d7030895d9e435f25af72c011b49 (diff)
Revert "ux500: mcde: Remove unnecessary MCDE fbdev update"video
This reverts commit 9bfa8c7f5cf9aff1df84f1761841c8f3e7c84e97.
-rw-r--r--arch/arm/mach-ux500/board-mop500-mcde.c46
-rw-r--r--arch/arm/mach-ux500/board-u5500-mcde.c46
2 files changed, 92 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-mcde.c b/arch/arm/mach-ux500/board-mop500-mcde.c
index e60842c86e8..3d8c8fc4852 100644
--- a/arch/arm/mach-ux500/board-mop500-mcde.c
+++ b/arch/arm/mach-ux500/board-mop500-mcde.c
@@ -415,11 +415,57 @@ static struct notifier_block display_nb = {
.notifier_call = display_postregistered_callback,
};
+/*
+* This function is used to refresh the display (lcd, hdmi, tvout) with black
+* when the framebuffer is registered.
+* The main display will not be updated if startup graphics is displayed
+* from u-boot.
+*/
+static int framebuffer_postregistered_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;
+ struct mcde_fb *mfb;
+
+ if (event != FB_EVENT_FB_REGISTERED)
+ return 0;
+
+ if (!event_data)
+ return 0;
+
+ info = event_data->info;
+ mfb = to_mcde_fb(info);
+ if (mfb->id == 0 && display_initialized_during_boot)
+ goto out;
+
+ var = info->var;
+ fix = info->fix;
+ var.yoffset = var.yoffset ? 0 : var.yres;
+ if (info->fbops->fb_pan_display)
+ ret = info->fbops->fb_pan_display(&var, info);
+out:
+ return ret;
+}
+
+static struct notifier_block framebuffer_nb = {
+ .notifier_call = framebuffer_postregistered_callback,
+};
+
static int __init init_display_devices(void)
{
+ int ret;
+
if (!cpu_is_u8500())
return 0;
+ ret = fb_register_client(&framebuffer_nb);
+ if (ret)
+ pr_warning("Failed to register framebuffer notifier\n");
+
(void)mcde_dss_register_notifier(&display_nb);
/* Set powermode to STANDBY if startup graphics is executed */
diff --git a/arch/arm/mach-ux500/board-u5500-mcde.c b/arch/arm/mach-ux500/board-u5500-mcde.c
index d28ee6473df..906b5572229 100644
--- a/arch/arm/mach-ux500/board-u5500-mcde.c
+++ b/arch/arm/mach-ux500/board-u5500-mcde.c
@@ -203,11 +203,57 @@ static struct notifier_block display_nb = {
.notifier_call = display_postregistered_callback,
};
+/*
+* This function is used to refresh the display (lcd, hdmi, tvout) with black
+* when the framebuffer is registered.
+* The main display will not be updated if startup graphics is displayed
+* from u-boot.
+*/
+static int framebuffer_postregistered_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;
+ struct mcde_fb *mfb;
+
+ if (event != FB_EVENT_FB_REGISTERED)
+ return 0;
+
+ if (!event_data)
+ return 0;
+
+ info = event_data->info;
+ mfb = to_mcde_fb(info);
+ if (mfb->id == 0 && display_initialized_during_boot)
+ goto out;
+
+ var = info->var;
+ fix = info->fix;
+ var.yoffset = var.yoffset ? 0 : var.yres;
+ if (info->fbops->fb_pan_display)
+ ret = info->fbops->fb_pan_display(&var, info);
+out:
+ return ret;
+}
+
+static struct notifier_block framebuffer_nb = {
+ .notifier_call = framebuffer_postregistered_callback,
+};
+
int __init init_u5500_display_devices(void)
{
+ int ret;
+
if (!cpu_is_u5500())
return 0;
+ ret = fb_register_client(&framebuffer_nb);
+ if (ret)
+ pr_warning("Failed to register framebuffer notifier\n");
+
(void)mcde_dss_register_notifier(&display_nb);
if (display_initialized_during_boot)