aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Persson <per.xb.persson@stericsson.com>2011-06-09 13:26:31 +0200
committerPhilippe Langlais <philippe.langlais@linaro.org>2011-07-22 15:52:21 +0200
commit3a0ed9472a4bddc22533bb7097ee4b1c1a7ec18b (patch)
treeb4be380bc9742436866e145f044c521fa12dc3e6
parentb9edaac39cf002c580bafcc8e2ba3a85b24c69fc (diff)
video: mcde: Add Fictive display
The possibility to use a fictive display that is not using HW, is added. Depends-On: I1ba92f35528518c9a9e2c805973dac8033a17f39 ST-Ericsson ID: 344358 ST-Ericsson Linux next: Not tested, ER 282779 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I8ddc6069e037d879582c810f9298273b3d75cc15 Signed-off-by: Per Persson <per.xb.persson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24716 Reviewed-by: QATOOLS Reviewed-by: QATEST Reviewed-by: Marcel TUNNISSEN <marcel.tuennissen@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/Kconfig-arch6
-rw-r--r--arch/arm/mach-ux500/board-mop500-mcde.c38
-rw-r--r--drivers/video/mcde/Makefile1
-rw-r--r--drivers/video/mcde/display-fictive.c64
-rw-r--r--drivers/video/mcde/mcde_fb.c45
-rw-r--r--include/video/mcde_display.h1
6 files changed, 133 insertions, 22 deletions
diff --git a/arch/arm/mach-ux500/Kconfig-arch b/arch/arm/mach-ux500/Kconfig-arch
index 580566baf99..7f7a52de9eb 100644
--- a/arch/arm/mach-ux500/Kconfig-arch
+++ b/arch/arm/mach-ux500/Kconfig-arch
@@ -149,6 +149,12 @@ config DISPLAY_AV8100_TRIPPLE_BUFFER
help
Say yes to enable tripple buffer. You'll get double buffer otherwise
+config DISPLAY_FICTIVE
+ bool "DISPLAY fictive"
+ default n
+ ---help---
+ Say Y if you want a fictive display that doesn't access hardware
+
endmenu
endif
diff --git a/arch/arm/mach-ux500/board-mop500-mcde.c b/arch/arm/mach-ux500/board-mop500-mcde.c
index d16c715ed86..a0ae5944b0b 100644
--- a/arch/arm/mach-ux500/board-mop500-mcde.c
+++ b/arch/arm/mach-ux500/board-mop500-mcde.c
@@ -39,10 +39,21 @@ static struct delayed_work work_dispreg_hdmi;
#endif
enum {
+#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY
PRIMARY_DISPLAY_ID,
+#endif
+#ifdef CONFIG_DISPLAY_GENERIC_DSI_SECONDARY
SECONDARY_DISPLAY_ID,
+#endif
+#ifdef CONFIG_DISPLAY_FICTIVE
+ FICTIVE_DISPLAY_ID,
+#endif
+#ifdef CONFIG_DISPLAY_AV8100_TERTIARY
AV8100_DISPLAY_ID,
+#endif
+#ifdef CONFIG_DISPLAY_AB8500_TERTIARY
AB8500_DISPLAY_ID,
+#endif
MCDE_NR_OF_DISPLAYS
};
static int display_initialized_during_boot;
@@ -79,6 +90,17 @@ static struct mcde_col_transform rgb_2_yCbCr_transform = {
};
#endif
+#ifdef CONFIG_DISPLAY_FICTIVE
+static struct mcde_display_device fictive_display = {
+ .name = "mcde_disp_fictive",
+ .id = FICTIVE_DISPLAY_ID,
+ .fictive = true,
+ .default_pixel_format = MCDE_OVLYPIXFMT_RGB565,
+ .native_x_res = 1280,
+ .native_y_res = 720,
+};
+#endif /* CONFIG_DISPLAY_FICTIVE */
+
#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY
static struct mcde_port port0 = {
.type = MCDE_PORTTYPE_DSI,
@@ -104,7 +126,7 @@ static struct mcde_port port0 = {
},
};
-struct mcde_display_generic_platform_data generic_display0_pdata = {
+static struct mcde_display_generic_platform_data generic_display0_pdata = {
.reset_delay = 1,
#ifdef CONFIG_REGULATOR
.regulator_id = "vaux12v5",
@@ -113,7 +135,7 @@ struct mcde_display_generic_platform_data generic_display0_pdata = {
#endif
};
-struct mcde_display_device generic_display0 = {
+static struct mcde_display_device generic_display0 = {
.name = "mcde_disp_generic",
.id = PRIMARY_DISPLAY_ID,
.port = &port0,
@@ -212,7 +234,7 @@ static struct mcde_port port0 = {
},
};
-struct mcde_display_dpi_platform_data generic_display0_pdata = {0};
+static struct mcde_display_dpi_platform_data generic_display0_pdata = {0};
static struct ux500_pins *dpi_pins;
static int dpi_display_platform_enable(struct mcde_display_device *ddev)
@@ -247,7 +269,7 @@ static int dpi_display_platform_disable(struct mcde_display_device *ddev)
}
-struct mcde_display_device generic_display0 = {
+static struct mcde_display_device generic_display0 = {
.name = "mcde_display_dpi",
.id = 0,
.port = &port0,
@@ -406,7 +428,6 @@ static struct mcde_display_device av8100_hdmi = {
.default_pixel_format = MCDE_OVLYPIXFMT_RGB888,
.native_x_res = 1280,
.native_y_res = 720,
- .synchronized_update = false,
.dev = {
.platform_data = &av8100_hdmi_pdata,
},
@@ -436,7 +457,7 @@ static int display_postregistered_callback(struct notifier_block *nb,
if (event != MCDE_DSS_EVENT_DISPLAY_REGISTERED)
return 0;
- if (ddev->id < PRIMARY_DISPLAY_ID || ddev->id >= MCDE_NR_OF_DISPLAYS)
+ if (ddev->id < 0 || ddev->id >= MCDE_NR_OF_DISPLAYS)
return 0;
mcde_dss_get_native_resolution(ddev, &width, &height);
@@ -626,6 +647,11 @@ int __init init_display_devices(void)
ret = mcde_dss_register_notifier(&display_nb);
if (ret)
pr_warning("Failed to register dss notifier\n");
+#ifdef CONFIG_DISPLAY_FICTIVE
+ ret = mcde_display_device_register(&fictive_display);
+ if (ret)
+ pr_warning("Failed to register fictive display device\n");
+#endif
#ifdef CONFIG_DISPLAY_GENERIC_PRIMARY
if (machine_is_hrefv60())
diff --git a/drivers/video/mcde/Makefile b/drivers/video/mcde/Makefile
index 93097f8961e..7c9324ded3a 100644
--- a/drivers/video/mcde/Makefile
+++ b/drivers/video/mcde/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_MCDE_DISPLAY_SONY_SY35560_DSI) += display-sony_sy35560_dsi.o
obj-$(CONFIG_MCDE_DISPLAY_VUIB500_DPI) += display-vuib500-dpi.o
obj-$(CONFIG_MCDE_DISPLAY_AB8500_DENC) += display-ab8500.o
obj-$(CONFIG_MCDE_DISPLAY_AV8100) += display-av8100.o
+obj-$(CONFIG_DISPLAY_FICTIVE) += display-fictive.o
ifdef CONFIG_FB_MCDE_DEBUG
EXTRA_CFLAGS += -DDEBUG
diff --git a/drivers/video/mcde/display-fictive.c b/drivers/video/mcde/display-fictive.c
new file mode 100644
index 00000000000..8389357a693
--- /dev/null
+++ b/drivers/video/mcde/display-fictive.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * ST-Ericsson MCDE fictive display driver
+ *
+ * Author: Per Persson <per.xb.persson@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * License terms: GNU General Public License (GPL), version 2.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+
+#include <video/mcde_display.h>
+
+static int __devinit fictive_probe(struct mcde_display_device *dev)
+{
+ dev->prepare_for_update = NULL;
+ dev->platform_enable = NULL,
+ dev->platform_disable = NULL,
+ dev->set_power_mode = NULL;
+
+ dev_info(&dev->dev, "Fictive display probed\n");
+
+ return 0;
+}
+
+static int __devexit fictive_remove(struct mcde_display_device *dev)
+{
+ return 0;
+}
+
+static struct mcde_display_driver fictive_driver = {
+ .probe = fictive_probe,
+ .remove = fictive_remove,
+ .driver = {
+ .name = "mcde_disp_fictive",
+ },
+};
+
+/* Module init */
+static int __init mcde_display_fictive_init(void)
+{
+ pr_info("%s\n", __func__);
+
+ return mcde_display_driver_register(&fictive_driver);
+}
+module_init(mcde_display_fictive_init);
+
+static void __exit mcde_display_fictive_exit(void)
+{
+ pr_info("%s\n", __func__);
+
+ mcde_display_driver_unregister(&fictive_driver);
+}
+module_exit(mcde_display_fictive_exit);
+
+MODULE_AUTHOR("Per Persson <per.xb.persson@stericsson.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("ST-Ericsson MCDE fictive display driver");
diff --git a/drivers/video/mcde/mcde_fb.c b/drivers/video/mcde/mcde_fb.c
index cd7dd70101d..3b464cd8024 100644
--- a/drivers/video/mcde/mcde_fb.c
+++ b/drivers/video/mcde/mcde_fb.c
@@ -490,6 +490,9 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev)
}
fbi->fix.line_length = line_len;
+ if (ddev->fictive)
+ goto apply_var_end;
+
if (ddev) {
/* Apply pixel format */
fmt = var_to_pix_fmt_info(var);
@@ -520,6 +523,7 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev)
mcde_dss_update_overlay(ovly, num_buffers == 3);
}
+apply_var_end:
return 0;
}
@@ -638,13 +642,15 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
init_fb(fbi);
mfb = to_mcde_fb(fbi);
- ret = mcde_dss_open_channel(ddev);
- if (ret)
- goto channel_open_failed;
+ if (ddev->fictive == false) {
+ ret = mcde_dss_open_channel(ddev);
+ if (ret)
+ goto channel_open_failed;
- ret = mcde_dss_enable_display(ddev);
- if (ret)
- goto display_enable_failed;
+ ret = mcde_dss_enable_display(ddev);
+ if (ret)
+ goto display_enable_failed;
+ }
/* Prepare var and allocate frame buffer memory */
init_var_fmt(&fbi->var, w, h, vw, vh, pix_fmt, rotate);
@@ -653,7 +659,8 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
if (ret)
goto apply_var_failed;
- mcde_dss_set_pixel_format(ddev, ddev->port->pixel_format);
+ if (ddev->fictive == false)
+ mcde_dss_set_pixel_format(ddev, ddev->port->pixel_format);
/* Setup overlay */
get_ovly_info(fbi, NULL, &ovly_info);
@@ -665,9 +672,11 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
mfb->ovlys[0] = ovly;
mfb->num_ovlys = 1;
- ret = mcde_dss_enable_overlay(ovly);
- if (ret)
- goto ovly_enable_failed;
+ if (ddev->fictive == false) {
+ ret = mcde_dss_enable_overlay(ovly);
+ if (ret)
+ goto ovly_enable_failed;
+ }
mfb->id = ddev->id;
@@ -679,11 +688,13 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
ddev->fbi = fbi;
#ifdef CONFIG_HAS_EARLYSUSPEND
- mfb->early_suspend.level =
+ if (ddev->fictive == false) {
+ mfb->early_suspend.level =
EARLY_SUSPEND_LEVEL_DISABLE_FB;
- mfb->early_suspend.suspend = early_suspend;
- mfb->early_suspend.resume = late_resume;
- register_early_suspend(&mfb->early_suspend);
+ mfb->early_suspend.suspend = early_suspend;
+ mfb->early_suspend.resume = late_resume;
+ register_early_suspend(&mfb->early_suspend);
+ }
#endif
goto out;
@@ -719,8 +730,10 @@ void mcde_fb_destroy(struct mcde_display_device *dev)
dev_vdbg(&dev->dev, "%s\n", __func__);
- mcde_dss_disable_display(dev);
- mcde_dss_close_channel(dev);
+ if (dev->fictive == false) {
+ mcde_dss_disable_display(dev);
+ mcde_dss_close_channel(dev);
+ }
mfb = to_mcde_fb(dev->fbi);
for (i = 0; i < mfb->num_ovlys; i++) {
diff --git a/include/video/mcde_display.h b/include/video/mcde_display.h
index 059d4a7e609..a5e449f6b5b 100644
--- a/include/video/mcde_display.h
+++ b/include/video/mcde_display.h
@@ -30,6 +30,7 @@ struct mcde_display_device {
int id;
struct mcde_port *port;
struct fb_info *fbi;
+ bool fictive;
/* MCDE dss driver internal */
bool initialized;