beagleboard: added 2.6.29 kernel from OE

tested on B7

Signed-off-by: Marcin Juszkiewicz <marcin@buglabs.net>
This commit is contained in:
Marcin Juszkiewicz
2009-04-27 16:41:24 +02:00
parent d65be3dd2a
commit 0adc74b062
146 changed files with 156117 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
From 26abf45ac80be4c54a63fecf1c3c1e1efb416e0a Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 1 Apr 2009 18:27:09 +0300
Subject: [PATCH] Revert "gro: Fix legacy path napi_complete crash"
This reverts commit 303c6a0251852ecbdc5c15e466dcaff5971f7517.
Fixes USB network problems
---
net/core/dev.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index e3fe5c7..c1e9dc0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota)
local_irq_disable();
skb = __skb_dequeue(&queue->input_pkt_queue);
if (!skb) {
+ __napi_complete(napi);
local_irq_enable();
- napi_complete(napi);
- goto out;
+ break;
}
local_irq_enable();
@@ -2599,7 +2599,6 @@ static int process_backlog(struct napi_struct *napi, int quota)
napi_gro_flush(napi);
-out:
return work;
}
--
1.5.6.5

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,396 @@
From 4cc0368574f587f448231ccd121266bed4bf9729 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 10:29:56 +0300
Subject: [PATCH] DSS2: Add panel drivers
- Generic panel
- Samsung LTE430WQ-F0C LCD Panel
- Sharp LS037V7DW01 LCD Panel
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
drivers/video/omap2/displays/Kconfig | 21 ++++
drivers/video/omap2/displays/Makefile | 3 +
drivers/video/omap2/displays/panel-generic.c | 96 +++++++++++++++++
.../omap2/displays/panel-samsung-lte430wq-f0c.c | 108 +++++++++++++++++++
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 112 ++++++++++++++++++++
5 files changed, 340 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/Kconfig
create mode 100644 drivers/video/omap2/displays/Makefile
create mode 100644 drivers/video/omap2/displays/panel-generic.c
create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
create mode 100644 drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
new file mode 100644
index 0000000..0419ec8
--- /dev/null
+++ b/drivers/video/omap2/displays/Kconfig
@@ -0,0 +1,21 @@
+menu "OMAP2/3 Display Device Drivers"
+ depends on OMAP2_DSS
+
+config PANEL_GENERIC
+ tristate "Generic Panel"
+ help
+ Generic panel driver.
+ Used for DVI output for Beagle and OMAP3 SDP.
+
+config PANEL_SAMSUNG_LTE430WQ_F0C
+ tristate "Samsung LTE430WQ-F0C LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used on Overo Palo43
+
+config PANEL_SHARP_LS037V7DW01
+ tristate "Sharp LS037V7DW01 LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used in TI's SDP3430 and EVM boards
+endmenu
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
new file mode 100644
index 0000000..a26bbd2
--- /dev/null
+++ b/drivers/video/omap2/displays/Makefile
@@ -0,0 +1,3 @@
+obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
+obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
+obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
new file mode 100644
index 0000000..8382acb
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-generic.c
@@ -0,0 +1,96 @@
+/*
+ * Generic panel support
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include <mach/display.h>
+
+static int generic_panel_init(struct omap_display *display)
+{
+ return 0;
+}
+
+static int generic_panel_enable(struct omap_display *display)
+{
+ int r = 0;
+
+ if (display->hw_config.panel_enable)
+ r = display->hw_config.panel_enable(display);
+
+ return r;
+}
+
+static void generic_panel_disable(struct omap_display *display)
+{
+ if (display->hw_config.panel_disable)
+ display->hw_config.panel_disable(display);
+}
+
+static int generic_panel_suspend(struct omap_display *display)
+{
+ generic_panel_disable(display);
+ return 0;
+}
+
+static int generic_panel_resume(struct omap_display *display)
+{
+ return generic_panel_enable(display);
+}
+
+static struct omap_panel generic_panel = {
+ .owner = THIS_MODULE,
+ .name = "panel-generic",
+ .init = generic_panel_init,
+ .enable = generic_panel_enable,
+ .disable = generic_panel_disable,
+ .suspend = generic_panel_suspend,
+ .resume = generic_panel_resume,
+
+ .timings = {
+ /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
+ .x_res = 640,
+ .y_res = 480,
+ .pixel_clock = 23500,
+ .hfp = 48,
+ .hsw = 32,
+ .hbp = 80,
+ .vfp = 3,
+ .vsw = 4,
+ .vbp = 7,
+ },
+
+ .config = OMAP_DSS_LCD_TFT,
+};
+
+
+static int __init generic_panel_drv_init(void)
+{
+ omap_dss_register_panel(&generic_panel);
+ return 0;
+}
+
+static void __exit generic_panel_drv_exit(void)
+{
+ omap_dss_unregister_panel(&generic_panel);
+}
+
+module_init(generic_panel_drv_init);
+module_exit(generic_panel_drv_exit);
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
new file mode 100644
index 0000000..e4bb781
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
@@ -0,0 +1,108 @@
+/*
+ * LCD panel driver for Samsung LTE430WQ-F0C
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include <mach/display.h>
+
+static int samsung_lte_panel_init(struct omap_display *display)
+{
+ return 0;
+}
+
+static void samsung_lte_panel_cleanup(struct omap_display *display)
+{
+}
+
+static int samsung_lte_panel_enable(struct omap_display *display)
+{
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+ if (display->hw_config.panel_enable)
+ r = display->hw_config.panel_enable(display);
+
+ return r;
+}
+
+static void samsung_lte_panel_disable(struct omap_display *display)
+{
+ if (display->hw_config.panel_disable)
+ display->hw_config.panel_disable(display);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
+ msleep(100);
+}
+
+static int samsung_lte_panel_suspend(struct omap_display *display)
+{
+ samsung_lte_panel_disable(display);
+ return 0;
+}
+
+static int samsung_lte_panel_resume(struct omap_display *display)
+{
+ return samsung_lte_panel_enable(display);
+}
+
+static struct omap_panel samsung_lte_panel = {
+ .owner = THIS_MODULE,
+ .name = "samsung-lte430wq-f0c",
+ .init = samsung_lte_panel_init,
+ .cleanup = samsung_lte_panel_cleanup,
+ .enable = samsung_lte_panel_enable,
+ .disable = samsung_lte_panel_disable,
+ .suspend = samsung_lte_panel_suspend,
+ .resume = samsung_lte_panel_resume,
+
+ .timings = {
+ .x_res = 480,
+ .y_res = 272,
+
+ .pixel_clock = 9200,
+
+ .hsw = 41,
+ .hfp = 8,
+ .hbp = 45-41,
+
+ .vsw = 10,
+ .vfp = 4,
+ .vbp = 12-10,
+ },
+ .recommended_bpp = 16,
+ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS,
+};
+
+
+static int __init samsung_lte_panel_drv_init(void)
+{
+ omap_dss_register_panel(&samsung_lte_panel);
+ return 0;
+}
+
+static void __exit samsung_lte_panel_drv_exit(void)
+{
+ omap_dss_unregister_panel(&samsung_lte_panel);
+}
+
+module_init(samsung_lte_panel_drv_init);
+module_exit(samsung_lte_panel_drv_exit);
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
new file mode 100644
index 0000000..1f99150
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -0,0 +1,112 @@
+/*
+ * LCD panel driver for Sharp LS037V7DW01
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include <mach/display.h>
+
+static int sharp_ls_panel_init(struct omap_display *display)
+{
+ return 0;
+}
+
+static void sharp_ls_panel_cleanup(struct omap_display *display)
+{
+}
+
+static int sharp_ls_panel_enable(struct omap_display *display)
+{
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+ if (display->hw_config.panel_enable)
+ r = display->hw_config.panel_enable(display);
+
+ return r;
+}
+
+static void sharp_ls_panel_disable(struct omap_display *display)
+{
+ if (display->hw_config.panel_disable)
+ display->hw_config.panel_disable(display);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
+
+ msleep(100);
+}
+
+static int sharp_ls_panel_suspend(struct omap_display *display)
+{
+ sharp_ls_panel_disable(display);
+ return 0;
+}
+
+static int sharp_ls_panel_resume(struct omap_display *display)
+{
+ return sharp_ls_panel_enable(display);
+}
+
+static struct omap_panel sharp_ls_panel = {
+ .owner = THIS_MODULE,
+ .name = "sharp-ls037v7dw01",
+ .init = sharp_ls_panel_init,
+ .cleanup = sharp_ls_panel_cleanup,
+ .enable = sharp_ls_panel_enable,
+ .disable = sharp_ls_panel_disable,
+ .suspend = sharp_ls_panel_suspend,
+ .resume = sharp_ls_panel_resume,
+
+ .timings = {
+ .x_res = 480,
+ .y_res = 640,
+
+ .pixel_clock = 19200,
+
+ .hsw = 2,
+ .hfp = 1,
+ .hbp = 28,
+
+ .vsw = 1,
+ .vfp = 1,
+ .vbp = 1,
+ },
+
+ .acb = 0x28,
+
+ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
+};
+
+
+static int __init sharp_ls_panel_drv_init(void)
+{
+ omap_dss_register_panel(&sharp_ls_panel);
+ return 0;
+}
+
+static void __exit sharp_ls_panel_drv_exit(void)
+{
+ omap_dss_unregister_panel(&sharp_ls_panel);
+}
+
+module_init(sharp_ls_panel_drv_init);
+module_exit(sharp_ls_panel_drv_exit);
+MODULE_LICENSE("GPL");
--
1.5.6.5

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
From 4741076cae4f4284e1fff9a03f35475b8455af54 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Wed, 1 Apr 2009 14:36:39 +0200
Subject: [PATCH] DSS2: Add function to display object to get the backlight level
This is needed by an upcoming patch that changes the backlight
initialization to use the backlight level set by the bootloader.
Also add a field for the maximum backlight level.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
arch/arm/plat-omap/include/mach/display.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 6288353..6b702c7 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -211,6 +211,8 @@ struct omap_dss_display_config {
int panel_reset_gpio;
int ctrl_reset_gpio;
+ int max_backlight_level;
+
const char *name; /* for debug */
const char *ctrl_name;
const char *panel_name;
@@ -225,6 +227,7 @@ struct omap_dss_display_config {
void (*ctrl_disable)(struct omap_display *display);
int (*set_backlight)(struct omap_display *display,
int level);
+ int (*get_backlight)(struct omap_display *display);
};
struct device;
--
1.5.6.5

View File

