From b5478f54d905e5c81680d1974e3a5fae1ca8941d Mon Sep 17 00:00:00 2001 From: Maciej Socha Date: Tue, 6 Dec 2011 12:39:36 +0100 Subject: misc: compdev added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This driver is needed to support new display composition cases in HC/ICS. The driver is similar to the dispdev driver but not the same. ST-Ericsson ID: 350337 ST-Ericsson FOSS-OUT ID: NA Change-Id: Ide63b6f3994dece44259ac25da26b06a2fcca832 Signed-off-by: Jörgen Nilsson Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42890 Reviewed-by: Per-Daniel OLSSON Tested-by: Per-Daniel OLSSON Reviewed-by: Jonas ABERG --- arch/arm/mach-ux500/board-mop500-mcde.c | 17 +- drivers/misc/Kconfig | 9 + drivers/misc/Makefile | 1 + drivers/misc/compdev/Makefile | 1 + drivers/misc/compdev/compdev.c | 481 ++++++++++++++++++++++++++++++++ include/linux/compdev.h | 106 +++++++ 6 files changed, 614 insertions(+), 1 deletion(-) create mode 100644 drivers/misc/compdev/Makefile create mode 100644 drivers/misc/compdev/compdev.c create mode 100644 include/linux/compdev.h diff --git a/arch/arm/mach-ux500/board-mop500-mcde.c b/arch/arm/mach-ux500/board-mop500-mcde.c index 470302b6809..8b9e0b5a9c2 100644 --- a/arch/arm/mach-ux500/board-mop500-mcde.c +++ b/arch/arm/mach-ux500/board-mop500-mcde.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -348,7 +349,7 @@ static int display_postregistered_callback(struct notifier_block *nb, u16 virtual_height; u32 rotate = FB_ROTATE_UR; struct fb_info *fbi; -#ifdef CONFIG_DISPDEV +#if defined(CONFIG_DISPDEV) || defined(CONFIG_COMPDEV) struct mcde_fb *mfb; #endif @@ -397,6 +398,20 @@ static int display_postregistered_callback(struct notifier_block *nb, } #endif +#ifdef CONFIG_COMPDEV + mfb = to_mcde_fb(fbi); + /* Create a compdev overlay for this display */ + if (compdev_create(ddev, mfb->ovlys[0]) < 0) { + dev_warn(&ddev->dev, + "Failed to create compdev for display %s\n", + ddev->name); + goto display_postregistered_callback_err; + } else { + dev_info(&ddev->dev, "compdev created for (%s)\n", + ddev->name); + } +#endif + out: return 0; diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 1b3e2b1ae2c..c7c7114859f 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -470,6 +470,15 @@ config DISPDEV addition to the framebuffer). The device allows for registration of userspace buffers to be used with the overlay. +config COMPDEV + bool "Display composition device" + depends on FB_MCDE && HWMEM + default n + help + This driver provides a way to use several overlays for a display. + This driver replaces the use of the framebuffer The device allows + for posting userspace buffers to be used with the overlays. + config PCH_PHUB tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) PHUB" depends on PCI diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 2868ec61bc5..6f925aafbd5 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -47,6 +47,7 @@ obj-$(CONFIG_AB8500_PWM) += ab8500-pwm.o obj-y += lis3lv02d/ obj-y += carma/ obj-$(CONFIG_DISPDEV) += dispdev/ +obj-$(CONFIG_COMPDEV) += compdev/ obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ obj-$(CONFIG_MAX8997_MUIC) += max8997-muic.o diff --git a/drivers/misc/compdev/Makefile b/drivers/misc/compdev/Makefile new file mode 100644 index 00000000000..8d5cd14dc36 --- /dev/null +++ b/drivers/misc/compdev/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_DISPDEV) += compdev.o diff --git a/drivers/misc/compdev/compdev.c b/drivers/misc/compdev/compdev.c new file mode 100644 index 00000000000..7e840a59d9c --- /dev/null +++ b/drivers/misc/compdev/compdev.c @@ -0,0 +1,481 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * Display overlay compositer device driver + * + * Author: Anders Bauer + * for ST-Ericsson. + * + * Modified: Per-Daniel Olsson + * for ST-Ericsson. + * + * License terms: GNU General Public License (GPL), version 2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include