From af12ef4f6b4ca111d9a2ef45263ad89610498724 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 13 Aug 2008 10:04:21 +0200 Subject: Don't call the vblank tasklet with irqs disabled. If a specific tasklet shares data with irq context, it needs to take a private irq-blocking spinlock within the tasklet itself. --- linux-core/drm_irq.c | 20 ++++++++++++-------- linux-core/drm_lock.c | 12 +++++------- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'linux-core') diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 5b9f474b..57419ca1 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -705,27 +705,31 @@ static void drm_locked_tasklet_func(unsigned long data) { struct drm_device *dev = (struct drm_device *)data; unsigned long irqflags; - + void (*tasklet_func)(struct drm_device *); + spin_lock_irqsave(&dev->tasklet_lock, irqflags); + tasklet_func = dev->locked_tasklet_func; + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); - if (!dev->locked_tasklet_func || + if (!tasklet_func || !drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT)) { - spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); return; } dev->lock.lock_time = jiffies; atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); - dev->locked_tasklet_func(dev); + spin_lock_irqsave(&dev->tasklet_lock, irqflags); + tasklet_func = dev->locked_tasklet_func; + dev->locked_tasklet_func = NULL; + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); + + if (tasklet_func != NULL) + tasklet_func(dev); drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT); - - dev->locked_tasklet_func = NULL; - - spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); } /** diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c index a2966efb..cad2e44d 100644 --- a/linux-core/drm_lock.c +++ b/linux-core/drm_lock.c @@ -155,6 +155,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_lock *lock = data; unsigned long irqflags; + void (*tasklet_func)(struct drm_device *); if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", @@ -163,14 +164,11 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) } spin_lock_irqsave(&dev->tasklet_lock, irqflags); - - if (dev->locked_tasklet_func) { - dev->locked_tasklet_func(dev); - - dev->locked_tasklet_func = NULL; - } - + tasklet_func = dev->locked_tasklet_func; + dev->locked_tasklet_func = NULL; spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); + if (tasklet_func != NULL) + tasklet_func(dev); atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); -- cgit v1.2.3 From ba840fca19077d352277519c5fa032e3b107ae27 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Thu, 14 Aug 2008 19:35:55 +0200 Subject: linux: on_each_cpu has 3 args on 2.6.27 --- linux-core/drm_ttm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c index 80a8ff5d..054a7ce8 100644 --- a/linux-core/drm_ttm.c +++ b/linux-core/drm_ttm.c @@ -72,7 +72,11 @@ void drm_ttm_cache_flush(struct page *pages[], unsigned long num_pages) return; } #endif - if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1)) +#else + if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0) +#endif DRM_ERROR("Timed out waiting for drm cache flush.\n"); } EXPORT_SYMBOL(drm_ttm_cache_flush); -- cgit v1.2.3 From a5381cac55e54a535acf752970886b659948563c Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Sun, 17 Aug 2008 00:41:50 +0200 Subject: nouveau: make it compile under 2.6.27 --- linux-core/nouveau_sgdma.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux-core') diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index cc4d5a92..739e0252 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -48,7 +48,11 @@ nouveau_sgdma_populate(struct drm_ttm_backend *be, unsigned long num_pages, page, o, NV_CTXDMA_PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + if (pci_dma_mapping_error(nvbe->dev->pdev, nvbe->pagelist[d])) { +#else if (pci_dma_mapping_error(nvbe->pagelist[d])) { +#endif be->func->clear(be); DRM_ERROR("pci_map_page failed\n"); return -EINVAL; @@ -223,7 +227,11 @@ nouveau_sgdma_init(struct drm_device *dev) dev_priv->gart_info.sg_dummy_page = alloc_page(GFP_KERNEL|__GFP_DMA32); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + set_page_locked(dev_priv->gart_info.sg_dummy_page); +#else SetPageLocked(dev_priv->gart_info.sg_dummy_page); +#endif dev_priv->gart_info.sg_dummy_bus = pci_map_page(dev->pdev, dev_priv->gart_info.sg_dummy_page, 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); -- cgit v1.2.3 From bffbb497e2502b0aa6fd24804251d6a21d8fa034 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Wed, 27 Aug 2008 02:27:10 +0200 Subject: Change git-describe into git describe. --- linux-core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/Makefile b/linux-core/Makefile index 4edec312..157664ef 100644 --- a/linux-core/Makefile +++ b/linux-core/Makefile @@ -341,7 +341,7 @@ CONFIG_DRM_I915 := m endif endif -GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17) +GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git describe --abbrev=17) ifneq ($(GIT_REVISION),) EXTRA_CFLAGS+=-D"GIT_REVISION=\"$(GIT_REVISION)\"" endif -- cgit v1.2.3 From b460aeec3ea817540e43c8215f2cdf432c957289 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Fri, 29 Aug 2008 00:43:19 +0200 Subject: Fix drm_realloc when you're reallocing into something smaller. --- linux-core/drm_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index b90fc020..d1a88c88 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -183,7 +183,7 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL; if (oldpt && oldsize) { - memcpy(pt, oldpt, oldsize); + memcpy(pt, oldpt, DRM_MIN(oldsize,size)); kfree(oldpt); } return pt; -- cgit v1.2.3 From 99f8cce3eae79c9cf5e9897ef1af8eac24b38c09 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 2 Sep 2008 10:07:14 +1000 Subject: drm: fix sysfs error path. Pointed out by Roel Kluin on dri-devel. Signed-off-by: Dave Airlie --- linux-core/drm_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/drm_sysfs.c b/linux-core/drm_sysfs.c index 32759424..6de93679 100644 --- a/linux-core/drm_sysfs.c +++ b/linux-core/drm_sysfs.c @@ -188,7 +188,7 @@ int drm_sysfs_device_add(struct drm_minor *minor) err_out_files: if (i > 0) for (j = 0; j < i; j++) - device_remove_file(&minor->kdev, &device_attrs[i]); + device_remove_file(&minor->kdev, &device_attrs[j]); device_unregister(&minor->kdev); err_out: -- cgit v1.2.3