@@ -0,0 +1,778 @@
From 66e16f86d3f4c5b34b37e965c65102b7192371de Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Thu, 2 Apr 2009 11:47:13 +0300
Subject: [PATCH] DSS2: Add acx565akm panel
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
drivers/video/omap2/displays/Kconfig | 8 +
drivers/video/omap2/displays/Makefile | 2 +
drivers/video/omap2/displays/panel-acx565akm.c | 712 ++++++++++++++++++++++++
drivers/video/omap2/displays/panel-acx565akm.h | 9 +
4 files changed, 731 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/panel-acx565akm.c
create mode 100644 drivers/video/omap2/displays/panel-acx565akm.h
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 356ceb1..3feecee 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -28,4 +28,12 @@ config CTRL_BLIZZARD
tristate "Blizzard Controller"
help
Blizzard Controller (hack)
+
+config PANEL_ACX565AKM
+ tristate "ACX565AKM LCD Panel"
+ depends on OMAP2_DSS_SDI
+ select BACKLIGHT_CLASS_DEVICE
+ help
+ LCD Panel used in RX51
+
endmenu
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 1b74b7e..9bafcb6 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -4,3 +4,5 @@ obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
obj-$(CONFIG_CTRL_BLIZZARD) += ctrl-blizzard.o
obj-$(CONFIG_PANEL_N800) += panel-n800.o
+
+obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
new file mode 100644
index 0000000..2679d6c
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -0,0 +1,712 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/spi/spi.h>
+#include <linux/jiffies.h>
+#include <linux/sched.h>
+#include <linux/backlight.h>
+#include <linux/fb.h>
+
+#include <mach/display.h>
+#include <mach/dma.h>
+
+#include "panel-acx565akm.h"
+
+#define MIPID_CMD_READ_DISP_ID 0x04
+#define MIPID_CMD_READ_RED 0x06
+#define MIPID_CMD_READ_GREEN 0x07
+#define MIPID_CMD_READ_BLUE 0x08
+#define MIPID_CMD_READ_DISP_STATUS 0x09
+#define MIPID_CMD_RDDSDR 0x0F
+#define MIPID_CMD_SLEEP_IN 0x10
+#define MIPID_CMD_SLEEP_OUT 0x11
+#define MIPID_CMD_DISP_OFF 0x28
+#define MIPID_CMD_DISP_ON 0x29
+#define MIPID_CMD_WRITE_DISP_BRIGHTNESS 0x51
+#define MIPID_CMD_READ_DISP_BRIGHTNESS 0x52
+#define MIPID_CMD_WRITE_CTRL_DISP 0x53
+
+#define CTRL_DISP_BRIGHTNESS_CTRL_ON (1 << 5)
+#define CTRL_DISP_AMBIENT_LIGHT_CTRL_ON (1 << 4)
+#define CTRL_DISP_BACKLIGHT_ON (1 << 2)
+#define CTRL_DISP_AUTO_BRIGHTNESS_ON (1 << 1)
+
+#define MIPID_CMD_READ_CTRL_DISP 0x54
+#define MIPID_CMD_WRITE_CABC 0x55
+#define MIPID_CMD_READ_CABC 0x56
+
+#define MIPID_VER_LPH8923 3
+#define MIPID_VER_LS041Y3 4
+#define MIPID_VER_L4F00311 8
+#define MIPID_VER_ACX565AKM 9
+
+struct acx565akm_device {
+ struct backlight_device *bl_dev;
+ int enabled;
+ int model;
+ int revision;
+ u8 display_id[3];
+ int has_bc:1;
+ int has_cabc:1;
+ unsigned int saved_bklight_level;
+ unsigned long hw_guard_end; /* next value of jiffies
+ when we can issue the
+ next sleep in/out command */
+ unsigned long hw_guard_wait; /* max guard time in jiffies */
+
+ struct spi_device *spi;
+ struct mutex mutex;
+ struct omap_panel panel;
+ struct omap_display *display;
+};
+
+static int acx565akm_bl_update_status(struct backlight_device *dev);
+
+static void acx565akm_transfer(struct acx565akm_device *md, int cmd,
+ const u8 *wbuf, int wlen, u8 *rbuf, int rlen)
+{
+ struct spi_message m;
+ struct spi_transfer *x, xfer[5];
+ int r;
+
+ BUG_ON(md->spi == NULL);
+
+ spi_message_init(&m);
+
+ memset(xfer, 0, sizeof(xfer));
+ x = &xfer[0];
+
+ cmd &= 0xff;
+ x->tx_buf = &cmd;
+ x->bits_per_word = 9;
+ x->len = 2;
+
+ if (rlen > 1 && wlen == 0) {
+ /*
+ * Between the command and the response data there is a
+ * dummy clock cycle. Add an extra bit after the command
+ * word to account for this.
+ */
+ x->bits_per_word = 10;
+ cmd <<= 1;
+ }
+ spi_message_add_tail(x, &m);
+
+ if (wlen) {
+ x++;
+ x->tx_buf = wbuf;
+ x->len = wlen;
+ x->bits_per_word = 9;
+ spi_message_add_tail(x, &m);
+ }
+
+ if (rlen) {
+ x++;
+ x->rx_buf = rbuf;
+ x->len = rlen;
+ spi_message_add_tail(x, &m);
+ }
+
+ r = spi_sync(md->spi, &m);
+ if (r < 0)
+ dev_dbg(&md->spi->dev, "spi_sync %d\n", r);
+}
+
+static inline void acx565akm_cmd(struct acx565akm_device *md, int cmd)
+{
+ acx565akm_transfer(md, cmd, NULL, 0, NULL, 0);
+}
+
+static inline void acx565akm_write(struct acx565akm_device *md,
+ int reg, const u8 *buf, int len)
+{
+ acx565akm_transfer(md, reg, buf, len, NULL, 0);
+}
+
+static inline void acx565akm_read(struct acx565akm_device *md,
+ int reg, u8 *buf, int len)
+{
+ acx565akm_transfer(md, reg, NULL, 0, buf, len);
+}
+
+static void hw_guard_start(struct acx565akm_device *md, int guard_msec)
+{
+ md->hw_guard_wait = msecs_to_jiffies(guard_msec);
+ md->hw_guard_end = jiffies + md->hw_guard_wait;
+}
+
+static void hw_guard_wait(struct acx565akm_device *md)
+{
+ unsigned long wait = md->hw_guard_end - jiffies;
+
+ if ((long)wait > 0 && wait <= md->hw_guard_wait) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(wait);
+ }
+}
+
+static void set_sleep_mode(struct acx565akm_device *md, int on)
+{
+ int cmd, sleep_time = 50;
+
+ if (on)
+ cmd = MIPID_CMD_SLEEP_IN;
+ else
+ cmd = MIPID_CMD_SLEEP_OUT;
+ hw_guard_wait(md);
+ acx565akm_cmd(md, cmd);
+ hw_guard_start(md, 120);
+ /*
+ * When we enable the panel, it seems we _have_ to sleep
+ * 120 ms before sending the init string. When disabling the
+ * panel we'll sleep for the duration of 2 frames, so that the
+ * controller can still provide the PCLK,HS,VS signals. */
+ if (!on)
+ sleep_time = 120;
+ msleep(sleep_time);
+}
+
+static void set_display_state(struct acx565akm_device *md, int enabled)
+{
+ int cmd = enabled ? MIPID_CMD_DISP_ON : MIPID_CMD_DISP_OFF;
+
+ acx565akm_cmd(md, cmd);
+}
+
+static int panel_enabled(struct acx565akm_device *md)
+{
+ u32 disp_status;
+ int enabled;
+
+ acx565akm_read(md, MIPID_CMD_READ_DISP_STATUS, (u8 *)&disp_status, 4);
+ disp_status = __be32_to_cpu(disp_status);
+ enabled = (disp_status & (1 << 17)) && (disp_status & (1 << 10));
+ dev_dbg(&md->spi->dev,
+ "LCD panel %senabled by bootloader (status 0x%04x)\n",
+ enabled ? "" : "not ", disp_status);
+ return enabled;
+}
+
+static void enable_backlight_ctrl(struct acx565akm_device *md, int enable)
+{
+ u16 ctrl;
+
+ acx565akm_read(md, MIPID_CMD_READ_CTRL_DISP, (u8 *)&ctrl, 1);
+ if (enable) {
+ ctrl |= CTRL_DISP_BRIGHTNESS_CTRL_ON |
+ CTRL_DISP_BACKLIGHT_ON;
+ } else {
+ ctrl &= ~(CTRL_DISP_BRIGHTNESS_CTRL_ON |
+ CTRL_DISP_BACKLIGHT_ON);
+ }
+
+ ctrl |= 1 << 8;
+ acx565akm_write(md, MIPID_CMD_WRITE_CTRL_DISP, (u8 *)&ctrl, 2);
+}
+
+static void set_cabc_mode(struct acx565akm_device *md, int mode)
+{
+ u16 cabc_ctrl;
+
+ cabc_ctrl = 0;
+ acx565akm_read(md, MIPID_CMD_READ_CABC, (u8 *)&cabc_ctrl, 1);
+ cabc_ctrl &= ~3;
+ cabc_ctrl |= (1 << 8) | (mode & 3);
+ acx565akm_write(md, MIPID_CMD_WRITE_CABC, (u8 *)&cabc_ctrl, 2);
+}
+
+static int get_cabc_mode(struct acx565akm_device *md)
+{
+ u8 cabc_ctrl;
+
+ acx565akm_read(md, MIPID_CMD_READ_CABC, &cabc_ctrl, 1);
+ return cabc_ctrl & 3;
+}
+
+static int panel_detect(struct acx565akm_device *md)
+{
+ acx565akm_read(md, MIPID_CMD_READ_DISP_ID, md->display_id, 3);
+ dev_dbg(&md->spi->dev, "MIPI display ID: %02x%02x%02x\n",
+ md->display_id[0], md->display_id[1], md->display_id[2]);
+
+ switch (md->display_id[0]) {
+ case 0x10:
+ md->model = MIPID_VER_ACX565AKM;
+ md->panel.name = "acx565akm";
+ md->has_bc = 1;
+ md->has_cabc = 1;
+ break;
+ case 0x29:
+ md->model = MIPID_VER_L4F00311;
+ md->panel.name = "l4f00311";
+ break;
+ case 0x45:
+ md->model = MIPID_VER_LPH8923;
+ md->panel.name = "lph8923";
+ break;
+ case 0x83:
+ md->model = MIPID_VER_LS041Y3;
+ md->panel.name = "ls041y3";
+ break;
+ default:
+ md->panel.name = "unknown";
+ dev_err(&md->spi->dev, "invalid display ID\n");
+ return -ENODEV;
+ }
+
+ md->revision = md->display_id[1];
+
+ pr_info("omapfb: %s rev %02x LCD detected\n",
+ md->panel.name, md->revision);
+
+ return 0;
+}
+
+static int acx565akm_panel_enable(struct omap_display *display)
+{
+ struct acx565akm_device *md =
+ (struct acx565akm_device *)display->panel->priv;
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ mutex_lock(&md->mutex);
+
+ if (display->hw_config.panel_enable)
+ display->hw_config.panel_enable(display);
+
+ md->enabled = panel_enabled(md);
+
+ if (md->enabled) {
+ dev_dbg(&md->spi->dev, "panel already enabled\n");
+ mutex_unlock(&md->mutex);
+ return 0;
+ }
+
+ set_sleep_mode(md, 0);
+ md->enabled = 1;
+ set_display_state(md, 1);
+
+ mutex_unlock(&md->mutex);
+
+ return acx565akm_bl_update_status(md->bl_dev);
+}
+
+static void acx565akm_panel_disable(struct omap_display *display)
+{
+ struct acx565akm_device *md =
+ (struct acx565akm_device *)display->panel->priv;
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ mutex_lock(&md->mutex);
+
+ if (!md->enabled) {
+ mutex_unlock(&md->mutex);
+ return;
+ }
+ set_display_state(md, 0);
+ set_sleep_mode(md, 1);
+ md->enabled = 0;
+
+ if (display->hw_config.panel_disable)
+ display->hw_config.panel_disable(display);
+
+ mutex_unlock(&md->mutex);
+}
+
+#if 0
+static void acx565akm_set_mode(struct omap_display *display,
+ int x_res, int y_res, int bpp)
+{
+ struct acx565akm_device *md =
+ (struct acx565akm_device *)display->panel->priv;
+ u16 par;
+
+ switch (bpp) {
+ case 16:
+ par = 0x150;
+ break;
+ case 18:
+ par = 0x160;
+ break;
+ case 24:
+ par = 0x170;
+ break;
+ }
+
+ acx565akm_write(md, 0x3a, (u8 *)&par, 2);
+}
+#endif
+
+static int acx565akm_panel_suspend(struct omap_display *display)
+{
+ acx565akm_panel_disable(display);
+ return 0;
+}
+
+static int acx565akm_panel_resume(struct omap_display *display)
+{
+ return acx565akm_panel_enable(display);
+}
+
+static void acx565akm_set_brightness(struct acx565akm_device *md, int level)
+{
+ int bv;
+
+ bv = level | (1 << 8);
+ acx565akm_write(md, MIPID_CMD_WRITE_DISP_BRIGHTNESS, (u8 *)&bv, 2);
+
+ if (level)
+ enable_backlight_ctrl(md, 1);
+ else
+ enable_backlight_ctrl(md, 0);
+}
+
+static int acx565akm_get_actual_brightness(struct acx565akm_device *md)
+{
+ u8 bv;
+
+ acx565akm_read(md, MIPID_CMD_READ_DISP_BRIGHTNESS, &bv, 1);
+
+ return bv;
+}
+
+static int acx565akm_bl_update_status(struct backlight_device *dev)
+{
+ struct acx565akm_device *md = dev_get_drvdata(&dev->dev);
+ struct omap_display *display = md->display;
+ int r;
+ int level;
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ if (display->hw_config.set_backlight == NULL)
+ return -ENODEV;
+
+ mutex_lock(&md->mutex);
+
+ if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
+ dev->props.power == FB_BLANK_UNBLANK)
+ level = dev->props.brightness;
+ else
+ level = 0;
+
+ r = 0;
+ if (md->has_bc)
+ acx565akm_set_brightness(md, level);
+ else
+ if (display->hw_config.set_backlight != NULL)
+ r = display->hw_config.set_backlight(display, level);
+ else
+ r = -ENODEV;
+
+ mutex_unlock(&md->mutex);
+
+ return r;
+}
+
+static int acx565akm_bl_get_intensity(struct backlight_device *dev)
+{
+ struct acx565akm_device *md = dev_get_drvdata(&dev->dev);
+ struct omap_display *display = md->display;
+
+ dev_dbg(&dev->dev, "%s\n", __func__);
+
+ if (md->has_bc && display->hw_config.set_backlight == NULL)
+ return -ENODEV;
+
+ if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
+ dev->props.power == FB_BLANK_UNBLANK) {
+ if (md->has_bc)
+ return acx565akm_get_actual_brightness(md);
+ else
+ return dev->props.brightness;
+ }
+
+ return 0;
+}
+
+static struct backlight_ops acx565akm_bl_ops = {
+ .get_brightness = acx565akm_bl_get_intensity,
+ .update_status = acx565akm_bl_update_status,
+};
+
+static const char *cabc_modes[] = {
+ "off", /* used also always when CABC is not supported */
+ "ui",
+ "still-image",
+ "moving-image",
+};
+
+static ssize_t show_cabc_mode(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct acx565akm_device *md = dev_get_drvdata(dev);
+ const char *mode_str;
+ int mode;
+ int len;
+
+ if (!md->has_cabc)
+ mode = 0;
+ else
+ mode = get_cabc_mode(md);
+ mode_str = "unknown";
+ if (mode >= 0 && mode < ARRAY_SIZE(cabc_modes))
+ mode_str = cabc_modes[mode];
+ len = snprintf(buf, PAGE_SIZE, "%s\n", mode_str);
+
+ return len < PAGE_SIZE - 1 ? len : PAGE_SIZE - 1;
+}
+
+static ssize_t store_cabc_mode(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct acx565akm_device *md = dev_get_drvdata(dev);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(cabc_modes); i++) {
+ const char *mode_str = cabc_modes[i];
+ int cmp_len = strlen(mode_str);
+
+ if (count > 0 && buf[count - 1] == '\n')
+ count--;
+ if (count != cmp_len)
+ continue;
+
+ if (strncmp(buf, mode_str, cmp_len) == 0)
+ break;
+ }
+
+ if (i == ARRAY_SIZE(cabc_modes))
+ return -EINVAL;
+
+ if (!md->has_cabc && i != 0)
+ return -EINVAL;
+
+ mutex_lock(&md->mutex);
+ set_cabc_mode(md, i);
+ mutex_unlock(&md->mutex);
+
+ return count;
+}
+
+static ssize_t show_cabc_available_modes(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct acx565akm_device *md = dev_get_drvdata(dev);
+ int len;
+ int i;
+
+ if (!md->has_cabc)
+ return snprintf(buf, PAGE_SIZE, "%s\n", cabc_modes[0]);
+
+ for (i = 0, len = 0;
+ len < PAGE_SIZE && i < ARRAY_SIZE(cabc_modes); i++)
+ len += snprintf(&buf[len], PAGE_SIZE - len, "%s%s%s",
+ i ? " " : "", cabc_modes[i],
+ i == ARRAY_SIZE(cabc_modes) - 1 ? "\n" : "");
+
+ return len < PAGE_SIZE ? len : PAGE_SIZE - 1;
+}
+
+static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR,
+ show_cabc_mode, store_cabc_mode);
+static DEVICE_ATTR(cabc_available_modes, S_IRUGO,
+ show_cabc_available_modes, NULL);
+
+static struct attribute *bldev_attrs[] = {
+ &dev_attr_cabc_mode.attr,
+ &dev_attr_cabc_available_modes.attr,
+ NULL,
+};
+
+static struct attribute_group bldev_attr_group = {
+ .attrs = bldev_attrs,
+};
+
+static int acx565akm_panel_init(struct omap_display *display)
+{
+ struct omap_panel *panel = display->panel;
+ struct acx565akm_panel_data *panel_data = display->hw_config.panel_data;
+ struct acx565akm_device *md = (struct acx565akm_device *)panel->priv;
+
+ struct backlight_device *bldev;
+ int brightness;
+ int max_brightness;
+ int r;
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ if (!panel_data) {
+ dev_err(&md->spi->dev, "no panel data\n");
+ return -ENODEV;
+ }
+
+ mutex_init(&md->mutex);
+ md->display = display;
+
+ if (display->hw_config.panel_enable)
+ display->hw_config.panel_enable(display);
+
+ md->enabled = panel_enabled(md);
+
+ r = panel_detect(md);
+ if (r) {
+ if (!md->enabled && display->hw_config.panel_disable)
+ display->hw_config.panel_disable(display);
+ mutex_unlock(&md->mutex);
+ return r;
+ }
+
+ if (!panel_data->bc_connected) {
+ md->has_bc = 0;
+ md->has_cabc = 0;
+ }
+
+#if 0
+ acx565akm_set_mode(display, panel->timings.x_res, panel->timings.y_res,
+ panel->bpp);
+#endif
+
+ if (!md->enabled)
+ display->hw_config.panel_disable(display);
+
+ bldev = backlight_device_register("acx565akm", &md->spi->dev,
+ md, &acx565akm_bl_ops);
+ md->bl_dev = bldev;
+
+ if (md->has_cabc) {
+ r = sysfs_create_group(&bldev->dev.kobj, &bldev_attr_group);
+ if (r) {
+ dev_err(&bldev->dev, "failed to create sysfs files\n");
+ backlight_device_unregister(bldev);
+ return r;
+ }
+ }
+
+ bldev->props.fb_blank = FB_BLANK_UNBLANK;
+ bldev->props.power = FB_BLANK_UNBLANK;
+
+ if (md->has_bc)
+ max_brightness = 255;
+ else
+ max_brightness = display->hw_config.max_backlight_level;
+
+ if (md->has_bc)
+ brightness = acx565akm_get_actual_brightness(md);
+ else {
+ if (display->hw_config.get_backlight != NULL)
+ brightness = display->hw_config.get_backlight(display);
+ else
+ brightness = 0;
+ }
+
+ bldev->props.max_brightness = max_brightness;
+ bldev->props.brightness = brightness;
+ acx565akm_bl_update_status(bldev);
+
+ return 0;
+}
+
+static struct omap_panel acx565akm_panel = {
+ .name = "panel-acx565akm",
+ .init = acx565akm_panel_init,
+ .suspend = acx565akm_panel_suspend,
+ .resume = acx565akm_panel_resume,
+ .enable = acx565akm_panel_enable,
+ .disable = acx565akm_panel_disable,
+
+ .timings = {
+ .x_res = 800,
+ .y_res = 480,
+
+ .pixel_clock = 24000,
+
+ .hsw = 4,
+ .hfp = 16,
+ .hbp = 12,
+
+ .vsw = 3,
+ .vfp = 3,
+ .vbp = 3,
+ },
+
+ .config = OMAP_DSS_LCD_TFT,
+
+ .recommended_bpp = 16,
+
+ /*
+ * supported modes: 12bpp(444), 16bpp(565), 18bpp(666), 24bpp(888)
+ * resolutions.
+ */
+};
+
+static int acx565akm_spi_probe(struct spi_device *spi)
+{
+ struct acx565akm_device *md;
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ md = kzalloc(sizeof(*md), GFP_KERNEL);
+ if (md == NULL) {
+ dev_err(&spi->dev, "out of memory\n");
+ return -ENOMEM;
+ }
+
+ spi->mode = SPI_MODE_3;
+ md->spi = spi;
+ dev_set_drvdata(&spi->dev, md);
+ md->panel = acx565akm_panel;
+ acx565akm_panel.priv = md;
+
+ omap_dss_register_panel(&acx565akm_panel);
+
+ return 0;
+}
+
+static int acx565akm_spi_remove(struct spi_device *spi)
+{
+ struct acx565akm_device *md = dev_get_drvdata(&spi->dev);
+
+ dev_dbg(&md->spi->dev, "%s\n", __func__);
+
+ sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group);
+ backlight_device_unregister(md->bl_dev);
+ omap_dss_unregister_panel(&acx565akm_panel);
+
+ kfree(md);
+
+ return 0;
+}
+
+static struct spi_driver acx565akm_spi_driver = {
+ .driver = {
+ .name = "acx565akm",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ .probe = acx565akm_spi_probe,
+ .remove = __devexit_p(acx565akm_spi_remove),
+};
+
+static int __init acx565akm_init(void)
+{
+ return spi_register_driver(&acx565akm_spi_driver);
+}
+
+static void __exit acx565akm_exit(void)
+{
+ spi_unregister_driver(&acx565akm_spi_driver);
+}
+
+module_init(acx565akm_init);
+module_exit(acx565akm_exit);
+
+MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
+MODULE_DESCRIPTION("acx565akm LCD Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-acx565akm.h b/drivers/video/omap2/displays/panel-acx565akm.h
new file mode 100644
index 0000000..6d3727b
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-acx565akm.h
@@ -0,0 +1,9 @@
+#ifndef __DRIVERS_VIDEO_OMAP2_DISPLAYS_PANEL_ACX565AKM_H
+#define __DRIVERS_VIDEO_OMAP2_DISPLAYS_PANEL_ACX565AKM_H
+
+struct acx565akm_panel_data {
+ unsigned bc_connected:1;
+};
+
+#endif
+
--
1.5.6.5

View File

@@ -0,0 +1,28 @@
From 370510e24ddbf539392ebb6a1e43280965fcb19b Mon Sep 17 00:00:00 2001
From: Vaibhav Hiremath <hvaibhav@ti.com>
Date: Tue, 31 Mar 2009 18:47:32 +0530
Subject: [PATCH] DSS2: Small VRFB context allocation bug fixed
This is minor bug while requesting and mapping memory for
VRFB space.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 852abe5..44febef 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1193,6 +1193,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
if(!va) {
printk(KERN_ERR "vrfb: ioremap failed\n");
+ omap_vrfb_release_ctx(&rg->vrfb);
return -ENOMEM;
}
--
1.5.6.5

View File

@@ -0,0 +1,37 @@
From 370d1f93a32e8fcaeac5c16574417e354af21d08 Mon Sep 17 00:00:00 2001
From: Vaibhav Hiremath <hvaibhav@ti.com>
Date: Tue, 31 Mar 2009 18:38:31 +0530
Subject: [PATCH] DSS2: Allocated memory for Color Look-up-table
We were not allocating memory for CMAP buffer and due to that
G_CMAP was failing, since it does check for size of CMAP buffer.
Called "fb_alloc_cmap" for llocating memory for CMAP.
We are currently not supporting 1,2,4,8 bpp, so meaning less
for us as of now. But for completeness this is required.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 44febef..afe40a9 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1525,6 +1525,11 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
goto err;
set_fb_fix(fbi);
+
+ r = fb_alloc_cmap(&fbi->cmap, 256, 0);
+ if (r)
+ dev_err(fbdev->dev, "unable to allocate color map memory\n");
+
err:
return r;
}
--
1.5.6.5

View File

@@ -0,0 +1,65 @@
From 9c93bcab724b5935d745604773ed43825efefd87 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 13:47:11 +0300
Subject: [PATCH] DSS2: Fix DMA rotation
u16 was not a good type for offsets. First, they need to be signed,
and second, 16 bits is not enough.
---
drivers/video/omap2/dss/dispc.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ffb5648..6cea545 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -778,7 +778,7 @@ static void _dispc_set_vid_size(enum omap_plane plane, int width, int height)
dispc_write_reg(vsi_reg[plane-1], val);
}
-static void _dispc_set_pix_inc(enum omap_plane plane, u16 inc)
+static void _dispc_set_pix_inc(enum omap_plane plane, s32 inc)
{
const struct dispc_reg ri_reg[] = { DISPC_GFX_PIXEL_INC,
DISPC_VID_PIXEL_INC(0),
@@ -787,7 +787,7 @@ static void _dispc_set_pix_inc(enum omap_plane plane, u16 inc)
dispc_write_reg(ri_reg[plane], inc);
}
-static void _dispc_set_row_inc(enum omap_plane plane, u16 inc)
+static void _dispc_set_row_inc(enum omap_plane plane, s32 inc)
{
const struct dispc_reg ri_reg[] = { DISPC_GFX_ROW_INC,
DISPC_VID_ROW_INC(0),
@@ -1123,7 +1123,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
}
}
-static int pixinc(int pixels, u8 ps)
+static s32 pixinc(int pixels, u8 ps)
{
if (pixels == 1)
return 1;
@@ -1140,7 +1140,7 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
u16 width, u16 height,
enum omap_color_mode color_mode, bool fieldmode,
unsigned *offset0, unsigned *offset1,
- u16 *row_inc, u16 *pix_inc)
+ s32 *row_inc, s32 *pix_inc)
{
u8 ps;
u16 fbw, fbh;
@@ -1298,8 +1298,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
bool fieldmode = 0;
int cconv = 0;
unsigned offset0, offset1;
- u16 row_inc;
- u16 pix_inc;
+ s32 row_inc;
+ s32 pix_inc;
if (plane == OMAP_DSS_GFX) {
if (width != out_width || height != out_height)
--
1.5.6.5

View File

@@ -0,0 +1,41 @@
From 360a55ddd309e3a45b227a4a905ae7120dd16169 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 14:21:12 +0300
Subject: [PATCH] DSS2: Verify that overlay paddr != 0
---
drivers/video/omap2/dss/dispc.c | 3 +++
drivers/video/omap2/dss/overlay.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 6cea545..2480a03 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1301,6 +1301,9 @@ static int _dispc_setup_plane(enum omap_plane plane,
s32 row_inc;
s32 pix_inc;
+ if (paddr == 0)
+ return -EINVAL;
+
if (plane == OMAP_DSS_GFX) {
if (width != out_width || height != out_height)
return -EINVAL;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 968edbe..9209acf 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -331,6 +331,9 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
int r;
struct omap_overlay_info old_info;
+ if (info->paddr == 0)
+ return -EINVAL;
+
old_info = ovl->info;
ovl->info = *info;
--
1.5.6.5

View File

@@ -0,0 +1,51 @@
From 832b763db235da8e62f7b6ab02bcb8ad6bcb7a01 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 16:48:41 +0300
Subject: [PATCH] DSS2: Add function to get DSS logic clock rate
---
drivers/video/omap2/dss/dispc.c | 15 +++++++++++++++
drivers/video/omap2/dss/dss.h | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 2480a03..1bc23f7 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1850,6 +1850,21 @@ unsigned long dispc_fclk_rate(void)
return r;
}
+unsigned long dispc_lclk_rate(void)
+{
+ int lcd;
+ unsigned long r;
+ u32 l;
+
+ l = dispc_read_reg(DISPC_DIVISOR);
+
+ lcd = FLD_GET(l, 23, 16);
+
+ r = dispc_fclk_rate();
+
+ return r / lcd;
+}
+
unsigned long dispc_pclk_rate(void)
{
int lcd, pcd;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index bac5ece..0be42b6 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -294,6 +294,7 @@ bool dispc_trans_key_enabled(enum omap_channel ch);
void dispc_set_lcd_timings(struct omap_video_timings *timings);
unsigned long dispc_fclk_rate(void);
+unsigned long dispc_lclk_rate(void);
unsigned long dispc_pclk_rate(void);
void dispc_set_pol_freq(struct omap_panel *panel);
void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
--
1.5.6.5

View File

@@ -0,0 +1,68 @@
From a5c235a6f0094494ae1fc1a1ba4728e0d33dfd3b Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 16:49:27 +0300
Subject: [PATCH] DSS2: DSI: calculate VP_CLK_RATIO properly
---
drivers/video/omap2/dss/dsi.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 4442931..aecb89d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1104,7 +1104,10 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
enable_clocks(1);
dsi_enable_pll_clock(1);
- /* configure dispc fck and pixel clock to something sane */
+ /* XXX this should be calculated depending on the screen size,
+ * required framerate and DSI speed.
+ * For now 48MHz is enough for 864x480@60 with 360Mbps/lane
+ * with two lanes */
r = dispc_calc_clock_div(1, 48 * 1000 * 1000, &cinfo);
if (r)
goto err0;
@@ -1119,7 +1122,7 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
if (r)
goto err0;
- /* PLL does not come out of reset without this... */
+ /* XXX PLL does not come out of reset without this... */
dispc_pck_free_enable(1);
if (wait_for_bit_change(DSI_PLL_STATUS, 0, 1) != 1) {
@@ -1128,8 +1131,8 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
goto err1;
}
- /* ... but if left on, we get problems when planes do not
- * fill the whole display. No idea about this XXX */
+ /* XXX ... but if left on, we get problems when planes do not
+ * fill the whole display. No idea about this */
dispc_pck_free_enable(0);
if (enable_hsclk && enable_hsdiv)
@@ -2214,6 +2217,7 @@ static int dsi_proto_config(struct omap_display *display)
{
u32 r;
int buswidth = 0;
+ int div;
dsi_config_tx_fifo(DSI_FIFO_SIZE_128,
DSI_FIFO_SIZE_0,
@@ -2254,8 +2258,9 @@ static int dsi_proto_config(struct omap_display *display)
r = FLD_MOD(r, 1, 1, 1); /* CS_RX_EN */
r = FLD_MOD(r, 1, 2, 2); /* ECC_RX_EN */
r = FLD_MOD(r, 1, 3, 3); /* TX_FIFO_ARBITRATION */
- /* XXX what should the ratio be */
- r = FLD_MOD(r, 0, 4, 4); /* VP_CLK_RATIO, VP_PCLK = VP_CLK/2 */
+
+ div = dispc_lclk_rate() / dispc_pclk_rate();
+ r = FLD_MOD(r, div == 2 ? 0 : 1, 4, 4); /* VP_CLK_RATIO */
r = FLD_MOD(r, buswidth, 7, 6); /* VP_DATA_BUS_WIDTH */
r = FLD_MOD(r, 0, 8, 8); /* VP_CLK_POL */
r = FLD_MOD(r, 2, 13, 12); /* LINE_BUFFER, 2 lines */
--
1.5.6.5

View File

@@ -0,0 +1,58 @@
From 6b2c9d84c7accdfe1067fcdc8a00e50674aab4bb Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 17:42:26 +0300
Subject: [PATCH] DSS2: DSI: improve packet len calculation
---
drivers/video/omap2/dss/dsi.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index aecb89d..66ac6ea 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -2624,17 +2624,28 @@ static void dsi_update_screen_dispc(struct omap_display *display,
u16 x, u16 y, u16 w, u16 h)
{
int bytespp = 3;
+ int len;
int total_len;
- int line_packet_len;
+ int packet_payload;
+ int packet_len;
u32 l;
if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
x, y, w, h);
- /* TODO: one packet could be longer, I think? Max is the line buffer */
- line_packet_len = w * bytespp + 1; /* 1 byte for DCS cmd */
- total_len = line_packet_len * h;
+ len = w * h * bytespp;
+
+ /* XXX: one packet could be longer, I think? Line buffer is
+ * 1024 x 24bits, but we have to put DCS cmd there also.
+ * 1023 * 3 should work, but causes strange color effects. */
+ packet_payload = min(w, (u16)1020) * bytespp;
+
+ packet_len = packet_payload + 1; /* 1 byte for DCS cmd */
+ total_len = (len / packet_payload) * packet_len;
+
+ if (len % packet_payload)
+ total_len += (len % packet_payload) + 1;
display->ctrl->setup_update(display, x, y, w, h);
@@ -2646,7 +2657,7 @@ static void dsi_update_screen_dispc(struct omap_display *display,
l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
dsi_write_reg(DSI_VC_TE(1), l);
- dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, line_packet_len, 0);
+ dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
if (dsi.use_te)
l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
--
1.5.6.5

View File

@@ -0,0 +1,103 @@
From 85848d329ca3a2d6ee6841cdc11cc5951d187931 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Fri, 3 Apr 2009 19:09:20 +0200
Subject: [PATCH] DSS2: Disable video planes on sync lost error
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
When encountering the sync lost error disable the display and all video
planes on the affected manager. Afterwards re-enable the display.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 50 +++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1bc23f7..41734f3 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2518,29 +2518,79 @@ static void dispc_error_worker(struct work_struct *work)
}
if (errors & DISPC_IRQ_SYNC_LOST) {
+ struct omap_overlay_manager *manager = NULL;
+ bool enable = false;
+
DSSERR("SYNC_LOST, disabling LCD\n");
+
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
struct omap_overlay_manager *mgr;
mgr = omap_dss_get_overlay_manager(i);
if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
+ manager = mgr;
+ enable = mgr->display->state ==
+ OMAP_DSS_DISPLAY_ACTIVE;
mgr->display->disable(mgr->display);
break;
}
}
+
+ if (manager) {
+ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+ struct omap_overlay *ovl;
+ ovl = omap_dss_get_overlay(i);
+
+ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+ continue;
+
+ if (ovl->id != 0 && ovl->manager == manager)
+ dispc_enable_plane(ovl->id, 0);
+ }
+
+ dispc_go(manager->id);
+ mdelay(50);
+ if (enable)
+ manager->display->enable(manager->display);
+ }
}
if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
+ struct omap_overlay_manager *manager = NULL;
+ bool enable = false;
+
DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
+
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
struct omap_overlay_manager *mgr;
mgr = omap_dss_get_overlay_manager(i);
if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
+ manager = mgr;
+ enable = mgr->display->state ==
+ OMAP_DSS_DISPLAY_ACTIVE;
mgr->display->disable(mgr->display);
break;
}
}
+
+ if (manager) {
+ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+ struct omap_overlay *ovl;
+ ovl = omap_dss_get_overlay(i);
+
+ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+ continue;
+
+ if (ovl->id != 0 && ovl->manager == manager)
+ dispc_enable_plane(ovl->id, 0);
+ }
+
+ dispc_go(manager->id);
+ mdelay(50);
+ if (enable)
+ manager->display->enable(manager->display);
+ }
}
if (errors & DISPC_IRQ_OCP_ERR) {
--
1.5.6.5

View File

@@ -0,0 +1,40 @@
From 63e15ba8d5f95b13d3abf359da718537d769f112 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Tue, 7 Apr 2009 10:01:58 +0300
Subject: [PATCH] DSS2: check for ovl paddr only when enabling
It seems Xvideo uses SETUP_PLANE ioctl even when
the fb memory has not been allocated. Sigh.
---
drivers/video/omap2/dss/overlay.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 9209acf..c047206 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -281,6 +281,11 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
info = &ovl->info;
+ if (info->paddr == 0) {
+ DSSDBG("check_overlay failed: paddr 0\n");
+ return -EINVAL;
+ }
+
display->get_resolution(display, &dw, &dh);
DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
@@ -331,9 +336,6 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
int r;
struct omap_overlay_info old_info;
- if (info->paddr == 0)
- return -EINVAL;
-
old_info = ovl->info;
ovl->info = *info;
--
1.5.6.5

View File

@@ -0,0 +1,183 @@
From 67f3fc050ab4e2006d5b7ec6ec341896627181ab Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 6 Apr 2009 17:32:04 +0200
Subject: [PATCH] DSS2: Check fclk limits when configuring video planes
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Check that the currect functional clock is fast enough to support
the requested scaling ratios. Also check if 5-tap filtering can be
used even though the downscaling ratio is less than 1:2 since the
functional clock rate required for 5-tap filtering can be less than
the requirement for 3-tap filtering, and 5-tap filtering should look
better.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 104 ++++++++++++++++++++++++++++++++++++---
1 files changed, 97 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 41734f3..61861d8 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1026,11 +1026,11 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
static void _dispc_set_scaling(enum omap_plane plane,
u16 orig_width, u16 orig_height,
u16 out_width, u16 out_height,
- bool ilace)
+ bool ilace, bool five_taps)
{
int fir_hinc;
int fir_vinc;
- int hscaleup, vscaleup, five_taps;
+ int hscaleup, vscaleup;
int fieldmode = 0;
int accu0 = 0;
int accu1 = 0;
@@ -1040,7 +1040,6 @@ static void _dispc_set_scaling(enum omap_plane plane,
hscaleup = orig_width <= out_width;
vscaleup = orig_height <= out_height;
- five_taps = orig_height > out_height * 2;
_dispc_set_scale_coef(plane, hscaleup, vscaleup, five_taps);
@@ -1283,6 +1282,73 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
}
}
+static unsigned long calc_fclk_five_taps(u16 width, u16 height,
+ u16 out_width, u16 out_height, enum omap_color_mode color_mode)
+{
+ u32 fclk = 0;
+ /* FIXME venc pclk? */
+ u64 tmp, pclk = dispc_pclk_rate();
+
+ if (height > out_height) {
+ /* FIXME get real display PPL */
+ unsigned int ppl = 800;
+
+ tmp = pclk * height * out_width;
+ do_div(tmp, 2 * out_height * ppl);
+ fclk = tmp;
+
+ if (height > 2 * out_height) {
+ tmp = pclk * (height - 2 * out_height) * out_width;
+ do_div(tmp, 2 * out_height * (ppl - out_width));
+ fclk = max(fclk, (u32) tmp);
+ }
+ }
+
+ if (width > out_width) {
+ tmp = pclk * width;
+ do_div(tmp, out_width);
+ fclk = max(fclk, (u32) tmp);
+
+ if (color_mode == OMAP_DSS_COLOR_RGB24U)
+ fclk <<= 1;
+ }
+
+ return fclk;
+}
+
+static unsigned long calc_fclk(u16 width, u16 height,
+ u16 out_width, u16 out_height,
+ enum omap_color_mode color_mode, bool five_taps)
+{
+ unsigned int hf, vf;
+
+ if (five_taps)
+ return calc_fclk_five_taps(width, height,
+ out_width, out_height, color_mode);
+
+ /*
+ * FIXME how to determine the 'A' factor
+ * for the no downscaling case ?
+ */
+
+ if (width > 3 * out_width)
+ hf = 4;
+ else if (width > 2 * out_width)
+ hf = 3;
+ else if (width > out_width)
+ hf = 2;
+ else
+ hf = 1;
+
+ if (height > out_height)
+ vf = 2;
+ else
+ vf = 1;
+
+ /* FIXME venc pclk? */
+ return dispc_pclk_rate() * vf * hf;
+}
+
static int _dispc_setup_plane(enum omap_plane plane,
enum omap_channel channel_out,
u32 paddr, u16 screen_width,
@@ -1294,7 +1360,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
u8 rotation, int mirror)
{
const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
- bool five_taps = height > out_height * 2;
+ bool five_taps = 0;
bool fieldmode = 0;
int cconv = 0;
unsigned offset0, offset1;
@@ -1323,8 +1389,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
}
} else {
/* video plane */
- if (width > (2048 >> five_taps))
- return -EINVAL;
+
+ unsigned long fclk;
if (out_width < width / maxdownscale ||
out_width > width * 8)
@@ -1356,6 +1422,30 @@ static int _dispc_setup_plane(enum omap_plane plane,
default:
return -EINVAL;
}
+
+ /* Must use 5-tap filter? */
+ five_taps = height > out_height * 2;
+
+ /* Try to use 5-tap filter whenever possible. */
+ if (cpu_is_omap34xx() && !five_taps &&
+ height > out_height && width <= 1024) {
+ fclk = calc_fclk_five_taps(width, height,
+ out_width, out_height, color_mode);
+ if (fclk <= dispc_fclk_rate())
+ five_taps = true;
+ }
+
+ if (width > (2048 >> five_taps))
+ return -EINVAL;
+
+ fclk = calc_fclk(width, height, out_width, out_height,
+ color_mode, five_taps);
+
+ DSSDBG("required fclk rate = %lu Hz\n", fclk);
+ DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
+
+ if (fclk > dispc_fclk_rate())
+ return -EINVAL;
}
if (ilace && height >= out_height)
@@ -1399,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
if (plane != OMAP_DSS_GFX) {
_dispc_set_scaling(plane, width, height,
out_width, out_height,
- ilace);
+ ilace, five_taps);
_dispc_set_vid_size(plane, out_width, out_height);
_dispc_set_vid_color_conv(plane, cconv);
}
--
1.5.6.5

