summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2010-02-10 13:26:05 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2010-02-11 11:40:29 +0100
commit3d74b70a416ce424d55659d77df7b1eb17f56de7 (patch)
tree2a43a199cb4c7acbeab52b6e308f40a6c6d65544 /recipes
parent0128a20973f6dc22bbb180b6b4736c3bbf390890 (diff)
linux-openmoko-2.6.32: bump revision and update gdrm-2.6.32 patches
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes')
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0001-wm8753-fix-build-with-gcc-4.4.2-which-works-ok-with-.patch11
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0002-DRM-for-platform-devices.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0001-DRM-for-platform-devices.patch)30
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0003-Glamo-DRM-and-KMS-driver.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0002-Glamo-DRM-and-KMS-driver.patch)92
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0004-Work-on-Glamo-core-for-DRM.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0003-Work-on-Glamo-core-for-DRM.patch)101
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0005-Add-JBT6k74-hook-for-use-by-KMS.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0004-Add-JBT6k74-hook-for-use-by-KMS.patch)12
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0006-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0001-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch)10
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0007-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch (renamed from recipes/linux/linux-openmoko-2.6.32/0002-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch)10
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0008-Fix-crash-when-reading-Glamo-registers-via-sysfs.patch38
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0009-A-couple-of-GEM-refcounting-fixes.patch42
-rw-r--r--recipes/linux/linux-openmoko-2.6.32_git.bb2
10 files changed, 159 insertions, 189 deletions
diff --git a/recipes/linux/linux-openmoko-2.6.32/0001-wm8753-fix-build-with-gcc-4.4.2-which-works-ok-with-.patch b/recipes/linux/linux-openmoko-2.6.32/0001-wm8753-fix-build-with-gcc-4.4.2-which-works-ok-with-.patch
index c6b989f997..c6a16ab4d5 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0001-wm8753-fix-build-with-gcc-4.4.2-which-works-ok-with-.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0001-wm8753-fix-build-with-gcc-4.4.2-which-works-ok-with-.patch
@@ -1,17 +1,18 @@
-From 63b619f9466dc36648d082dc4e4fad714a343d80 Mon Sep 17 00:00:00 2001
+From b3b22a8f23e6b49d21bbfe70f278a0d79419e3df Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sat, 7 Nov 2009 20:33:06 +0100
-Subject: [PATCH 1/5] wm8753: fix build with gcc-4.4.2, which works ok with 4.1.2
+Subject: [PATCH 1/9] wm8753: fix build with gcc-4.4.2, which works ok with 4.1.2
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
sound/soc/codecs/wm8753.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
-index d80d414..1e685b2 100644
+index 5ad677c..e148406 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
-@@ -709,7 +709,9 @@ static void pll_factors(struct _pll_div *pll_div, unsigned int target,
+@@ -710,7 +710,9 @@ static void pll_factors(struct _pll_div *pll_div, unsigned int target,
Nmod = target % source;
Kpart = FIXED_PLL_SIZE * (long long)Nmod;
@@ -23,5 +24,5 @@ index d80d414..1e685b2 100644
K = Kpart & 0xFFFFFFFF;
--
-1.6.5.2
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0001-DRM-for-platform-devices.patch b/recipes/linux/linux-openmoko-2.6.32/0002-DRM-for-platform-devices.patch
index 2c9b611165..4e47a088d0 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0001-DRM-for-platform-devices.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0002-DRM-for-platform-devices.patch
@@ -1,7 +1,7 @@
-From da270cf61e67d912b38e314719511efc4c2ea085 Mon Sep 17 00:00:00 2001
+From 660570997a5c998aaecc94798b6ea8d60b0da053 Mon Sep 17 00:00:00 2001
From: Thomas White <taw@bitwiz.org.uk>
Date: Tue, 20 Oct 2009 15:52:30 +0200
-Subject: [PATCH 1/4] DRM for platform devices
+Subject: [PATCH 2/9] DRM for platform devices
This modifies the DRM core in a small number of places to allow platform
devices to be used for direct rendering, alongside PCI devices.
@@ -19,7 +19,7 @@ Signed-off-by: Thomas White <taw@bitwiz.org.uk>
8 files changed, 224 insertions(+), 47 deletions(-)
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
-index 39b393d..cef3d2c 100644
+index 96eddd1..8b050ad 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -6,7 +6,7 @@
@@ -32,7 +32,7 @@ index 39b393d..cef3d2c 100644
select I2C_ALGOBIT
help
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
-index 6246e3f..b9f15bf 100644
+index 8417cc4..5a3b203 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -188,7 +188,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
@@ -45,7 +45,7 @@ index 6246e3f..b9f15bf 100644
map->offset < virt_to_phys(high_memory)) {
kfree(map);
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index b39d7bf..a7861e8 100644
+index a75ca63..26005d9 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -247,6 +247,7 @@ int drm_lastclose(struct drm_device * dev)
@@ -285,7 +285,7 @@ index 9b9ff46..133ef29 100644
return 0;
}
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
-index 55bb8a8..a7069ad 100644
+index 55bb8a8..5e3d65a 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -230,8 +230,10 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
@@ -325,7 +325,7 @@ index 55bb8a8..a7069ad 100644
+ int ret;
+ DRM_DEBUG("\n");
+
-+ dev = kmalloc(sizeof(*dev), GFP_KERNEL);
++ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ if (!dev)
+ return -ENOMEM;
+ dev->dev_private = priv;
@@ -379,10 +379,10 @@ index 55bb8a8..a7069ad 100644
*
* \param sec_minor - structure to be released
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
-index f7a615b..fea2b71 100644
+index 7e42b7e..c08e7b7 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
-@@ -482,7 +482,11 @@ int drm_sysfs_device_add(struct drm_minor *minor)
+@@ -486,7 +486,11 @@ int drm_sysfs_device_add(struct drm_minor *minor)
int err;
char *minor_str;
@@ -396,7 +396,7 @@ index f7a615b..fea2b71 100644
minor->kdev.release = drm_sysfs_device_release;
minor->kdev.devt = minor->device;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 45b67d9..66253f9 100644
+index 7ad3faa..1d9a229 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -55,6 +55,7 @@
@@ -407,7 +407,7 @@ index 45b67d9..66253f9 100644
#if defined(__alpha__) || defined(__powerpc__)
#include <asm/pgtable.h> /* For pte_wrprotect */
#endif
-@@ -113,6 +114,7 @@ extern void drm_ut_debug_printk(unsigned int request_level,
+@@ -143,6 +144,7 @@ extern void drm_ut_debug_printk(unsigned int request_level,
#define DRIVER_IRQ_VBL2 0x800
#define DRIVER_GEM 0x1000
#define DRIVER_MODESET 0x2000
@@ -415,7 +415,7 @@ index 45b67d9..66253f9 100644
/***********************************************************************/
/** \name Begin the DRM... */
-@@ -981,6 +983,7 @@ struct drm_device {
+@@ -1008,6 +1010,7 @@ struct drm_device {
wait_queue_head_t buf_writers; /**< Processes waiting to ctx switch */
struct drm_agp_head *agp; /**< AGP data */
@@ -423,7 +423,7 @@ index 45b67d9..66253f9 100644
struct pci_dev *pdev; /**< PCI device structure */
int pci_vendor; /**< PCI vendor id */
-@@ -1091,12 +1094,20 @@ static inline int drm_mtrr_del(int handle, unsigned long offset,
+@@ -1118,12 +1121,20 @@ static inline int drm_mtrr_del(int handle, unsigned long offset,
}
#endif
@@ -444,7 +444,7 @@ index 45b67d9..66253f9 100644
extern void drm_exit(struct drm_driver *driver);
extern int drm_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
-@@ -1314,6 +1325,8 @@ extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
+@@ -1342,6 +1353,8 @@ extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
struct drm_master *drm_master_create(struct drm_minor *minor);
extern struct drm_master *drm_master_get(struct drm_master *master);
@@ -454,5 +454,5 @@ index 45b67d9..66253f9 100644
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
struct drm_driver *driver);
--
-1.6.5.3
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0002-Glamo-DRM-and-KMS-driver.patch b/recipes/linux/linux-openmoko-2.6.32/0003-Glamo-DRM-and-KMS-driver.patch
index 4a837e9b08..6c1cc415d9 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0002-Glamo-DRM-and-KMS-driver.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0003-Glamo-DRM-and-KMS-driver.patch
@@ -1,31 +1,30 @@
-From 01435b6f8fba2031e6941756a6a4e42be553f4a0 Mon Sep 17 00:00:00 2001
+From eff70b6d14cc372944bbeda0dd0afe8599327f96 Mon Sep 17 00:00:00 2001
From: Thomas White <taw@bitwiz.org.uk>
Date: Tue, 20 Oct 2009 16:14:55 +0200
-Subject: [PATCH 2/4] Glamo DRM and KMS driver
+Subject: [PATCH 3/9] Glamo DRM and KMS driver
This adds the Glamo DRM and KMS driver, but not the modifications needed
elsewhere to support it.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
---
- drivers/gpu/drm/drm_stub.c | 2 +-
drivers/mfd/glamo/Kconfig | 15 +
drivers/mfd/glamo/Makefile | 5 +-
drivers/mfd/glamo/glamo-buffer.c | 372 ++++++++++++++
drivers/mfd/glamo/glamo-buffer.h | 60 +++
drivers/mfd/glamo/glamo-cmdq.c | 528 ++++++++++++++++++++
drivers/mfd/glamo/glamo-cmdq.h | 49 ++
- drivers/mfd/glamo/glamo-display.c | 875 +++++++++++++++++++++++++++++++++
+ drivers/mfd/glamo/glamo-display.c | 869 +++++++++++++++++++++++++++++++++
drivers/mfd/glamo/glamo-display.h | 39 ++
- drivers/mfd/glamo/glamo-drm-drv.c | 453 +++++++++++++++++
+ drivers/mfd/glamo/glamo-drm-drv.c | 444 +++++++++++++++++
drivers/mfd/glamo/glamo-drm-private.h | 156 ++++++
- drivers/mfd/glamo/glamo-fence.c | 329 +++++++++++++
- drivers/mfd/glamo/glamo-fence.h | 36 ++
+ drivers/mfd/glamo/glamo-fence.c | 330 +++++++++++++
+ drivers/mfd/glamo/glamo-fence.h | 34 ++
drivers/mfd/glamo/glamo-kms-fb.c | 540 ++++++++++++++++++++
drivers/mfd/glamo/glamo-kms-fb.h | 41 ++
include/drm/Kbuild | 1 +
include/drm/glamo_drm.h | 153 ++++++
- 17 files changed, 3652 insertions(+), 2 deletions(-)
+ 16 files changed, 3635 insertions(+), 1 deletions(-)
create mode 100644 drivers/mfd/glamo/glamo-buffer.c
create mode 100644 drivers/mfd/glamo/glamo-buffer.h
create mode 100644 drivers/mfd/glamo/glamo-cmdq.c
@@ -40,24 +39,11 @@ Signed-off-by: Thomas White <taw@bitwiz.org.uk>
create mode 100644 drivers/mfd/glamo/glamo-kms-fb.h
create mode 100644 include/drm/glamo_drm.h
-diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
-index a7069ad..5e3d65a 100644
---- a/drivers/gpu/drm/drm_stub.c
-+++ b/drivers/gpu/drm/drm_stub.c
-@@ -471,7 +471,7 @@ int drm_get_platform_dev(struct platform_device *pdev,
- int ret;
- DRM_DEBUG("\n");
-
-- dev = kmalloc(sizeof(*dev), GFP_KERNEL);
-+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
- if (!dev)
- return -ENOMEM;
- dev->dev_private = priv;
diff --git a/drivers/mfd/glamo/Kconfig b/drivers/mfd/glamo/Kconfig
-index 8c93bcb..375e5db 100644
+index 3aa4831..214c70e 100644
--- a/drivers/mfd/glamo/Kconfig
+++ b/drivers/mfd/glamo/Kconfig
-@@ -39,3 +39,18 @@ config MFD_GLAMO_MCI
+@@ -40,3 +40,18 @@ config MFD_GLAMO_MCI
neo1973 GTA-02.
If unsure, say N.
@@ -1130,10 +1116,10 @@ index 0000000..510d195
+#endif /* __GLAMO_CMDQ_H */
diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c
new file mode 100644
-index 0000000..93aa917
+index 0000000..34a665a
--- /dev/null
+++ b/drivers/mfd/glamo/glamo-display.c
-@@ -0,0 +1,875 @@
+@@ -0,0 +1,869 @@
+/*
+ * SMedia Glamo 336x/337x display
+ *
@@ -1967,12 +1953,6 @@ index 0000000..93aa917
+ glamo_run_lcd_script(gdrm, lcd_init_script,
+ ARRAY_SIZE(lcd_init_script));
+
-+ /* Enable pixel clock */
-+ glamo_engine_clkreg_set(gdrm->glamo_core,
-+ GLAMO_ENGINE_LCD,
-+ GLAMO_CLOCK_LCD_EN_DCLK,
-+ GLAMO_CLOCK_LCD_EN_DCLK);
-+
+ /* Restore timings */
+ glamo_lcd_cmd_mode(gdrm, 1);
+ glamo_engine_reclock(gdrm->glamo_core, GLAMO_ENGINE_LCD,
@@ -2056,10 +2036,10 @@ index 0000000..d6f21bc
+#endif /* __GLAMO_DISPLAY_H */
diff --git a/drivers/mfd/glamo/glamo-drm-drv.c b/drivers/mfd/glamo/glamo-drm-drv.c
new file mode 100644
-index 0000000..81215f4
+index 0000000..f30097e
--- /dev/null
+++ b/drivers/mfd/glamo/glamo-drm-drv.c
-@@ -0,0 +1,453 @@
+@@ -0,0 +1,444 @@
+/* Smedia Glamo 336x/337x Graphics Driver
+ *
+ * Copyright (C) 2009 Openmoko, Inc. Jorge Luis Zapata <turran@openmoko.com>
@@ -2379,12 +2359,6 @@ index 0000000..81215f4
+
+ /* Hook up IRQ handle for fence processing */
+ gdrm->twod_irq = platform_get_irq_byname(pdev, "glamo-2d-irq");
-+ rc = request_irq(gdrm->twod_irq, glamo_fence_irq_handler,
-+ IRQF_SHARED, pdev->name, gdrm);
-+ if ( rc ) {
-+ dev_err(&pdev->dev, "failed to register irq.\n");
-+ goto out_unmap_2d;
-+ }
+
+ gdrm->vram_size = GLAMO_FB_SIZE;
+ printk(KERN_INFO "[glamo-drm] %lli bytes of VRAM\n",
@@ -2395,8 +2369,6 @@ index 0000000..81215f4
+
+ return 0;
+
-+out_unmap_2d:
-+ iounmap(gdrm->twod_base);
+out_release_2d:
+ release_mem_region(gdrm->twod_regs->start,
+ resource_size(gdrm->twod_regs));
@@ -2445,7 +2417,6 @@ index 0000000..81215f4
+ release_mem_region(gdrm->cmdq->start, resource_size(gdrm->cmdq));
+
+ /* Release 2D engine */
-+ free_irq(gdrm->twod_irq, gdrm);
+ iounmap(gdrm->twod_base);
+ release_mem_region(gdrm->twod_regs->start,
+ resource_size(gdrm->twod_regs));
@@ -2677,10 +2648,10 @@ index 0000000..7949a2e
+#endif /* __GLAMO_DRMPRIV_H */
diff --git a/drivers/mfd/glamo/glamo-fence.c b/drivers/mfd/glamo/glamo-fence.c
new file mode 100644
-index 0000000..ab77241
+index 0000000..9119675
--- /dev/null
+++ b/drivers/mfd/glamo/glamo-fence.c
-@@ -0,0 +1,329 @@
+@@ -0,0 +1,330 @@
+/*
+ * SMedia Glamo 336x/337x fence objects
+ *
@@ -2781,7 +2752,7 @@ index 0000000..ab77241
+
+static void glamo_fence_enable(struct glamodrm_handle *gdrm)
+{
-+ glamo_enable_irq(gdrm->glamo_core, GLAMO_IRQ_2D);
++ enable_irq( GLAMO_IRQ_2D);
+}
+
+
@@ -2833,18 +2804,11 @@ index 0000000..ab77241
+}
+
+
-+irqreturn_t glamo_fence_irq_handler(unsigned int irq, void *data)
++static irqreturn_t glamo_fence_irq_handler(int irq, void *data)
+{
+ struct glamodrm_handle *gdrm = data;
-+
-+ if (!gdrm) {
-+ printk(KERN_ERR "[glamo-drm] 2D IRQ called with no data\n");
-+ return IRQ_NONE;
-+ }
-+ glamo_clear_irq(gdrm->glamo_core, GLAMO_IRQ_2D);
-+
++ if (!gdrm) return IRQ_NONE;
+ tasklet_schedule(&gdrm->fence_tl);
-+
+ return IRQ_HANDLED;
+}
+
@@ -2982,10 +2946,10 @@ index 0000000..ab77241
+void glamo_fence_init(struct glamodrm_handle *gdrm)
+{
+ unsigned long irq_flags;
++ int r;
+
+ if ( gdrm->twod_irq == 0 ) {
-+ printk(KERN_ERR "[glamo-drm] Attempted to initialise fence"
-+ " system before 2D IRQ registered\n");
++ printk(KERN_ERR "[glamo-drm] Don't know which IRQ to use!\n");
+ return;
+ }
+
@@ -3001,21 +2965,29 @@ index 0000000..ab77241
+
+ tasklet_init(&gdrm->fence_tl, glamo_fence_tl, (unsigned long)gdrm);
+
++ r = request_irq(gdrm->twod_irq, glamo_fence_irq_handler,
++ IRQF_SHARED, "glamo-fence", gdrm);
++ if ( r ) {
++ printk(KERN_ERR "[glamo-drm] Failed to register irq.\n");
++ return;
++ }
++
+ glamo_fence_enable(gdrm);
+}
+
+
+void glamo_fence_shutdown(struct glamodrm_handle *gdrm)
+{
++ free_irq(gdrm->twod_irq, gdrm);
+ wake_up_all(&gdrm->fence_queue);
+ tasklet_kill(&gdrm->fence_tl);
+}
diff --git a/drivers/mfd/glamo/glamo-fence.h b/drivers/mfd/glamo/glamo-fence.h
new file mode 100644
-index 0000000..948fae3
+index 0000000..deda995
--- /dev/null
+++ b/drivers/mfd/glamo/glamo-fence.h
-@@ -0,0 +1,36 @@
+@@ -0,0 +1,34 @@
+/*
+ * SMedia Glamo 336x/337x fence objects
+ *
@@ -3043,8 +3015,6 @@ index 0000000..948fae3
+
+#include "glamo-drm-private.h"
+
-+extern void glamo_fence_irq_handler(unsigned int irq, struct irq_desc *desc);
-+
+extern void glamo_fence_init(struct glamodrm_handle *gdrm);
+extern void glamo_fence_shutdown(struct glamodrm_handle *gdrm);
+
@@ -3814,5 +3784,5 @@ index 0000000..4c194dc
+
+#endif
--
-1.6.5.3
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0003-Work-on-Glamo-core-for-DRM.patch b/recipes/linux/linux-openmoko-2.6.32/0004-Work-on-Glamo-core-for-DRM.patch
index 76223ed136..2bddd1758a 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0003-Work-on-Glamo-core-for-DRM.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0004-Work-on-Glamo-core-for-DRM.patch
@@ -1,21 +1,21 @@
-From 50c9919c9bc7d3e1db72dcbdd62d73efad409720 Mon Sep 17 00:00:00 2001
+From eb0614d6a8a879bd3ac69050b3f5b012ef562b9e Mon Sep 17 00:00:00 2001
From: Thomas White <taw@bitwiz.org.uk>
Date: Tue, 17 Nov 2009 23:45:29 +0100
-Subject: [PATCH 3/4] Work on Glamo-core for DRM
+Subject: [PATCH 4/9] Work on Glamo-core for DRM
This adds modifications to the core of the Glamo driver to expose functionality
to support DRM and KMS.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
---
- drivers/mfd/glamo/glamo-core.c | 85 +++++++++++++++++++++++++++++++++++++---
- drivers/mfd/glamo/glamo-core.h | 45 ++++++++++++++++-----
- drivers/mfd/glamo/glamo-regs.h | 24 +++++++++++
- include/linux/mfd/glamo.h | 7 +--
- 4 files changed, 140 insertions(+), 21 deletions(-)
+ drivers/mfd/glamo/glamo-core.c | 33 +++++++++++++++++++++++++++------
+ drivers/mfd/glamo/glamo-core.h | 35 +++++++++++++++++++++++++----------
+ drivers/mfd/glamo/glamo-regs.h | 24 ++++++++++++++++++++++++
+ include/linux/mfd/glamo.h | 7 ++-----
+ 4 files changed, 78 insertions(+), 21 deletions(-)
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
-index e0e3940..32aeff1 100644
+index 82a906a..a614d44 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -221,10 +221,31 @@ static struct resource glamo_fb_resources[] = {
@@ -66,74 +66,8 @@ index e0e3940..32aeff1 100644
.flags = IORESOURCE_MEM
}, {
.start = GLAMO_IRQ_MMC,
-@@ -354,6 +375,24 @@ static void glamo_irq_demux_handler(unsigned int irq, struct irq_desc *desc)
- sysfs
- */
-
-+void glamo_clear_irq(struct glamo_core *glamo, unsigned int irq)
-+{
-+ /* set interrupt source */
-+ __reg_write(glamo, GLAMO_REG_IRQ_CLEAR, irq);
-+}
-+
-+
-+void glamo_enable_irq(struct glamo_core *glamo, unsigned int irq)
-+{
-+ u_int16_t tmp;
-+
-+ /* set bit in enable register */
-+ tmp = __reg_read(glamo, GLAMO_REG_IRQ_ENABLE);
-+ tmp |= irq;
-+ __reg_write(glamo, GLAMO_REG_IRQ_ENABLE, tmp);
-+}
-+
-+
- static ssize_t regs_write(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
- {
-@@ -579,6 +618,40 @@ int glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine)
- }
- EXPORT_SYMBOL_GPL(glamo_engine_disable);
-
-+
-+static const u_int16_t engine_clock_regs[__NUM_GLAMO_ENGINES] = {
-+ [GLAMO_ENGINE_LCD] = GLAMO_REG_CLOCK_LCD,
-+ [GLAMO_ENGINE_MMC] = GLAMO_REG_CLOCK_MMC,
-+ [GLAMO_ENGINE_ISP] = GLAMO_REG_CLOCK_ISP,
-+ [GLAMO_ENGINE_JPEG] = GLAMO_REG_CLOCK_JPEG,
-+ [GLAMO_ENGINE_3D] = GLAMO_REG_CLOCK_3D,
-+ [GLAMO_ENGINE_2D] = GLAMO_REG_CLOCK_2D,
-+ [GLAMO_ENGINE_MPEG_ENC] = GLAMO_REG_CLOCK_MPEG,
-+ [GLAMO_ENGINE_MPEG_DEC] = GLAMO_REG_CLOCK_MPEG,
-+};
-+
-+void glamo_engine_clkreg_set(struct glamo_core *glamo,
-+ enum glamo_engine engine,
-+ u_int16_t mask, u_int16_t val)
-+{
-+ reg_set_bit_mask(glamo, engine_clock_regs[engine], mask, val);
-+}
-+EXPORT_SYMBOL_GPL(glamo_engine_clkreg_set);
-+
-+u_int16_t glamo_engine_clkreg_get(struct glamo_core *glamo,
-+ enum glamo_engine engine)
-+{
-+ u_int16_t val;
-+
-+ spin_lock(&glamo->lock);
-+ val = __reg_read(glamo, engine_clock_regs[engine]);
-+ spin_unlock(&glamo->lock);
-+
-+ return val;
-+}
-+EXPORT_SYMBOL_GPL(glamo_engine_clkreg_get);
-+
-+
- int __glamo_engine_suspend(struct glamo_core *glamo, enum glamo_engine engine)
- {
- int i;
diff --git a/drivers/mfd/glamo/glamo-core.h b/drivers/mfd/glamo/glamo-core.h
-index e5b1a35..ea6caa3 100644
+index 17017b0..d21bdc4 100644
--- a/drivers/mfd/glamo/glamo-core.h
+++ b/drivers/mfd/glamo/glamo-core.h
@@ -3,18 +3,33 @@
@@ -180,21 +114,6 @@ index e5b1a35..ea6caa3 100644
enum glamo_pll {
GLAMO_PLL1,
-@@ -57,4 +72,14 @@ void glamo_reg_read_batch(struct glamo_core *glamo, uint16_t reg,
- uint16_t count, uint16_t *values);
- void glamo_reg_write_batch(struct glamo_core *glamo, uint16_t reg,
- uint16_t count, uint16_t *values);
-+void glamo_engine_clkreg_set(struct glamo_core *glamo,
-+ enum glamo_engine engine,
-+ u_int16_t mask, u_int16_t val);
-+
-+extern void glamo_clear_irq(struct glamo_core *glamo, unsigned int irq);
-+extern void glamo_enable_irq(struct glamo_core *glamo, unsigned int irq);
-+
-+u_int16_t glamo_engine_clkreg_get(struct glamo_core *glamo,
-+ enum glamo_engine engine);
-+
- #endif /* __GLAMO_CORE_H */
diff --git a/drivers/mfd/glamo/glamo-regs.h b/drivers/mfd/glamo/glamo-regs.h
index 59848e1..8b2fd47 100644
--- a/drivers/mfd/glamo/glamo-regs.h
@@ -248,5 +167,5 @@ index 529d4f0..ea91a06 100644
+
#endif
--
-1.6.5.3
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0004-Add-JBT6k74-hook-for-use-by-KMS.patch b/recipes/linux/linux-openmoko-2.6.32/0005-Add-JBT6k74-hook-for-use-by-KMS.patch
index a223f5b7a9..744004e7b1 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0004-Add-JBT6k74-hook-for-use-by-KMS.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0005-Add-JBT6k74-hook-for-use-by-KMS.patch
@@ -1,7 +1,7 @@
-From 6035b76b940c71e30824921271e8c3da8047f869 Mon Sep 17 00:00:00 2001
+From 972c0a58e9e238c266adc77c88dcd8de6f123742 Mon Sep 17 00:00:00 2001
From: Thomas White <taw@bitwiz.org.uk>
Date: Sat, 21 Nov 2009 21:42:16 +0100
-Subject: [PATCH 4/4] Add JBT6k74 hook for use by KMS
+Subject: [PATCH 5/9] Add JBT6k74 hook for use by KMS
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
---
@@ -9,10 +9,10 @@ Signed-off-by: Thomas White <taw@bitwiz.org.uk>
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/jbt6k74.c b/drivers/video/backlight/jbt6k74.c
-index b1aacb7..b9d02f2 100644
+index 8450904..95ca4cf 100644
--- a/drivers/video/backlight/jbt6k74.c
+++ b/drivers/video/backlight/jbt6k74.c
-@@ -688,6 +688,22 @@ static int jbt6k74_get_power(struct lcd_device *ld)
+@@ -698,6 +698,22 @@ static int jbt6k74_get_power(struct lcd_device *ld)
}
}
@@ -35,7 +35,7 @@ index b1aacb7..b9d02f2 100644
struct lcd_ops jbt6k74_lcd_ops = {
.set_power = jbt6k74_set_power,
.get_power = jbt6k74_get_power,
-@@ -718,6 +734,8 @@ static int __devinit jbt_probe(struct spi_device *spi)
+@@ -728,6 +744,8 @@ static int __devinit jbt_probe(struct spi_device *spi)
if (!jbt)
return -ENOMEM;
@@ -45,5 +45,5 @@ index b1aacb7..b9d02f2 100644
jbt->lcd_dev = lcd_device_register("jbt6k74-lcd", &spi->dev, jbt,
--
-1.6.5.3
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0001-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch b/recipes/linux/linux-openmoko-2.6.32/0006-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch
index d9afec8830..f685608253 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0001-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0006-glamo-drm-use-dev_set_drvdata-instead-of-setting-dri.patch
@@ -1,7 +1,7 @@
-From eadea0d7bda93fec0e2c7a3b675fc6ab21cdfe61 Mon Sep 17 00:00:00 2001
+From be2d944c2b29b19b4cee7c64b00bd75cf7209724 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 22 Dec 2009 16:11:27 +0100
-Subject: [PATCH 1/2] glamo-drm: use dev_set_drvdata instead of setting driver_data directly
+Subject: [PATCH 6/9] glamo-drm: use dev_set_drvdata instead of setting driver_data directly
* driver_data is private since 2.6.32
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4028437876866aba4747a655ede00f892089e14
@@ -12,10 +12,10 @@ Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/glamo/glamo-drm-drv.c b/drivers/mfd/glamo/glamo-drm-drv.c
-index 81215f4..4352091 100644
+index f30097e..1907a47 100644
--- a/drivers/mfd/glamo/glamo-drm-drv.c
+++ b/drivers/mfd/glamo/glamo-drm-drv.c
-@@ -355,7 +355,7 @@ out_release_regs:
+@@ -347,7 +347,7 @@ out_release_regs:
release_mem_region(gdrm->reg->start, resource_size(gdrm->reg));
out_free:
kfree(gdrm);
@@ -25,5 +25,5 @@ index 81215f4..4352091 100644
}
--
-1.6.6.rc4
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0002-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch b/recipes/linux/linux-openmoko-2.6.32/0007-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch
index ddcb709b27..68751942a9 100644
--- a/recipes/linux/linux-openmoko-2.6.32/0002-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch
+++ b/recipes/linux/linux-openmoko-2.6.32/0007-glamo-drm-select-DRM_KMS_HELPER-for-crtc-functions.patch
@@ -1,17 +1,17 @@
-From 9880cfc5fe34d8be48bc8c30cb3c3188ebf11b59 Mon Sep 17 00:00:00 2001
+From 8bb128ce2474ef10c71ea681fa01e574c1ec3114 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 22 Dec 2009 16:32:57 +0100
-Subject: [PATCH 2/2] glamo-drm: select DRM_KMS_HELPER for crtc functions
+Subject: [PATCH 7/9] glamo-drm: select DRM_KMS_HELPER for crtc functions
---
drivers/mfd/glamo/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/glamo/Kconfig b/drivers/mfd/glamo/Kconfig
-index 375e5db..cdcd3bc 100644
+index 214c70e..a12ebf6 100644
--- a/drivers/mfd/glamo/Kconfig
+++ b/drivers/mfd/glamo/Kconfig
-@@ -46,6 +46,7 @@ config MFD_GLAMO_DRM
+@@ -47,6 +47,7 @@ config MFD_GLAMO_DRM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -20,5 +20,5 @@ index 375e5db..cdcd3bc 100644
Direct Rendering Manager interface for the S-Media Glamo chip, as
used in Openmoko FreeRunner (GTA02).
--
-1.6.6.rc4
+1.6.6.1
diff --git a/recipes/linux/linux-openmoko-2.6.32/0008-Fix-crash-when-reading-Glamo-registers-via-sysfs.patch b/recipes/linux/linux-openmoko-2.6.32/0008-Fix-crash-when-reading-Glamo-registers-via-sysfs.patch
new file mode 100644
index 0000000000..f5da51ed95
--- /dev/null
+++ b/recipes/linux/linux-openmoko-2.6.32/0008-Fix-crash-when-reading-Glamo-registers-via-sysfs.patch
@@ -0,0 +1,38 @@
+From f6debba05c9f6d0337324dc0eaa8e892d2d3142b Mon Sep 17 00:00:00 2001
+From: Thomas White <taw@bitwiz.org.uk>
+Date: Thu, 4 Feb 2010 00:07:25 +0100
+Subject: [PATCH 8/9] Fix crash when reading Glamo registers via sysfs
+
+glamo-core didn't ioremap() some areas, so don't try to read them.
+
+Signed-off-by: Thomas White <taw@bitwiz.org.uk>
+---
+ drivers/mfd/glamo/glamo-core.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
+index a614d44..faaf269 100644
+--- a/drivers/mfd/glamo/glamo-core.c
++++ b/drivers/mfd/glamo/glamo-core.c
+@@ -90,14 +90,14 @@ static const struct reg_range reg_range[] = {
+ /* { 0x0500, 0x300, "ISP", 0 }, */
+ /* { 0x0800, 0x400, "JPEG", 0 }, */
+ /* { 0x0c00, 0xcc, "MPEG", 0 }, */
+- { 0x1100, 0xb2, "LCD 1", 1 },
+- { 0x1200, 0x64, "LCD 2", 1 },
+- { 0x1400, 0x42, "MMC", 1 },
++ { 0x1100, 0xb2, "LCD 1", 0 },
++ { 0x1200, 0x64, "LCD 2", 0 },
++ { 0x1400, 0x42, "MMC", 0 },
+ /* { 0x1500, 0x080, "MPU 0", 0 },
+ { 0x1580, 0x080, "MPU 1", 0 },
+ { 0x1600, 0x080, "Cmd Queue", 0 },
+ { 0x1680, 0x080, "RISC CPU", 0 },*/
+- { 0x1700, 0x400, "2D Unit", 1 },
++ { 0x1700, 0x400, "2D Unit", 0 },
+ /* { 0x1b00, 0x900, "3D Unit", 0 }, */
+ };
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-openmoko-2.6.32/0009-A-couple-of-GEM-refcounting-fixes.patch b/recipes/linux/linux-openmoko-2.6.32/0009-A-couple-of-GEM-refcounting-fixes.patch
new file mode 100644
index 0000000000..7fb2fa8762
--- /dev/null
+++ b/recipes/linux/linux-openmoko-2.6.32/0009-A-couple-of-GEM-refcounting-fixes.patch
@@ -0,0 +1,42 @@
+From 75e660e406cd4941f253ddbdeaa45f59d107a014 Mon Sep 17 00:00:00 2001
+From: Thomas White <taw@bitwiz.org.uk>
+Date: Sun, 7 Feb 2010 13:27:20 +0100
+Subject: [PATCH 9/9] A couple of GEM refcounting fixes
+
+This allows GEM objects to be freed properly, which wasn't working before.
+
+Signed-off-by: Thomas White <taw@bitwiz.org.uk>
+---
+ drivers/mfd/glamo/glamo-buffer.c | 2 ++
+ drivers/mfd/glamo/glamo-drm-drv.c | 2 ++
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mfd/glamo/glamo-buffer.c b/drivers/mfd/glamo/glamo-buffer.c
+index 45500d3..82ea0c0 100644
+--- a/drivers/mfd/glamo/glamo-buffer.c
++++ b/drivers/mfd/glamo/glamo-buffer.c
+@@ -245,6 +245,8 @@ int glamo_ioctl_gem_mmap(struct drm_device *dev, void *data,
+ if (!gobj->mmap_offset) {
+ ret = glamo_gem_create_mmap_offset(obj);
+ if (ret) {
++ printk(KERN_CRIT "Couldn't create mmap offset\n");
++ drm_gem_object_unreference(obj);
+ mutex_unlock(&dev->struct_mutex);
+ return ret;
+ }
+diff --git a/drivers/mfd/glamo/glamo-drm-drv.c b/drivers/mfd/glamo/glamo-drm-drv.c
+index 1907a47..e7220d5 100644
+--- a/drivers/mfd/glamo/glamo-drm-drv.c
++++ b/drivers/mfd/glamo/glamo-drm-drv.c
+@@ -153,6 +153,8 @@ static int glamodrm_unload(struct drm_device *dev)
+
+ static struct vm_operations_struct glamodrm_gem_vm_ops = {
+ .fault = glamodrm_gem_fault,
++ .open = drm_gem_vm_open,
++ .close = drm_gem_vm_close,
+ };
+
+ static struct drm_driver glamodrm_drm_driver = {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-openmoko-2.6.32_git.bb b/recipes/linux/linux-openmoko-2.6.32_git.bb
index 8861375808..889b1a58e8 100644
--- a/recipes/linux/linux-openmoko-2.6.32_git.bb
+++ b/recipes/linux/linux-openmoko-2.6.32_git.bb
@@ -7,7 +7,7 @@ KERNEL_RELEASE="2.6.32.8"
OEV = "oe1"
PV = "${KERNEL_RELEASE}-${OEV}+gitr${SRCREV}"
-PR = "r0"
+PR = "r1"
SRC_URI = "\
git://git.openmoko.org/git/kernel.git;protocol=git;branch=om-gta02-2.6.32 \