mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes
@ 2012-01-19  8:23 Teresa Gámez
  2012-01-19  8:23 ` [PATCH 2/5] video imx-ipu-fb: add num_modes to imx3 boards Teresa Gámez
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Teresa Gámez @ 2012-01-19  8:23 UTC (permalink / raw)
  To: barebox

Make support of multiple video modes possible for i.MX3 boards.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-imx/include/mach/imx-ipu-fb.h |    1 +
 drivers/video/imx-ipu-fb.c                  |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
index 8e1cc87..5d583e8 100644
--- a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
+++ b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
@@ -27,6 +27,7 @@
 struct imx_ipu_fb_platform_data {
 	struct fb_videomode	*mode;
 	unsigned char		bpp;
+	u_int			num_modes;
 	void __iomem		*framebuffer;
 	/** hook to enable backlight and stuff */
 	void			(*enable)(int enable);
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index dce2a9e..a3fdb76 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -807,9 +807,15 @@ static void ipu_fb_disable(struct fb_info *info)
 	reg_write(fbi, reg, SDC_COM_CONF);
 }
 
+static int ipu_fb_activate_var(struct fb_info *info)
+{
+	return 0;
+}
+
 static struct fb_ops imxfb_ops = {
 	.fb_enable = ipu_fb_enable,
 	.fb_disable = ipu_fb_disable,
+	.fb_activate_var = ipu_fb_activate_var,
 };
 
 static void imxfb_init_info(struct fb_info *info, struct fb_videomode *mode,
@@ -860,9 +866,11 @@ static int imxfb_probe(struct device_d *dev)
 
 	fbi->regs = dev_request_mem_region(dev, 0);
 	fbi->dev = dev;
+	fbi->enable = pdata->enable;
 	info->priv = fbi;
 	info->fbops = &imxfb_ops;
-	fbi->enable = pdata->enable;
+	info->num_modes = pdata->num_modes;
+	info->mode_list = pdata->mode;
 
 	imxfb_init_info(info, pdata->mode, pdata->bpp);
 
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] video imx-ipu-fb: add num_modes to imx3 boards
  2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
@ 2012-01-19  8:23 ` Teresa Gámez
  2012-01-19  8:23 ` [PATCH 3/5] imx-ipu-fb: Fix offset for IPU Clock Teresa Gámez
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Teresa Gámez @ 2012-01-19  8:23 UTC (permalink / raw)
  To: barebox

Added num_modes to all imx_ipu_fb_platform_data structs.
Removed defines for pcm043 to choose display.
We may switch this during runtime now.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c |    1 +
 arch/arm/boards/freescale-mx35-3-stack/3stack.c   |    1 +
 arch/arm/boards/guf-cupid/board.c                 |    1 +
 arch/arm/boards/pcm043/pcm043.c                   |   74 ++++++++++----------
 arch/arm/mach-imx/Kconfig                         |   10 ---
 5 files changed, 40 insertions(+), 47 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index d167ab9..249aaee 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -91,6 +91,7 @@ static void eukrea_cpuimx35_enable_display(int enable)
 
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.mode		= &imxfb_mode,
+	.num_modes	= 1,
 	.bpp		= 16,
 	.enable		= eukrea_cpuimx35_enable_display,
 };
diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
index 030a1a7..fe17899 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
@@ -100,6 +100,7 @@ static struct fb_videomode CTP_CLAA070LC0ACW = {
 
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.mode		= &CTP_CLAA070LC0ACW,
+	.num_modes	= 1,
 	.bpp		= 16,
 };
 
diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c
index 158adfc..94692e7 100644
--- a/arch/arm/boards/guf-cupid/board.c
+++ b/arch/arm/boards/guf-cupid/board.c
@@ -92,6 +92,7 @@ static void cupid_fb_enable(int enable)
 
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.mode		= &guf_cupid_fb_mode,
+	.num_modes	= 1,
 	.bpp		= 16,
 	.enable		= cupid_fb_enable,
 };
diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
index 23580c9..cd1721c 100644
--- a/arch/arm/boards/pcm043/pcm043.c
+++ b/arch/arm/boards/pcm043/pcm043.c
@@ -56,46 +56,46 @@ struct imx_nand_platform_data nand_info = {
 	.flash_bbt = 1,
 };
 
-#ifdef CONFIG_PCM043_DISPLAY_SHARP
-static struct fb_videomode pcm043_fb_mode = {
-	/* 240x320 @ 60 Hz */
-	.name		= "Sharp-LQ035Q7",
-	.refresh	= 60,
-	.xres		= 240,
-	.yres		= 320,
-	.pixclock	= 185925,
-	.left_margin	= 9,
-	.right_margin	= 16,
-	.upper_margin	= 7,
-	.lower_margin	= 9,
-	.hsync_len	= 1,
-	.vsync_len	= 1,
-	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE | FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
-	.vmode		= FB_VMODE_NONINTERLACED,
-	.flag		= 0,
-};
-#else
-static struct fb_videomode pcm043_fb_mode = {
-	/* 240x320 @ 60 Hz */
-	.name		= "TX090",
-	.refresh	= 60,
-	.xres		= 240,
-	.yres		= 320,
-	.pixclock	= 38255,
-	.left_margin	= 144,
-	.right_margin	= 0,
-	.upper_margin	= 7,
-	.lower_margin	= 40,
-	.hsync_len	= 96,
-	.vsync_len	= 1,
-	.sync		= FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
-	.vmode		= FB_VMODE_NONINTERLACED,
-	.flag		= 0,
+static struct fb_videomode pcm043_fb_mode[] = {
+	{
+		/* 240x320 @ 60 Hz */
+		.name		= "TX090",
+		.refresh	= 60,
+		.xres		= 240,
+		.yres		= 320,
+		.pixclock	= 38255,
+		.left_margin	= 144,
+		.right_margin	= 0,
+		.upper_margin	= 7,
+		.lower_margin	= 40,
+		.hsync_len	= 96,
+		.vsync_len	= 1,
+		.sync		= FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
+		.vmode		= FB_VMODE_NONINTERLACED,
+		.flag		= 0,
+	}, {
+		/* 240x320 @ 60 Hz */
+		.name		= "Sharp-LQ035Q7",
+		.refresh	= 60,
+		.xres		= 240,
+		.yres		= 320,
+		.pixclock	= 185925,
+		.left_margin	= 9,
+		.right_margin	= 16,
+		.upper_margin	= 7,
+		.lower_margin	= 9,
+		.hsync_len	= 1,
+		.vsync_len	= 1,
+		.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE | \
+				 FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
+		.vmode		= FB_VMODE_NONINTERLACED,
+		.flag		= 0,
+	}
 };
-#endif
 
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
-	.mode		= &pcm043_fb_mode,
+	.mode		= pcm043_fb_mode,
+	.num_modes	= ARRAY_SIZE(pcm043_fb_mode),
 	.bpp		= 16,
 };
 
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 7da39cb..a4b603b 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -405,16 +405,6 @@ endif
 
 menu "Board specific settings       "
 
-if MACH_PCM043
-choice
-	prompt "Display type"
-config PCM043_DISPLAY_SHARP
-	bool "Sharp LQ035Q7"
-config PCM043_DISPLAY_TY090
-	bool "TX090"
-endchoice
-endif
-
 if MACH_PCM037
 choice
 	prompt "SDRAM Bank0"
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] imx-ipu-fb: Fix offset for IPU Clock.
  2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
  2012-01-19  8:23 ` [PATCH 2/5] video imx-ipu-fb: add num_modes to imx3 boards Teresa Gámez