View File

@@ -0,0 +1,79 @@
From 9f8f1613253656f155b3844c8255a560f86e0acd Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 6 Apr 2009 17:32:05 +0200
Subject: [PATCH] DSS2: Check scaling limits against proper values
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Move the ilace and fieldmode related height adjustments to be performed
before checking the scaling limits.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 61861d8..ae7be3d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1366,10 +1366,25 @@ static int _dispc_setup_plane(enum omap_plane plane,
unsigned offset0, offset1;
s32 row_inc;
s32 pix_inc;
+ u16 frame_height = height;
if (paddr == 0)
return -EINVAL;
+ if (ilace && height >= out_height)
+ fieldmode = 1;
+
+ if (ilace) {
+ if (fieldmode)
+ height /= 2;
+ pos_y /= 2;
+ out_height /= 2;
+
+ DSSDBG("adjusting for ilace: height %d, pos_y %d, "
+ "out_height %d\n",
+ height, pos_y, out_height);
+ }
+
if (plane == OMAP_DSS_GFX) {
if (width != out_width || height != out_height)
return -EINVAL;
@@ -1448,28 +1463,14 @@ static int _dispc_setup_plane(enum omap_plane plane,
return -EINVAL;
}
- if (ilace && height >= out_height)
- fieldmode = 1;
-
calc_rotation_offset(rotation, mirror,
- screen_width, width, height, color_mode,
+ screen_width, width, frame_height, color_mode,
fieldmode,
&offset0, &offset1, &row_inc, &pix_inc);
DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
offset0, offset1, row_inc, pix_inc);
- if (ilace) {
- if (fieldmode)
- height /= 2;
- pos_y /= 2;
- out_height /= 2;
-
- DSSDBG("adjusting for ilace: height %d, pos_y %d, "
- "out_height %d\n",
- height, pos_y, out_height);
- }
-
_dispc_set_channel_out(plane, channel_out);
_dispc_set_color_mode(plane, color_mode);
--
1.5.6.5

View File

@@ -0,0 +1,96 @@
From c5e71be877e71c7df329205307e830f158c403bf Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 6 Apr 2009 17:32:06 +0200
Subject: [PATCH] DSS2: Add venc register dump
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Add a new file to debugfs to dump the VENC registers. The function
prototype was already there but the implementation was missing.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/venc.c | 55 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index aceed9f..b655df4 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -30,6 +30,7 @@
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/string.h>
+#include <linux/seq_file.h>
#include <mach/display.h>
#include <mach/cpu.h>
@@ -81,6 +82,7 @@
#define VENC_TVDETGP_INT_START_STOP_Y 0xB4
#define VENC_GEN_CTRL 0xB8
#define VENC_OUTPUT_CONTROL 0xC4
+#define VENC_OUTPUT_TEST 0xC8
#define VENC_DAC_B__DAC_C 0xC8
struct venc_config {
@@ -598,3 +600,56 @@ void venc_init_display(struct omap_display *display)
display->set_timings = venc_set_timings;
display->check_timings = venc_check_timings;
}
+
+void venc_dump_regs(struct seq_file *s)
+{
+#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))
+
+ venc_enable_clocks(1);
+
+ DUMPREG(VENC_F_CONTROL);
+ DUMPREG(VENC_VIDOUT_CTRL);
+ DUMPREG(VENC_SYNC_CTRL);
+ DUMPREG(VENC_LLEN);
+ DUMPREG(VENC_FLENS);
+ DUMPREG(VENC_HFLTR_CTRL);
+ DUMPREG(VENC_CC_CARR_WSS_CARR);
+ DUMPREG(VENC_C_PHASE);
+ DUMPREG(VENC_GAIN_U);
+ DUMPREG(VENC_GAIN_V);
+ DUMPREG(VENC_GAIN_Y);
+ DUMPREG(VENC_BLACK_LEVEL);
+ DUMPREG(VENC_BLANK_LEVEL);
+ DUMPREG(VENC_X_COLOR);
+ DUMPREG(VENC_M_CONTROL);
+ DUMPREG(VENC_BSTAMP_WSS_DATA);
+ DUMPREG(VENC_S_CARR);
+ DUMPREG(VENC_LINE21);
+ DUMPREG(VENC_LN_SEL);
+ DUMPREG(VENC_L21__WC_CTL);
+ DUMPREG(VENC_HTRIGGER_VTRIGGER);
+ DUMPREG(VENC_SAVID__EAVID);
+ DUMPREG(VENC_FLEN__FAL);
+ DUMPREG(VENC_LAL__PHASE_RESET);
+ DUMPREG(VENC_HS_INT_START_STOP_X);
+ DUMPREG(VENC_HS_EXT_START_STOP_X);
+ DUMPREG(VENC_VS_INT_START_X);
+ DUMPREG(VENC_VS_INT_STOP_X__VS_INT_START_Y);
+ DUMPREG(VENC_VS_INT_STOP_Y__VS_EXT_START_X);
+ DUMPREG(VENC_VS_EXT_STOP_X__VS_EXT_START_Y);
+ DUMPREG(VENC_VS_EXT_STOP_Y);
+ DUMPREG(VENC_AVID_START_STOP_X);
+ DUMPREG(VENC_AVID_START_STOP_Y);
+ DUMPREG(VENC_FID_INT_START_X__FID_INT_START_Y);
+ DUMPREG(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X);
+ DUMPREG(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y);
+ DUMPREG(VENC_TVDETGP_INT_START_STOP_X);
+ DUMPREG(VENC_TVDETGP_INT_START_STOP_Y);
+ DUMPREG(VENC_GEN_CTRL);
+ DUMPREG(VENC_OUTPUT_CONTROL);
+ DUMPREG(VENC_OUTPUT_TEST);
+
+ venc_enable_clocks(0);
+
+#undef DUMPREG
+}
--
1.5.6.5

View File

@@ -0,0 +1,27 @@
From facfd479bb6efad76eec1e74048cb7a31da7287d Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Mon, 6 Apr 2009 22:26:04 +0200
Subject: [PATCH] DSS2: FB: remove unused var warning
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index afe40a9..12ce0c3 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1246,7 +1246,9 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
display->get_resolution(display, &w, &h);
if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+#ifdef DEBUG
int oldw = w, oldh = h;
+#endif
omap_vrfb_adjust_size(&w, &h, bytespp);
--
1.5.6.5

View File

@@ -0,0 +1,214 @@
From c02b843c2732bc7b15a3e35b5dd715d68225bbd1 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Wed, 8 Apr 2009 12:51:46 +0200
Subject: [PATCH] DSS2: pass the default FB color format through board info
Add a field to the FB memory region platform data, so that board
init code can pass a default color format to the driver. Set this
format as an initial setting for the given FB.
This is needed for an upcoming patch that adds detection of the
color format set by the bootloader.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 121 +++++++++++++++++++++++++++---
drivers/video/omap2/omapfb/omapfb.h | 2 +
include/linux/omapfb.h | 5 +
3 files changed, 117 insertions(+), 11 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 12ce0c3..67c67c2 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -370,6 +370,21 @@ static enum omap_color_mode fb_mode_to_dss_mode(struct fb_var_screeninfo *var)
return -EINVAL;
}
+static int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
+ struct fb_var_screeninfo *var)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
+ struct omapfb_colormode *mode = &omapfb_colormodes[i];
+ if (dssmode == mode->dssmode) {
+ assign_colormode_to_var(var, mode);
+ return 0;
+ }
+ }
+ return -ENOENT;
+}
+
void set_fb_fix(struct fb_info *fbi)
{
struct fb_fix_screeninfo *fix = &fbi->fix;
@@ -1267,6 +1282,60 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
return omapfb_alloc_fbmem(fbi, size, paddr);
}
+static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format format)
+{
+ enum omap_color_mode mode;
+
+ switch (format) {
+ case OMAPFB_COLOR_RGB565:
+ mode = OMAP_DSS_COLOR_RGB16;
+ break;
+ case OMAPFB_COLOR_YUV422:
+ mode = OMAP_DSS_COLOR_YUV2;
+ break;
+ case OMAPFB_COLOR_CLUT_8BPP:
+ mode = OMAP_DSS_COLOR_CLUT8;
+ break;
+ case OMAPFB_COLOR_CLUT_4BPP:
+ mode = OMAP_DSS_COLOR_CLUT4;
+ break;
+ case OMAPFB_COLOR_CLUT_2BPP:
+ mode = OMAP_DSS_COLOR_CLUT2;
+ break;
+ case OMAPFB_COLOR_CLUT_1BPP:
+ mode = OMAP_DSS_COLOR_CLUT1;
+ break;
+ case OMAPFB_COLOR_RGB444:
+ mode = OMAP_DSS_COLOR_RGB12U;
+ break;
+ case OMAPFB_COLOR_YUY422:
+ mode = OMAP_DSS_COLOR_UYVY;
+ break;
+ case OMAPFB_COLOR_ARGB16:
+ mode = OMAP_DSS_COLOR_ARGB16;
+ break;
+ case OMAPFB_COLOR_RGB24U:
+ mode = OMAP_DSS_COLOR_RGB24U;
+ break;
+ case OMAPFB_COLOR_RGB24P:
+ mode = OMAP_DSS_COLOR_RGB24P;
+ break;
+ case OMAPFB_COLOR_ARGB32:
+ mode = OMAP_DSS_COLOR_ARGB32;
+ break;
+ case OMAPFB_COLOR_RGBA32:
+ mode = OMAP_DSS_COLOR_RGBA32;
+ break;
+ case OMAPFB_COLOR_RGBX32:
+ mode = OMAP_DSS_COLOR_RGBX32;
+ break;
+ default:
+ mode = -EINVAL;
+ }
+
+ return mode;
+}
+
static int omapfb_parse_vram_param(const char *param, int max_entries,
unsigned long *sizes, unsigned long *paddrs)
{
@@ -1483,9 +1552,36 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
}
var->nonstd = 0;
+ var->bits_per_pixel = 0;
var->rotate = ofbi->rotation;
+ /*
+ * Check if there is a default color format set in the board file,
+ * and use this format instead the default deducted from the
+ * display bpp.
+ */
+ if (fbdev->dev->platform_data) {
+ struct omapfb_platform_data *opd;
+ int id = ofbi->id;
+
+ opd = fbdev->dev->platform_data;
+ if (opd->mem_desc.region[id].format_used) {
+ enum omap_color_mode mode;
+ enum omapfb_color_format format;
+
+ format = opd->mem_desc.region[id].format;
+ mode = fb_format_to_dss_mode(format);
+ if (mode < 0) {
+ r = mode;
+ goto err;
+ }
+ r = dss_mode_to_fb_mode(mode, var);
+ if (r < 0)
+ goto err;
+ }
+ }
+
if (display) {
u16 w, h;
display->get_resolution(display, &w, &h);
@@ -1502,16 +1598,18 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
var->xres_virtual = var->xres;
var->yres_virtual = var->yres;
- switch (display->get_recommended_bpp(display)) {
- case 16:
- var->bits_per_pixel = 16;
- break;
- case 24:
- var->bits_per_pixel = 32;
- break;
- default:
- dev_err(fbdev->dev, "illegal display bpp\n");
- return -EINVAL;
+ if (!var->bits_per_pixel) {
+ switch (display->get_recommended_bpp(display)) {
+ case 16:
+ var->bits_per_pixel = 16;
+ break;
+ case 24:
+ var->bits_per_pixel = 32;
+ break;
+ default:
+ dev_err(fbdev->dev, "illegal display bpp\n");
+ return -EINVAL;
+ }
}
} else {
/* if there's no display, let's just guess some basic values */
@@ -1519,7 +1617,8 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
var->yres = 240;
var->xres_virtual = var->xres;
var->yres_virtual = var->yres;
- var->bits_per_pixel = 16;
+ if (!var->bits_per_pixel)
+ var->bits_per_pixel = 16;
}
r = check_fb_var(fbi, var);
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 65e9e6e..2607def 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -27,6 +27,8 @@
#define DEBUG
#endif
+#include <mach/display.h>
+
#ifdef DEBUG
extern unsigned int omapfb_debug;
#define DBG(format, ...) \
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index 96190b2..7a34f22 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -298,6 +298,11 @@ struct omapfb_mem_region {
void __iomem *vaddr;
unsigned long size;
u8 type; /* OMAPFB_PLANE_MEM_* */
+ enum omapfb_color_format format;/* OMAPFB_COLOR_* */
+ unsigned format_used:1; /* Must be set when format is set.
+ * Needed b/c of the badly chosen 0
+ * base for OMAPFB_COLOR_* values
+ */
unsigned alloc:1; /* allocated by the driver */
unsigned map:1; /* kernel mapped by the driver */
};
--
1.5.6.5

View File

@@ -0,0 +1,48 @@
From 2710416c43572652cb5355a5eaf68038c95659e8 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 9 Apr 2009 12:10:46 +0300
Subject: [PATCH] DSS2: Beagle: Use gpio_set_value
---
arch/arm/mach-omap2/board-omap3beagle.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index b67e7a5..8c1961d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -372,7 +372,7 @@ static struct platform_device keys_gpio = {
static int beagle_enable_dvi(struct omap_display *display)
{
if (display->hw_config.panel_reset_gpio != -1)
- gpio_direction_output(display->hw_config.panel_reset_gpio, 1);
+ gpio_set_value(display->hw_config.panel_reset_gpio, 1);
return 0;
}
@@ -380,7 +380,7 @@ static int beagle_enable_dvi(struct omap_display *display)
static void beagle_disable_dvi(struct omap_display *display)
{
if (display->hw_config.panel_reset_gpio != -1)
- gpio_direction_output(display->hw_config.panel_reset_gpio, 0);
+ gpio_set_value(display->hw_config.panel_reset_gpio, 0);
}
static struct omap_dss_display_config beagle_display_data_dvi = {
@@ -445,8 +445,12 @@ static void __init beagle_display_init(void)
int r;
r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
- if (r < 0)
+ if (r < 0) {
printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(beagle_display_data_dvi.panel_reset_gpio, 0);
}
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
--
1.5.6.5

View File

@@ -0,0 +1,28 @@
From 990f3160d33361c135ee72e91f202e05a8c378fc Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Mon, 13 Apr 2009 18:50:24 +0530
Subject: [PATCH] DSS2: VRFB: Macro for calculating base address of the VRFB context was faulty
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/vrfb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index 7e0f8fc..d68065f 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -16,8 +16,8 @@
#define SMS_ROT_VIRT_BASE(context, rot) \
(((context >= 4) ? 0xD0000000 : 0x70000000) \
- | 0x4000000 * (context) \
- | 0x1000000 * (rot))
+ + (0x4000000 * (context)) \
+ + (0x1000000 * (rot)))
#define OMAP_VRFB_SIZE (2048 * 2048 * 4)
--
1.5.6.5

View File

@@ -0,0 +1,78 @@
From a1e8018c0806a1a0579eda4b93b7d6764a2ff643 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 15 Apr 2009 14:06:54 +0300
Subject: [PATCH] DSS2: DSI: sidlemode to noidle while sending frame
DISPC interrupts are not wake-up capable. Smart-idle in DISPC_SIDLEMODE
causes DSS interface to go to idle at the end of the frame, and the
FRAMEDONE interrupt is then delayed until something wakes up the DSS
interface.
So we set SIDLEMODE to no-idle when we start sending the frame, and
set it back to smart-idle after receiving FRAMEDONE.
---
drivers/video/omap2/dss/dispc.c | 10 ++++++++++
drivers/video/omap2/dss/dsi.c | 4 ++++
drivers/video/omap2/dss/dss.h | 3 +++
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ae7be3d..16c68b8 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2791,6 +2791,16 @@ static void _omap_dispc_initialize_irq(void)
omap_dispc_set_irqs();
}
+void dispc_enable_sidle(void)
+{
+ REG_FLD_MOD(DISPC_SYSCONFIG, 2, 4, 3); /* SIDLEMODE: smart idle */
+}
+
+void dispc_disable_sidle(void)
+{
+ REG_FLD_MOD(DISPC_SYSCONFIG, 1, 4, 3); /* SIDLEMODE: no idle */
+}
+
static void _omap_dispc_initial_config(void)
{
u32 l;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 66ac6ea..50af925 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -2665,6 +2665,8 @@ static void dsi_update_screen_dispc(struct omap_display *display,
l = FLD_MOD(l, 1, 31, 31); /* TE_START */
dsi_write_reg(DSI_VC_TE(1), l);
+ dispc_disable_sidle();
+
dispc_enable_lcd_out(1);
if (dsi.use_te)
@@ -2678,6 +2680,8 @@ static void framedone_callback(void *data, u32 mask)
return;
}
+ dispc_enable_sidle();
+
dsi.framedone_scheduled = 1;
/* We get FRAMEDONE when DISPC has finished sending pixels and turns
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0be42b6..d0917a8 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -244,6 +244,9 @@ void dispc_fake_vsync_irq(void);
void dispc_save_context(void);
void dispc_restore_context(void);
+void dispc_enable_sidle(void);
+void dispc_disable_sidle(void);
+
void dispc_lcd_enable_signal_polarity(bool act_high);
void dispc_lcd_enable_signal(bool enable);
void dispc_pck_free_enable(bool enable);
--
1.5.6.5

View File

@@ -0,0 +1,324 @@
From 77e848eeba461e9b55b09d39fd0d640caea13e19 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 9 Apr 2009 12:09:44 +0530
Subject: [PATCH] DSS2: VRFB rotation and mirroring implemented.
DSS2 modified to accept the rotation_type input
to get the dma or VRFB rotation.
DSS2: VRFB: Changed to pass DSS mode to vrfb_setup instead of Bpp.
VRFB size registers requires the width to be halved when the
mode is YUV or UYVY. So modifed to pass the mode to omap_vrfb_setup
function.
Code added by Tim Yamin for few bug fixes
Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/include/mach/display.h | 6 ++
arch/arm/plat-omap/include/mach/vrfb.h | 3 +-
arch/arm/plat-omap/vrfb.c | 36 +++++++++-
drivers/video/omap2/dss/dispc.c | 109 +++++++++++++++++++++++++++--
drivers/video/omap2/dss/dss.h | 1 +
drivers/video/omap2/dss/manager.c | 1 +
6 files changed, 144 insertions(+), 12 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 6b702c7..b0a6272 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -341,6 +341,11 @@ enum omap_dss_overlay_managers {
struct omap_overlay_manager;
+enum omap_dss_rotation_type {
+ OMAP_DSS_ROT_DMA = 0,
+ OMAP_DSS_ROT_VRFB = 1,
+};
+
struct omap_overlay_info {
bool enabled;
@@ -351,6 +356,7 @@ struct omap_overlay_info {
u16 height;
enum omap_color_mode color_mode;
u8 rotation;
+ enum omap_dss_rotation_type rotation_type;
bool mirror;
u16 pos_x;
diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
index 2047862..12c7fab 100644
--- a/arch/arm/plat-omap/include/mach/vrfb.h
+++ b/arch/arm/plat-omap/include/mach/vrfb.h
@@ -24,6 +24,7 @@
#ifndef __VRFB_H
#define __VRFB_H
+#include <mach/display.h>
#define OMAP_VRFB_LINE_LEN 2048
struct vrfb
@@ -42,6 +43,6 @@ extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
u8 bytespp);
extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
u16 width, u16 height,
- u8 bytespp);
+ enum omap_color_mode color_mode);
#endif /* __VRFB_H */
diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index d68065f..2f08f6d 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -5,7 +5,6 @@
#include <mach/io.h>
#include <mach/vrfb.h>
-
/*#define DEBUG*/
#ifdef DEBUG
@@ -50,19 +49,48 @@ EXPORT_SYMBOL(omap_vrfb_adjust_size);
void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
u16 width, u16 height,
- u8 bytespp)
+ enum omap_color_mode color_mode)
{
unsigned pixel_size_exp;
u16 vrfb_width;
u16 vrfb_height;
u8 ctx = vrfb->context;
+ u8 bytespp;
DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
width, height, bytespp);
- if (bytespp == 4)
+ switch (color_mode) {
+ case OMAP_DSS_COLOR_RGB16:
+ case OMAP_DSS_COLOR_ARGB16:
+ bytespp = 2;
+ break;
+
+ case OMAP_DSS_COLOR_RGB24P:
+ bytespp = 3;
+ break;
+
+ case OMAP_DSS_COLOR_RGB24U:
+ case OMAP_DSS_COLOR_ARGB32:
+ case OMAP_DSS_COLOR_RGBA32:
+ case OMAP_DSS_COLOR_RGBX32:
+ case OMAP_DSS_COLOR_YUV2:
+ case OMAP_DSS_COLOR_UYVY:
+ bytespp = 4;
+ break;
+
+ default:
+ BUG();
+ return;
+ }
+
+ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+ color_mode == OMAP_DSS_COLOR_UYVY)
+ width >>= 1;
+
+ if (bytespp == 4) {
pixel_size_exp = 2;
- else if (bytespp == 2)
+ } else if (bytespp == 2)
pixel_size_exp = 1;
else
BUG();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 16c68b8..23a8155 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1106,7 +1106,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
case 0: vidrot = 0; break;
case 1: vidrot = 1; break;
case 2: vidrot = 2; break;
- case 3: vidrot = 1; break;
+ case 3: vidrot = 3; break;
}
}
@@ -1134,7 +1134,92 @@ static s32 pixinc(int pixels, u8 ps)
BUG();
}
-static void calc_rotation_offset(u8 rotation, bool mirror,
+static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ u16 screen_width,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode, bool fieldmode,
+ unsigned *offset0, unsigned *offset1,
+ s32 *row_inc, s32 *pix_inc)
+{
+ u8 ps;
+
+ switch (color_mode) {
+ case OMAP_DSS_COLOR_RGB16:
+ case OMAP_DSS_COLOR_ARGB16:
+ ps = 2;
+ break;
+
+ case OMAP_DSS_COLOR_RGB24P:
+ ps = 3;
+ break;
+
+ case OMAP_DSS_COLOR_RGB24U:
+ case OMAP_DSS_COLOR_ARGB32:
+ case OMAP_DSS_COLOR_RGBA32:
+ case OMAP_DSS_COLOR_RGBX32:
+ case OMAP_DSS_COLOR_YUV2:
+ case OMAP_DSS_COLOR_UYVY:
+ ps = 4;
+ break;
+
+ default:
+ BUG();
+ return;
+ }
+
+ DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
+ width, height);
+ switch (rotation + mirror * 4) {
+ case 0:
+ case 2:
+ /*
+ * If the pixel format is YUV or UYVY divide the width
+ * of the image by 2 for 0 and 180 degree rotation.
+ */
+ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+ color_mode == OMAP_DSS_COLOR_UYVY)
+ width = width >> 1;
+ case 1:
+ case 3:
+ *offset0 = 0;
+ if (fieldmode)
+ *offset1 = screen_width * ps;
+ else
+ *offset1 = 0;
+
+ *row_inc = pixinc(1 + (screen_width - width) +
+ (fieldmode ? screen_width : 0),
+ ps);
+ *pix_inc = pixinc(1, ps);
+ break;
+
+ case 4:
+ case 6:
+ /* If the pixel format is YUV or UYVY divide the width
+ * of the image by 2 for 0 degree and 180 degree
+ */
+ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+ color_mode == OMAP_DSS_COLOR_UYVY)
+ width = width >> 1;
+ case 5:
+ case 7:
+ *offset0 = 0;
+ if (fieldmode)
+ *offset1 = screen_width * ps;
+ else
+ *offset1 = 0;
+ *row_inc = pixinc(1 - (screen_width + width) -
+ (fieldmode ? screen_width : 0),
+ ps);
+ *pix_inc = pixinc(1, ps);
+ break;
+
+ default:
+ BUG();
+ }
+}
+
+static void calc_dma_rotation_offset(u8 rotation, bool mirror,
u16 screen_width,
u16 width, u16 height,
enum omap_color_mode color_mode, bool fieldmode,
@@ -1357,6 +1442,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
u16 out_width, u16 out_height,
enum omap_color_mode color_mode,
bool ilace,
+ enum omap_dss_rotation_type rotation_type,
u8 rotation, int mirror)
{
const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
@@ -1463,10 +1549,16 @@ static int _dispc_setup_plane(enum omap_plane plane,
return -EINVAL;
}
- calc_rotation_offset(rotation, mirror,
- screen_width, width, frame_height, color_mode,
- fieldmode,
- &offset0, &offset1, &row_inc, &pix_inc);
+ if (rotation_type == OMAP_DSS_ROT_DMA)
+ calc_dma_rotation_offset(rotation, mirror,
+ screen_width, width, frame_height, color_mode,
+ fieldmode,
+ &offset0, &offset1, &row_inc, &pix_inc);
+ else
+ calc_vrfb_rotation_offset(rotation, mirror,
+ screen_width, width, frame_height, color_mode,
+ fieldmode,
+ &offset0, &offset1, &row_inc, &pix_inc);
DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
offset0, offset1, row_inc, pix_inc);
@@ -2889,6 +2981,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
u16 out_width, u16 out_height,
enum omap_color_mode color_mode,
bool ilace,
+ enum omap_dss_rotation_type rotation_type,
u8 rotation, bool mirror)
{
int r = 0;
@@ -2909,6 +3002,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
width, height,
out_width, out_height,
color_mode, ilace,
+ rotation_type,
rotation, mirror);
enable_clocks(0);
@@ -3122,7 +3216,8 @@ void dispc_setup_partial_planes(struct omap_display *display,
pw, ph,
pow, poh,
pi->color_mode, 0,
- pi->rotation, // XXX rotation probably wrong
+ pi->rotation_type,
+ pi->rotation,
pi->mirror);
dispc_enable_plane(ovl->id, 1);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index d0917a8..584dce6 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -272,6 +272,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
u16 out_width, u16 out_height,
enum omap_color_mode color_mode,
bool ilace,
+ enum omap_dss_rotation_type rotation_type,
u8 rotation, bool mirror);
void dispc_go(enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index b0fee80..8ca0bbb 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -395,6 +395,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
outh,
ovl->info.color_mode,
ilace,
+ ovl->info.rotation_type,
ovl->info.rotation,
ovl->info.mirror);
--
1.5.6.5

View File

@@ -0,0 +1,236 @@
From c09f1a0642fd58a1b081594ea36dfd1bf71aec52 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 9 Apr 2009 12:13:07 +0530
Subject: [PATCH] DSS2: OMAPFB: Added support for the YUV VRFB rotation and mirroring.
DSS2 now requires roatation_type to be specified by driver.
Added support for that.
DSS2 OMAPFB: Modified to pass the dss mode to omap_vrfb_setup function.
VRFB size register requires the width to be halved when the
mode is YUV or UYVY. So VRFB is modifed to pass the mode to omap_vrfb_setup
function.
Few changes done by Tim Yamin
Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/vrfb.c | 4 +-
drivers/video/omap2/omapfb/omapfb-main.c | 59 ++++++++++++++----------------
drivers/video/omap2/omapfb/omapfb.h | 7 +---
3 files changed, 30 insertions(+), 40 deletions(-)
diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index 2f08f6d..2ae0d68 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -88,9 +88,9 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
color_mode == OMAP_DSS_COLOR_UYVY)
width >>= 1;
- if (bytespp == 4) {
+ if (bytespp == 4)
pixel_size_exp = 2;
- } else if (bytespp == 2)
+ else if (bytespp == 2)
pixel_size_exp = 1;
else
BUG();
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 67c67c2..57f5900 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -176,15 +176,9 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
{
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
- unsigned offset;
- int rot;
-
- rot = ofbi->rotation;
-
- offset = omapfb_get_vrfb_offset(ofbi, rot);
-
- return ofbi->region.vrfb.paddr[rot] + offset;
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ return ofbi->region.vrfb.paddr[ofbi->rotation]
+ + omapfb_get_vrfb_offset(ofbi, ofbi->rotation);
} else {
return ofbi->region.paddr;
}
@@ -192,7 +186,7 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
{
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
return ofbi->region.vrfb.paddr[0];
else
return ofbi->region.paddr;
@@ -200,7 +194,7 @@ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
{
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
return ofbi->region.vrfb.vaddr[0];
else
return ofbi->region.vaddr;
@@ -398,7 +392,7 @@ void set_fb_fix(struct fb_info *fbi)
fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
/* used by mmap in fbmem.c */
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
fix->line_length =
(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
else
@@ -434,11 +428,14 @@ void set_fb_fix(struct fb_info *fbi)
fix->xpanstep = 1;
fix->ypanstep = 1;
- if (rg->size) {
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
- omap_vrfb_setup(&rg->vrfb, rg->paddr,
- var->xres_virtual, var->yres_virtual,
- var->bits_per_pixel >> 3);
+ if (rg->size && ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ enum omap_color_mode mode = 0;
+ mode = fb_mode_to_dss_mode(var);
+
+ omap_vrfb_setup(&rg->vrfb, rg->paddr,
+ var->xres_virtual,
+ var->yres_virtual,
+ mode);
}
}
@@ -527,7 +524,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
if (var->yres > var->yres_virtual)
var->yres = var->yres_virtual;
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
line_size = OMAP_VRFB_LINE_LEN * bytespp;
else
line_size = var->xres_virtual * bytespp;
@@ -549,7 +546,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
if (line_size * var->yres_virtual > max_frame_size) {
DBG("can't fit FB into memory, reducing x\n");
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
return -EINVAL;
var->xres_virtual = max_frame_size / var->yres_virtual /
@@ -672,7 +669,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
struct omap_overlay_info info;
int xres, yres;
int screen_width;
- int rot, mirror;
+ int mirror;
DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
posx, posy, outw, outh);
@@ -688,7 +685,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
offset = ((var->yoffset * var->xres_virtual +
var->xoffset) * var->bits_per_pixel) >> 3;
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
data_start_p = omapfb_get_region_rot_paddr(ofbi);
data_start_v = NULL;
} else {
@@ -711,13 +708,10 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
ovl->get_overlay_info(ovl, &info);
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
- rot = 0;
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
mirror = 0;
- } else {
- rot = ofbi->rotation;
+ else
mirror = ofbi->mirror;
- }
info.paddr = data_start_p;
info.vaddr = data_start_v;
@@ -725,7 +719,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
info.width = xres;
info.height = yres;
info.color_mode = mode;
- info.rotation = rot;
+ info.rotation_type = ofbi->rotation_type;
+ info.rotation = ofbi->rotation;
info.mirror = mirror;
info.pos_x = posx;
@@ -1121,7 +1116,7 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
if (rg->vaddr)
iounmap(rg->vaddr);
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
/* unmap the 0 angle rotation */
if (rg->vrfb.vaddr[0]) {
iounmap(rg->vrfb.vaddr[0]);
@@ -1181,7 +1176,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
return -ENOMEM;
}
- if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
+ if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
vaddr = ioremap_wc(paddr, size);
if (!vaddr) {
@@ -1260,7 +1255,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
display->get_resolution(display, &w, &h);
- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
#ifdef DEBUG
int oldw = w, oldh = h;
#endif
@@ -1701,8 +1696,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
ofbi->id = i;
/* assign these early, so that fb alloc can use them */
- ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
- OMAPFB_ROT_DMA;
+ ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
+ OMAP_DSS_ROT_DMA;
ofbi->rotation = def_rotate;
ofbi->mirror = def_mirror;
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 2607def..43f6922 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -53,11 +53,6 @@ struct omapfb2_mem_region {
bool map; /* kernel mapped by the driver */
};
-enum omapfb_rotation_type {
- OMAPFB_ROT_DMA = 0,
- OMAPFB_ROT_VRFB = 1,
-};
-
/* appended to fb_info */
struct omapfb_info {
int id;
@@ -66,7 +61,7 @@ struct omapfb_info {
int num_overlays;
struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
struct omapfb2_device *fbdev;
- enum omapfb_rotation_type rotation_type;
+ enum omap_dss_rotation_type rotation_type;
u8 rotation;
bool mirror;
};
--
1.5.6.5

View File

@@ -0,0 +1,61 @@
From a8a37babe4856170f4cba86c425a8f21975d9e9e Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasm@roo.me.uk>
Date: Mon, 13 Apr 2009 13:57:42 -0700
Subject: [PATCH] DSS2: OMAPFB: Set line_length correctly for YUV with VRFB.
Signed-off-by: Tim Yamin <plasm@roo.me.uk>
---
drivers/video/omap2/omapfb/omapfb-main.c | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 57f5900..cd63740 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -392,10 +392,19 @@ void set_fb_fix(struct fb_info *fbi)
fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
/* used by mmap in fbmem.c */
- if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
- fix->line_length =
- (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
- else
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ switch (var->nonstd) {
+ case OMAPFB_COLOR_YUV422:
+ case OMAPFB_COLOR_YUY422:
+ fix->line_length =
+ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 2;
+ break;
+ default:
+ fix->line_length =
+ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
+ break;
+ }
+ } else
fix->line_length =
(var->xres_virtual * var->bits_per_pixel) >> 3;
fix->smem_start = omapfb_get_region_paddr(ofbi);
@@ -704,7 +713,18 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
goto err;
}
- screen_width = fix->line_length / (var->bits_per_pixel >> 3);
+ switch (var->nonstd) {
+ case OMAPFB_COLOR_YUV422:
+ case OMAPFB_COLOR_YUY422:
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ screen_width = fix->line_length
+ / (var->bits_per_pixel >> 2);
+ break;
+ }
+ default:
+ screen_width = fix->line_length / (var->bits_per_pixel >> 3);
+ break;
+ }
ovl->get_overlay_info(ovl, &info);
--
1.5.6.5

View File

@@ -0,0 +1,29 @@
From bda19b9359d9dc60f8b0beb5685e173e236ee30f Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Wed, 15 Apr 2009 17:05:18 +0530
Subject: [PATCH] DSS2: dispc_get_trans_key was returning wrong key type
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
drivers/video/omap2/dss/dispc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 23a8155..076d3d4 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1826,9 +1826,9 @@ void dispc_get_trans_key(enum omap_channel ch,
enable_clocks(1);
if (type) {
if (ch == OMAP_DSS_CHANNEL_LCD)
- *type = REG_GET(DISPC_CONFIG, 11, 11) >> 11;
+ *type = REG_GET(DISPC_CONFIG, 11, 11);
else if (ch == OMAP_DSS_CHANNEL_DIGIT)
- *type = REG_GET(DISPC_CONFIG, 13, 13) >> 13;
+ *type = REG_GET(DISPC_CONFIG, 13, 13);
else
BUG();
}
--
1.5.6.5

View File

@@ -0,0 +1,33 @@
From 30c40f5e6b1794430f678bf23d3319354321cab7 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Tue, 14 Apr 2009 14:50:11 +0200
Subject: [PATCH] DSS2: do bootmem reserve for exclusive access
BOOTMEM_DEFAULT would allow multiple reservations for the same location,
we need to reserve the region for our exclusive use. Also check if the
reserve succeeded.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
arch/arm/plat-omap/vram.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index f24a110..520f260 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -524,7 +524,10 @@ void __init omapfb_reserve_sdram(void)
return;
}
- reserve_bootmem(paddr, size, BOOTMEM_DEFAULT);
+ if (reserve_bootmem(paddr, size, BOOTMEM_EXCLUSIVE) < 0) {
+ pr_err("FB: failed to reserve VRAM\n");
+ return;
+ }
} else {
if (size > sdram_size) {
printk(KERN_ERR "Illegal SDRAM size for VRAM\n");
--
1.5.6.5

View File

@@ -0,0 +1,35 @@
From ed7a9223f6785be03951c55f3b0695b0d5635c80 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Thu, 9 Apr 2009 15:04:44 +0200
Subject: [PATCH] DSS2: Fix DISPC_VID_FIR value for omap34xx
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
The msbs of the DISPC_VID_FIR fields were incorrectly masked out on
omap34xx and thus 4:1 downscale did not work correctly.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 076d3d4..b8a3329 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -994,7 +994,10 @@ static void _dispc_set_fir(enum omap_plane plane, int hinc, int vinc)
BUG_ON(plane == OMAP_DSS_GFX);
- val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0);
+ if (cpu_is_omap24xx())
+ val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0);
+ else
+ val = FLD_VAL(vinc, 28, 16) | FLD_VAL(hinc, 12, 0);
dispc_write_reg(fir_reg[plane-1], val);
}
--
1.5.6.5

View File

@@ -0,0 +1,82 @@
From 5390230ed12585a79683733209db34e9130b8e3b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Thu, 9 Apr 2009 15:04:43 +0200
Subject: [PATCH] DSS2: Prefer 3-tap filter
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
The 5-tap filter seems rather unstable. With some scaling settings it
works and with some it doesn't even though the functional clock remains
within the TRM limits. So prefer the 3-tap filter unless the functional
clock required for it is too high.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b8a3329..b631dd8 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1405,15 +1405,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
}
static unsigned long calc_fclk(u16 width, u16 height,
- u16 out_width, u16 out_height,
- enum omap_color_mode color_mode, bool five_taps)
+ u16 out_width, u16 out_height)
{
unsigned int hf, vf;
- if (five_taps)
- return calc_fclk_five_taps(width, height,
- out_width, out_height, color_mode);
-
/*
* FIXME how to determine the 'A' factor
* for the no downscaling case ?
@@ -1494,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
} else {
/* video plane */
- unsigned long fclk;
+ unsigned long fclk = 0;
if (out_width < width / maxdownscale ||
out_width > width * 8)
@@ -1530,20 +1525,22 @@ static int _dispc_setup_plane(enum omap_plane plane,
/* Must use 5-tap filter? */
five_taps = height > out_height * 2;
- /* Try to use 5-tap filter whenever possible. */
- if (cpu_is_omap34xx() && !five_taps &&
- height > out_height && width <= 1024) {
- fclk = calc_fclk_five_taps(width, height,
- out_width, out_height, color_mode);
- if (fclk <= dispc_fclk_rate())
+ if (!five_taps) {
+ fclk = calc_fclk(width, height,
+ out_width, out_height);
+
+ /* Try 5-tap filter if 3-tap fclk is too high */
+ if (cpu_is_omap34xx() && height > out_height &&
+ fclk > dispc_fclk_rate())
five_taps = true;
}
if (width > (2048 >> five_taps))
return -EINVAL;
- fclk = calc_fclk(width, height, out_width, out_height,
- color_mode, five_taps);
+ if (five_taps)
+ fclk = calc_fclk_five_taps(width, height,
+ out_width, out_height, color_mode);
DSSDBG("required fclk rate = %lu Hz\n", fclk);
DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
--
1.5.6.5

View File

@@ -0,0 +1,135 @@
From 946eb774e95cdc2f2fa5cdc24aa69229f82814b8 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 16 Apr 2009 17:56:00 +0300
Subject: [PATCH] DSS2: VRAM: improve omap_vram_add_region()
Combine postponed and non-posponed versions of omap_vram_add_region.
Make the func non-static, so it can be called from board files.
---
arch/arm/plat-omap/include/mach/vram.h | 1 +
arch/arm/plat-omap/vram.c | 54 +++++++++++++------------------
2 files changed, 24 insertions(+), 31 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
index f176562..8639e08 100644
--- a/arch/arm/plat-omap/include/mach/vram.h
+++ b/arch/arm/plat-omap/include/mach/vram.h
@@ -24,6 +24,7 @@
#include <asm/types.h>
+extern int omap_vram_add_region(unsigned long paddr, size_t size);
extern int omap_vram_free(unsigned long paddr, size_t size);
extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
extern int omap_vram_reserve(unsigned long paddr, size_t size);
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index 520f260..8e9fe77 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -60,6 +60,7 @@
* time when we cannot yet allocate the region list */
#define MAX_POSTPONED_REGIONS 10
+static bool vram_initialized;
static int postponed_cnt __initdata;
static struct {
unsigned long paddr;
@@ -145,39 +146,32 @@ static void omap_vram_free_allocation(struct vram_alloc *va)
kfree(va);
}
-static __init int omap_vram_add_region_postponed(unsigned long paddr,
- size_t size)
-{
- if (postponed_cnt == MAX_POSTPONED_REGIONS)
- return -ENOMEM;
-
- postponed_regions[postponed_cnt].paddr = paddr;
- postponed_regions[postponed_cnt].size = size;
-
- ++postponed_cnt;
-
- return 0;
-}
-
-/* add/remove_region can be exported if there's need to add/remove regions
- * runtime */
-static int omap_vram_add_region(unsigned long paddr, size_t size)
+int omap_vram_add_region(unsigned long paddr, size_t size)
{
struct vram_region *rm;
unsigned pages;
- DBG("adding region paddr %08lx size %d\n",
- paddr, size);
+ if (vram_initialized) {
+ DBG("adding region paddr %08lx size %d\n",
+ paddr, size);
- size &= PAGE_MASK;
- pages = size >> PAGE_SHIFT;
+ size &= PAGE_MASK;
+ pages = size >> PAGE_SHIFT;
- rm = omap_vram_create_region(paddr, pages);
- if (rm == NULL)
- return -ENOMEM;
+ rm = omap_vram_create_region(paddr, pages);
+ if (rm == NULL)
+ return -ENOMEM;
+
+ list_add(&rm->list, &region_list);
+ } else {
+ if (postponed_cnt == MAX_POSTPONED_REGIONS)
+ return -ENOMEM;
- list_add(&rm->list, &region_list);
+ postponed_regions[postponed_cnt].paddr = paddr;
+ postponed_regions[postponed_cnt].size = size;
+ ++postponed_cnt;
+ }
return 0;
}
@@ -438,6 +432,8 @@ static __init int omap_vram_init(void)
{
int i, r;
+ vram_initialized = 1;
+
for (i = 0; i < postponed_cnt; i++)
omap_vram_add_region(postponed_regions[i].paddr,
postponed_regions[i].size);
@@ -472,10 +468,6 @@ static void __init omapfb_early_vram(char **p)
omapfb_def_sdram_vram_size = memparse(*p, p);
if (**p == ',')
omapfb_def_sdram_vram_start = simple_strtoul((*p) + 1, p, 16);
-
- printk("omapfb_early_vram, %d, 0x%x\n",
- omapfb_def_sdram_vram_size,
- omapfb_def_sdram_vram_start);
}
__early_param("vram=", omapfb_early_vram);
@@ -538,7 +530,7 @@ void __init omapfb_reserve_sdram(void)
BUG_ON(paddr & ~PAGE_MASK);
}
- omap_vram_add_region_postponed(paddr, size);
+ omap_vram_add_region(paddr, size);
pr_info("Reserving %u bytes SDRAM for VRAM\n", size);
}
@@ -594,7 +586,7 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
reserved = pend_avail - paddr;
size_avail = pend_avail - reserved - pstart_avail;
- omap_vram_add_region_postponed(paddr, size);
+ omap_vram_add_region(paddr, size);
if (reserved)
pr_info("Reserving %lu bytes SRAM for VRAM\n", reserved);
--
1.5.6.5

View File

@@ -0,0 +1,66 @@
From f825cafd5ee5c600218740507f85594c825b0c00 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 16 Apr 2009 18:47:49 +0530
Subject: [PATCH] DSS2: Added the function pointer for getting default color.
V4L2 Framework has a CID for getting/setting default color.
So added the function pointer for doing same.
SYSFS based getting the default color will remain same
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/include/mach/display.h | 1 +
drivers/video/omap2/dss/manager.c | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index b0a6272..073cdda 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -414,6 +414,7 @@ struct omap_overlay_manager {
int (*apply)(struct omap_overlay_manager *mgr);
void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
+ u32 (*get_default_color)(struct omap_overlay_manager *mgr);
void (*set_trans_key)(struct omap_overlay_manager *mgr,
enum omap_dss_color_key_type type,
u32 trans_key);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 8ca0bbb..12cf7b0 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -98,10 +98,8 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const cha
static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
char *buf)
{
- u32 default_color;
-
- default_color = dispc_get_default_color(mgr->id);
- return snprintf(buf, PAGE_SIZE, "%d", default_color);
+ return snprintf(buf, PAGE_SIZE, "%d",
+ mgr->get_default_color(mgr));
}
static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
@@ -470,6 +468,10 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
{
dispc_enable_trans_key(mgr->id, enable);
}
+static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
+{
+ return dispc_get_default_color(mgr->id);
+}
static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
{
@@ -512,6 +514,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
mgr->set_default_color = &omap_dss_mgr_set_def_color,
mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
+ mgr->get_default_color = &omap_dss_mgr_get_default_color;
mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
dss_overlay_setup_dispc_manager(mgr);
--
1.5.6.5

View File

@@ -0,0 +1,118 @@
From 6c56dc10226c84f41917ac2117b0e654fa080d40 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 16 Apr 2009 19:00:11 +0530
Subject: [PATCH] DSS2: Added support for setting and querying alpha blending.
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/include/mach/display.h | 3 +++
drivers/video/omap2/dss/dispc.c | 26 ++++++++++++++++++++++++++
drivers/video/omap2/dss/dss.h | 2 ++
drivers/video/omap2/dss/manager.c | 14 ++++++++++++++
4 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 073cdda..e1f615a 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -415,11 +415,14 @@ struct omap_overlay_manager {
void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
u32 (*get_default_color)(struct omap_overlay_manager *mgr);
+ bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
void (*set_trans_key)(struct omap_overlay_manager *mgr,
enum omap_dss_color_key_type type,
u32 trans_key);
void (*enable_trans_key)(struct omap_overlay_manager *mgr,
bool enable);
+ void (*enable_alpha_blending)(struct omap_overlay_manager *mgr,
+ bool enable);
};
enum omap_display_caps {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b631dd8..7e551c2 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1847,6 +1847,32 @@ void dispc_enable_trans_key(enum omap_channel ch, bool enable)
REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12);
enable_clocks(0);
}
+void dispc_enable_alpha_blending(enum omap_channel ch, bool enable)
+{
+ enable_clocks(1);
+ if (ch == OMAP_DSS_CHANNEL_LCD)
+ REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
+ else /* OMAP_DSS_CHANNEL_DIGIT */
+ REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
+ enable_clocks(0);
+}
+bool dispc_alpha_blending_enabled(enum omap_channel ch)
+{
+ bool enabled;
+
+ enable_clocks(1);
+ if (ch == OMAP_DSS_CHANNEL_LCD)
+ enabled = REG_GET(DISPC_CONFIG, 18, 18);
+ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
+ enabled = REG_GET(DISPC_CONFIG, 18, 18);
+ else
+ BUG();
+ enable_clocks(0);
+
+ return enabled;
+
+}
+
bool dispc_trans_key_enabled(enum omap_channel ch)
{
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 584dce6..1d01ff6 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -294,7 +294,9 @@ void dispc_get_trans_key(enum omap_channel ch,
enum omap_dss_color_key_type *type,
u32 *trans_key);
void dispc_enable_trans_key(enum omap_channel ch, bool enable);
+void dispc_enable_alpha_blending(enum omap_channel ch, bool enable);
bool dispc_trans_key_enabled(enum omap_channel ch);
+bool dispc_alpha_blending_enabled(enum omap_channel ch);
void dispc_set_lcd_timings(struct omap_video_timings *timings);
unsigned long dispc_fclk_rate(void);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 12cf7b0..90acd28 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -468,6 +468,16 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
{
dispc_enable_trans_key(mgr->id, enable);
}
+static void omap_dss_mgr_enable_alpha_blending(struct omap_overlay_manager *mgr,
+ bool enable)
+{
+ dispc_enable_alpha_blending(mgr->id, enable);
+}
+static bool omap_dss_mgr_get_alpha_blending_status(
+ struct omap_overlay_manager *mgr)
+{
+ return dispc_alpha_blending_enabled(mgr->id);
+}
static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
{
return dispc_get_default_color(mgr->id);
@@ -514,6 +524,10 @@ int dss_init_overlay_managers(struct platform_device *pdev)
mgr->set_default_color = &omap_dss_mgr_set_def_color,
mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
+ mgr->enable_alpha_blending =
+ &omap_dss_mgr_enable_alpha_blending;
+ mgr->get_alpha_blending_status =
+ omap_dss_mgr_get_alpha_blending_status;
mgr->get_default_color = &omap_dss_mgr_get_default_color;
mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
--
1.5.6.5

View File

@@ -0,0 +1,150 @@
From 2c9edd6af31a812a9487dd8bc12322e105a29f44 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Fri, 17 Apr 2009 09:42:36 +0530
Subject: [PATCH] DSS2: Added support for querying color keying.
V4L2 Framework has a ioctl for getting/setting color keying.
So added the function manager pointers for doing same.
Modifed the color keying sysfs entries to use manager
function pointer. Earlier they were calling direcly
dispc function to set/enable color keying.
Some of color-keying function pointers in the overlay_manager
structure re-named to be more specific.
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
arch/arm/plat-omap/include/mach/display.h | 6 ++++-
drivers/video/omap2/dss/manager.c | 36 +++++++++++++++++++++--------
2 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index e1f615a..d0b4c83 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -416,7 +416,11 @@ struct omap_overlay_manager {
void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
u32 (*get_default_color)(struct omap_overlay_manager *mgr);
bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
- void (*set_trans_key)(struct omap_overlay_manager *mgr,
+ bool (*get_trans_key_status)(struct omap_overlay_manager *mgr);
+ void (*get_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type *type,
+ u32 *trans_key);
+ void (*set_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
enum omap_dss_color_key_type type,
u32 trans_key);
void (*enable_trans_key)(struct omap_overlay_manager *mgr,
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 90acd28..e0501c4 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -124,7 +124,7 @@ static ssize_t manager_color_key_type_show(struct omap_overlay_manager *mgr,
{
enum omap_dss_color_key_type key_type;
- dispc_get_trans_key(mgr->id, &key_type, NULL);
+ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
BUG_ON(key_type >= ARRAY_SIZE(color_key_type_str));
return snprintf(buf, PAGE_SIZE, "%s\n", color_key_type_str[key_type]);
@@ -143,8 +143,8 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
}
if (key_type == ARRAY_SIZE(color_key_type_str))
return -EINVAL;
- dispc_get_trans_key(mgr->id, NULL, &key_value);
- dispc_set_trans_key(mgr->id, key_type, key_value);
+ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
return size;
}
@@ -154,7 +154,7 @@ static ssize_t manager_color_key_value_show(struct omap_overlay_manager *mgr,
{
u32 key_value;
- dispc_get_trans_key(mgr->id, NULL, &key_value);
+ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
return snprintf(buf, PAGE_SIZE, "%d\n", key_value);
}
@@ -167,8 +167,8 @@ static ssize_t manager_color_key_value_store(struct omap_overlay_manager *mgr,
if (sscanf(buf, "%d", &key_value) != 1)
return -EINVAL;
- dispc_get_trans_key(mgr->id, &key_type, NULL);
- dispc_set_trans_key(mgr->id, key_type, key_value);
+ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
return size;
}
@@ -177,7 +177,7 @@ static ssize_t manager_color_key_enabled_show(struct omap_overlay_manager *mgr,
char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n",
- dispc_trans_key_enabled(mgr->id));
+ mgr->get_trans_key_status(mgr));
}
static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
@@ -188,7 +188,7 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
if (sscanf(buf, "%d", &enable) != 1)
return -EINVAL;
- dispc_enable_trans_key(mgr->id, enable);
+ mgr->enable_trans_key(mgr, enable);
return size;
}
@@ -456,12 +456,20 @@ static void omap_dss_mgr_set_def_color(struct omap_overlay_manager *mgr,
dispc_set_default_color(mgr->id, color);
}
-static void omap_dss_mgr_set_trans_key(struct omap_overlay_manager *mgr,
+static void omap_dss_mgr_set_trans_key_type_and_value(
+ struct omap_overlay_manager *mgr,
enum omap_dss_color_key_type type,
u32 trans_key)
{
dispc_set_trans_key(mgr->id, type, trans_key);
}
+static void omap_dss_mgr_get_trans_key_type_and_value(
+ struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type *type,
+ u32 *trans_key)
+{
+ dispc_get_trans_key(mgr->id, type, trans_key);
+}
static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
bool enable)
@@ -482,6 +490,10 @@ static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
{
return dispc_get_default_color(mgr->id);
}
+static bool omap_dss_mgr_get_trans_key_status(struct omap_overlay_manager *mgr)
+{
+ return dispc_trans_key_enabled(mgr->id);
+}
static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
{
@@ -522,8 +534,12 @@ int dss_init_overlay_managers(struct platform_device *pdev)
mgr->unset_display = &omap_dss_unset_display,
mgr->apply = &omap_dss_mgr_apply,
mgr->set_default_color = &omap_dss_mgr_set_def_color,
- mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
+ mgr->set_trans_key_type_and_value =
+ &omap_dss_mgr_set_trans_key_type_and_value,
+ mgr->get_trans_key_type_and_value =
+ &omap_dss_mgr_get_trans_key_type_and_value,
mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
+ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status,
mgr->enable_alpha_blending =
&omap_dss_mgr_enable_alpha_blending;
mgr->get_alpha_blending_status =
--
1.5.6.5

View File

@@ -0,0 +1,56 @@
From 9e8877f0e5b17d3ddd101d6a63aa86fdb14d35d5 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Fri, 17 Apr 2009 09:51:25 +0530
Subject: [PATCH] DSS2:OMAPFB: Some color keying pointerd renamed in DSS2. Replicated in FB
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
drivers/video/omap2/omapfb/omapfb-ioctl.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 7f18d2a..79d8916 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -288,7 +288,8 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
{
enum omap_dss_color_key_type kt;
- if(!mgr->set_default_color || !mgr->set_trans_key ||
+ if (!mgr->set_default_color ||
+ !mgr->set_trans_key_type_and_value ||
!mgr->enable_trans_key)
return 0;
@@ -310,7 +311,7 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
}
mgr->set_default_color(mgr, ck->background);
- mgr->set_trans_key(mgr, kt, ck->trans_key);
+ mgr->set_trans_key_type_and_value(mgr, kt, ck->trans_key);
mgr->enable_trans_key(mgr, 1);
omapfb_color_keys[mgr->id] = *ck;
@@ -341,7 +342,8 @@ static int omapfb_set_color_key(struct fb_info *fbi,
goto err;
}
- if(!mgr->set_default_color || !mgr->set_trans_key ||
+ if (!mgr->set_default_color ||
+ !mgr->set_trans_key_type_and_value ||
!mgr->enable_trans_key) {
r = -ENODEV;
goto err;
@@ -377,7 +379,8 @@ static int omapfb_get_color_key(struct fb_info *fbi,
goto err;
}
- if(!mgr->set_default_color || !mgr->set_trans_key ||
+ if (!mgr->set_default_color ||
+ !mgr->set_trans_key_type_and_value ||
!mgr->enable_trans_key) {
r = -ENODEV;
goto err;
--
1.5.6.5

View File

@@ -0,0 +1,59 @@
From 6f1f0c7b19ecb468824b79f9d181ef0da41b7d7d Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Fri, 17 Apr 2009 13:58:21 +0530
Subject: [PATCH] DSS2: Add sysfs entry to for the alpha blending support.
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
drivers/video/omap2/dss/manager.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index e0501c4..7965a84 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -192,6 +192,22 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
return size;
}
+static ssize_t manager_alpha_blending_enabled_show(
+ struct omap_overlay_manager *mgr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+ mgr->get_alpha_blending_status(mgr));
+}
+static ssize_t manager_alpha_blending_enabled_store(
+ struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+{
+ int enable;
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+ mgr->enable_alpha_blending(mgr, enable);
+ return size;
+}
struct manager_attribute {
@@ -215,6 +231,10 @@ static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR,
manager_color_key_value_show, manager_color_key_value_store);
static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR,
manager_color_key_enabled_show, manager_color_key_enabled_store);
+static MANAGER_ATTR(alpha_blending_enabled, S_IRUGO|S_IWUSR,
+ manager_alpha_blending_enabled_show,
+ manager_alpha_blending_enabled_store);
+
static struct attribute *manager_sysfs_attrs[] = {
&manager_attr_name.attr,
@@ -223,6 +243,7 @@ static struct attribute *manager_sysfs_attrs[] = {
&manager_attr_color_key_type.attr,
&manager_attr_color_key_value.attr,
&manager_attr_color_key_enabled.attr,
+ &manager_attr_alpha_blending_enabled.attr,
NULL
};
--
1.5.6.5

View File

@@ -0,0 +1,97 @@
From a5129f272a48aa22629137c9c31e60eddb8c3f5d Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Fri, 17 Apr 2009 14:24:46 +0530
Subject: [PATCH] DSS2: Provided proper exclusion for destination color keying and alpha blending.
OMAP does not support destination color key and alpha blending
simultaneously. So this patch does not allow the user
so set both at a time.
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
drivers/video/omap2/dss/manager.c | 50 ++++++++++++++++++++++++++++++++++++-
1 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 7965a84..108489c 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -137,12 +137,26 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
u32 key_value;
for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
- key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
+ key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
if (sysfs_streq(buf, color_key_type_str[key_type]))
break;
}
if (key_type == ARRAY_SIZE(color_key_type_str))
return -EINVAL;
+ /* OMAP does not support destination color key and alpha blending
+ * simultaneously. So if alpha blending and color keying both are
+ * enabled then refrain from setting the color key type to
+ * gfx-destination
+ */
+ if (!key_type) {
+ bool color_key_enabled;
+ bool alpha_blending_enabled;
+ color_key_enabled = mgr->get_trans_key_status(mgr);
+ alpha_blending_enabled = mgr->get_alpha_blending_status(mgr);
+ if (color_key_enabled && alpha_blending_enabled)
+ return -EINVAL;
+ }
+
mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
@@ -188,6 +202,23 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
if (sscanf(buf, "%d", &enable) != 1)
return -EINVAL;
+ /* OMAP does not support destination color keying and
+ * alpha blending simultaneously. so if alpha blending
+ * is enabled refrain from enabling destination color
+ * keying.
+ */
+ if (enable) {
+ bool enabled;
+ enabled = mgr->get_alpha_blending_status(mgr);
+ if (enabled) {
+ enum omap_dss_color_key_type key_type;
+ mgr->get_trans_key_type_and_value(mgr,
+ &key_type, NULL);
+ if (!key_type)
+ return -EINVAL;
+ }
+
+ }
mgr->enable_trans_key(mgr, enable);
return size;
@@ -205,6 +236,23 @@ static ssize_t manager_alpha_blending_enabled_store(
int enable;
if (sscanf(buf, "%d", &enable) != 1)
return -EINVAL;
+ /* OMAP does not support destination color keying and
+ * alpha blending simultaneously. so if destination
+ * color keying is enabled refrain from enabling
+ * alpha blending
+ */
+ if (enable) {
+ bool enabled;
+ enabled = mgr->get_trans_key_status(mgr);
+ if (enabled) {
+ enum omap_dss_color_key_type key_type;
+ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+ if (!key_type)
+ return -EINVAL;
+
+ }
+
+ }
mgr->enable_alpha_blending(mgr, enable);
return size;
}
--
1.5.6.5

View File

@@ -0,0 +1,71 @@
From 9bcac9b9e678f476c83b5679b1215b6bc946130a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 20 Apr 2009 16:26:18 +0200
Subject: [PATCH] DSS2: Disable vertical offset with fieldmode
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
When using fieldmode each field is basically a separate picture so the
vertical filter should start at phase 0 for both fields.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7e551c2..f15614b 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1029,12 +1029,12 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
static void _dispc_set_scaling(enum omap_plane plane,
u16 orig_width, u16 orig_height,
u16 out_width, u16 out_height,
- bool ilace, bool five_taps)
+ bool ilace, bool five_taps,
+ bool fieldmode)
{
int fir_hinc;
int fir_vinc;
int hscaleup, vscaleup;
- int fieldmode = 0;
int accu0 = 0;
int accu1 = 0;
u32 l;
@@ -1072,17 +1072,12 @@ static void _dispc_set_scaling(enum omap_plane plane,
dispc_write_reg(dispc_reg_att[plane], l);
- if (ilace) {
- if (fieldmode) {
- accu0 = fir_vinc / 2;
- accu1 = 0;
- } else {
- accu0 = 0;
- accu1 = fir_vinc / 2;
- if (accu1 >= 1024/2) {
- accu0 = 1024/2;
- accu1 -= accu0;
- }
+ if (ilace && !fieldmode) {
+ accu0 = 0;
+ accu1 = fir_vinc / 2;
+ if (accu1 >= 1024/2) {
+ accu0 = 1024/2;
+ accu1 -= accu0;
}
}
@@ -1582,7 +1577,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
if (plane != OMAP_DSS_GFX) {
_dispc_set_scaling(plane, width, height,
out_width, out_height,
- ilace, five_taps);
+ ilace, five_taps, fieldmode);
_dispc_set_vid_size(plane, out_width, out_height);
_dispc_set_vid_color_conv(plane, cconv);
}
--
1.5.6.5

View File

@@ -0,0 +1,34 @@
From 9c6de0fed6e8a598d026d348533fdf731b737d55 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 20 Apr 2009 16:26:19 +0200
Subject: [PATCH] DSS2: Don't enable fieldmode automatically
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
The only case where enabling fieldmode automatically seems reasonable
is when source and destination heights are equal. Some kind of user
controllable knob should be added so the user could enable field mode
when the source is interlaced.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f15614b..1c036c1 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1450,7 +1450,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
if (paddr == 0)
return -EINVAL;
- if (ilace && height >= out_height)
+ if (ilace && height == out_height)
fieldmode = 1;
if (ilace) {
--
1.5.6.5

View File

@@ -0,0 +1,170 @@
From 35e88797e93b107ba602dee1e2ac8ea761dccd4b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
Date: Mon, 20 Apr 2009 16:26:20 +0200
Subject: [PATCH] DSS2: Swap field 0 and field 1 registers
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
The values for the registers which have alternate values for each field
were reveresed to what the hardware expects. For the hardware field 0
is the even field or the bottom field, field 1 is the odd field or the
top field. So simply swap the register values.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
drivers/video/omap2/dss/dispc.c | 66 ++++++++++++++++++++++-----------------
1 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1c036c1..9bab6cf 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1072,12 +1072,16 @@ static void _dispc_set_scaling(enum omap_plane plane,
dispc_write_reg(dispc_reg_att[plane], l);
+ /*
+ * field 0 = even field = bottom field
+ * field 1 = odd field = top field
+ */
if (ilace && !fieldmode) {
- accu0 = 0;
- accu1 = fir_vinc / 2;
- if (accu1 >= 1024/2) {
- accu0 = 1024/2;
- accu1 -= accu0;
+ accu1 = 0;
+ accu0 = fir_vinc / 2;
+ if (accu0 >= 1024/2) {
+ accu1 = 1024/2;
+ accu0 -= accu1;
}
}
@@ -1266,34 +1270,38 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
fbh = width;
}
+ /*
+ * field 0 = even field = bottom field
+ * field 1 = odd field = top field
+ */
switch (rotation + mirror * 4) {
case 0:
- *offset0 = 0;
+ *offset1 = 0;
if (fieldmode)
- *offset1 = screen_width * ps;
+ *offset0 = screen_width * ps;
else
- *offset1 = 0;
+ *offset0 = 0;
*row_inc = pixinc(1 + (screen_width - fbw) +
(fieldmode ? screen_width : 0),
ps);
*pix_inc = pixinc(1, ps);
break;
case 1:
- *offset0 = screen_width * (fbh - 1) * ps;
+ *offset1 = screen_width * (fbh - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 + ps;
+ *offset0 = *offset1 + ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(screen_width * (fbh - 1) + 1 +
(fieldmode ? 1 : 0), ps);
*pix_inc = pixinc(-screen_width, ps);
break;
case 2:
- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 - screen_width * ps;
+ *offset0 = *offset1 - screen_width * ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(-1 -
(screen_width - fbw) -
(fieldmode ? screen_width : 0),
@@ -1301,11 +1309,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
*pix_inc = pixinc(-1, ps);
break;
case 3:
- *offset0 = (fbw - 1) * ps;
+ *offset1 = (fbw - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 - ps;
+ *offset0 = *offset1 - ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(-screen_width * (fbh - 1) - 1 -
(fieldmode ? 1 : 0), ps);
*pix_inc = pixinc(screen_width, ps);
@@ -1313,11 +1321,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
/* mirroring */
case 0 + 4:
- *offset0 = (fbw - 1) * ps;
+ *offset1 = (fbw - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 + screen_width * ps;
+ *offset0 = *offset1 + screen_width * ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(screen_width * 2 - 1 +
(fieldmode ? screen_width : 0),
ps);
@@ -1325,11 +1333,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
break;
case 1 + 4:
- *offset0 = 0;
+ *offset1 = 0;
if (fieldmode)
- *offset1 = *offset0 + screen_width * ps;
+ *offset0 = *offset1 + screen_width * ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(-screen_width * (fbh - 1) + 1 +
(fieldmode ? 1 : 0),
ps);
@@ -1337,11 +1345,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
break;
case 2 + 4:
- *offset0 = screen_width * (fbh - 1) * ps;
+ *offset1 = screen_width * (fbh - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 + screen_width * ps;
+ *offset0 = *offset1 + screen_width * ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(1 - screen_width * 2 -
(fieldmode ? screen_width : 0),
ps);
@@ -1349,11 +1357,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
break;
case 3 + 4:
- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
if (fieldmode)
- *offset1 = *offset0 + screen_width * ps;
+ *offset0 = *offset1 + screen_width * ps;
else
- *offset1 = *offset0;
+ *offset0 = *offset1;
*row_inc = pixinc(screen_width * (fbh - 1) - 1 -
(fieldmode ? 1 : 0),
ps);
--
1.5.6.5

View File

@@ -0,0 +1,76 @@
From a9b3500bd14609750a2337e866e1df62627c1bac Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Mon, 20 Apr 2009 14:55:33 +0200
Subject: [PATCH] DSS2: add sysfs entry for seting the rotate type
This can help in utilizing VRAM memory better. Since with VRFB rotation
we waste a lot of physical memory due to the VRFB HW design, provide the
possibility to turn it off and free the extra memory for the use by other
planes for example.
---
drivers/video/omap2/omapfb/omapfb-sysfs.c | 42 ++++++++++++++++++++++++++++-
1 files changed, 41 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 2c88718..4e3da42 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -43,6 +43,46 @@ static ssize_t show_rotate_type(struct device *dev,
return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->rotation_type);
}
+static ssize_t store_rotate_type(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+ enum omap_dss_rotation_type rot_type;
+ int r;
+
+ rot_type = simple_strtoul(buf, NULL, 0);
+
+ if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
+ return -EINVAL;
+
+ omapfb_lock(fbdev);
+
+ r = 0;
+ if (rot_type == ofbi->rotation_type)
+ goto out;
+
+ r = -EBUSY;
+ if (ofbi->region.size)
+ goto out;
+
+ ofbi->rotation_type = rot_type;
+
+ /*
+ * Since the VRAM for this FB is not allocated at the moment we don't need to
+ * do any further parameter checking at this point.
+ */
+
+ r = count;
+out:
+ omapfb_unlock(fbdev);
+
+ return r;
+}
+
+
static ssize_t show_mirror(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -327,7 +367,7 @@ static ssize_t show_virt(struct device *dev,
}
static struct device_attribute omapfb_attrs[] = {
- __ATTR(rotate_type, S_IRUGO, show_rotate_type, NULL),
+ __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, store_rotate_type),
__ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror),
__ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size),
__ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays),
--
1.5.6.5

View File

@@ -0,0 +1,48 @@
From b0e081456a9b094109c04467d041ff693843ca47 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Tue, 21 Apr 2009 09:25:16 +0300
Subject: [PATCH] DSS2: Fixed line endings from , to ;
---
drivers/video/omap2/dss/manager.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 108489c..bf059e0 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -599,22 +599,22 @@ int dss_init_overlay_managers(struct platform_device *pdev)
break;
}
- mgr->set_display = &omap_dss_set_display,
- mgr->unset_display = &omap_dss_unset_display,
- mgr->apply = &omap_dss_mgr_apply,
- mgr->set_default_color = &omap_dss_mgr_set_def_color,
+ mgr->set_display = &omap_dss_set_display;
+ mgr->unset_display = &omap_dss_unset_display;
+ mgr->apply = &omap_dss_mgr_apply;
+ mgr->set_default_color = &omap_dss_mgr_set_def_color;
mgr->set_trans_key_type_and_value =
- &omap_dss_mgr_set_trans_key_type_and_value,
+ &omap_dss_mgr_set_trans_key_type_and_value;
mgr->get_trans_key_type_and_value =
- &omap_dss_mgr_get_trans_key_type_and_value,
- mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
- mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status,
+ &omap_dss_mgr_get_trans_key_type_and_value;
+ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key;
+ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status;
mgr->enable_alpha_blending =
&omap_dss_mgr_enable_alpha_blending;
mgr->get_alpha_blending_status =
omap_dss_mgr_get_alpha_blending_status;
mgr->get_default_color = &omap_dss_mgr_get_default_color;
- mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
+ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
dss_overlay_setup_dispc_manager(mgr);
--
1.5.6.5

View File

@@ -0,0 +1,26 @@
From 0f88992b2681aed4f31dc7dd3926b357bbc95154 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Tue, 21 Apr 2009 10:11:55 +0300
Subject: [PATCH] DSS2: DSI: decrease sync timeout from 60s to 2s
The framedone-problem should be ok now, so we shouldn't get long waits.
---
drivers/video/omap2/dss/dsi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 50af925..d59ad38 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3216,7 +3216,7 @@ static void dsi_push_set_mirror(struct omap_display *display, int mirror)
static int dsi_wait_sync(struct omap_display *display)
{
- long wait = msecs_to_jiffies(60000);
+ long wait = msecs_to_jiffies(2000);
struct completion compl;
DSSDBGF("");
--
1.5.6.5

View File

@@ -0,0 +1,44 @@
From 7ddd5eaa7bc345c3719d613a46a95b7e8052ad2c Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Tue, 21 Apr 2009 15:18:36 +0200
Subject: [PATCH] DSS2: fix return value for rotate_type sysfs function
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
drivers/video/omap2/omapfb/omapfb-sysfs.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 4e3da42..13028ae 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -64,9 +64,10 @@ static ssize_t store_rotate_type(struct device *dev,
if (rot_type == ofbi->rotation_type)
goto out;
- r = -EBUSY;
- if (ofbi->region.size)
+ if (ofbi->region.size) {
+ r = -EBUSY;
goto out;
+ }
ofbi->rotation_type = rot_type;
@@ -74,12 +75,10 @@ static ssize_t store_rotate_type(struct device *dev,
* Since the VRAM for this FB is not allocated at the moment we don't need to
* do any further parameter checking at this point.
*/
-
- r = count;
out:
omapfb_unlock(fbdev);
- return r;
+ return r ? r : count;
}
--
1.5.6.5

View File

@@ -0,0 +1,123 @@
From e34564db95627ad20e918b240c45e2bd5555f7e8 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 22 Apr 2009 10:06:08 +0300
Subject: [PATCH] OMAP2/3: DMA: implement trans copy and const fill
Implement transparent copy and constant fill features for OMAP2/3.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
arch/arm/plat-omap/dma.c | 81 +++++++++++++++++++++------------
arch/arm/plat-omap/include/mach/dma.h | 1 +
2 files changed, 52 insertions(+), 30 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 3fd0e77..060ac71 100755
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params);
void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
{
- u16 w;
-
BUG_ON(omap_dma_in_1510_mode());
- if (cpu_class_is_omap2()) {
- REVISIT_24XX();
- return;
- }
+ if (cpu_class_is_omap1()) {
+ u16 w;
- w = dma_read(CCR2(lch));
- w &= ~0x03;
+ w = dma_read(CCR2(lch));
+ w &= ~0x03;
- switch (mode) {
- case OMAP_DMA_CONSTANT_FILL:
- w |= 0x01;
- break;
- case OMAP_DMA_TRANSPARENT_COPY:
- w |= 0x02;
- break;
- case OMAP_DMA_COLOR_DIS:
- break;
- default:
- BUG();
+ switch (mode) {
+ case OMAP_DMA_CONSTANT_FILL:
+ w |= 0x01;
+ break;
+ case OMAP_DMA_TRANSPARENT_COPY:
+ w |= 0x02;
+ break;
+ case OMAP_DMA_COLOR_DIS:
+ break;
+ default:
+ BUG();
+ }
+ dma_write(w, CCR2(lch));
+
+ w = dma_read(LCH_CTRL(lch));
+ w &= ~0x0f;
+ /* Default is channel type 2D */
+ if (mode) {
+ dma_write((u16)color, COLOR_L(lch));
+ dma_write((u16)(color >> 16), COLOR_U(lch));
+ w |= 1; /* Channel type G */
+ }
+ dma_write(w, LCH_CTRL(lch));
}
- dma_write(w, CCR2(lch));
- w = dma_read(LCH_CTRL(lch));
- w &= ~0x0f;
- /* Default is channel type 2D */
- if (mode) {
- dma_write((u16)color, COLOR_L(lch));
- dma_write((u16)(color >> 16), COLOR_U(lch));
- w |= 1; /* Channel type G */
+ if (cpu_class_is_omap2()) {
+ u32 val;
+
+ val = dma_read(CCR(lch));
+ val &= ~((1 << 17) | (1 << 16));
+
+ switch (mode) {
+ case OMAP_DMA_CONSTANT_FILL:
+ val |= 1 << 16;
+ break;
+ case OMAP_DMA_TRANSPARENT_COPY:
+ val |= 1 << 17;
+ break;
+ case OMAP_DMA_COLOR_DIS:
+ break;
+ default:
+ BUG();
+ }
+ dma_write(val, CCR(lch));
+
+ color &= 0xffffff;
+ dma_write(color, COLOR(lch));
}
- dma_write(w, LCH_CTRL(lch));
}
EXPORT_SYMBOL(omap_set_dma_color_mode);
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 224b077..4e34f47 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -144,6 +144,7 @@
#define OMAP_DMA4_CSSA_U(n) 0
#define OMAP_DMA4_CDSA_L(n) 0
#define OMAP_DMA4_CDSA_U(n) 0
+#define OMAP1_DMA_COLOR(n) 0
/*----------------------------------------------------------------------------*/
--
1.5.6.5

View File

@@ -0,0 +1,101 @@
From 02034cc79f69512a6037f03ad1243c28f59fdd8a Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 22 Apr 2009 10:25:20 +0300
Subject: [PATCH] DSS2: VRAM: clear allocated area with DMA
Use DMA constant fill feature to clear VRAM area when
someone allocates it.
---
arch/arm/plat-omap/vram.c | 57 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index 8e9fe77..90276ac 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -31,11 +31,13 @@
#include <linux/seq_file.h>
#include <linux/bootmem.h>
#include <linux/omapfb.h>
+#include <linux/completion.h>
#include <asm/setup.h>
#include <mach/sram.h>
#include <mach/vram.h>
+#include <mach/dma.h>
#ifdef DEBUG
#define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__)
@@ -276,6 +278,59 @@ int omap_vram_reserve(unsigned long paddr, size_t size)
}
EXPORT_SYMBOL(omap_vram_reserve);
+static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data)
+{
+ struct completion *compl = data;
+ complete(compl);
+}
+
+static int _omap_vram_clear(u32 paddr, unsigned pages)
+{
+ struct completion compl;
+ unsigned elem_count;
+ unsigned frame_count;
+ int r;
+ int lch;
+
+ init_completion(&compl);
+
+ r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA",
+ _omap_vram_dma_cb,
+ &compl, &lch);
+ if (r) {
+ pr_err("VRAM: request_dma failed for memory clear\n");
+ return -EBUSY;
+ }
+
+ elem_count = pages * PAGE_SIZE / 4;
+ frame_count = 1;
+
+ omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32,
+ elem_count, frame_count,
+ OMAP_DMA_SYNC_ELEMENT,
+ 0, 0);
+
+ omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC,
+ paddr, 0, 0);
+
+ omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000);
+
+ omap_start_dma(lch);
+
+ if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) {
+ omap_stop_dma(lch);
+ pr_err("VRAM: dma timeout while clearing memory\n");
+ r = -EIO;
+ goto err;
+ }
+
+ r = 0;
+err:
+ omap_free_dma(lch);
+
+ return r;
+}
+
static int _omap_vram_alloc(int mtype, unsigned pages, unsigned long *paddr)
{
struct vram_region *rm;
@@ -313,6 +368,8 @@ found:
*paddr = start;
+ _omap_vram_clear(start, pages);
+
return 0;
}
--
1.5.6.5

View File

@@ -0,0 +1,53 @@
From 07482193cccdfe9ede1f47d72790dfbe54343505 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 22 Apr 2009 10:26:06 +0300
Subject: [PATCH] DSS2: OMAPFB: remove fb clearing code
VRAM manager does the clearing now when the area is allocated.
---
drivers/video/omap2/omapfb/omapfb-main.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index cd63740..76e7c6c 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1174,7 +1174,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
struct omapfb2_mem_region *rg;
void __iomem *vaddr;
int r;
- int clear = 0;
rg = &ofbi->region;
memset(rg, 0, sizeof(*rg));
@@ -1184,7 +1183,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
if (!paddr) {
DBG("allocating %lu bytes for fb %d\n", size, ofbi->id);
r = omap_vram_alloc(OMAPFB_MEMTYPE_SDRAM, size, &paddr);
- clear = 1;
} else {
DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr,
ofbi->id);
@@ -1206,9 +1204,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
}
DBG("allocated VRAM paddr %lx, vaddr %p\n", paddr, vaddr);
-
- if (clear)
- memset_io(vaddr, 0, size);
} else {
void __iomem *va;
@@ -1232,9 +1227,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
rg->vrfb.vaddr[0] = va;
vaddr = NULL;
-
- if (clear)
- memset_io(va, 0, size);
}
rg->paddr = paddr;
--
1.5.6.5

View File

@@ -0,0 +1,170 @@
From b47aef28536f3c276d232c41cd3084c69389dca4 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 22 Apr 2009 14:11:52 +0300
Subject: [PATCH] DSS2: VRAM: use debugfs, not procfs
---
arch/arm/plat-omap/vram.c | 103 +++++++++++++++------------------------------
1 files changed, 34 insertions(+), 69 deletions(-)
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index 90276ac..e847579 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -27,11 +27,11 @@
#include <linux/mm.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
-#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/bootmem.h>
#include <linux/omapfb.h>
#include <linux/completion.h>
+#include <linux/debugfs.h>
#include <asm/setup.h>
@@ -398,88 +398,54 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr)
}
EXPORT_SYMBOL(omap_vram_alloc);
-#ifdef CONFIG_PROC_FS
-static void *r_next(struct seq_file *m, void *v, loff_t *pos)
-{
- struct list_head *l = v;
-
- (*pos)++;
-
- if (list_is_last(l, &region_list))
- return NULL;
-
- return l->next;
-}
-
-static void *r_start(struct seq_file *m, loff_t *pos)
-{
- loff_t p = *pos;
- struct list_head *l = &region_list;
-
- mutex_lock(&region_mutex);
-
- do {
- l = l->next;
- if (l == &region_list)
- return NULL;
- } while (p--);
-
- return l;
-}
-
-static void r_stop(struct seq_file *m, void *v)
-{
- mutex_unlock(&region_mutex);
-}
-
-static int r_show(struct seq_file *m, void *v)
+#if defined(CONFIG_DEBUG_FS)
+static int vram_debug_show(struct seq_file *s, void *unused)
{
struct vram_region *vr;
struct vram_alloc *va;
unsigned size;
- vr = list_entry(v, struct vram_region, list);
-
- size = vr->pages << PAGE_SHIFT;
-
- seq_printf(m, "%08lx-%08lx (%d bytes)\n",
- vr->paddr, vr->paddr + size - 1,
- size);
+ mutex_lock(&region_mutex);
- list_for_each_entry(va, &vr->alloc_list, list) {
- size = va->pages << PAGE_SHIFT;
- seq_printf(m, " %08lx-%08lx (%d bytes)\n",
- va->paddr, va->paddr + size - 1,
+ list_for_each_entry(vr, &region_list, list) {
+ size = vr->pages << PAGE_SHIFT;
+ seq_printf(s, "%08lx-%08lx (%d bytes)\n",
+ vr->paddr, vr->paddr + size - 1,
size);
- }
+ list_for_each_entry(va, &vr->alloc_list, list) {
+ size = va->pages << PAGE_SHIFT;
+ seq_printf(s, " %08lx-%08lx (%d bytes)\n",
+ va->paddr, va->paddr + size - 1,
+ size);
+ }
+ }
+ mutex_unlock(&region_mutex);
return 0;
}
-static const struct seq_operations resource_op = {
- .start = r_start,
- .next = r_next,
- .stop = r_stop,
- .show = r_show,
-};
-
-static int vram_open(struct inode *inode, struct file *file)
+static int vram_debug_open(struct inode *inode, struct file *file)
{
- return seq_open(file, &resource_op);
+ return single_open(file, vram_debug_show, inode->i_private);
}
-static const struct file_operations proc_vram_operations = {
- .open = vram_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release,
+static const struct file_operations vram_debug_fops = {
+ .open = vram_debug_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
-static int __init omap_vram_create_proc(void)
+static int __init omap_vram_create_debugfs(void)
{
- proc_create("omap-vram", 0, NULL, &proc_vram_operations);
+ struct dentry *d;
+
+ d = debugfs_create_file("vram", S_IRUGO, NULL,
+ NULL, &vram_debug_fops);
+ if (IS_ERR(d))
+ return PTR_ERR(d);
return 0;
}
@@ -487,7 +453,7 @@ static int __init omap_vram_create_proc(void)
static __init int omap_vram_init(void)
{
- int i, r;
+ int i;
vram_initialized = 1;
@@ -495,10 +461,9 @@ static __init int omap_vram_init(void)
omap_vram_add_region(postponed_regions[i].paddr,
postponed_regions[i].size);
-#ifdef CONFIG_PROC_FS
- r = omap_vram_create_proc();
- if (r)
- return -ENOMEM;
+#ifdef CONFIG_DEBUG_FS
+ if (omap_vram_create_debugfs())
+ pr_err("VRAM: Failed to create debugfs file\n");
#endif
return 0;
--
1.5.6.5

View File

@@ -0,0 +1,34 @@
From 635fa66abe6e502c9b78b1dc66757bf67fd163e1 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Wed, 22 Apr 2009 14:40:48 +0200
Subject: [PATCH] DSS2: VRAM: fix section mismatch warning
postponed_regions are accessed from the non __init
omap_vram_add_region().
Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
arch/arm/plat-omap/vram.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index e847579..b126a64 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -63,11 +63,11 @@
#define MAX_POSTPONED_REGIONS 10
static bool vram_initialized;
-static int postponed_cnt __initdata;
+static int postponed_cnt;
static struct {
unsigned long paddr;
size_t size;
-} postponed_regions[MAX_POSTPONED_REGIONS] __initdata;
+} postponed_regions[MAX_POSTPONED_REGIONS];
struct vram_alloc {
struct list_head list;
--
1.5.6.5

View File

@@ -0,0 +1,41 @@
From c7ce3c5e9f7e28900b8ea9c3e1afe41dcdc0863d Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 23 Apr 2009 10:46:53 +0300
Subject: [PATCH] DSS2: disable LCD & DIGIT before resetting DSS
This seems to fix the synclost problem that we get, if the bootloader
starts the DSS and the kernel resets it.
---
drivers/video/omap2/dss/dss.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index adc1f34..aab9758 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -285,6 +285,11 @@ int dss_init(bool skip_init)
}
if (!skip_init) {
+ /* disable LCD and DIGIT output. This seems to fix the synclost
+ * problem that we get, if the bootloader starts the DSS and
+ * the kernel resets it */
+ omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
+
/* We need to wait here a bit, otherwise we sometimes start to
* get synclost errors, and after that only power cycle will
* restore DSS functionality. I have no idea why this happens.
@@ -294,10 +299,7 @@ int dss_init(bool skip_init)
msleep(50);
_omap_dss_reset();
-
}
- else
- printk("DSS SKIP RESET\n");
/* autoidle */
REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
--
1.5.6.5