@ 2012-01-19  8:23 ` Teresa Gámez
  2012-01-19  8:23 ` [PATCH 4/5] imx-ipu-fb: Add overlay support Teresa Gámez
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Teresa Gámez @ 2012-01-19  8:23 UTC (permalink / raw)
  To: barebox

The offset for the IPU Clock in the CGR1 register is 18 not 22.
See MCIMX35RM table 14-17.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 drivers/video/imx-ipu-fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index a3fdb76..385f574 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -735,7 +735,7 @@ static void ipu_fb_enable(struct fb_info *info)
 
 	/* Start the clock */
 	reg = readl(IMX_CCM_BASE + CCM_CGR1);
-	reg |= (3 << 22);
+	reg |= (3 << 18);
 	writel(reg, IMX_CCM_BASE + CCM_CGR1);
 
 	/* ipu_idmac.c::ipu_idmac_init() */
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] imx-ipu-fb: Add overlay support
  2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
  2012-01-19  8:23 ` [PATCH 2/5] video imx-ipu-fb: add num_modes to imx3 boards Teresa Gámez
  2012-01-19  8:23 ` [PATCH 3/5] imx-ipu-fb: Fix offset for IPU Clock Teresa Gámez
@ 2012-01-19  8:23 ` Teresa Gámez
  2012-01-19  8:23 ` [PATCH 5/5] ARM pcm043: " Teresa Gámez
  2012-01-23  8:40 ` [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Teresa Gámez @ 2012-01-19  8:23 UTC (permalink / raw)
  To: barebox

Adding overlay support for i.MX3 sdc.

Foreground channel only works when background is also enabled.
The foreground video mode is always the same as the background.

Also added alpha command to set the alpha value of the foreground.

Tested on a phyCORE-i.MX35.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-imx/include/mach/imx-ipu-fb.h |    1 +
 drivers/video/Kconfig                       |    4 +
 drivers/video/imx-ipu-fb.c                  |  157 ++++++++++++++++++++++++---
 3 files changed, 148 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
index 5d583e8..74a1a88 100644
--- a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
+++ b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
@@ -29,6 +29,7 @@ struct imx_ipu_fb_platform_data {
 	unsigned char		bpp;
 	u_int			num_modes;
 	void __iomem		*framebuffer;
+	void __iomem		*framebuffer_ovl;
 	/** hook to enable backlight and stuff */
 	void			(*enable)(int enable);
 };
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4a05af9..509ba64 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -20,6 +20,10 @@ config DRIVER_VIDEO_IMX_IPU
 	  Add support for the IPU framebuffer device found on
 	  i.MX31 and i.MX35 CPUs.
 
+config DRIVER_VIDEO_IMX_IPU_OVERLAY
+	bool "i.MX31/35 framebuffer overlay support"
+	depends on DRIVER_VIDEO_IMX_IPU && (ARCH_IMX35 || ARCH_IMX_31)
+
 config DRIVER_VIDEO_STM
 	bool "i.MX23/28 framebuffer driver"
 	depends on ARCH_MXS
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 385f574..8039de0 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -39,6 +39,7 @@ struct ipu_fb_info {
 	void			(*enable)(int enable);
 
 	struct fb_info		info;
+	struct fb_info		overlay;
 	struct device_d		*dev;
 };
 
@@ -465,10 +466,13 @@ static int sdc_init_panel(struct fb_info *info, enum pixel_fmt pixel_fmt)
 	case IPU_PANEL_SHARP_TFT:
 		reg_write(fbi, 0x00FD0102L, SDC_SHARP_CONF_1);
 		reg_write(fbi, 0x00F500F4L, SDC_SHARP_CONF_2);
-		reg_write(fbi, SDC_COM_SHARP | SDC_COM_TFT_COLOR, SDC_COM_CONF);
+		reg = reg_read(fbi, SDC_COM_CONF);
+		reg_write(fbi, reg | SDC_COM_SHARP | SDC_COM_TFT_COLOR,
+							SDC_COM_CONF);
 		break;
 	case IPU_PANEL_TFT:
-		reg_write(fbi, SDC_COM_TFT_COLOR, SDC_COM_CONF);
+		reg = reg_read(fbi, SDC_COM_CONF) & ~SDC_COM_SHARP;
+		reg_write(fbi, reg | SDC_COM_TFT_COLOR, SDC_COM_CONF);
 		break;
 	default:
 		return -EINVAL;
@@ -607,6 +611,7 @@ static void ipu_init_channel_buffer(struct ipu_fb_info *fbi,
 
 	switch (channel) {
 	case IDMAC_SDC_0:
+	case IDMAC_SDC_1:
 		/* In original code only IPU_PIX_FMT_RGB565 was setting burst */
 		params.pp.npb = 16 - 1;
 		break;
@@ -651,6 +656,7 @@ static int ipu_enable_channel(struct ipu_fb_info *fbi, enum ipu_channel channel)
 
 	switch (channel) {
 	case IDMAC_SDC_0:
+	case IDMAC_SDC_1:
 		ipu_channel_set_priority(fbi, channel, 1);
 		break;
 	default:
@@ -701,17 +707,21 @@ static int idmac_tx_submit(struct ipu_fb_info *fbi, enum ipu_channel channel,
 	return ret;
 }
 
-static void sdc_enable_channel(struct ipu_fb_info *fbi, void *fbmem)
+static void sdc_enable_channel(struct ipu_fb_info *fbi, void *fbmem,
+				enum ipu_channel channel)
 {
-	int ret;
+	int ret = 0;
 	u32 reg;
 
-	ret = idmac_tx_submit(fbi, IDMAC_SDC_0, fbmem);
+	ret = idmac_tx_submit(fbi, channel, fbmem);
 
 	/* mx3fb.c::sdc_fb_init() */
 	if (ret >= 0) {
 		reg = reg_read(fbi, SDC_COM_CONF);
-		reg_write(fbi, reg | SDC_COM_BG_EN, SDC_COM_CONF);
+		if (channel == IDMAC_SDC_1)
+			reg_write(fbi, reg | SDC_COM_FG_EN, SDC_COM_CONF);
+		else
+			reg_write(fbi, reg | SDC_COM_BG_EN, SDC_COM_CONF);
 	}
 
 	/*
@@ -743,14 +753,12 @@ static void ipu_fb_enable(struct fb_info *info)
 	/* Service request counter to maximum - shouldn't be needed */
 	reg_write(fbi, 0x00000070, IDMAC_CONF);
 
-
 	/* ipu_idmac.c::ipu_init_channel() */
 
 	/* Enable IPU sub modules */
 	reg = reg_read(fbi, IPU_CONF) | IPU_CONF_SDC_EN | IPU_CONF_DI_EN;
 	reg_write(fbi, reg, IPU_CONF);
 
-
 	/* mx3fb.c::init_fb_chan() */
 
 	/* set Display Interface clock period */
@@ -771,12 +779,11 @@ static void ipu_fb_enable(struct fb_info *info)
 	reg = reg_read(fbi, SDC_COM_CONF);
 	reg_write(fbi, reg | SDC_COM_GLB_A, SDC_COM_CONF);
 
-
 	/* mx3fb.c::sdc_set_color_key() */
 
 	/* Disable colour-keying for background */
 	reg = reg_read(fbi, SDC_COM_CONF) &
-		~(SDC_COM_GWSEL | SDC_COM_KEY_COLOR_G);
+		~(SDC_COM_KEY_COLOR_G);
 	reg_write(fbi, reg, SDC_COM_CONF);
 
 	sdc_init_panel(info, IPU_PIX_FMT_RGB666);
@@ -784,7 +791,7 @@ static void ipu_fb_enable(struct fb_info *info)
 	reg_write(fbi, (mode->left_margin << 16) | mode->upper_margin,
 			SDC_BG_POS);
 
-	sdc_enable_channel(fbi, info->screen_base);
+	sdc_enable_channel(fbi, info->screen_base, IDMAC_SDC_0);
 
 	/*
 	 * Linux driver calls sdc_set_brightness() here again,
@@ -809,6 +816,16 @@ static void ipu_fb_disable(struct fb_info *info)
 
 static int ipu_fb_activate_var(struct fb_info *info)
 {
+#ifdef CONFIG_DRIVER_VIDEO_IMX_IPU_OVERLAY
+	struct ipu_fb_info *fbi = info->priv;
+	struct fb_info *overlay = &fbi->overlay;
+
+	/* overlay also needs to know the new values */
+	overlay->mode = info->mode;
+	overlay->xres = info->xres;
+	overlay->yres = info->yres;
+#endif
+
 	return 0;
 }
 
@@ -851,12 +868,121 @@ static void imxfb_init_info(struct fb_info *info, struct fb_videomode *mode,
 	info->transp = rgb->transp;
 }
 
+#ifdef CONFIG_DRIVER_VIDEO_IMX_IPU_OVERLAY
+
+static void ipu_fb_overlay_enable_controller(struct fb_info *overlay)
+{
+	struct ipu_fb_info *fbi = overlay->priv;
+	struct fb_videomode *mode = overlay->mode;
+	int reg;
+
+	sdc_init_panel(overlay, IPU_PIX_FMT_RGB666);
+
+	reg_write(fbi, (mode->left_margin << 16) | mode->upper_margin,
+							SDC_FG_POS);
+
+	reg = reg_read(fbi, SDC_COM_CONF);
+	reg_write(fbi, reg | SDC_COM_GWSEL, SDC_COM_CONF);
+
+	if (fbi->enable)
+		fbi->enable(1);
+
+	sdc_enable_channel(fbi, overlay->screen_base, IDMAC_SDC_1);
+}
+
+static void ipu_fb_overlay_disable_controller(struct fb_info *overlay)
+{
+	struct ipu_fb_info *fbi = overlay->priv;
+	u32 reg;
+
+	if (fbi->enable)
+		fbi->enable(0);
+
+	/* Disable foreground and set graphic window to background */
+	reg = reg_read(fbi, SDC_COM_CONF);
+	reg &= ~(SDC_COM_FG_EN | SDC_COM_GWSEL);
+	reg_write(fbi, reg, SDC_COM_CONF);
+}
+
+static int ipu_fb_overlay_setcolreg(u_int regno, u_int red, u_int green,
+		u_int blue, u_int trans, struct fb_info *info)
+{
+	return 0;
+}
+
+static struct fb_ops ipu_fb_overlay_ops = {
+	.fb_setcolreg	= ipu_fb_overlay_setcolreg,
+	.fb_enable	= ipu_fb_overlay_enable_controller,
+	.fb_disable	= ipu_fb_overlay_disable_controller,
+};
+
+static int sdc_alpha_set(struct device_d *dev, struct param_d *param,
+			const char *val)
+{
+	struct fb_info *info = dev->priv;
+	struct ipu_fb_info *fbi = info->priv;
+	int alpha;
+	char alphastr[16];
+	unsigned int tmp;
+
+	if (!val)
+		return dev_param_set_generic(dev, param, NULL);
+
+	alpha = simple_strtoul(val, NULL, 0);
+	alpha &= 0xff;
+
+	tmp = reg_read(fbi, SDC_GW_CTRL) & 0x00FFFFFFL;
+	reg_write(fbi, tmp | ((u32) alpha << 24), SDC_GW_CTRL);
+
+	sprintf(alphastr, "%d", alpha);
+
+	dev_param_set_generic(dev, param, alphastr);
+
+	return 0;
+}
+
+static int sdc_fb_register_overlay(struct ipu_fb_info *fbi, void *fb)
+{
+	struct fb_info *overlay;
+	const struct imx_ipu_fb_platform_data *pdata = fbi->dev->platform_data;
+	int ret;
+
+	overlay = &fbi->overlay;
+	overlay->priv = fbi;
+	overlay->fbops = &ipu_fb_overlay_ops;
+
+	imxfb_init_info(overlay, pdata->mode, pdata->bpp);
+
+	if (fb)
+		overlay->screen_base = fb;
+	else
+		overlay->screen_base = xzalloc(overlay->xres * overlay->yres *
+				(overlay->bits_per_pixel >> 3));
+
+	if (!overlay->screen_base)
+		return -ENOMEM;
+
+	sdc_enable_channel(fbi, overlay->screen_base, IDMAC_SDC_1);
+
+	ret = register_framebuffer(&fbi->overlay);
+	if (ret < 0) {
+		dev_err(fbi->dev, "failed to register framebuffer\n");
+		return ret;
+	}
+
+	dev_add_param(&overlay->dev, "alpha", sdc_alpha_set, NULL, 0);
+	dev_set_param(&overlay->dev, "alpha", "0");
+	return 0;
+}
+
+#endif
+
 static int imxfb_probe(struct device_d *dev)
 {
 	struct ipu_fb_info *fbi;
 	struct fb_info *info;
 	const struct imx_ipu_fb_platform_data *pdata = dev->platform_data;
-	int ret;
+	int ret = 0;
 
 	if (!pdata)
 		return -ENODEV;
@@ -888,7 +1014,7 @@ static int imxfb_probe(struct device_d *dev)
 			return -ENOMEM;
 	}
 
-	sdc_enable_channel(fbi, info->screen_base);
+	sdc_enable_channel(fbi, info->screen_base, IDMAC_SDC_0);
 
 	ret = register_framebuffer(&fbi->info);
 	if (ret < 0) {
@@ -896,7 +1022,10 @@ static int imxfb_probe(struct device_d *dev)
 		return ret;
 	}
 
-	return 0;
+#ifdef CONFIG_DRIVER_VIDEO_IMX_IPU_OVERLAY
+	ret = sdc_fb_register_overlay(fbi, pdata->framebuffer_ovl);
+#endif
+	return ret;
 }
 
 static void imxfb_remove(struct device_d *dev)
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] ARM pcm043: Add overlay support
  2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
                   ` (2 preceding siblings ...)
  2012-01-19  8:23 ` [PATCH 4/5] imx-ipu-fb: Add overlay support Teresa Gámez
@ 2012-01-19  8:23 ` Teresa Gámez
  2012-01-23  8:40 ` [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Teresa Gámez @ 2012-01-19  8:23 UTC (permalink / raw)
  To: barebox

Adding overlay support for phyCORE-i.MX35.
Also move the TEXT_BASE to leave enough space for the overlay image
at the end of the RAM.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/pcm043/pcm043.c   |   10 ++++++----
 arch/arm/configs/pcm043_defconfig |    2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
index cd1721c..b7a7b2f 100644
--- a/arch/arm/boards/pcm043/pcm043.c
+++ b/arch/arm/boards/pcm043/pcm043.c
@@ -29,6 +29,7 @@
 #include <driver.h>
 #include <environment.h>
 #include <fs.h>
+#include <sizes.h>
 #include <mach/imx-regs.h>
 #include <asm/armlinux.h>
 #include <mach/gpio.h>
@@ -94,14 +95,15 @@ static struct fb_videomode pcm043_fb_mode[] = {
 };
 
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
-	.mode		= pcm043_fb_mode,
-	.num_modes	= ARRAY_SIZE(pcm043_fb_mode),
-	.bpp		= 16,
+	.mode			= pcm043_fb_mode,
+	.num_modes		= ARRAY_SIZE(pcm043_fb_mode),
+	.framebuffer_ovl	= (void *) (IMX_SDRAM_CS0 + SZ_128M - SZ_1M),
+	.bpp			= 16,
 };
 
 static int pcm043_mem_init(void)
 {
-	arm_add_mem_device("ram0", IMX_SDRAM_CS0, 128 * 1024 * 1024);
+	arm_add_mem_device("ram0", IMX_SDRAM_CS0, SZ_128M);
 
 	return 0;
 }
diff --git a/arch/arm/configs/pcm043_defconfig b/arch/arm/configs/pcm043_defconfig
index 179d403..7f7a2d6 100644
--- a/arch/arm/configs/pcm043_defconfig
+++ b/arch/arm/configs/pcm043_defconfig
@@ -10,7 +10,7 @@ CONFIG_AEABI=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_ARM_UNWIND=y
 CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x87F00000
+CONFIG_TEXT_BASE=0x87E00000
 CONFIG_MALLOC_SIZE=0x1000000
 CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes
  2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
                   ` (3 preceding siblings ...)
  2012-01-19  8:23 ` [PATCH 5/5] ARM pcm043: " Teresa Gámez
@ 2012-01-23  8:40 ` Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-01-23  8:40 UTC (permalink / raw)
  To: Teresa Gámez; +Cc: barebox

On Thu, Jan 19, 2012 at 09:23:12AM +0100, Teresa Gámez wrote:
> Make support of multiple video modes possible for i.MX3 boards.

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-23  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19  8:23 [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Teresa Gámez
2012-01-19  8:23 ` [PATCH 2/5] video imx-ipu-fb: add num_modes to imx3 boards Teresa Gámez
2012-01-19  8:23 ` [PATCH 3/5] imx-ipu-fb: Fix offset for IPU Clock Teresa Gámez
2012-01-19  8:23 ` [PATCH 4/5] imx-ipu-fb: Add overlay support Teresa Gámez
2012-01-19  8:23 ` [PATCH 5/5] ARM pcm043: " Teresa Gámez
2012-01-23  8:40 ` [PATCH 1/5] imx-ipu-fb: Add support for multiple video modes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox