rpms/kernel/devel agp-set_memory_ucwb.patch, NONE, 1.1.10.2 drm-fix-setmaster-deadlock.patch, NONE, 1.1.2.2 drm-maybe-fix-nouveau.patch, NONE, 1.1.10.2 drm-next.patch, 1.6.6.1, 1.6.6.2 drm-radeon-pm.patch, NONE, 1.2.6.2 git-bluetooth.patch, NONE, 1.2.2.2 hda_intel-prealloc-4mb-dmabuffer.patch, NONE, 1.1.6.2 linux-2.6-ipw2x00-age-scan-results-on-resume.patch, NONE, 1.1.10.2 linux-2.6-mac80211-age-scan-results-on-resume.patch, NONE, 1.1.10.2 linux-2.6-v4l-dvb-fixes.patch, NONE, 1.2.8.2 patch-2.6.29-rc7.bz2.sign, NONE, 1.1.6.2 .cvsignore, 1.1014.2.4, 1.1014.2.5 config-generic, 1.238.6.6, 1.238.6.7 config-ia64-generic, 1.21, 1.21.6.1 config-powerpc-generic, 1.33.6.2, 1.33.6.3 drm-modesetting-radeon.patch, 1.54.6.2, 1.54.6.3 drm-nouveau.patch, 1.8, 1.8.6.1 kernel.spec, 1.1294.2.8, 1.1294.2.9 linux-2.6-hdpvr.patch, 1.4, 1.4.6.1 linux-2.6-silence-fbcon-logo.patch, 1.1, 1.1.16.1 linux-2.6-v4l-dvb-update.patch, 1.1.2.2, 1.1.2.3 linux-2.6.29-lirc.patch, 1.3, 1.3.6.1 sources, 1.976.2.5, 1.976.2.6 upstream, 1.888.2.4, 1.888.2.5 xen.pvops.patch, 1.1.2.7, 1.1.2.8 xen.pvops.post.patch, 1.1.2.3, 1.1.2.4 xen.pvops.pre.patch, 1.1.2.3, 1.1.2.4 drm-edid-revision-0-should-be-valid.patch, 1.1.2.2, NONE linux-2.6-iwlwifi-dma-direction.patch, 1.1, NONE linux-2.6-libertas-netpriv-fixes.patch, 1.1.2.2, NONE patch-2.6.29-rc6-git2.bz2.sign, 1.1.2.2, NONE patch-2.6.29-rc6.bz2.sign, 1.1.2.2, NONE
Michael Young
myoung at fedoraproject.org
Thu Mar 5 01:30:40 UTC 2009
Author: myoung
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12118
Modified Files:
Tag: private-myoung-dom0-branch
.cvsignore config-generic config-ia64-generic
config-powerpc-generic drm-modesetting-radeon.patch
drm-nouveau.patch kernel.spec linux-2.6-hdpvr.patch
linux-2.6-silence-fbcon-logo.patch
linux-2.6-v4l-dvb-update.patch linux-2.6.29-lirc.patch sources
upstream xen.pvops.patch xen.pvops.post.patch
xen.pvops.pre.patch
Added Files:
Tag: private-myoung-dom0-branch
agp-set_memory_ucwb.patch drm-fix-setmaster-deadlock.patch
drm-maybe-fix-nouveau.patch drm-next.patch drm-radeon-pm.patch
git-bluetooth.patch hda_intel-prealloc-4mb-dmabuffer.patch
linux-2.6-ipw2x00-age-scan-results-on-resume.patch
linux-2.6-mac80211-age-scan-results-on-resume.patch
linux-2.6-v4l-dvb-fixes.patch patch-2.6.29-rc7.bz2.sign
Removed Files:
Tag: private-myoung-dom0-branch
drm-edid-revision-0-should-be-valid.patch
linux-2.6-iwlwifi-dma-direction.patch
linux-2.6-libertas-netpriv-fixes.patch
patch-2.6.29-rc6-git2.bz2.sign patch-2.6.29-rc6.bz2.sign
Log Message:
Update pvops patch
agp-set_memory_ucwb.patch:
--- NEW FILE agp-set_memory_ucwb.patch ---
commit 082dd38cdc63cbee3924806bff5d87b751270747
Author: Pierre Willenbrock <pierre at pirsoft.de>
Date: Fri Dec 12 01:36:41 2008 +0100
Use set_memory_{uc,wb} instead of set_memory_array_{uc,wb} for CONFIG_HIGHMEM64G
set_memory_array_{uc,wb} expects an unsigned long *,
but was called with a dma_addr_t *. This optimistically assumes
only CONFIG_HIGHMEM64G selects something incompatible with
unsigned long for dma_addr_t.
Signed-off-by: Pierre Willenbrock <pierre at pirsoft.de>
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 97e8b41..aeeaf68 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -1240,12 +1240,17 @@ int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *m
}
#ifdef CONFIG_X86
+#ifdef CONFIG_HIGHMEM64G
+ for (i = 0; i < num_pages; i++)
+ set_memory_uc(mem->memory[i], 1);
+#else
set_memory_array_uc(mem->memory, num_pages);
#endif
+#endif
ret = 0;
out:
for (i = 0; i < mem->page_count; i++)
- mem->memory[i] = virt_to_gart((void *)mem->memory[i]);
+ mem->memory[i] = virt_to_gart((void *)(unsigned long)mem->memory[i]);
return ret;
}
EXPORT_SYMBOL(agp_generic_alloc_pages);
@@ -1279,11 +1284,16 @@ void agp_generic_destroy_pages(struct agp_memory *mem)
mem->memory[i] = (unsigned long)gart_to_virt(mem->memory[i]);
#ifdef CONFIG_X86
+#ifdef CONFIG_HIGHMEM64G
+ for (i = 0; i < mem->page_count; i++)
+ set_memory_wb(mem->memory[i], 1);
+#else
set_memory_array_wb(mem->memory, mem->page_count);
#endif
+#endif
for (i = 0; i < mem->page_count; i++) {
- addr = (void *)mem->memory[i];
+ addr = (void *)(unsigned long)mem->memory[i];
page = virt_to_page(addr);
#ifndef CONFIG_X86
diff -up linux-2.6.28.noarch/drivers/gpu/drm/i915/i915_dma.c.dma linux-2.6.28.noarch/drivers/gpu/drm/i915/i915_dma.c
--- linux-2.6.28.noarch/drivers/gpu/drm/i915/i915_dma.c.dma 2009-02-27 13:11:03.000000000 +1000
+++ linux-2.6.28.noarch/drivers/gpu/drm/i915/i915_dma.c 2009-02-27 13:11:11.000000000 +1000
@@ -1104,7 +1104,7 @@ int i915_driver_load(struct drm_device *
"performance may suffer.\n");
}
-#ifdef CONFIG_HIGHMEM64G
+#if 0 /* Fedora has AGP workaround patch */
/* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
dev_priv->has_gem = 0;
#else
drm-fix-setmaster-deadlock.patch:
--- NEW FILE drm-fix-setmaster-deadlock.patch ---
>From 3b7d6997b09c2ca5f06e154375aafa92271966c2 Mon Sep 17 00:00:00 2001
From: Helge Bahmann <helge.bahmann at secunet.com>
Date: Wed, 4 Mar 2009 09:58:32 +0100
Subject: [PATCH] Fix deadlock in drm_setmaster_ioctl
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Kristian Høgsberg <krh at redhat.com>
---
drivers/gpu/drm/drm_stub.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 46bb923..0823b11 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -176,7 +176,7 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
file_priv->minor->master != file_priv->master) {
mutex_lock(&dev->struct_mutex);
file_priv->minor->master = drm_master_get(file_priv->master);
- mutex_lock(&dev->struct_mutex);
+ mutex_unlock(&dev->struct_mutex);
}
return 0;
--
1.6.1.3
drm-maybe-fix-nouveau.patch:
--- NEW FILE drm-maybe-fix-nouveau.patch ---
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 5b4a646..5574952 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -309,7 +309,7 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size,
if (flags & 0x80000000) {
while (size) {
struct nouveau_gpuobj *pt = pgt[virt / (512*1024*1024)];
- int pte = ((virt % (512*1024*1024)) / psz) * 2;
+ int pte = ((u32)(virt % (512*1024*1024)) / psz) * 2;
INSTANCE_WR(pt, pte++, 0x00000000);
INSTANCE_WR(pt, pte++, 0x00000000);
@@ -320,7 +320,7 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size,
} else {
while (size) {
struct nouveau_gpuobj *pt = pgt[virt / (512*1024*1024)];
- int pte = ((virt % (512*1024*1024)) / psz) * 2;
+ int pte = ((u32)(virt % (512*1024*1024)) / psz) * 2;
INSTANCE_WR(pt, pte++, phys | pfl);
INSTANCE_WR(pt, pte++, flags);
drm-next.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.6.6.1 -r 1.6.6.2 drm-next.patch
Index: drm-next.patch
===================================================================
RCS file: drm-next.patch
diff -N drm-next.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ drm-next.patch 5 Mar 2009 01:30:22 -0000 1.6.6.2
@@ -0,0 +1,31664 @@
+commit afdecdb151030e719a95896b610fdbde0ad4ca9f
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Feb 26 10:15:24 2009 +1000
+
+ drm/r600: fix rptr address along lines of previous fixes to radeon.
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit cc35bf2855020c4067e298cbd50fa5494b82ab7f
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Feb 26 10:14:40 2009 +1000
+
+ drm/r600: fixup r600 gart table accessor like ati_pcigart.c
+
+ This attempts to fixup the r600 GART accessors so they work on other arches.
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 0101c60cfa2d6bd9e86524f267f8ba092bc7b0ae
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Feb 26 10:13:47 2009 +1000
+
+ drm/ati_pcigart: use memset_io to reset the memory
+
+ Also don't setup pci_gart if we aren't going to need it.
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit c455abd7d1f5ed1815d692f37b317f8eab358ced
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Feb 26 10:12:10 2009 +1000
+
+ drm: add DRM_READ/WRITE64 wrappers around readq/writeq.
+
+ The readq/writeq stuff is from Dave Miller, and he
+ warns users to be careful about using these. Plans are only
+ r600 to use it so far.
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 89de134be815fe9e30ca42aeac8a4ef5c8db8d30
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Wed Feb 25 17:02:19 2009 -0500
+
+ radeon: add RS600 pci ids
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 8dba4f2bd6d91a38a732dc3417187b75a6607e62
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Wed Feb 25 16:57:49 2009 -0500
+
+ radeon: add support for rs600 GPUs
+
+ RS600s are an AMD IGP for Intel CPUs, that look like RS690s from
+ a lot of perspectives but look like r600s from a memory controller
+ point of view.
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit e482e2e2c5dab12db6f1aa032c30993ca36d77b9
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Wed Feb 25 15:55:01 2009 -0500
+
+ radeon: fix r600 AGP support
+
+ This fixes the ioremap issues with r600 AGP.
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit dbcce50efba41272d795b64edd06b1261dbdc5b8
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Tue Feb 24 17:13:42 2009 -0500
+
+ radeon: add R6xx/R7xx pci ids
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 69184db08c49fd54d4e3a197dae64581c35a144f
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Tue Feb 24 16:22:29 2009 -0500
+
+ drm/radeon: add initial support for R6xx/R7xx GPUs
+
+ This adds support for 2D/Xv acceleration in the X.org 2D driver,
+ to the drm. It doesn't yet provide any 3D support hooks.
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit b95ec10efe0bb8a106c6ab4edc019033c5081d3d
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Tue Feb 24 14:28:34 2009 -0500
+
+ drm/radeon: add r6xx/r7xx microcode
+
+ This uses the same microcode system as the current radeon code.
+
+ It should be converted to the new microcode loader I suppose,
+ though really I need a lot more proof of the worth of me maintaining
+ firmware blobs externally.
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 1e7e66e6dce44a77d4042b80de23c8ba4346c459
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Tue Feb 24 14:02:13 2009 -0500
+
+ drm/radeon: prep for r6xx/r7xx support
+
+ - add r6xx/r7xx regs and macros
+ - add r6xx/r7xx chip families
+ - fix register access for regs with offsets >= 0x10000
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 9cb39ece1f32fe75e7c34b193022650108d4bf0f
+Author: Owain G. Ainsworth <oga at openbsd.org>
+Date: Fri Feb 20 08:30:19 2009 +0000
+
+ i915/drm: Remove two redundant agp_chipset_flushes
+
+ agp_chipset_flush() is for flushing the intel GMCH write cache via the
+ IFP, these two uses are for when we're getting the object into the cpu
+ READ domain, and thus should not be needed. This confused me when I was
+ getting my head around the code.
+
+ With thanks to airlied for helping me check my mental picture of how the
+ flushes and clflushes are supposed to be used.
+
+ Signed-off-by: Owain G. Ainsworth <oga at openbsd.org>
+ Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 5e60aaba5c9d226ec49f4c1030fc871bcea86048
+Author: Chris Wilson <chris at chris-wilson.co.uk>
+Date: Wed Feb 11 14:26:38 2009 +0000
+
+ drm/i915: Display fence register state in debugfs i915_gem_fence_regs node.
+
+ Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
+ Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 475f933c677b8c59f34744aed2fc3bdcbec24c6e
+Author: Eric Anholt <eric at anholt.net>
+Date: Tue Feb 17 23:53:41 2009 -0800
+
+ drm/i915: Add information on pinning and fencing to the i915 list debug.
+
+ This was inspired by a patch by Chris Wilson, though none of it applied in any
+ way due to the debugfs work and I decided to change the formatting of the
+ new information anyway.
+
+ Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit b4212836fef1ef28c6070f43d70fc73f9f5687f6
+Author: Ben Gamari <bgamari at gmail.com>
+Date: Tue Feb 17 20:08:51 2009 -0500
+
+ drm/i915: Consolidate gem object list dumping
+
+ Here we eliminate a few functions in favor of using a single function
+ to dump from all of the object lists.
+
+ Signed-Off-By: Ben Gamari <bgamari at gmail.com>
+ Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit a584bb1ed4de35a9206a8ed42fc7de18b3d46b5a
+Author: Ben Gamari <bgamari at gmail.com>
+Date: Tue Feb 17 20:08:49 2009 -0500
+
+ drm: Convert proc files to seq_file and introduce debugfs
+
+ The old mechanism to formatting proc files is extremely ugly. The
+ seq_file API was designed specifically for cases like this and greatly
+ simplifies the process.
+
+ Also, most of the files in /proc really don't belong there. This patch
+ introduces the infrastructure for putting these into debugfs and exposes
+ all of the proc files in debugfs as well.
+
+ This contains the i915 hooks rewrite as well, to make bisectability better.
+
+ Signed-off-by: Ben Gamari <bgamari at gmail.com>
[...31271 lines suppressed...]
+
+diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
+index 5ded1ac..33ae98c 100644
+--- a/include/drm/drm_crtc.h
++++ b/include/drm/drm_crtc.h
+@@ -550,7 +550,7 @@ struct drm_mode_config {
+ int min_width, min_height;
+ int max_width, max_height;
+ struct drm_mode_config_funcs *funcs;
+- unsigned long fb_base;
++ resource_size_t fb_base;
+
+ /* pointers to standard properties */
+ struct list_head property_blob_list;
+diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h
+index 8dbd257..013551d 100644
+--- a/include/drm/drm_os_linux.h
++++ b/include/drm/drm_os_linux.h
+@@ -6,6 +6,19 @@
+ #include <linux/interrupt.h> /* For task queue support */
+ #include <linux/delay.h>
+
++#ifndef readq
++static u64 readq(void __iomem *reg)
++{
++ return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32);
++}
++
++static void writeq(u64 val, void __iomem *reg)
++{
++ writel(val & 0xffffffff, reg);
++ writel(val >> 32, reg + 0x4UL);
++}
++#endif
++
+ /** Current process ID */
+ #define DRM_CURRENTPID task_pid_nr(current)
+ #define DRM_SUSER(p) capable(CAP_SYS_ADMIN)
+@@ -23,6 +36,12 @@
+ /** Write a dword into a MMIO region */
+ #define DRM_WRITE32(map, offset, val) writel(val, ((void __iomem *)(map)->handle) + (offset))
+ /** Read memory barrier */
++
++/** Read a qword from a MMIO region - be careful using these unless you really understand them */
++#define DRM_READ64(map, offset) readq(((void __iomem *)(map)->handle) + (offset))
++/** Write a qword into a MMIO region */
++#define DRM_WRITE64(map, offset, val) writeq(val, ((void __iomem *)(map)->handle) + (offset))
++
+ #define DRM_READMEMORYBARRIER() rmb()
+ /** Write memory barrier */
+ #define DRM_WRITEMEMORYBARRIER() wmb()
+diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
+index 5165f24..c2fd3c5 100644
+--- a/include/drm/drm_pciids.h
++++ b/include/drm/drm_pciids.h
+@@ -239,10 +239,121 @@
+ {0x1002, 0x7835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+ {0x1002, 0x791e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
+ {0x1002, 0x791f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
++ {0x1002, 0x793f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x7941, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x7942, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP}, \
+ {0x1002, 0x796c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
+ {0x1002, 0x796d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
+ {0x1002, 0x796e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
+ {0x1002, 0x796f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
++ {0x1002, 0x9400, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9402, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9403, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x940A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x940B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x944B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x944C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x944E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9450, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9452, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9456, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x945A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x945B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x946A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x946B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x947A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x947B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9480, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9487, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9488, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9489, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x949F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94CB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x94CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV610|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9500, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9501, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9504, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9505, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9506, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9507, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9508, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9509, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x950F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9515, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9517, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9519, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV670|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9540, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9541, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9542, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x954E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x954F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9586, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9587, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9588, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9589, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x958F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9590, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9591, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9593, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9595, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9596, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9597, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x95CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
++ {0x1002, 0x9610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9612, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+ {0, 0, 0}
+
+ #define r128_PCI_IDS \
+diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
+index 73ff51f..937a275 100644
+--- a/include/drm/radeon_drm.h
++++ b/include/drm/radeon_drm.h
+@@ -304,6 +304,8 @@ typedef union {
+
+ #define RADEON_SCRATCH_REG_OFFSET 32
+
++#define R600_SCRATCH_REG_OFFSET 256
++
+ #define RADEON_NR_SAREA_CLIPRECTS 12
+
+ /* There are 2 heaps (local/GART). Each region within a heap is a
+@@ -526,7 +528,8 @@ typedef struct drm_radeon_init {
+ RADEON_INIT_CP = 0x01,
+ RADEON_CLEANUP_CP = 0x02,
+ RADEON_INIT_R200_CP = 0x03,
+- RADEON_INIT_R300_CP = 0x04
++ RADEON_INIT_R300_CP = 0x04,
++ RADEON_INIT_R600_CP = 0x05
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
drm-radeon-pm.patch:
--- NEW FILE drm-radeon-pm.patch ---
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c 2009-03-03 20:53:05.000000000 +0000
@@ -441,14 +441,23 @@ static bool atombios_crtc_mode_fixup(str
static void atombios_crtc_prepare(struct drm_crtc *crtc)
{
+ struct drm_device *dev = crtc->dev;
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+
+ mutex_lock(&dev_priv->mode_info.power.pll_mutex);
+
atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
atombios_lock_crtc(crtc, 1);
}
static void atombios_crtc_commit(struct drm_crtc *crtc)
{
+ struct drm_device *dev = crtc->dev;
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+
atombios_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
atombios_lock_crtc(crtc, 0);
+ mutex_unlock(&dev_priv->mode_info.power.pll_mutex);
}
static const struct drm_crtc_helper_funcs atombios_helper_funcs = {
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_atombios.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_atombios.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_atombios.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_atombios.c 2009-03-03 20:53:05.000000000 +0000
@@ -620,6 +620,34 @@ void radeon_atom_static_pwrmgt_setup(str
atom_execute_table(dev_priv->mode_info.atom_context, index, (uint32_t *)&args);
}
+void radeon_atom_get_mc_arb_info(struct drm_device *dev)
+{
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+ struct radeon_mode_info *mode_info = &dev_priv->mode_info;
+ struct atom_context *ctx = mode_info->atom_context;
+ int index = GetIndexIntoMasterTable(DATA, MC_InitParameter);
+ uint8_t frev, crev;
+ uint16_t size, data_offset;
+
+ atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset);
+ dev_priv->mode_info.power.mc_arb_init_values =
+ kmalloc(size*sizeof(int), GFP_KERNEL);
+ memcpy(dev_priv->mode_info.power.mc_arb_init_values,
+ ctx->bios + data_offset, size * sizeof(int));
+}
+
+void radeon_atom_get_engine_clock(struct drm_device *dev, int *engine_clock)
+{
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+ struct radeon_mode_info *mode_info = &dev_priv->mode_info;
+ struct atom_context *ctx = mode_info->atom_context;
+ GET_ENGINE_CLOCK_PS_ALLOCATION args;
+ int index = GetIndexIntoMasterTable(COMMAND, GetEngineClock);
+
+ atom_execute_table(ctx, index, (uint32_t *)&args);
+ *engine_clock = args.ulReturnEngineClock;
+}
+
void radeon_atom_set_engine_clock(struct drm_device *dev, int eng_clock)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
@@ -633,6 +661,18 @@ void radeon_atom_set_engine_clock(struct
atom_execute_table(dev_priv->mode_info.atom_context, index, (uint32_t *)&args);
}
+void radeon_atom_get_memory_clock(struct drm_device *dev, int *mem_clock)
+{
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+ struct radeon_mode_info *mode_info = &dev_priv->mode_info;
+ struct atom_context *ctx = mode_info->atom_context;
+ GET_MEMORY_CLOCK_PS_ALLOCATION args;
+ int index = GetIndexIntoMasterTable(COMMAND, GetMemoryClock);
+
+ atom_execute_table(ctx, index, (uint32_t *)&args);
+ *mem_clock = args.ulReturnMemoryClock;
+}
+
void radeon_atom_set_memory_clock(struct drm_device *dev, int mem_clock)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
@@ -646,6 +686,16 @@ void radeon_atom_set_memory_clock(struct
atom_execute_table(dev_priv->mode_info.atom_context, index, (uint32_t *)&args);
}
+void radeon_atom_initialize_memory_controller(struct drm_device *dev)
+{
+ struct drm_radeon_private *dev_priv = dev->dev_private;
+ struct atom_context *ctx = dev_priv->mode_info.atom_context;
+ int index = GetIndexIntoMasterTable(COMMAND, MemoryDeviceInit);
+ MEMORY_PLLINIT_PS_ALLOCATION args;
+
+ atom_execute_table(ctx, index, (uint32_t *)&args);
+}
+
void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cp.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cp.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cp.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cp.c 2009-03-03 20:53:05.000000000 +0000
@@ -3223,6 +3223,8 @@ int radeon_driver_load(struct drm_device
if (ret)
goto modeset_fail;
+ mutex_init(&dev_priv->mode_info.power.pll_mutex);
+
radeon_modeset_init(dev);
radeon_modeset_cp_init(dev);
@@ -3231,7 +3233,7 @@ int radeon_driver_load(struct drm_device
drm_irq_install(dev);
}
-
+ radeon_pm_init(dev);
return ret;
modeset_fail:
dev->driver->driver_features &= ~DRIVER_MODESET;
@@ -3303,6 +3305,8 @@ int radeon_driver_unload(struct drm_devi
{
drm_radeon_private_t *dev_priv = dev->dev_private;
+ radeon_pm_exit(dev);
+
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
drm_irq_uninstall(dev);
radeon_modeset_cleanup(dev);
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cs.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cs.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cs.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_cs.c 2009-03-03 20:53:05.000000000 +0000
@@ -41,6 +41,8 @@ int radeon_cs_ioctl(struct drm_device *d
long size;
int r, i;
+ radeon_pm_timer_reset(dev);
+
mutex_lock(&dev_priv->cs.cs_mutex);
/* set command stream id to 0 which is fake id */
cs_id = 0;
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_drv.h.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_drv.h
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_drv.h.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_drv.h 2009-03-03 20:53:05.000000000 +0000
@@ -612,6 +612,9 @@ extern int radeon_modeset_cp_resume(stru
/* radeon_pm.c */
int radeon_suspend(struct drm_device *dev, pm_message_t state);
int radeon_resume(struct drm_device *dev);
+void radeon_pm_init(struct drm_device *dev);
+void radeon_pm_exit(struct drm_device *dev);
+void radeon_pm_timer_reset(struct drm_device *dev);
/* Flags for stats.boxes
*/
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_irq.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_irq.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_irq.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_irq.c 2009-03-03 20:53:05.000000000 +0000
@@ -185,8 +185,10 @@ irqreturn_t radeon_driver_irq_handler(DR
struct drm_device *dev = (struct drm_device *) arg;
drm_radeon_private_t *dev_priv =
(drm_radeon_private_t *) dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
u32 stat;
u32 r500_disp_int;
+ unsigned long flags;
/* Only consider the bits we're interested in - others could be used
* outside the DRM
@@ -206,15 +208,47 @@ irqreturn_t radeon_driver_irq_handler(DR
/* VBLANK interrupt */
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690) {
- if (r500_disp_int & R500_D1_VBLANK_INTERRUPT)
+ if (r500_disp_int & R500_D1_VBLANK_INTERRUPT) {
+ spin_lock_irqsave(&power->power_lock, flags);
+ if (power->reclock_head & 1) {
+ power->reclock_head &= ~1;
+ schedule_work(&power->reclock_work);
+ drm_vblank_put(dev, 0);
+ }
+ spin_unlock_irqrestore(&power->power_lock, flags);
drm_handle_vblank(dev, 0);
- if (r500_disp_int & R500_D2_VBLANK_INTERRUPT)
+ }
+ if (r500_disp_int & R500_D2_VBLANK_INTERRUPT) {
+ spin_lock_irqsave(&power->power_lock, flags);
+ if (power->reclock_head & 2) {
+ power->reclock_head &= ~2;
+ schedule_work(&power->reclock_work);
+ drm_vblank_put(dev, 1);
+ }
+ spin_unlock_irqrestore(&power->power_lock, flags);
drm_handle_vblank(dev, 1);
+ }
} else {
- if (stat & RADEON_CRTC_VBLANK_STAT)
+ if (stat & RADEON_CRTC_VBLANK_STAT) {
+ spin_lock_irqsave(&power->power_lock, flags);
+ if (power->reclock_head & 1) {
+ power->reclock_head &= ~1;
+ schedule_work(&power->reclock_work);
+ drm_vblank_put(dev, 0);
+ }
+ spin_unlock_irqrestore(&power->power_lock, flags);
drm_handle_vblank(dev, 0);
- if (stat & RADEON_CRTC2_VBLANK_STAT)
+ }
+ if (stat & RADEON_CRTC2_VBLANK_STAT) {
+ spin_lock_irqsave(&power->power_lock, flags);
+ if (power->reclock_head & 2) {
+ power->reclock_head &= ~2;
+ schedule_work(&power->reclock_work);
+ drm_vblank_put(dev, 1);
+ }
+ spin_unlock_irqrestore(&power->power_lock, flags);
drm_handle_vblank(dev, 1);
+ }
}
return IRQ_HANDLED;
}
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_mode.h.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_mode.h
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_mode.h.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_mode.h 2009-03-03 20:53:05.000000000 +0000
@@ -173,6 +173,22 @@ struct radeon_i2c_chan {
struct radeon_i2c_bus_rec rec;
};
+struct radeon_powermanagement_info {
+ struct timer_list idle_power_timer;
+ struct work_struct reclock_work;
+ struct drm_device *dev;
+ uint32_t orig_memory_clock;
+ uint32_t orig_engine_clock;
+ uint32_t *mc_arb_init_values;
+ uint8_t orig_fbdiv;
+ int new_mem_clock;
+ int new_engine_clock;
+ int current_clock_state;
+ int reclock_head;
+ struct mutex pll_mutex;
+ spinlock_t power_lock;
+};
+
struct radeon_mode_info {
struct atom_context *atom_context;
struct radeon_bios_connector bios_connector[RADEON_MAX_BIOS_CONNECTOR];
@@ -182,6 +198,9 @@ struct radeon_mode_info {
struct radeon_pll mpll;
uint32_t mclk;
uint32_t sclk;
+
+ /* power management */
+ struct radeon_powermanagement_info power;
};
struct radeon_crtc {
@@ -307,6 +326,12 @@ extern int radeon_crtc_cursor_move(struc
extern bool radeon_atom_get_clock_info(struct drm_device *dev);
extern bool radeon_combios_get_clock_info(struct drm_device *dev);
+extern void radeon_atom_get_engine_clock(struct drm_device *dev, int *engine_clock);
+extern void radeon_atom_get_memory_clock(struct drm_device *dev, int *memory_clock);
+extern void radeon_atom_set_engine_clock(struct drm_device *dev, int engine_clock);
+extern void radeon_atom_set_memory_clock(struct drm_device *dev, int memory_clock);
+extern void radeon_atom_initialize_memory_controller(struct drm_device *dev);
+extern void radeon_atom_get_mc_arb_info(struct drm_device *dev);
extern void radeon_atombios_get_lvds_info(struct radeon_encoder *encoder);
extern void radeon_atombios_get_tmds_info(struct radeon_encoder *encoder);
extern bool radeon_combios_get_lvds_info(struct radeon_encoder *encoder);
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_pm.c.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_pm.c
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_pm.c.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_pm.c 2009-03-03 20:53:05.000000000 +0000
@@ -31,6 +31,8 @@
#include "drm_crtc_helper.h"
+#define RADEON_DOWNCLOCK_IDLE_MS 30
+
int radeon_suspend(struct drm_device *dev, pm_message_t state)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
@@ -255,3 +257,214 @@ bool radeon_set_pcie_lanes(struct drm_de
return false;
}
+static void radeon_pm_set_engine_clock(struct drm_device *dev, int freq)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+
+ if (dev_priv->is_atom_bios)
+ radeon_atom_set_engine_clock(dev, freq);
+}
+
+static void radeon_pm_set_memory_clock(struct drm_device *dev, int freq)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+
+ mutex_lock(&power->pll_mutex);
+ radeon_do_cp_idle(dev_priv);
+ if (dev_priv->is_atom_bios) {
+ int mpll, spll, hclk, sclk, fbdiv, index, factor;
+ switch (dev_priv->chip_family) {
+ case CHIP_R520:
+ case CHIP_RV530:
+ case CHIP_RV560:
+ case CHIP_RV570:
+ case CHIP_R580:
+ mpll = RADEON_READ_PLL(dev_priv, MPLL_FUNC_CNTL);
+ fbdiv = (mpll & 0x1fe0) >> 5;
+
+ /* Set new fbdiv */
+ factor = power->orig_memory_clock / freq;
+ fbdiv = power->orig_fbdiv / factor;
+
+ mpll &= ~0x1fe0;
+ mpll |= ((fbdiv << 5) | (1 << 24));
+ mpll &= ~(1 << 25);
+
+ spll = RADEON_READ_PLL(dev_priv, SPLL_FUNC_CNTL);
+
+ hclk = fbdiv << 5;
+ hclk += 0x20;
+ hclk *= 8;
+
+ sclk = spll & 0x1fe0;
+ sclk += 0x20;
+ sclk *= 6;
+ sclk = sclk >> 5;
+
+ index = (hclk/sclk);
+
+ R500_WRITE_MCIND(R530_MC_ARB_RATIO_CLK_SEQ,
+ power->mc_arb_init_values[index]);
+ RADEON_WRITE_PLL(dev_priv, MPLL_FUNC_CNTL, mpll);
+ radeon_atom_initialize_memory_controller(dev);
+ break;
+ }
+ }
+
+ mutex_unlock(&power->pll_mutex);
+}
+
+static int radeon_pm_get_active_crtcs(struct drm_device *dev, int *crtcs)
+{
+ struct drm_crtc *crtc;
+ int count = 0;
+ struct radeon_crtc *radeon_crtc;
+
+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+ radeon_crtc = to_radeon_crtc(crtc);
+ if (crtc->enabled) {
+ count++;
+ *crtcs |= (1 << radeon_crtc->crtc_id);
+ }
+ }
+ return count;
+}
+
+
+static void radeon_pm_perform_transition(struct drm_device *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+ int crtcs = 0, count;
+ unsigned long flags;
+
+ count = radeon_pm_get_active_crtcs(dev, &crtcs);
+
+ spin_lock_irqsave(&power->power_lock, flags);
+ switch (count) {
+ case 0:
+ schedule_work(&power->reclock_work);
+ break;
+ case 1:
+ if (power->reclock_head)
+ break;
+ if (crtcs & 1) {
+ power->reclock_head |= 1;
+ drm_vblank_get(dev, 0);
+ } else {
+ power->reclock_head |= 2;
+ drm_vblank_get(dev, 1);
+ }
+ break;
+ default:
+ /* Too many active heads */
+ break;
+ }
+ spin_unlock_irqrestore(&power->power_lock, flags);
+}
+
+
+static int radeon_pm_set_runtime_power(struct drm_device *dev, int value)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+
+ if (power->current_clock_state == value)
+ return 1;
+
+ switch (value) {
+ case 0:
+ power->new_engine_clock = 100*100;
+ power->new_mem_clock = 100*100;
+ break;
+ case 1:
+ power->new_engine_clock = power->orig_engine_clock;
+ power->new_mem_clock = power->orig_memory_clock;
+ break;
+ }
+
+ power->current_clock_state = value;
+ radeon_pm_perform_transition(dev);
+
+ return 0;
+}
+
+static void radeon_pm_idle_timeout(unsigned long d)
+{
+ struct drm_device *dev = (struct drm_device *)d;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+
+ radeon_pm_set_runtime_power(dev, 0);
+}
+
+static void radeon_pm_reclock_callback(struct work_struct *work)
+{
+ struct radeon_powermanagement_info *power =
+ container_of(work, struct radeon_powermanagement_info,
+ reclock_work);
+ struct drm_device *dev = power->dev;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+
+ mutex_lock(&dev_priv->cs.cs_mutex);
+ radeon_pm_set_memory_clock(dev, power->new_mem_clock);
+ radeon_pm_set_engine_clock(dev, power->new_engine_clock);
+ mutex_unlock(&dev_priv->cs.cs_mutex);
+}
+
+void radeon_pm_timer_reset(struct drm_device *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+
+ if (!drm_core_check_feature(dev, DRIVER_MODESET))
+ return;
+
+ radeon_pm_set_runtime_power(dev, 1);
+
+ mod_timer(&power->idle_power_timer,
+ jiffies + msecs_to_jiffies(RADEON_DOWNCLOCK_IDLE_MS));
+}
+
+void radeon_pm_init(struct drm_device *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+
+ power->dev = dev;
+
+ if (!drm_core_check_feature(dev, DRIVER_MODESET))
+ return;
+
+ if (dev_priv->is_atom_bios) {
+ int mpll;
+ radeon_atom_get_mc_arb_info(dev);
+ radeon_atom_get_engine_clock(dev, &power->orig_engine_clock);
+ radeon_atom_get_memory_clock(dev, &power->orig_memory_clock);
+
+ mpll = RADEON_READ_PLL(dev_priv, MPLL_FUNC_CNTL);
+ dev_priv->mode_info.power.orig_fbdiv = (mpll & 0x1fe0) >> 5;
+ }
+
+ setup_timer(&power->idle_power_timer, radeon_pm_idle_timeout,
+ (unsigned long)dev);
+ INIT_WORK(&power->reclock_work, radeon_pm_reclock_callback);
+
+ spin_lock_init(&power->power_lock);
+
+ power->current_clock_state = 1;
+ power->reclock_head = 0;
+
+ radeon_pm_timer_reset(dev);
+}
+
+void radeon_pm_exit(struct drm_device *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct radeon_powermanagement_info *power = &dev_priv->mode_info.power;
+
+ if (!drm_core_check_feature(dev, DRIVER_MODESET))
+ return;
+
+ del_timer_sync(&power->idle_power_timer);
+}
diff -up linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_reg.h.mjg linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_reg.h
--- linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_reg.h.mjg 2009-03-03 19:41:48.000000000 +0000
+++ linux-2.6.28.x86_64/drivers/gpu/drm/radeon/radeon_reg.h 2009-03-03 20:53:05.000000000 +0000
@@ -303,6 +303,28 @@
# define RADEON_PLL_WR_EN (1 << 7)
# define RADEON_PLL_DIV_SEL (3 << 8)
# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8)
+#define SPLL_FUNC_CNTL 0x0000
+#define MPLL_FUNC_CNTL 0x0004
+#define GENERAL_PWRMGT 0x0008
+# define RADEON_GLOBAL_PWRMGT_EN (1 << 0)
+#define SCLK_PWRMGT_CNTL 0x0009
+# define RADEON_SCLK_PWRMGT_OFF (1 << 0)
+#define MCLK_PWRMGT_CNTL 0x000a
+# define RADEON_MCLK_PWRMGT_OFF (1 << 0)
+#define DYN_PWRMGT_SCLK_CNTL 0x000b
+# define RADEON_ENGINE_DYNCLK_MODE (1 << 0)
+# define RADEON_STATIC_SCREEN_EN (1 << 20)
+# define RADEON_CLIENT_SELECT_POWER_EN (1 << 21)
+#define DYN_SCLK_PWMEN_PIPE 0x000d
+# define RADEON_PIPE_3D_NOT_AUTO (1 << 8)
+#define DYN_SCLK_VOL_CNTL 0x000e
+# define RADEON_IO_CG_VOLTAGE_DROP (1 << 0)
+# define RADEON_VOLTAGE_DROP_SYNC (1 << 2)
+#define CP_DYN_CNTL 0x000f
+# define RADEON_CP_FORCEON (1 << 0)
+# define RADEON_CP_LOWER_POWER_IGNORE (1 << 20)
+# define RADEON_CP_NORMAL_POWER_IGNORE (1 << 21)
+# define RADEON_CP_NORMAL_POWER_BUSY (1 << 24)
#define RADEON_CLK_PWRMGT_CNTL 0x0014
# define RADEON_ENGIN_DYNCLK_MODE (1 << 12)
# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13)
@@ -3961,7 +3983,48 @@
# define AVIVO_I2C_RESET (1 << 8)
#define R600_GENERAL_PWRMGT 0x618
+# define R600_GLOBAL_PWRMGT_EN (1 << 0)
+# define R600_STATIC_PM_EN (1 << 1)
+# define R600_MOBILE_SU (1 << 2)
+# define R600_THERMAL_PROTECTION_DIS (1 << 3)
+# define R600_THERMAL_PROTECTION_TYPE (1 << 4)
+# define R600_ENABLE_GEN2PCIE (1 << 5)
+# define R600_SW_GPIO_INDEX (1 << 6)
+# define R600_LOW_VOLT_D2_ACPI (1 << 8)
+# define R600_LOW_VOLT_D3_ACPI (1 << 9)
+# define R600_VOLT_PWRMGT_EN (1 << 10)
# define R600_OPEN_DRAIN_PADS (1 << 11)
+# define R600_AVP_SCLK_EN (1 << 12)
+# define R600_IDCT_SCLK_EN (1 << 13)
+# define R600_GPU_COUNTER_ACPI (1 << 14)
+# define R600_COUNTER_CLK (1 << 15)
+# define R600_BACKBIAS_PAD_EN (1 << 16)
+# define R600_BACKBIAS_VALUE (1 << 17)
+# define R600_BACKBIAS_DPM_CNTL (1 << 18)
+# define R600_SPREAD_SPECTRUM_INDEX (1 << 19)
+# define R600_DYN_SPREAD_SPECTRUM_EN (1 << 21)
+
+#define R600_SCLK_PWRMGT_CNTL 0x620
+# define R600_SCLK_PWRMGT_OFF (1 << 0)
+# define R600_SCLK_TURNOFF (1 << 1)
+# define R600_SPLL_TURNOFF (1 << 2)
+# define R600_SU_SCLK_USE_BCLK (1 << 3)
+# define R600_DYNAMIC_GFX_ISLAND_PWR_DOWN (1 << 4)
+# define R600_DYNAMIC_GFX_ISLAND_LP (1 << 5)
+# define R600_CLK_TURN_ON_STAGGER (1 << 6)
+# define R600_CLK_TURN_OFF_STAGGER (1 << 7)
+# define R600_FIR_FORCE_TREND_SEL (1 << 8)
+# define R600_FIR_TREND_MODE (1 << 9)
+# define R600_DYN_GFX_CLK_OFF_EN (1 << 10)
+# define R600_VDDC3D_TURNOFF_D1 (1 << 11)
+# define R600_VDDC3D_TURNOFF_D2 (1 << 12)
+# define R600_VDDC3D_TURNOFF_D3 (1 << 13)
+# define R600_SPLL_TURNOFF_D2 (1 << 14)
+# define R600_SCLK_LOW_D1 (1 << 15)
+# define R600_DYN_GFX_CLK_OFF_MC_EN (1 << 16)
+
+#define R600_MCLK_PWRMGT_CNTL 0x624
+# define R600_MPLL_PWRMGT_OFF (1 << 0)
#define R600_LOWER_GPIO_ENABLE 0x710
#define R600_CTXSW_VID_LOWER_GPIO_CNTL 0x718
@@ -5331,5 +5394,6 @@
# define R500_RS_IP_OFFSET_EN (1 << 31)
#define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */
+#define R530_MC_ARB_RATIO_CLK_SEQ 0x0016 /* MC */
#endif
git-bluetooth.patch:
--- NEW FILE git-bluetooth.patch ---
commit b1fb06830dc870d862f7f80e276130c0ab84d59f
Author: Wei Yongjun <yjwei at cn.fujitsu.com>
Date: Wed Feb 25 18:09:33 2009 +0800
Bluetooth: Remove some pointless conditionals before kfree_skb()
Remove some pointless conditionals before kfree_skb().
Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
commit 7585b97a48180f754ebdade1be94092e36bef365
Author: Wei Yongjun <yjwei at cn.fujitsu.com>
Date: Wed Feb 25 18:29:52 2009 +0800
Bluetooth: Remove some pointless conditionals before kfree_skb()
Remove some pointless conditionals before kfree_skb().
Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
commit 2ae9a6be5f476f3512839a4d11a8f432bfd2914c
Author: Dave Young <hidave.darkstar at gmail.com>
Date: Sat Feb 21 16:13:34 2009 +0800
Bluetooth: Move hci_conn_del_sysfs() back to avoid device destruct too early
The following commit introduce a regression:
commit 7d0db0a373195385a2e0b19d1f5e4b186fdcffac
Author: Marcel Holtmann <marcel at holtmann.org>
Date: Mon Jul 14 20:13:51 2008 +0200
[Bluetooth] Use a more unique bus name for connections
I get panic as following (by netconsole):
[ 2709.344034] usb 5-1: new full speed USB device using uhci_hcd and address 4
[ 2709.505776] usb 5-1: configuration #1 chosen from 1 choice
[ 2709.569207] Bluetooth: Generic Bluetooth USB driver ver 0.4
[ 2709.570169] usbcore: registered new interface driver btusb
[ 2845.742781] BUG: unable to handle kernel paging request at 6b6b6c2f
[ 2845.742958] IP: [<c015515c>] __lock_acquire+0x6c/0xa80
[ 2845.743087] *pde = 00000000
[ 2845.743206] Oops: 0002 [#1] SMP
[ 2845.743377] last sysfs file: /sys/class/bluetooth/hci0/hci0:6/type
[ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
[ 2845.743742]
[ 2845.743742] Pid: 0, comm: swapper Not tainted (2.6.29-rc5-smp #54) Dell DM051
[ 2845.743742] EIP: 0060:[<c015515c>] EFLAGS: 00010002 CPU: 0
[ 2845.743742] EIP is at __lock_acquire+0x6c/0xa80
[ 2845.743742] EAX: 00000046 EBX: 00000046 ECX: 6b6b6b6b EDX: 00000002
[ 2845.743742] ESI: 6b6b6b6b EDI: 00000000 EBP: c064fd14 ESP: c064fcc8
[ 2845.743742] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 2845.743742] Process swapper (pid: 0, ti=c064e000 task=c05d1400 task.ti=c064e000)
[ 2845.743742] Stack:
[ 2845.743742] c05d1400 00000002 c05d1400 00000001 00000002 00000000 f65388dc c05d1400
[ 2845.743742] 6b6b6b6b 00000292 c064fd0c c0153732 00000000 00000000 00000001 f700fa50
[ 2845.743742] 00000046 00000000 00000000 c064fd40 c0155be6 00000000 00000002 00000001
[ 2845.743742] Call Trace:
[ 2845.743742] [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
[ 2845.743742] [<c0155be6>] ? lock_acquire+0x76/0xa0
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c046c885>] ? _spin_lock_irqsave+0x45/0x80
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1f94>] ? skb_queue_purge+0x14/0x20
[ 2845.743742] [<f8171f5a>] ? hci_conn_del+0x10a/0x1c0 [bluetooth]
[ 2845.743742] [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
[ 2845.743742] [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
[ 2845.743742] [<f8175758>] ? hci_event_packet+0x5f8/0x31c0 [bluetooth]
[ 2845.743742] [<c03dfe19>] ? sock_def_readable+0x59/0x80
[ 2845.743742] [<c046c14d>] ? _read_unlock+0x1d/0x20
[ 2845.743742] [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
[ 2845.743742] [<c015388b>] ? trace_hardirqs_on+0xb/0x10
[ 2845.743742] [<f816fa6a>] ? hci_rx_task+0x2ba/0x490 [bluetooth]
[ 2845.743742] [<c0133661>] ? tasklet_action+0x31/0xc0
[ 2845.743742] [<c013367c>] ? tasklet_action+0x4c/0xc0
[ 2845.743742] [<c0132eb7>] ? __do_softirq+0xa7/0x170
[ 2845.743742] [<c0116dec>] ? ack_apic_level+0x5c/0x1c0
[ 2845.743742] [<c0132fd7>] ? do_softirq+0x57/0x60
[ 2845.743742] [<c01333dc>] ? irq_exit+0x7c/0x90
[ 2845.743742] [<c01055bb>] ? do_IRQ+0x4b/0x90
[ 2845.743742] [<c01333d5>] ? irq_exit+0x75/0x90
[ 2845.743742] [<c010392c>] ? common_interrupt+0x2c/0x34
[ 2845.743742] [<c010a14f>] ? mwait_idle+0x4f/0x70
[ 2845.743742] [<c0101c05>] ? cpu_idle+0x65/0xb0
[ 2845.743742] [<c045731e>] ? rest_init+0x4e/0x60
[ 2845.743742] Code: 0f 84 69 02 00 00 83 ff 07 0f 87 1e 06 00 00 85 ff 0f 85 08 05 00 00 8b 4d cc 8b 49 04 85 c9 89 4d d4 0f 84 f7 04 00 00 8b 75 d4 <f0> ff 86 c4 00 00 00 89 f0 e8 56 a9 ff ff 85 c0 0f 85 6e 03 00
[ 2845.743742] EIP: [<c015515c>] __lock_acquire+0x6c/0xa80 SS:ESP 0068:c064fcc8
[ 2845.743742] ---[ end trace 4c985b38f022279f ]---
[ 2845.743742] Kernel panic - not syncing: Fatal exception in interrupt
[ 2845.743742] ------------[ cut here ]------------
[ 2845.743742] WARNING: at kernel/smp.c:329 smp_call_function_many+0x151/0x200()
[ 2845.743742] Hardware name: Dell DM051
[ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
[ 2845.743742] Pid: 0, comm: swapper Tainted: G D 2.6.29-rc5-smp #54
[ 2845.743742] Call Trace:
[ 2845.743742] [<c012e076>] warn_slowpath+0x86/0xa0
[ 2845.743742] [<c015041b>] ? trace_hardirqs_off+0xb/0x10
[ 2845.743742] [<c0146384>] ? up+0x14/0x40
[ 2845.743742] [<c012e661>] ? release_console_sem+0x31/0x1e0
[ 2845.743742] [<c046c8ab>] ? _spin_lock_irqsave+0x6b/0x80
[ 2845.743742] [<c015041b>] ? trace_hardirqs_off+0xb/0x10
[ 2845.743742] [<c046c900>] ? _read_lock_irqsave+0x40/0x80
[ 2845.743742] [<c012e7f2>] ? release_console_sem+0x1c2/0x1e0
[ 2845.743742] [<c0146384>] ? up+0x14/0x40
[ 2845.743742] [<c015041b>] ? trace_hardirqs_off+0xb/0x10
[ 2845.743742] [<c046a3d7>] ? __mutex_unlock_slowpath+0x97/0x160
[ 2845.743742] [<c046a563>] ? mutex_trylock+0xb3/0x180
[ 2845.743742] [<c046a4a8>] ? mutex_unlock+0x8/0x10
[ 2845.743742] [<c015b991>] smp_call_function_many+0x151/0x200
[ 2845.743742] [<c010a1a0>] ? stop_this_cpu+0x0/0x40
[ 2845.743742] [<c015ba61>] smp_call_function+0x21/0x30
[ 2845.743742] [<c01137ae>] native_smp_send_stop+0x1e/0x50
[ 2845.743742] [<c012e0f5>] panic+0x55/0x110
[ 2845.743742] [<c01065a8>] oops_end+0xb8/0xc0
[ 2845.743742] [<c010668f>] die+0x4f/0x70
[ 2845.743742] [<c011a8c9>] do_page_fault+0x269/0x610
[ 2845.743742] [<c011a660>] ? do_page_fault+0x0/0x610
[ 2845.743742] [<c046cbaf>] error_code+0x77/0x7c
[ 2845.743742] [<c015515c>] ? __lock_acquire+0x6c/0xa80
[ 2845.743742] [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
[ 2845.743742] [<c0155be6>] lock_acquire+0x76/0xa0
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c046c885>] _spin_lock_irqsave+0x45/0x80
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1aad>] skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1f94>] skb_queue_purge+0x14/0x20
[ 2845.743742] [<f8171f5a>] hci_conn_del+0x10a/0x1c0 [bluetooth]
[ 2845.743742] [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
[ 2845.743742] [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
[ 2845.743742] [<f8175758>] hci_event_packet+0x5f8/0x31c0 [bluetooth]
[ 2845.743742] [<c03dfe19>] ? sock_def_readable+0x59/0x80
[ 2845.743742] [<c046c14d>] ? _read_unlock+0x1d/0x20
[ 2845.743742] [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
[ 2845.743742] [<c015388b>] ? trace_hardirqs_on+0xb/0x10
[ 2845.743742] [<f816fa6a>] hci_rx_task+0x2ba/0x490 [bluetooth]
[ 2845.743742] [<c0133661>] ? tasklet_action+0x31/0xc0
[ 2845.743742] [<c013367c>] tasklet_action+0x4c/0xc0
[ 2845.743742] [<c0132eb7>] __do_softirq+0xa7/0x170
[ 2845.743742] [<c0116dec>] ? ack_apic_level+0x5c/0x1c0
[ 2845.743742] [<c0132fd7>] do_softirq+0x57/0x60
[ 2845.743742] [<c01333dc>] irq_exit+0x7c/0x90
[ 2845.743742] [<c01055bb>] do_IRQ+0x4b/0x90
[ 2845.743742] [<c01333d5>] ? irq_exit+0x75/0x90
[ 2845.743742] [<c010392c>] common_interrupt+0x2c/0x34
[ 2845.743742] [<c010a14f>] ? mwait_idle+0x4f/0x70
[ 2845.743742] [<c0101c05>] cpu_idle+0x65/0xb0
[ 2845.743742] [<c045731e>] rest_init+0x4e/0x60
[ 2845.743742] ---[ end trace 4c985b38f02227a0 ]---
[ 2845.743742] ------------[ cut here ]------------
[ 2845.743742] WARNING: at kernel/smp.c:226 smp_call_function_single+0x8e/0x110()
[ 2845.743742] Hardware name: Dell DM051
[ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
[ 2845.743742] Pid: 0, comm: swapper Tainted: G D W 2.6.29-rc5-smp #54
[ 2845.743742] Call Trace:
[ 2845.743742] [<c012e076>] warn_slowpath+0x86/0xa0
[ 2845.743742] [<c012e000>] ? warn_slowpath+0x10/0xa0
[ 2845.743742] [<c015041b>] ? trace_hardirqs_off+0xb/0x10
[ 2845.743742] [<c0146384>] ? up+0x14/0x40
[ 2845.743742] [<c012e661>] ? release_console_sem+0x31/0x1e0
[ 2845.743742] [<c046c8ab>] ? _spin_lock_irqsave+0x6b/0x80
[ 2845.743742] [<c015041b>] ? trace_hardirqs_off+0xb/0x10
[ 2845.743742] [<c046c900>] ? _read_lock_irqsave+0x40/0x80
[ 2845.743742] [<c012e7f2>] ? release_console_sem+0x1c2/0x1e0
[ 2845.743742] [<c0146384>] ? up+0x14/0x40
[ 2845.743742] [<c015b7be>] smp_call_function_single+0x8e/0x110
[ 2845.743742] [<c010a1a0>] ? stop_this_cpu+0x0/0x40
[ 2845.743742] [<c026d23f>] ? cpumask_next_and+0x1f/0x40
[ 2845.743742] [<c015b95a>] smp_call_function_many+0x11a/0x200
[ 2845.743742] [<c010a1a0>] ? stop_this_cpu+0x0/0x40
[ 2845.743742] [<c015ba61>] smp_call_function+0x21/0x30
[ 2845.743742] [<c01137ae>] native_smp_send_stop+0x1e/0x50
[ 2845.743742] [<c012e0f5>] panic+0x55/0x110
[ 2845.743742] [<c01065a8>] oops_end+0xb8/0xc0
[ 2845.743742] [<c010668f>] die+0x4f/0x70
[ 2845.743742] [<c011a8c9>] do_page_fault+0x269/0x610
[ 2845.743742] [<c011a660>] ? do_page_fault+0x0/0x610
[ 2845.743742] [<c046cbaf>] error_code+0x77/0x7c
[ 2845.743742] [<c015515c>] ? __lock_acquire+0x6c/0xa80
[ 2845.743742] [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
[ 2845.743742] [<c0155be6>] lock_acquire+0x76/0xa0
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c046c885>] _spin_lock_irqsave+0x45/0x80
[ 2845.743742] [<c03e1aad>] ? skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1aad>] skb_dequeue+0x1d/0x70
[ 2845.743742] [<c03e1f94>] skb_queue_purge+0x14/0x20
[ 2845.743742] [<f8171f5a>] hci_conn_del+0x10a/0x1c0 [bluetooth]
[ 2845.743742] [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
[ 2845.743742] [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
[ 2845.743742] [<f8175758>] hci_event_packet+0x5f8/0x31c0 [bluetooth]
[ 2845.743742] [<c03dfe19>] ? sock_def_readable+0x59/0x80
[ 2845.743742] [<c046c14d>] ? _read_unlock+0x1d/0x20
[ 2845.743742] [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
[ 2845.743742] [<c015388b>] ? trace_hardirqs_on+0xb/0x10
[ 2845.743742] [<f816fa6a>] hci_rx_task+0x2ba/0x490 [bluetooth]
[ 2845.743742] [<c0133661>] ? tasklet_action+0x31/0xc0
[...2945 lines suppressed...]
+ case BT_SECURITY_HIGH:
+ opt = RFCOMM_LM_AUTH | RFCOMM_LM_ENCRYPT |
+ RFCOMM_LM_SECURE;
+ break;
+ default:
+ opt = 0;
+ break;
+ }
+
+ if (rfcomm_pi(sk)->role_switch)
+ opt |= RFCOMM_LM_MASTER;
+
+ if (put_user(opt, (u32 __user *) optval))
err = -EFAULT;
break;
case RFCOMM_CONNINFO:
- if (sk->sk_state != BT_CONNECTED) {
+ if (sk->sk_state != BT_CONNECTED &&
+ !rfcomm_pi(sk)->dlc->defer_setup) {
err = -ENOTCONN;
break;
}
@@ -785,6 +896,60 @@ static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, c
return err;
}
+static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
+{
+ struct sock *sk = sock->sk;
+ struct bt_security sec;
+ int len, err = 0;
+
+ BT_DBG("sk %p", sk);
+
+ if (level == SOL_RFCOMM)
+ return rfcomm_sock_getsockopt_old(sock, optname, optval, optlen);
+
+ if (level != SOL_BLUETOOTH)
+ return -ENOPROTOOPT;
+
+ if (get_user(len, optlen))
+ return -EFAULT;
+
+ lock_sock(sk);
+
+ switch (optname) {
+ case BT_SECURITY:
+ if (sk->sk_type != SOCK_STREAM) {
+ err = -EINVAL;
+ break;
+ }
+
+ sec.level = rfcomm_pi(sk)->sec_level;
+
+ len = min_t(unsigned int, len, sizeof(sec));
+ if (copy_to_user(optval, (char *) &sec, len))
+ err = -EFAULT;
+
+ break;
+
+ case BT_DEFER_SETUP:
+ if (sk->sk_state != BT_BOUND && sk->sk_state != BT_LISTEN) {
+ err = -EINVAL;
+ break;
+ }
+
+ if (put_user(bt_sk(sk)->defer_setup, (u32 __user *) optval))
+ err = -EFAULT;
+
+ break;
+
+ default:
+ err = -ENOPROTOOPT;
+ break;
+ }
+
+ release_sock(sk);
+ return err;
+}
+
static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct sock *sk __maybe_unused = sock->sk;
@@ -888,6 +1053,10 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
done:
bh_unlock_sock(parent);
+
+ if (bt_sk(parent)->defer_setup)
+ parent->sk_state_change(parent);
+
return result;
}
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 46fd8bf..51ae0c3 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -195,7 +195,7 @@ static int sco_connect(struct sock *sk)
else
type = SCO_LINK;
- hcon = hci_connect(hdev, type, dst, HCI_AT_NO_BONDING);
+ hcon = hci_connect(hdev, type, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING);
if (!hcon)
goto done;
@@ -668,7 +668,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char
return err;
}
-static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
+static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
struct sco_options opts;
@@ -723,6 +723,31 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char
return err;
}
+static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
+{
+ struct sock *sk = sock->sk;
+ int len, err = 0;
+
+ BT_DBG("sk %p", sk);
+
+ if (level == SOL_SCO)
+ return sco_sock_getsockopt_old(sock, optname, optval, optlen);
+
+ if (get_user(len, optlen))
+ return -EFAULT;
+
+ lock_sock(sk);
+
+ switch (optname) {
+ default:
+ err = -ENOPROTOOPT;
+ break;
+ }
+
+ release_sock(sk);
+ return err;
+}
+
static int sco_sock_release(struct socket *sock)
{
struct sock *sk = sock->sk;
@@ -832,10 +857,30 @@ done:
/* ----- SCO interface with lower layer (HCI) ----- */
static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
{
+ register struct sock *sk;
+ struct hlist_node *node;
+ int lm = 0;
+
+ if (type != SCO_LINK && type != ESCO_LINK)
+ return 0;
+
BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr));
- /* Always accept connection */
- return HCI_LM_ACCEPT;
+ /* Find listening sockets */
+ read_lock(&sco_sk_list.lock);
+ sk_for_each(sk, node, &sco_sk_list.head) {
+ if (sk->sk_state != BT_LISTEN)
+ continue;
+
+ if (!bacmp(&bt_sk(sk)->src, &hdev->bdaddr) ||
+ !bacmp(&bt_sk(sk)->src, BDADDR_ANY)) {
+ lm |= HCI_LM_ACCEPT;
+ break;
+ }
+ }
+ read_unlock(&sco_sk_list.lock);
+
+ return lm;
}
static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
@@ -857,7 +902,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
return 0;
}
-static int sco_disconn_ind(struct hci_conn *hcon, __u8 reason)
+static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)
{
BT_DBG("hcon %p reason %d", hcon, reason);
@@ -940,7 +985,7 @@ static struct hci_proto sco_hci_proto = {
.id = HCI_PROTO_SCO,
.connect_ind = sco_connect_ind,
.connect_cfm = sco_connect_cfm,
- .disconn_ind = sco_disconn_ind,
+ .disconn_cfm = sco_disconn_cfm,
.recv_scodata = sco_recv_scodata
};
hda_intel-prealloc-4mb-dmabuffer.patch:
--- NEW FILE hda_intel-prealloc-4mb-dmabuffer.patch ---
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c8d9178..7d3bb15 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1774,6 +1774,7 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct azx_pcm *apcm;
int pcm_dev = cpcm->device;
int s, err;
+ size_t prealloc_min = 64*1024; /* 64KB */
if (pcm_dev >= AZX_MAX_PCMS) {
snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n",
@@ -1807,10 +1808,21 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
if (cpcm->stream[s].substreams)
snd_pcm_set_ops(pcm, s, &azx_pcm_ops);
}
+
/* buffer pre-allocation */
+
+ /* subtle, don't allocate a big buffer for modems...
+ * also, don't just test 32BIT_MASK, since azx supports
+ * 64-bit DMA in some cases.
+ */
+ /* lennart wants a 2.2MB buffer for 2sec of 48khz */
+ if (pcm->dev_class == SNDRV_PCM_CLASS_GENERIC &&
+ chip->pci->dma_mask >= DMA_32BIT_MASK)
+ prealloc_min = 4 * 1024 * 1024; /* 4MB */
+
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
snd_dma_pci_data(chip->pci),
- 1024 * 64, 32 * 1024 * 1024);
+ prealloc_min, 32 * 1024 * 1024);
return 0;
}
linux-2.6-ipw2x00-age-scan-results-on-resume.patch:
--- NEW FILE linux-2.6-ipw2x00-age-scan-results-on-resume.patch ---
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 823c2bf..2d7e32c 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1692,7 +1692,13 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
u32 lock;
u32 ord_len = sizeof(lock);
- /* Quite if manually disabled. */
+ /* Age scan list entries found before suspend */
+ if (priv->suspend_time) {
+ ieee80211_networks_age(priv->ieee, priv->suspend_time);
+ priv->suspend_time = 0;
+ }
+
+ /* Quiet if manually disabled. */
if (priv->status & STATUS_RF_KILL_SW) {
IPW_DEBUG_INFO("%s: Radio is disabled by Manual Disable "
"switch\n", priv->net_dev->name);
@@ -6414,6 +6420,8 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
pci_disable_device(pci_dev);
pci_set_power_state(pci_dev, PCI_D3hot);
+ priv->suspend_at = get_seconds();
+
mutex_unlock(&priv->action_mutex);
return 0;
@@ -6457,6 +6465,8 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
* the queue of needed */
netif_device_attach(dev);
+ priv->suspend_time = get_seconds() - priv->suspend_at;
+
/* Bring the device back up */
if (!(priv->status & STATUS_RF_KILL_SW))
ipw2100_up(priv, 0);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.h b/drivers/net/wireless/ipw2x00/ipw2100.h
index bbf1ddc..3a65e8a 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.h
+++ b/drivers/net/wireless/ipw2x00/ipw2100.h
@@ -591,6 +591,10 @@ struct ipw2100_priv {
int user_requested_scan;
+ /* Track time in suspend */
+ unsigned long suspend_at;
+ unsigned long suspend_time;
+
u32 interrupts;
int tx_interrupts;
int rx_interrupts;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 625f2cf..90cc346 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11224,6 +11224,12 @@ static int ipw_up(struct ipw_priv *priv)
{
int rc, i, j;
+ /* Age scan list entries found before suspend */
+ if (priv->suspend_time) {
+ ieee80211_networks_age(priv->ieee, priv->suspend_time);
+ priv->suspend_time = 0;
+ }
+
if (priv->status & STATUS_EXIT_PENDING)
return -EIO;
@@ -11824,6 +11830,8 @@ static int ipw_pci_suspend(struct pci_dev *pdev, pm_message_t state)
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
+ priv->suspend_at = get_seconds();
+
return 0;
}
@@ -11859,6 +11867,8 @@ static int ipw_pci_resume(struct pci_dev *pdev)
* the queue of needed */
netif_device_attach(dev);
+ priv->suspend_time = get_seconds() - priv->suspend_at;
+
/* Bring the device back up */
queue_work(priv->workqueue, &priv->up);
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.h b/drivers/net/wireless/ipw2x00/ipw2200.h
index 277b274..9e156b9 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.h
+++ b/drivers/net/wireless/ipw2x00/ipw2200.h
@@ -1346,6 +1346,10 @@ struct ipw_priv {
s8 tx_power;
+ /* Track time in suspend */
+ unsigned long suspend_at;
+ unsigned long suspend_time;
+
#ifdef CONFIG_PM
u32 pm_state[16];
#endif
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index a2f5616..e062edc 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -105,6 +105,21 @@ static inline void ieee80211_networks_free(struct ieee80211_device *ieee)
ieee->networks = NULL;
}
+void ieee80211_networks_age(struct ieee80211_device *ieee,
+ unsigned long age_secs)
+{
+ struct ieee80211_network *network = NULL;
+ unsigned long flags;
+ unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC);
+
+ spin_lock_irqsave(&ieee->lock, flags);
+ list_for_each_entry(network, &ieee->network_list, list) {
+ network->last_scanned -= age_jiffies;
+ }
+ spin_unlock_irqrestore(&ieee->lock, flags);
+}
+EXPORT_SYMBOL(ieee80211_networks_age);
+
static void ieee80211_networks_initialize(struct ieee80211_device *ieee)
{
int i;
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 9c67dfa..cbdfca8 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -1615,7 +1615,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
break;
if ((oldest == NULL) ||
- (target->last_scanned < oldest->last_scanned))
+ time_before(target->last_scanned, oldest->last_scanned))
oldest = target;
}
diff --git a/drivers/net/wireless/ipw2x00/libipw_wx.c b/drivers/net/wireless/ipw2x00/libipw_wx.c
index 31ea3ab..4528649 100644
--- a/drivers/net/wireless/ipw2x00/libipw_wx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_wx.c
@@ -42,6 +42,16 @@ static const char *ieee80211_modes[] = {
"?", "a", "b", "ab", "g", "ag", "bg", "abg"
};
+static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
+{
+ unsigned long end = jiffies;
+
+ if (end >= start)
+ return jiffies_to_msecs(end - start);
+
+ return jiffies_to_msecs(end + (MAX_JIFFY_OFFSET - start) + 1);
+}
+
#define MAX_CUSTOM_LEN 64
static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
char *start, char *stop,
@@ -215,8 +225,8 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
iwe.cmd = IWEVCUSTOM;
p = custom;
p += snprintf(p, MAX_CUSTOM_LEN - (p - custom),
- " Last beacon: %dms ago",
- jiffies_to_msecs(jiffies - network->last_scanned));
+ " Last beacon: %ums ago",
+ elapsed_jiffies_msecs(network->last_scanned));
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
@@ -276,15 +286,15 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
time_after(network->last_scanned + ieee->scan_age, jiffies))
ev = ieee80211_translate_scan(ieee, ev, stop, network,
info);
- else
+ else {
IEEE80211_DEBUG_SCAN("Not showing network '%s ("
- "%pM)' due to age (%dms).\n",
+ "%pM)' due to age (%ums).\n",
print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid,
- jiffies_to_msecs(jiffies -
- network->
- last_scanned));
+ elapsed_jiffies_msecs(
+ network->last_scanned));
+ }
}
spin_unlock_irqrestore(&ieee->lock, flags);
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index adb7cf3..7515fad 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -1119,6 +1119,9 @@ static inline int ieee80211_is_cck_rate(u8 rate)
extern void free_ieee80211(struct net_device *dev);
extern struct net_device *alloc_ieee80211(int sizeof_priv);
+extern void ieee80211_networks_age(struct ieee80211_device *ieee,
+ unsigned long age_secs);
+
extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
/* ieee80211_tx.c */
linux-2.6-mac80211-age-scan-results-on-resume.patch:
--- NEW FILE linux-2.6-mac80211-age-scan-results-on-resume.patch ---
Backport of "cfg80211: age scan results on resume" by Dan Williams.
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 23c0ab7..0432eb6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -450,6 +450,9 @@ struct ieee80211_channel;
* wireless extensions but this is subject to reevaluation as soon as this
* code is used more widely and we have a first user without wext.
*
+ * @suspend: wiphy device needs to be suspended
+ * @resume: wiphy device needs to be resumed
+ *
* @add_virtual_intf: create a new virtual interface with the given name,
* must set the struct wireless_dev's iftype.
*
@@ -499,6 +502,9 @@ struct ieee80211_channel;
* @set_channel: Set channel
*/
struct cfg80211_ops {
+ int (*suspend)(struct wiphy *wiphy);
+ int (*resume)(struct wiphy *wiphy);
+
int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params);
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 21c5d96..ae2d34d 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -220,6 +220,9 @@ struct wiphy {
/* dir in debugfs: ieee80211/<wiphyname> */
struct dentry *debugfsdir;
+ /* time spent in suspend, in seconds */
+ unsigned long suspend_duration;
+
char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
};
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9d4e4d8..691183e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1141,6 +1141,32 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
}
+#ifdef CONFIG_PM
+static int ieee80211_suspend(struct wiphy *wiphy)
+{
+ return 0;
+}
+
+static int ieee80211_resume(struct wiphy *wiphy)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ unsigned long age_jiffies;
+ struct ieee80211_bss *bss;
+
+ age_jiffies = msecs_to_jiffies(wiphy->suspend_duration * MSEC_PER_SEC);
+ spin_lock_bh(&local->bss_lock);
+ list_for_each_entry(bss, &local->bss_list, list) {
+ bss->last_update -= age_jiffies;
+ }
+ spin_unlock_bh(&local->bss_lock);
+
+ return 0;
+}
+#else
+#define ieee80211_suspend NULL
+#define ieee80211_resume NULL
+#endif
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -1169,4 +1195,6 @@ struct cfg80211_ops mac80211_config_ops = {
.change_bss = ieee80211_change_bss,
.set_txq_params = ieee80211_set_txq_params,
.set_channel = ieee80211_set_channel,
+ .suspend = ieee80211_suspend,
+ .resume = ieee80211_resume,
};
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index f5c7c33..eb43ff5 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -745,6 +745,15 @@ static void ieee80211_scan_add_ies(struct iw_request_info *info,
}
}
+static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
+{
+ unsigned long end = jiffies;
+
+ if (end >= start)
+ return jiffies_to_msecs(end - start);
+
+ return jiffies_to_msecs(end + (MAX_JIFFY_OFFSET - start) + 1);
+}
static char *
ieee80211_scan_result(struct ieee80211_local *local,
@@ -857,8 +866,8 @@ ieee80211_scan_result(struct ieee80211_local *local,
&iwe, buf);
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVCUSTOM;
- sprintf(buf, " Last beacon: %dms ago",
- jiffies_to_msecs(jiffies - bss->last_update));
+ sprintf(buf, " Last beacon: %ums ago",
+ elapsed_jiffies_msecs(bss->last_update));
iwe.u.data.length = strlen(buf);
current_ev = iwe_stream_add_point(info, current_ev,
end_buf, &iwe, buf);
diff --git a/net/wireless/core.h b/net/wireless/core.h
index f7fb9f4..a4031a9 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -41,6 +41,8 @@ struct cfg80211_registered_device {
struct mutex devlist_mtx;
struct list_head netdev_list;
+ unsigned long suspend_at;
+
/* must be last because of the way we do wiphy_priv(),
* and it should at least be aligned to NETDEV_ALIGN */
struct wiphy wiphy __attribute__((__aligned__(NETDEV_ALIGN)));
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index 79a3828..dc92564 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -55,6 +55,39 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)
}
#endif
+static int wiphy_suspend(struct device *dev, pm_message_t state)
+{
+ struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
+ int ret = 0;
+
+ rdev->wiphy.suspend_duration = 0;
+ rdev->suspend_at = get_seconds();
+
+ if (rdev->ops->suspend) {
+ rtnl_lock();
+ ret = rdev->ops->suspend(&rdev->wiphy);
+ rtnl_unlock();
+ }
+
+ return ret;
+}
+
+static int wiphy_resume(struct device *dev)
+{
+ struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
+ int ret = 0;
+
+ rdev->wiphy.suspend_duration = get_seconds() - rdev->suspend_at;
+
+ if (rdev->ops->resume) {
+ rtnl_lock();
+ ret = rdev->ops->resume(&rdev->wiphy);
+ rtnl_unlock();
+ }
+
+ return ret;
+}
+
struct class ieee80211_class = {
.name = "ieee80211",
.owner = THIS_MODULE,
@@ -63,6 +96,8 @@ struct class ieee80211_class = {
#ifdef CONFIG_HOTPLUG
.dev_uevent = wiphy_uevent,
#endif
+ .suspend = wiphy_suspend,
+ .resume = wiphy_resume,
};
int wiphy_sysfs_init(void)
linux-2.6-v4l-dvb-fixes.patch:
--- NEW FILE linux-2.6-v4l-dvb-fixes.patch ---
diff -upr drivers/media/video/v4l2-common.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/video/v4l2-common.c
--- a/drivers/media/video/v4l2-common.c 2009-02-27 22:44:26.000000000 -0300
+++ b/drivers/media/video/v4l2-common.c 2009-01-06 22:29:51.000000000 -0200
@@ -547,7 +547,6 @@ int v4l2_ctrl_query_fill(struct v4l2_que
case V4L2_CID_CONTRAST:
case V4L2_CID_SATURATION:
case V4L2_CID_HUE:
- case V4L2_CID_SHARPNESS:
qctrl->flags |= V4L2_CTRL_FLAG_SLIDER;
break;
}
@@ -586,8 +585,6 @@ int v4l2_ctrl_query_fill_std(struct v4l2
return v4l2_ctrl_query_fill(qctrl, 0, 127, 1, 64);
case V4L2_CID_HUE:
return v4l2_ctrl_query_fill(qctrl, -128, 127, 1, 0);
- case V4L2_CID_SHARPNESS:
- return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
/* MPEG controls */
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
--- NEW FILE patch-2.6.29-rc7.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info
iD8DBQBJrdg9yGugalF9Dw4RAkFfAJ4xnteJus29MN1bxtl2e2Jth3eD9gCfSg+B
7+Al92iS+MSQAiNKlvYD9Ps=
=d3rT
-----END PGP SIGNATURE-----
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/.cvsignore,v
retrieving revision 1.1014.2.4
retrieving revision 1.1014.2.5
diff -u -r1.1014.2.4 -r1.1014.2.5
--- .cvsignore 25 Feb 2009 21:25:59 -0000 1.1014.2.4
+++ .cvsignore 5 Mar 2009 01:30:21 -0000 1.1014.2.5
@@ -1,8 +1,8 @@
clog
+.shared-srctree
GNUmakefile
kernel-2.6.*.config
temp-*
kernel-2.6.28
linux-2.6.28.tar.bz2
-patch-2.6.29-rc6.bz2
-patch-2.6.29-rc6-git2.bz2
+patch-2.6.29-rc7.bz2
Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.238.6.6
retrieving revision 1.238.6.7
diff -u -r1.238.6.6 -r1.238.6.7
--- config-generic 25 Feb 2009 23:14:05 -0000 1.238.6.6
+++ config-generic 5 Mar 2009 01:30:21 -0000 1.238.6.7
@@ -2044,10 +2044,10 @@
CONFIG_W1_MASTER_DS1WM=m
CONFIG_W1_SLAVE_THERM=m
CONFIG_W1_SLAVE_SMEM=m
+CONFIG_W1_SLAVE_DS2431=m
CONFIG_W1_SLAVE_DS2433=m
CONFIG_W1_SLAVE_DS2433_CRC=y
CONFIG_W1_SLAVE_DS2760=m
-
#
# Mice
#
@@ -2174,6 +2174,7 @@
CONFIG_DRM_I915_KMS=y
CONFIG_DRM_VIA=m
CONFIG_DRM_NOUVEAU=m
+# CONFIG_DRM_NOUVEAU_KMS is not set
#
# PCMCIA character devices
@@ -2808,6 +2809,7 @@
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_USB_GSPCA_SQ905=m
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_OV511=m
@@ -3946,3 +3948,8 @@
CONFIG_XEN_NETDEV_BACKEND=y
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_X86_X2APIC is not set
+# CONFIG_RD_GZIP is not set
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_XEN_GNTDEV is not set
+# CONFIG_EVENT_TRACER is not set
Index: config-ia64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-ia64-generic,v
retrieving revision 1.21
retrieving revision 1.21.6.1
diff -u -r1.21 -r1.21.6.1
--- config-ia64-generic 7 Jan 2009 18:29:22 -0000 1.21
+++ config-ia64-generic 5 Mar 2009 01:30:21 -0000 1.21.6.1
@@ -211,3 +211,4 @@
CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT=y
+CONFIG_DMAR_DEFAULT_ON=y
Index: config-powerpc-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-powerpc-generic,v
retrieving revision 1.33.6.2
retrieving revision 1.33.6.3
diff -u -r1.33.6.2 -r1.33.6.3
--- config-powerpc-generic 25 Feb 2009 21:25:59 -0000 1.33.6.2
+++ config-powerpc-generic 5 Mar 2009 01:30:21 -0000 1.33.6.3
@@ -256,7 +256,8 @@
# CONFIG_PPC_SMLPAR is not set
CONFIG_MGCOGE=y
-CONFIG_GEF_SBC610=y
+### breaks usb on mac...? #486511
+# CONFIG_GEF_SBC610 is not set
CONFIG_QUICC_ENGINE=y
CONFIG_QE_GPIO=y
CONFIG_MPC8xxx_GPIO=y
drm-modesetting-radeon.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.54.6.2 -r 1.54.6.3 drm-modesetting-radeon.patch
Index: drm-modesetting-radeon.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-modesetting-radeon.patch,v
retrieving revision 1.54.6.2
retrieving revision 1.54.6.3
diff -u -r1.54.6.2 -r1.54.6.3
--- drm-modesetting-radeon.patch 25 Feb 2009 21:26:00 -0000 1.54.6.2
+++ drm-modesetting-radeon.patch 5 Mar 2009 01:30:21 -0000 1.54.6.3
@@ -1,23 +1,116 @@
-commit 0f6053741411f3ab78a99470523175f20c56b256
-Author: David Miller <davem at davemloft.net>
-Date: Thu Feb 12 02:15:39 2009 -0800
+commit 530ebda60cb7270795b7edd72930ab2d0e4db102
+Author: Dave Airlie <airlied at redhat.com>
+Date: Tue Mar 3 18:23:22 2009 +1000
+
+ radeon: port proc debug files to new debugfs interface
+
+commit 94137dff359fc70b51bdf035f97cfbab7424a5ce
+Author: Dave Airlie <airlied at redhat.com>
+Date: Tue Mar 3 15:33:52 2009 +1000
+
+ radeon: pin framebuffer and cursors dynamically
+
+commit 90a014f6d04548790dbcef1932ad3d89ff12aa32
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Fri Feb 27 20:25:36 2009 -0500
+
+ radeon: fix MC setup on systems with more than 512 MB of VRAM
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit 9e3775d3fe8677b2f995230521fd93cd9ef69327
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Fri Feb 27 20:18:20 2009 -0500
+
+ radeon: leave the MC_FB_LOCATION alone on RS780
+
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit b3c52a1d083b846541e2b6d78c917ae00e9f04c1
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Fri Feb 27 20:15:04 2009 -0500
- drm: radeon: Fix RADEON_*_EMITED defines.
+ radeon: wait for MC idle on r6xx/r7xx chips
- These are not supposed to be booleans, they are
- supposed to be bit masks.
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit b077cde9a296856bcadb3003e746950034e929bb
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date: Fri Feb 27 20:07:13 2009 -0500
+
+ radeon: fix up RS600 mc setup and unify mc reg access
- Signed-off-by: David S. Miller <davem at davemloft.net>
- Signed-off-by: Dave Airlie <airlied at linux.ie>
- (cherry picked from commit c88605574cafb3883011c898d21309b5d93d0d09)
+ Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit 85a3e7390f17ba442c020dda1a47e6b6b1ce0588
+Author: Dave Airlie <airlied at redhat.com>
+Date: Mon Mar 2 23:51:30 2009 +1100
+
+ radeon: fixup suspend/resume hooks
+
+commit 1467208a03bb127c3882c59cbcc2818fb1076b8d
+Author: Dave Airlie <airlied at redhat.com>
+Date: Sun Mar 1 18:25:07 2009 +1100
+
+ radeon: fix rs480 gart size
+
+commit f3812bb92e9900be559d5d4b2098b8dcef01cce9
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Feb 27 15:37:14 2009 +1000
+
+ radeon: disable kms by default for r600
+
+commit 924db462f118847e313a1a185e93e58016866da4
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Feb 27 11:51:22 2009 +1000
+
+ radeon: fixup proc hacks
+
+commit 59883501a17405b6db133066d41309db083eb722
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Feb 27 11:51:08 2009 +1000
+
+ radeon: fixup module load
+
+commit 0b8ecbca3940dc13b163ab2c46f633625d52aa72
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Feb 27 11:50:50 2009 +1000
+
+ radeon: fix up ring read/write for new drm-next code
+
+commit 6bffd54b50ca1889aea58454e39edf23e3c4ec50
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Feb 27 11:50:24 2009 +1000
+
+ ati_pcigart: update pcigart for changes in drm-next
+
+commit ddd936403f8c89d85a6407809e93e32b050b09b0
+Author: Dave Airlie <airlied at linux.ie>
+Date: Thu Feb 26 22:27:21 2009 +1000
+
+ radeon: fixup writeback/ring ptrs for Kms
+
+commit b245e49600fe885e376150d9e8adc6308408c70f
+Author: Dave Airlie <airlied at linux.ie>
+Date: Thu Feb 26 22:00:59 2009 +1000
+
+ radeon: fixup after rebase so it builds
+
+ lots more to do
+
+commit c2181284133a30bd1355b9f9463710f9ec43ccaa
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Feb 26 12:03:55 2009 +1000
+
+ drm/radeno: add support for r100 cp type 3 packets
-commit d5315273951332ebc92d0a0a32412c98fc3b6bec
+commit 62fb97e2a2e71f83c2c6c783f95a36ba19ec468f
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 25 16:07:15 2009 +1000
radeon: fixup cs buffer re-use code to not block straight away
-commit da53c6edb0b09776687bbf37796b3db3a47192af
+commit 7da8970a24bad69684fba5713106b3c7ab69c858
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 25 16:06:30 2009 +1000
@@ -25,37 +118,37 @@
Totally missed this before - really helps stability
-commit 5d2a309e5f10266667bc733b884198a2f51cf845
+commit 97c941152f9ebf9e8554d5fc9810a48c722e0c9b
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 25 13:03:47 2009 +1000
radeon: fix IB dump end
-commit 57f22b7e9781a6d0894af48369c75b0caa6d9a8b
+commit 7ce614a4e8d2c1f184de524eb5185fa0004328c5
Author: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Date: Tue Feb 24 20:26:53 2009 +1000
drm/ttm: work around some x86 pat oddities by using mixedmap instead of pfnmap
-commit 465937aec83364d3cf516bc8b6c2ca7f785892d9
+commit a7b9422d556ac958d4a13fc03f83be4cfa39b46a
Author: Dave Airlie <airlied at redhat.com>
Date: Sun Feb 22 08:22:14 2009 +1000
radeon: add module IDs
-commit dd6dc3d83534ae6ae908629cfe0d1a784e073102
+commit 9a51f123fcf038946ee12626b2b43c51aa83ce6c
Author: Dave Airlie <airlied at redhat.com>
Date: Sun Feb 22 08:19:33 2009 +1000
radeon: fixup for new APIs
-commit a93e118253bdf74092233dbc21d3e257688f39c8
+commit 60f38523ede4949f2b45ca50965b63a32d7a55ba
Author: Dave Airlie <airlied at redhat.com>
Date: Sun Feb 22 08:11:33 2009 +1000
drm: fix parmeter passed to fb_release
-commit 2b6628ce5e481e1ff5a30d8957d7b32fd5b4d1e1
+commit fb9c478ac883cbff1c1dc749c375fb530516e37e
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 18 17:36:33 2009 +1000
@@ -63,13 +156,13 @@
this adds basic IB dumping and cleans up some code around it.
-commit cb1fedbb2df6da2f104a026c7846dfc91564e2f7
+commit c7c57bbbc13a80bfd5eec9a52111f354871d6416
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 18 11:12:19 2009 +1000
radeon: fix packet2 parsing + enhance debug
-commit c3e00f3af01659590ef278d822ef0a727faf4f71
+commit 7970531e80133bae363d81d2da4b71b8b058a9eb
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 18 11:11:39 2009 +1000
@@ -80,37 +173,37 @@
It also doesn't or in the table values but sets them
[...4821 lines suppressed...]
}
break;
case RADEON_SETPARAM_PCIGART_LOCATION:
@@ -35150,7 +35295,7 @@
dev_priv->gart_info.table_size = sp->value;
if (dev_priv->gart_info.table_size < RADEON_PCIGART_TABLE_SIZE)
dev_priv->gart_info.table_size = RADEON_PCIGART_TABLE_SIZE;
-@@ -3127,6 +3153,14 @@ static int radeon_cp_setparam(struct drm_device *dev, void *data, struct drm_fil
+@@ -3137,6 +3163,14 @@ static int radeon_cp_setparam(struct drm_device *dev, void *data, struct drm_fil
case RADEON_SETPARAM_VBLANK_CRTC:
return radeon_vblank_crtc_set(dev, sp->value);
break;
@@ -35165,7 +35310,7 @@
default:
DRM_DEBUG("Invalid parameter %d\n", sp->param);
return -EINVAL;
-@@ -3215,7 +3249,19 @@ struct drm_ioctl_desc radeon_ioctls[] = {
+@@ -3226,7 +3260,19 @@ struct drm_ioctl_desc radeon_ioctls[] = {
DRM_IOCTL_DEF(DRM_RADEON_IRQ_WAIT, radeon_irq_wait, DRM_AUTH),
DRM_IOCTL_DEF(DRM_RADEON_SETPARAM, radeon_cp_setparam, DRM_AUTH),
DRM_IOCTL_DEF(DRM_RADEON_SURF_ALLOC, radeon_surface_alloc, DRM_AUTH),
@@ -35199,7 +35344,7 @@
/**
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index e5f4ae9..c963f25 100644
+index ccbcd13..99e348d 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -147,9 +147,23 @@ struct drm_device;
@@ -35226,7 +35371,7 @@
/*@}*/
-@@ -652,6 +666,8 @@ struct drm_master {
+@@ -665,6 +679,8 @@ struct drm_master {
void *driver_priv; /**< Private structure for driver to use */
};
@@ -35235,7 +35380,7 @@
/**
* DRM driver structure. This structure represent the common code for
* a family of cards. There will one drm_device for each card present
-@@ -770,6 +786,8 @@ struct drm_driver {
+@@ -784,6 +800,8 @@ struct drm_driver {
/* Driver private ops for this object */
struct vm_operations_struct *gem_vm_ops;
@@ -35244,7 +35389,7 @@
int major;
int minor;
-@@ -845,7 +863,10 @@ struct drm_device {
+@@ -906,7 +924,10 @@ struct drm_device {
/*@{ */
struct list_head maplist; /**< Linked list of regions */
int map_count; /**< Number of mappable regions */
@@ -35256,7 +35401,7 @@
/** \name Context handle management */
/*@{ */
-@@ -856,6 +877,7 @@ struct drm_device {
+@@ -917,6 +938,7 @@ struct drm_device {
struct idr ctx_idr;
struct list_head vmalist; /**< List of vmas (for debugging) */
@@ -35264,7 +35409,7 @@
/*@} */
-@@ -927,7 +949,6 @@ struct drm_device {
+@@ -988,7 +1010,6 @@ struct drm_device {
int num_crtcs; /**< Number of CRTCs on this device */
void *dev_private; /**< device private data */
void *mm_private;
@@ -35272,7 +35417,7 @@
struct drm_sigdata sigdata; /**< For block_all_signals */
sigset_t sigmask;
-@@ -937,6 +958,9 @@ struct drm_device {
+@@ -998,6 +1019,9 @@ struct drm_device {
struct drm_minor *control; /**< Control node for card */
struct drm_minor *primary; /**< render type primary screen head */
@@ -35282,7 +35427,7 @@
/** \name Drawable information */
/*@{ */
spinlock_t drw_lock;
-@@ -959,8 +983,28 @@ struct drm_device {
+@@ -1020,8 +1044,28 @@ struct drm_device {
uint32_t invalidate_domains; /* domains pending invalidation */
uint32_t flush_domains; /* domains pending flush */
/*@} */
@@ -35311,7 +35456,7 @@
static inline int drm_dev_to_irq(struct drm_device *dev)
{
-@@ -1070,6 +1114,17 @@ extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
+@@ -1131,6 +1175,17 @@ extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
uint32_t type);
extern int drm_unbind_agp(DRM_AGP_MEM * handle);
@@ -35329,7 +35474,7 @@
/* Misc. IOCTL support (drm_ioctl.h) */
extern int drm_irq_by_busid(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-@@ -1240,6 +1295,7 @@ extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size
+@@ -1301,6 +1356,7 @@ extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size
extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
@@ -35337,7 +35482,7 @@
extern void drm_agp_chipset_flush(struct drm_device *dev);
/* Stub support (drm_stub.h) */
-@@ -1281,6 +1337,8 @@ extern int drm_ati_pcigart_init(struct drm_device *dev,
+@@ -1368,6 +1424,8 @@ extern int drm_ati_pcigart_init(struct drm_device *dev,
struct drm_ati_pcigart_info * gart_info);
extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
struct drm_ati_pcigart_info * gart_info);
@@ -35346,7 +35491,7 @@
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
size_t align, dma_addr_t maxaddr);
-@@ -1438,6 +1496,39 @@ extern void drm_free(void *pt, size_t size, int area);
+@@ -1525,6 +1583,39 @@ extern void drm_free(void *pt, size_t size, int area);
extern void *drm_calloc(size_t nmemb, size_t size, int area);
#endif
@@ -35387,10 +35532,10 @@
#endif /* __KERNEL__ */
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
-index 0b0d236..cb3952c 100644
+index c7d4b2e..3091fc3 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
-@@ -121,4 +121,6 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
+@@ -122,4 +122,6 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
}
extern int drm_helper_resume_force_mode(struct drm_device *dev);
@@ -36349,10 +36494,10 @@
* on the security mechanisms provided by hardware.
*/
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
-index 73ff51f..1f67a11 100644
+index 937a275..f716e0a 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
-@@ -453,6 +453,15 @@ typedef struct {
+@@ -455,6 +455,15 @@ typedef struct {
int pfCurrentPage; /* which buffer is being displayed? */
int crtc2_base; /* CRTC2 frame offset */
int tiling_enabled; /* set by drm, read by 2d + 3d clients */
@@ -36368,7 +36513,7 @@
} drm_radeon_sarea_t;
/* WARNING: If you change any of these defines, make sure to change the
-@@ -493,6 +502,18 @@ typedef struct {
+@@ -495,6 +504,18 @@ typedef struct {
#define DRM_RADEON_SURF_ALLOC 0x1a
#define DRM_RADEON_SURF_FREE 0x1b
@@ -36387,7 +36532,7 @@
#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
-@@ -521,6 +542,18 @@ typedef struct {
+@@ -523,6 +544,18 @@ typedef struct {
#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
@@ -36406,7 +36551,7 @@
typedef struct drm_radeon_init {
enum {
RADEON_INIT_CP = 0x01,
-@@ -677,6 +710,8 @@ typedef struct drm_radeon_indirect {
+@@ -680,6 +713,8 @@ typedef struct drm_radeon_indirect {
#define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */
#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
@@ -36415,7 +36560,7 @@
typedef struct drm_radeon_getparam {
int param;
-@@ -731,6 +766,7 @@ typedef struct drm_radeon_setparam {
+@@ -734,6 +769,7 @@ typedef struct drm_radeon_setparam {
#define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
#define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
@@ -36423,7 +36568,7 @@
/* 1.14: Clients can allocate/free a surface
*/
typedef struct drm_radeon_surface_alloc {
-@@ -746,4 +782,106 @@ typedef struct drm_radeon_surface_free {
+@@ -749,4 +785,106 @@ typedef struct drm_radeon_surface_free {
#define DRM_RADEON_VBLANK_CRTC1 1
#define DRM_RADEON_VBLANK_CRTC2 2
drm-nouveau.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.8 -r 1.8.6.1 drm-nouveau.patch
Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.8
retrieving revision 1.8.6.1
diff -u -r1.8 -r1.8.6.1
--- drm-nouveau.patch 11 Feb 2009 04:35:13 -0000 1.8
+++ drm-nouveau.patch 5 Mar 2009 01:30:22 -0000 1.8.6.1
@@ -1,8 +1,8 @@
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
-index 0d87bfc..433bd8b 100644
+index a74980b..36582ff 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
-@@ -134,3 +134,9 @@ config DRM_SAVAGE
+@@ -133,3 +133,18 @@ config DRM_SAVAGE
help
Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister
chipset. If M is selected the module will be called savage.
@@ -12,44 +12,131 @@
+ depends on DRM
+ help
+ Choose this option for open-source nVidia support.
++
++config DRM_NOUVEAU_KMS
++ bool "Enable modesetting on nouveau by default"
++ depends on DRM_NOUVEAU
++ help
++ Choose this option if you want kernel modesetting enabled by default,
++ and you have a new enough userspace to support this. Running old
++ userspaces with this enabled will cause pain.
++
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
-index 9aba961..954fd51 100644
+index 03ceb3e..3df55d7 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
-@@ -26,4 +26,5 @@ obj-$(CONFIG_DRM_I915) += i915/
+@@ -27,4 +27,5 @@ obj-$(CONFIG_DRM_I915) += i915/
obj-$(CONFIG_DRM_SIS) += sis/
obj-$(CONFIG_DRM_SAVAGE)+= savage/
obj-$(CONFIG_DRM_VIA) +=via/
+obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
-index 19039d8..d5718bb 100644
+index 325b4aa..05e928f 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
-@@ -49,8 +49,8 @@ unsigned long drm_get_resource_len(struct drm_device *dev, unsigned int resource
+@@ -51,38 +51,24 @@ resource_size_t drm_get_resource_len(struct drm_device *dev, unsigned int resour
EXPORT_SYMBOL(drm_get_resource_len);
-static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
-- drm_local_map_t *map)
+- struct drm_local_map *map)
+struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
-+ drm_local_map_t *map)
++ struct drm_local_map *map)
{
struct drm_map_list *entry;
list_for_each_entry(entry, &dev->maplist, head) {
-@@ -63,6 +63,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
+- /*
+- * Because the kernel-userspace ABI is fixed at a 32-bit offset
+- * while PCI resources may live above that, we ignore the map
+- * offset for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS.
+- * It is assumed that each driver will have only one resource of
+- * each type.
+- */
+ if (!entry->map ||
+ map->type != entry->map->type ||
+ entry->master != dev->primary->master)
+ continue;
+- switch (map->type) {
+- case _DRM_SHM:
+- if (map->flags != _DRM_CONTAINS_LOCK)
+- break;
+- case _DRM_REGISTERS:
+- case _DRM_FRAME_BUFFER:
+- return entry;
+- default: /* Make gcc happy */
+- ;
+- }
+- if (entry->map->offset == map->offset)
++
++ if (entry->map->offset == map->offset ||
++ (map->type == _DRM_SHM && map->flags & _DRM_CONTAINS_LOCK))
+ return entry;
+ }
return NULL;
}
+EXPORT_SYMBOL(drm_find_matching_map);
static int drm_map_handle(struct drm_device *dev, struct drm_hash_item *hash,
- unsigned long user_token, int hashed_handle)
-diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index c6ade45..969b372 100644
---- a/drivers/gpu/drm/drm_drv.c
-+++ b/drivers/gpu/drm/drm_drv.c
-@@ -327,11 +327,10 @@ static void drm_cleanup(struct drm_device * dev)
+ unsigned long user_token, int hashed_handle, int shm)
+@@ -349,7 +335,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
+ /* We do it here so that dev->struct_mutex protects the increment */
+ user_token = (map->type == _DRM_SHM) ? (unsigned long)map->handle :
+ map->offset;
+- ret = drm_map_handle(dev, &list->hash, user_token, 0,
++ ret = drm_map_handle(dev, &list->hash, user_token, 1,
+ (map->type == _DRM_SHM));
+ if (ret) {
+ if (map->type == _DRM_REGISTERS)
+diff --git a/drivers/gpu/drm/drm_fence.c b/drivers/gpu/drm/drm_fence.c
+index f1c386c..fd62fd9 100644
+--- a/drivers/gpu/drm/drm_fence.c
++++ b/drivers/gpu/drm/drm_fence.c
+@@ -369,7 +369,7 @@ int drm_fence_object_wait(struct drm_fence_object *fence,
+ struct drm_fence_manager *fm = &dev->fm;
+ struct drm_fence_class_manager *fc = &fm->fence_class[fence->fence_class];
+ int ret = 0;
+- unsigned long _end = 3 * DRM_HZ;
++ unsigned long _end = jiffies + 3 * DRM_HZ;
+
+ if (mask & ~fence->type) {
+ DRM_ERROR("Wait trying to extend fence type"
+diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
+index 7e277c7..e5efd4a 100644
+--- a/drivers/gpu/drm/drm_stub.c
++++ b/drivers/gpu/drm/drm_stub.c
+@@ -414,14 +414,14 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
+ if (dev->driver->load) {
+ ret = dev->driver->load(dev, ent->driver_data);
+ if (ret)
+- goto err_g3;
++ goto err_g4;
+ }
+
+ /* setup the grouping for the legacy output */
+ if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+ ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
+ if (ret)
+- goto err_g3;
++ goto err_g4;
+ }
+
+ list_add_tail(&dev->driver_item, &driver->device_list);
+@@ -432,8 +432,11 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
+
+ return 0;
+
+-err_g3:
++err_g4:
+ drm_put_minor(&dev->primary);
++err_g3:
++ if (drm_core_check_feature(dev, DRIVER_MODESET))
++ drm_put_minor(&dev->control);
+ err_g2:
+ pci_disable_device(pdev);
+ err_g1:
+@@ -515,11 +518,11 @@ void drm_put_dev(struct drm_device *dev)
dev->agp = NULL;
}
@@ -59,13 +146,14 @@
list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
drm_rmmap(dev, r_list->map);
+ drm_ht_remove(&dev->map_hash);
++
+ drm_ctxbitmap_cleanup(dev);
if (drm_core_check_feature(dev, DRIVER_MODESET))
drm_put_minor(&dev->control);
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
new file mode 100644
-index 0000000..d8a32e0
+index 0000000..12af41b
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/Makefile
@@ -0,0 +1,24 @@
@@ -78,7 +166,8 @@
+ nouveau_object.o nouveau_irq.o nouveau_notifier.o \
+ nouveau_swmthd.o nouveau_sgdma.o nouveau_dma.o \
+ nouveau_bo.o nouveau_fence.o nouveau_gem.o \
-+ nouveau_bios.o \
++ nouveau_bios.o nouveau_display.o nouveau_fbcon.o \
++ nouveau_backlight.o \
+ nv04_timer.o \
+ nv04_mc.o nv40_mc.o nv50_mc.o \
+ nv04_fb.o nv10_fb.o nv40_fb.o \
@@ -87,12 +176,173 @@
+ nv40_graph.o nv50_graph.o \
+ nv04_instmem.o nv50_instmem.o \
+ nv50_crtc.o nv50_dac.o nv50_sor.o nv50_connector.o \
-+ nv50_lut.o nv50_cursor.o nv50_i2c.o nv50_display.o \
-+ nv50_fbcon.o nv50_fbcon_accel.o
++ nv50_cursor.o nv50_i2c.o nv50_display.o nv50_fbcon.o
+
+nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
+
[...51941 lines suppressed...]
-+ struct drm_display_mode *mode;
++ struct nouveau_encoder *encoder = to_nouveau_encoder(drm_encoder);
++ struct nouveau_connector *connector;
+
-+ DRM_DEBUG("or %d\n", output->or);
++ connector = nouveau_encoder_connector_get(encoder);
++ if (!connector)
++ return false;
+
-+ /* We don't yet know what to do, if anything at all. */
-+ if (output->base.encoder_type == DRM_MODE_ENCODER_LVDS)
-+ return 0;
++ if ((connector->scaling_mode != DRM_MODE_SCALE_NON_GPU &&
++ connector->scaling_mode != DRM_MODE_SCALE_NO_SCALE) &&
++ connector->native_mode) {
++ int id = adjusted_mode->base.id;
++ *adjusted_mode = *connector->native_mode;
++ adjusted_mode->base.id = id;
++ }
+
-+ if (crtc->use_native_mode)
-+ mode = crtc->native_mode;
-+ else
-+ mode = crtc->mode;
++ return true;
++}
+
-+ /* 0x70000 was a late addition to nv, mentioned as fixing tmds initialisation on certain gpu's. */
-+ /* I presume it's some kind of clock setting, but what precisely i do not know. */
-+ nv_wr32(NV50_PDISPLAY_SOR_CLK_CLK_CTRL2(output->or), 0x70000 | ((mode->clock > limit) ? 0x101 : 0));
++static void nv50_sor_prepare(struct drm_encoder *drm_encoder)
++{
++ struct nouveau_encoder *encoder = to_nouveau_encoder(drm_encoder);
+
-+ return 0;
++ nv50_sor_dpms(drm_encoder, DRM_MODE_DPMS_OFF);
++ nv50_sor_disconnect(encoder);
+}
+
-+static int nv50_sor_set_power_mode(struct nv50_output *output, int mode)
++static void nv50_sor_commit(struct drm_encoder *drm_encoder)
+{
-+ struct drm_nouveau_private *dev_priv = output->base.dev->dev_private;
-+ uint32_t val;
-+ int or = output->or;
++ nv50_sor_dpms(drm_encoder, DRM_MODE_DPMS_ON);
++}
+
-+ DRM_DEBUG("or %d\n", output->or);
++static void nv50_sor_mode_set(struct drm_encoder *drm_encoder,
++ struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ struct nouveau_encoder *encoder = to_nouveau_encoder(drm_encoder);
++ struct drm_device *dev = drm_encoder->dev;
++ struct nouveau_crtc *crtc = to_nouveau_crtc(drm_encoder->crtc);
++ uint32_t offset = encoder->or * 0x40;
++ uint32_t mode_ctl = NV50_SOR_MODE_CTRL_OFF;
+
-+ /* wait for it to be done */
-+ while (nv_rd32(NV50_PDISPLAY_SOR_REGS_DPMS_CTRL(or)) & NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_PENDING);
++ DRM_DEBUG("or %d\n", encoder->or);
+
-+ val = nv_rd32(NV50_PDISPLAY_SOR_REGS_DPMS_CTRL(or));
++ if (encoder->base.encoder_type == DRM_MODE_ENCODER_LVDS) {
++ mode_ctl |= NV50_SOR_MODE_CTRL_LVDS;
++ } else {
++ mode_ctl |= NV50_SOR_MODE_CTRL_TMDS;
++ if (mode->clock > 165000)
++ mode_ctl |= NV50_SOR_MODE_CTRL_TMDS_DUAL_LINK;
++ }
+
-+ if (mode == DRM_MODE_DPMS_ON)
-+ val |= NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_ON;
++ if (crtc->index == 1)
++ mode_ctl |= NV50_SOR_MODE_CTRL_CRTC1;
+ else
-+ val &= ~NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_ON;
++ mode_ctl |= NV50_SOR_MODE_CTRL_CRTC0;
+
-+ nv_wr32(NV50_PDISPLAY_SOR_REGS_DPMS_CTRL(or), val | NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_PENDING);
++ if (mode->flags & DRM_MODE_FLAG_NHSYNC)
++ mode_ctl |= NV50_SOR_MODE_CTRL_NHSYNC;
+
-+ return 0;
++ if (mode->flags & DRM_MODE_FLAG_NVSYNC)
++ mode_ctl |= NV50_SOR_MODE_CTRL_NVSYNC;
++
++ OUT_MODE(NV50_SOR0_MODE_CTRL + offset, mode_ctl);
++ OUT_MODE(NV50_UPDATE_DISPLAY, 0);
+}
+
++static const struct drm_encoder_helper_funcs nv50_sor_helper_funcs = {
++ .dpms = nv50_sor_dpms,
++ .save = nv50_sor_save,
++ .restore = nv50_sor_restore,
++ .mode_fixup = nv50_sor_mode_fixup,
++ .prepare = nv50_sor_prepare,
++ .commit = nv50_sor_commit,
++ .mode_set = nv50_sor_mode_set,
++ .detect = NULL
++};
++
+static void nv50_sor_destroy(struct drm_encoder *drm_encoder)
+{
-+ struct nv50_output *output = to_nv50_output(drm_encoder);
++ struct nouveau_encoder *encoder = to_nouveau_encoder(drm_encoder);
+
+ DRM_DEBUG("\n");
+
+ if (!drm_encoder)
+ return;
+
-+ drm_encoder_cleanup(&output->base);
++ drm_encoder_cleanup(&encoder->base);
+
-+ kfree(output->native_mode);
-+ kfree(output);
++ kfree(encoder);
+}
+
+static const struct drm_encoder_funcs nv50_sor_encoder_funcs = {
@@ -35910,7 +42651,7 @@
+int nv50_sor_create(struct drm_device *dev, struct dcb_entry *entry)
+{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
-+ struct nv50_output *output = NULL;
++ struct nouveau_encoder *encoder = NULL;
+ int type;
+
+ DRM_DEBUG("\n");
@@ -35928,35 +42669,26 @@
+ return -EINVAL;
+ }
+
-+ output = kzalloc(sizeof(*output), GFP_KERNEL);
-+ if (!output)
-+ return -ENOMEM;
-+
-+ output->native_mode = kzalloc(sizeof(*output->native_mode), GFP_KERNEL);
-+ if (!output->native_mode) {
-+ kfree(output);
++ encoder = kzalloc(sizeof(*encoder), GFP_KERNEL);
++ if (!encoder)
+ return -ENOMEM;
-+ }
+
-+ output->dcb_entry = entry;
-+ output->or = ffs(entry->or) - 1;
++ encoder->dcb_entry = entry;
++ encoder->or = ffs(entry->or) - 1;
+
+ /* Set function pointers. */
-+ output->validate_mode = nv50_sor_validate_mode;
-+ output->execute_mode = nv50_sor_execute_mode;
-+ output->set_clock_mode = nv50_sor_set_clock_mode;
-+ output->set_power_mode = nv50_sor_set_power_mode;
-+ output->detect = NULL;
++ encoder->set_clock_mode = nv50_sor_set_clock_mode;
+
-+ drm_encoder_init(dev, &output->base, &nv50_sor_encoder_funcs, type);
++ drm_encoder_init(dev, &encoder->base, &nv50_sor_encoder_funcs, type);
++ drm_encoder_helper_add(&encoder->base, &nv50_sor_helper_funcs);
+
+ /* I've never seen possible crtc's restricted. */
-+ output->base.possible_crtcs = 3;
-+ output->base.possible_clones = 0;
++ encoder->base.possible_crtcs = 3;
++ encoder->base.possible_clones = 0;
+
+ /* Some default state, unknown what it precisely means. */
-+ if (output->base.encoder_type == DRM_MODE_ENCODER_TMDS) {
-+ int or = output->or;
++ if (encoder->base.encoder_type == DRM_MODE_ENCODER_TMDS) {
++ int or = encoder->or;
+
+ nv_wr32(NV50_PDISPLAY_SOR_REGS_UNK_00C(or), 0x03010700);
+ nv_wr32(NV50_PDISPLAY_SOR_REGS_UNK_010(or), 0x0000152f);
@@ -35976,10 +42708,10 @@
unifdef-y += via_drm.h
+unifdef-y += nouveau_drm.h
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 67cadab..4e2c0c8 100644
+index 99e348d..e57c98f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
-@@ -1206,6 +1206,8 @@ extern void drm_idlelock_release(struct drm_lock_data *lock_data);
+@@ -1267,6 +1267,8 @@ extern void drm_idlelock_release(struct drm_lock_data *lock_data);
extern int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv);
/* Buffer management support (drm_bufs.h) */
@@ -35987,7 +42719,7 @@
+ drm_local_map_t *map);
extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request);
extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request);
- extern int drm_addmap(struct drm_device *dev, unsigned int offset,
+ extern int drm_addmap(struct drm_device *dev, resource_size_t offset,
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
new file mode 100644
index 0000000..4147f35
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1294.2.8
retrieving revision 1.1294.2.9
diff -u -r1.1294.2.8 -r1.1294.2.9
--- kernel.spec 25 Feb 2009 23:14:05 -0000 1.1294.2.8
+++ kernel.spec 5 Mar 2009 01:30:23 -0000 1.1294.2.9
@@ -56,9 +56,9 @@
# The next upstream release sublevel (base_sublevel+1)
%define upstream_sublevel %(echo $((%{base_sublevel} + 1)))
# The rc snapshot level
-%define rcrev 6
+%define rcrev 7
# The git snapshot level
-%define gitrev 2
+%define gitrev 0
# Set rpm version accordingly
%define rpmversion 2.6.%{upstream_sublevel}
%endif
@@ -246,7 +246,7 @@
# no need to build headers again for these arches,
# they can just use i586 and ppc64 headers
-%ifarch i686 ppc64iseries
+%ifarch i686 ppc64iseries ppc ppc64
%define with_headers 0
%endif
@@ -259,9 +259,9 @@
%endif
# bootwrapper is only on ppc
-%ifnarch ppc ppc64
+#%ifnarch ppc ppc64
%define with_bootwrapper 0
-%endif
+#%endif
# sparse blows up on ppc64 alpha and sparc64
%ifarch ppc64 ppc alpha sparc64
@@ -312,7 +312,7 @@
%define asmarch sparc
%define all_arch_configs kernel-%{version}-sparc64*.config
%define make_target image
-%define kernel_image arch/sparc64/boot/image
+%define kernel_image arch/sparc/boot/image
%define image_install_path boot
%endif
@@ -588,6 +588,7 @@
Patch09: linux-2.6-upstream-reverts.patch
# Git trees.
Patch10: git-cpufreq.patch
+Patch11: git-bluetooth.patch
# Standalone patches
Patch20: linux-2.6-hotfixes.patch
@@ -627,12 +628,13 @@
Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
+Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
Patch670: linux-2.6-ata-quirk.patch
Patch680: linux-2.6-rt2x00-asus-leds.patch
-
-Patch690: linux-2.6-iwlwifi-dma-direction.patch
+Patch681: linux-2.6-mac80211-age-scan-results-on-resume.patch
+Patch682: linux-2.6-ipw2x00-age-scan-results-on-resume.patch
Patch1515: linux-2.6.29-lirc.patch
Patch1520: linux-2.6-hdpvr.patch
@@ -641,13 +643,15 @@
# but the drive isn't yet ready.
Patch1550: linux-2.6-cdrom-door-status.patch
+Patch1700: agp-set_memory_ucwb.patch
# nouveau + drm fixes
+Patch1811: drm-next.patch
Patch1812: drm-modesetting-radeon.patch
+Patch1813: drm-radeon-pm.patch
Patch1814: drm-nouveau.patch
-Patch1815: drm-intel-next.patch
Patch1816: drm-no-gem-on-i8xx.patch
Patch1818: drm-i915-resume-force-mode.patch
-Patch1819: drm-edid-revision-0-should-be-valid.patch
+Patch1819: drm-fix-setmaster-deadlock.patch
# kludge to make ich9 e1000 work
Patch2000: linux-2.6-e1000-ich9.patch
@@ -662,15 +666,13 @@
Patch2300: linux-2.6.28-sunrpc-ipv6-rpcbind.patch
Patch2301: linux-2.6.28-lockd-svc-register.patch
-# fix libertas problem for olpc (http://lists.infradead.org/pipermail/libertas-dev/2009-February/002297.html)
-Patch2400: linux-2.6-libertas-netpriv-fixes.patch
-
# Quiet boot fixes
# silence the ACPI blacklist code
Patch2802: linux-2.6-silence-acpi-blacklist.patch
-# Updates V4L/DVB to the latest development tree
-Patch 2900: linux-2.6-v4l-dvb-update.patch
+# Updates/Fixes on V4L/DVB to the latest development tree
+Patch2899: linux-2.6-v4l-dvb-fixes.patch
+Patch2900: linux-2.6-v4l-dvb-update.patch
Patch9001: revert-fix-modules_install-via-nfs.patch
@@ -907,6 +909,11 @@
%endif
%endif
+# We can share hardlinked source trees by putting the
+# directory name of the CVS checkout that we want to share
+# with in .shared-srctree. (Full pathname is required.)
+[ -f .shared-srctree ] && sharedir=$(cat .shared-srctree)
+
if [ ! -d kernel-%{kversion}/vanilla-%{vanillaversion} ]; then
if [ -d kernel-%{kversion}/vanilla-%{kversion} ]; then
@@ -922,31 +929,46 @@
# Ok, first time we do a make prep.
rm -f pax_global_header
+ if [[ ! -z $sharedir && -d $sharedir/kernel-%{kversion}/vanilla-%{kversion} ]] ; then
+%setup -q -n kernel-%{kversion} -c -T
+ cp -rl $sharedir/kernel-%{kversion}/vanilla-%{kversion} .
+ else
%setup -q -n kernel-%{kversion} -c
- mv linux-%{kversion} vanilla-%{kversion}
+ mv linux-%{kversion} vanilla-%{kversion}
+ fi
fi
%if "%{kversion}" != "%{vanillaversion}"
- cp -rl vanilla-%{kversion} vanilla-%{vanillaversion}
-%endif
- cd vanilla-%{vanillaversion}
+
+ if [[ ! -z $sharedir && -d $sharedir/kernel-%{kversion}/vanilla-%{vanillaversion} ]] ; then
+
+ cp -rl $sharedir/kernel-%{kversion}/vanilla-%{vanillaversion} .
+
+ else
+
+ cp -rl vanilla-%{kversion} vanilla-%{vanillaversion}
+ cd vanilla-%{vanillaversion}
# Update vanilla to the latest upstream.
# (non-released_kernel case only)
%if 0%{?rcrev}
-ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
+ ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
%if 0%{?gitrev}
-ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
+ ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
%endif
%else
# pre-{base_sublevel+1}-rc1 case
%if 0%{?gitrev}
-ApplyPatch patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
+ ApplyPatch patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
%endif
%endif
- cd ..
+ cd ..
+
+ fi
+
+%endif
else
# We already have a vanilla dir.
@@ -1022,6 +1044,7 @@
fi
#ApplyPatch git-cpufreq.patch
+ApplyPatch git-bluetooth.patch
ApplyPatch linux-2.6-hotfixes.patch
@@ -1131,6 +1154,7 @@
# squelch hda_beep by default
ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
+ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
# ia64 ata quirk
ApplyPatch linux-2.6-ata-quirk.patch
@@ -1138,8 +1162,9 @@
# rt2x00: back-port activity LED init patches
ApplyPatch linux-2.6-rt2x00-asus-leds.patch
-# Intel wireless DMA fix
-ApplyPatch linux-2.6-iwlwifi-dma-direction.patch
+# back-port scan result aging patches
+ApplyPatch linux-2.6-mac80211-age-scan-results-on-resume.patch
+ApplyPatch linux-2.6-ipw2x00-age-scan-results-on-resume.patch
# http://www.lirc.org/
ApplyPatch linux-2.6.29-lirc.patch
@@ -1154,16 +1179,16 @@
ApplyPatch linux-2.6-net-tulip-interrupt.patch
-ApplyPatch linux-2.6-libertas-netpriv-fixes.patch
-
+ApplyPatch agp-set_memory_ucwb.patch
# Nouveau DRM + drm fixes
-#ApplyPatch drm-next.patch
+ApplyPatch drm-next.patch
ApplyPatch drm-modesetting-radeon.patch
ApplyPatch drm-nouveau.patch
-#ApplyPatch drm-intel-next.patch
+# pm broken on my thinkpad t60p - airlied
+#ApplyPatch drm-radeon-pm.patch
ApplyPatch drm-no-gem-on-i8xx.patch
ApplyPatch drm-i915-resume-force-mode.patch
-ApplyPatch drm-edid-revision-0-should-be-valid.patch
+ApplyPatch drm-fix-setmaster-deadlock.patch
# linux1394 git patches
ApplyPatch linux-2.6-firewire-git-update.patch
@@ -1178,7 +1203,8 @@
# silence the ACPI blacklist code
ApplyPatch linux-2.6-silence-acpi-blacklist.patch
-# V4L/DVB updates
+# V4L/DVB updates/fixes
+ApplyPatch linux-2.6-v4l-dvb-fixes.patch
ApplyPatch linux-2.6-v4l-dvb-update.patch
# revert 8b249b6856f16f09b0e5b79ce5f4d435e439b9d6
@@ -1425,6 +1451,8 @@
'ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register'
collect_modules_list drm \
'drm_open|drm_init'
+ collect_modules_list modesetting \
+ 'drm_crtc_init'
# detect missing or incorrect license tags
rm -f modinfo
@@ -1735,6 +1763,7 @@
%ghost /boot/initrd-%{KVERREL}%{?2:.%{2}}.img\
%{expand:%%files %{?2:%{2}-}devel}\
%defattr(-,root,root)\
+%dir /usr/src/kernels\
%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
/usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
%if %{with_debuginfo}\
@@ -1765,11 +1794,144 @@
%kernel_variant_files %{with_pae_debug} PAEdebug
%kernel_variant_files -k vmlinux %{with_kdump} kdump
+# plz don't put in a version string unless you're going to tag
+# and build.
+
%changelog
-* Wed Feb 25 2009 Jeremy Katz <katzj at redhat.com>
-- add dcbw's patch to fix wireless problems on the OLPC (from cjb, should be up
-stream "soon" but is
- currently blocking OLPC testing)
+* Wed Mar 4 2009 <m.a.young at durham.ac.uk>
+- update to latest pvops patch
+- merge conflict from drm-next.patch
+- disable ppc and ppc64 packages
+
+* Wed Mar 4 2009 <krh at redhat.com>
+- Add fix for deadlock in drm setmaster.
+
+* Wed Mar 04 2009 Kyle McMartin <kyle at redhat.com>
+- Rebase git-bluetooth.patch from bluetooth-next-2.6 instead of
+ bluetooth-testing, per Marcel's suggestions.
+
+* Wed Mar 04 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: lvds, dpms and gamma_set fixes
+
+* Wed Mar 04 2009 Dave Jones <davej at redhat.com> 2.6.29-0.197.rc7
+- 2.6.29-rc7
+
+* Wed Mar 04 2009 Dennis Gilmore <dennis at ausil.us> - 2.6.29-0.195.rc6.git7
+- sparc kernel is now in arch/sparc/boot/image
+
+* Wed Mar 04 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm: fix bustage of _DRM_SHM maps
+
+* Wed Mar 04 2009 Kyle McMartin <kyle at redhat.com>
+- Tony Breeds says CONFIG_GEF_SBC610 breaks USB. I, for one, believe
+ him. Looks to be fairly useless anyway... (#486511)
+
+* Wed Mar 04 2009 Dave Airlie <airlied at redhat.com>
+- rebase drm properly kill -pm it breaks my laptop
+
+* Wed Mar 04 2009 Dave Airlie <airlied at redhat.com> 2.6.29-0.185.rc6.git7
+- rebase drm patches on git7
+
+* Tue Mar 03 2009 Dave Jones <davej at redhat.com> 2.6.29-0.184.rc6.git7
+- 2.6.29-rc6-git7
+
+* Tue Mar 03 2009 Matthew Garrett <mjg at redhat.com>
+- Add dynamic power management for later r500-based Radeons
+
+* Tue Mar 03 2009 Kyle McMartin <kyle at redhat.com>
+- Allocate a bigger default DMA buffer for snd-hda_intel. Azalia uses a
+ 32-bit or wider DMA mask, so this is fine.
+
+* Tue Mar 03 2009 Kyle McMartin <kyle at redhat.com>
+- Add bluetooth-testing git tree. Mostly bugfixes...
+
+* Tue Mar 03 2009 Dave Airlie <airlied at redhat.com>
+- pull patch from Linus to fix build
+
+* Tue Mar 03 2009 Ben Skeggs <bskeggs at redhat.com>
+- nouveau: some gf8/9 and kms fixes
+
+* Tue Mar 03 2009 Dave Airlie <airlied at redhat.com> 2.6.29-0.184.rc6.git6
+- drm-modesetting-radeon.patch: fix suspend/resume, proc->debugfs
+
+* Mon Mar 02 2009 Dave Jones <davej at redhat.com> 2.6.29-0.183.rc6.git6
+- 2.6.29-rc6-git6
+
+* Mon Mar 02 2009 Ben Skeggs <bskeggs at redhat.com>
+- CONFIG_DRM_NOUVEAU_KMS got enabled somewhere, lets not do that yet
+
+* Mon Mar 02 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.179.rc6.git5
+- fix oops in ipv6 when NET_NS is enabled.
+
+* Mon Mar 02 2009 Ben Skeggs <bskeggs at redhat.com>
+- nouveau fixes for recent drm-next changes, and various kms issues
+
+* Sat Feb 28 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29-0.176.rc6.git5
+- Linux 2.6.29-rc6-git5
+- Removed parts of v4l-fixes patch that were merged upstream.
+- Added hotfix from lkml to export symbols needed by i915.
+- New driver: CONFIG_W1_SLAVE_DS2431=m
+
+* Fri Feb 27 2009 Mauro Carvalho Chehab <mchehab at redhat.com>
+- Update V4L/DVB to the latest development tree (fixes and updates for linux-next)
+
+* Fri Feb 27 2009 Jarod Wilson <jarod at redhat.com>
+- minor lirc and hdpvr patch updates from respective upstreams
+
+* Fri Feb 27 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.172.rc6.git4
+- avoid a 64-bit divide which generates a libgcc __udivdi3 call
+ in drm-nouveau. maybe.
+
+* Fri Feb 27 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.171.rc6.git4
+- fixt drm-nouveau for drm-next.
+
+* Fri Feb 27 2009 Chuck Ebbert <cebbert at redhat.com>
+- Linux 2.6.29-rc6-git4
+
+* Fri Feb 27 2009 Ben Skeggs <bskeggs at redhat.com>
+- nouveau/kms: hopefully fix dac outputs
+
+* Fri Feb 27 2009 Dave Airlie <airlied at redhat.com>
+- radeon: disable r600 kms by default - we want accel to work
+
+* Fri Feb 27 2009 Ben Skeggs <bskeggs at redhat.com>
+- Bring in nouveau update
+ - "getting there" nv50 modesetting rework
+ - nv50 stability improvements
+ - support for >512MiB VRAM on nv50
+ - nv40/nv50 backlight support
+
+* Fri Feb 27 2009 Dave Airlie <airlied at redhat.com>
+- agp-set_memory_ucwb.patch - enable GEM/KMS on PAE hopefully
+
+* Fri Feb 27 2009 Dave Airlie <airlied at redhat.com>
+- drm-next.patch: bring in drm-next tree for r600 support
+- rebased drm-modesetting-radeon.patch and drm-nouveau.patch
+
+* Thu Feb 26 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29-0.163.rc6.git3
+- Add support for sharing source trees between CVS checkouts.
+
+* Thu Feb 26 2009 Dave Jones <davej at redhat.com> 2.6.29-0.162.rc6.git3
+- Own the /usr/src/kernels dir in devel packages.
+
+* Thu Feb 26 2009 Kyle McMartin <kyle at redhat.com>
+- myoung points out we're not returning a value in the fbcon quiet patch.
+
+* Thu Feb 26 2009 John W. Linville <linville at redhat.com>
+- Add dcbw's back-port patches to age scan results on resume
+
+* Thu Feb 26 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.159.rc6.git3
+- Update to -git3.
+- drm-edid-revision-0-should-be-valid.patch: merged upstream
+- linux-2.6-iwlwifi-dma-direction.patch: merged upstream
+- CONFIG_DMAR_DEFAULT_ON: enable on ia64
+
+* Wed Feb 25 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29-0.158.rc6.git2
+- re-add modules.modesetting list.
+
+* Wed Feb 25 2009 Jeremy Katz <katzj at redhat.com> 2.6.29-0.157.rc6.git2
+- add dcbw's patch to fix wireless problems on the OLPC (from cjb, should
+ be upstream "soon" but is currently blocking OLPC testing)
* Wed Feb 25 2009 Michael Young <m.a.young at durham.ac.uk>
- update pvops patch (x2) which fixes an smp mtrr bug
linux-2.6-hdpvr.patch:
Index: linux-2.6-hdpvr.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-hdpvr.patch,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -r1.4 -r1.4.6.1
--- linux-2.6-hdpvr.patch 27 Jan 2009 02:39:42 -0000 1.4
+++ linux-2.6-hdpvr.patch 5 Mar 2009 01:30:24 -0000 1.4.6.1
@@ -1,3 +1,24 @@
+Video capture driver for the Hauppauge HD PVR
+
+upstream: http://hg.jannau.net/hdpvr/
+product info: http://hauppauge.com/site/products/data_hdpvr.html
+
+Signed-off-by: Jarod Wilson <jarod at redhat.com>
+
+---
+ drivers/media/video/Kconfig | 2 +
+ drivers/media/video/Makefile | 2 +
+ drivers/media/video/hdpvr/Kconfig | 10 +
+ drivers/media/video/hdpvr/Makefile | 7 +
+ drivers/media/video/hdpvr/hdpvr-control.c | 212 +++++
+ drivers/media/video/hdpvr/hdpvr-core.c | 461 +++++++++++
+ drivers/media/video/hdpvr/hdpvr-i2c.c | 145 ++++
+ drivers/media/video/hdpvr/hdpvr-video.c | 1258 +++++++++++++++++++++++++++++
+ drivers/media/video/hdpvr/hdpvr.h | 326 ++++++++
+ drivers/media/video/v4l2-common.c | 3 +
+ include/linux/i2c-id.h | 1 +
+ 11 files changed, 2427 insertions(+), 0 deletions(-)
+
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 19cf3b8..4f29e1a 100644
--- a/drivers/media/video/Kconfig
@@ -12,18 +33,18 @@
source "drivers/media/video/usbvision/Kconfig"
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
-index 72f6d03..35ff442 100644
+index 72f6d03..e7e4508 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
-@@ -122,6 +122,8 @@ obj-$(CONFIG_USB_PWC) += pwc/
- obj-$(CONFIG_USB_ZC0301) += zc0301/
- obj-$(CONFIG_USB_GSPCA) += gspca/
+@@ -128,6 +128,8 @@ obj-$(CONFIG_USB_VICAM) += usbvideo/
+ obj-$(CONFIG_USB_QUICKCAM_MESSENGER) += usbvideo/
+ obj-$(CONFIG_USB_S2255) += s2255drv.o
-+obj-$(CONFIG_VIDEO_HDPVR) += hdpvr/
++obj-$(CONFIG_VIDEO_HDPVR) += hdpvr/
+
- obj-$(CONFIG_USB_IBMCAM) += usbvideo/
- obj-$(CONFIG_USB_KONICAWC) += usbvideo/
- obj-$(CONFIG_USB_VICAM) += usbvideo/
+ obj-$(CONFIG_VIDEO_IVTV) += ivtv/
+ obj-$(CONFIG_VIDEO_CX18) += cx18/
+
diff --git a/drivers/media/video/hdpvr/Kconfig b/drivers/media/video/hdpvr/Kconfig
new file mode 100644
index 0000000..de247f3
@@ -273,10 +294,10 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
new file mode 100644
-index 0000000..19e5282
+index 0000000..394309a
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
-@@ -0,0 +1,455 @@
+@@ -0,0 +1,461 @@
+/*
+ * Hauppage HD PVR USB driver
+ *
@@ -336,6 +357,8 @@
+/* table of devices that work with this driver */
+static struct usb_device_id hdpvr_table [] = {
+ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) },
++ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) },
++ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
+ { } /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, hdpvr_table);
@@ -452,6 +475,10 @@
+ dev->flags &= ~HDPVR_FLAG_AC3_CAP;
+ } else if (buf[1] == HDPVR_FIRMWARE_VERSION_AC3) {
+ dev->flags |= HDPVR_FLAG_AC3_CAP;
++ } else if (buf[1] > HDPVR_FIRMWARE_VERSION_AC3) {
++ hdpvr_print("untested firmware version 0x%x, the driver might "
++ "not work", buf[1]);
++ dev->flags |= HDPVR_FLAG_AC3_CAP;
+ } else {
+ hdpvr_err("unknown firmware version 0x%x", buf[1]);
+ ret = -EINVAL;
@@ -885,7 +912,7 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
new file mode 100644
-index 0000000..0297f91
+index 0000000..33788d0
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -0,0 +1,1258 @@
@@ -1253,7 +1280,7 @@
+ return retval;
+}
+
-+#if 0
++
+static void hdpvr_draw_down(struct hdpvr_device *dev)
+{
+ hdpvr_trace("status = %d", dev->status);
@@ -1279,7 +1306,6 @@
+
+ return 0;
+}
-+#endif
+
+static int hdpvr_release(struct file *file)
+{
@@ -1456,8 +1482,7 @@
+}
+
+
-+static long hdpvr_ioctl(struct file *filp, unsigned int cmd,
-+ unsigned long arg)
++static long hdpvr_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
+ struct hdpvr_device *dev = fh->dev;
@@ -1501,10 +1526,9 @@
+ .owner = THIS_MODULE,
+ .open = hdpvr_open,
+ .release = hdpvr_release,
-+/* .flush = hdpvr_flush, */
+ .read = hdpvr_read,
+ .poll = hdpvr_poll,
-+ .ioctl = hdpvr_ioctl,
++ .unlocked_ioctl = hdpvr_ioctl,
+};
+
+/*=======================================================================*/
@@ -1515,8 +1539,11 @@
+static int vidioc_querycap(struct file *file, void *priv,
+ struct v4l2_capability *cap)
+{
++ struct hdpvr_device *dev = video_drvdata(file);
++
+ strcpy(cap->driver, "hdpvr");
+ strcpy(cap->card, "Haupauge HD PVR");
++ usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
+ cap->version = HDPVR_VERSION;
+ cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_AUDIO |
@@ -2149,10 +2176,10 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h
new file mode 100644
-index 0000000..ffe3a36
+index 0000000..1514742
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr.h
-@@ -0,0 +1,324 @@
+@@ -0,0 +1,326 @@
+/*
+ * Hauppage HD PVR USB driver
+ *
@@ -2180,6 +2207,8 @@
+/* Define these values to match your devices */
+#define HD_PVR_VENDOR_ID 0x2040
+#define HD_PVR_PRODUCT_ID 0x4900
++#define HD_PVR_PRODUCT_ID1 0x4901
++#define HD_PVR_PRODUCT_ID2 0x4902
+
+#define UNSET (-1U)
+
linux-2.6-silence-fbcon-logo.patch:
Index: linux-2.6-silence-fbcon-logo.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-silence-fbcon-logo.patch,v
retrieving revision 1.1
retrieving revision 1.1.16.1
diff -u -r1.1 -r1.1.16.1
--- linux-2.6-silence-fbcon-logo.patch 11 Jun 2008 20:16:39 -0000 1.1
+++ linux-2.6-silence-fbcon-logo.patch 5 Mar 2009 01:30:24 -0000 1.1.16.1
@@ -1,8 +1,8 @@
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
-index 97aff8d..5e230b6 100644
+index 1657b96..4c5c2be 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
-@@ -674,13 +674,15 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
+@@ -631,13 +631,15 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
kfree(save);
}
@@ -25,13 +25,14 @@
}
}
#endif /* MODULE */
-@@ -3604,6 +3606,13 @@ static int __init fb_console_init(void)
+@@ -3489,6 +3491,14 @@ static int __init fb_console_init(void)
return 0;
}
+static int __init quiet_logo(char *str)
+{
+ logo_shown = FBCON_LOGO_DONTSHOW;
++ return 0;
+}
+
+early_param("quiet", quiet_logo);
linux-2.6-v4l-dvb-update.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.1.2.2 -r 1.1.2.3 linux-2.6-v4l-dvb-update.patch
Index: linux-2.6-v4l-dvb-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-v4l-dvb-update.patch,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- linux-2.6-v4l-dvb-update.patch 25 Feb 2009 21:26:01 -0000 1.1.2.2
+++ linux-2.6-v4l-dvb-update.patch 5 Mar 2009 01:30:24 -0000 1.1.2.3
@@ -1,3 +1,15 @@
+diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
+index f1d6399..3a311fe 100644
+--- a/Documentation/ioctl/ioctl-number.txt
++++ b/Documentation/ioctl/ioctl-number.txt
+@@ -125,7 +125,6 @@ Code Seq# Include File Comments
+ 'd' 00-DF linux/video_decoder.h conflict!
+ 'd' F0-FF linux/digi1.h
+ 'e' all linux/digi1.h conflict!
+-'e' 00-1F linux/video_encoder.h conflict!
+ 'e' 00-1F net/irda/irtty.h conflict!
+ 'f' 00-1F linux/ext2_fs.h
+ 'h' 00-7F Charon filesystem
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
index 0d93fa1..4dfe626 100644
--- a/Documentation/video4linux/CARDLIST.bttv
@@ -19,19 +31,33 @@
+ 15 -> TeVii S470 [d470:9022]
+ 16 -> DVBWorld DVB-S2 2005 [0001:2005]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
-index 75bded8..77874bd 100644
+index 75bded8..78d0a6e 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
-@@ -7,7 +7,7 @@
+@@ -7,12 +7,12 @@
6 -> Terratec Cinergy 200 USB (em2800)
7 -> Leadtek Winfast USB II (em2800) [0413:6023]
8 -> Kworld USB2800 (em2800)
- 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a]
-+ 9 -> Pinnacle Dazzle DVC 90/DVC 100/DVC 101/DVC 107 (em2820/em2840) [2304:0207,2304:021a]
++ 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,2304:0207,2304:021a]
10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
11 -> Terratec Hybrid XS (em2880) [0ccd:0042]
12 -> Kworld PVR TV 2800 RF (em2820/em2840)
-@@ -58,3 +58,7 @@
+ 13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
+- 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
++ 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
+ 15 -> V-Gear PocketTV (em2800)
+ 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b]
+ 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
+@@ -30,7 +30,6 @@
+ 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
+ 31 -> Usbgear VD204v9 (em2821)
+ 32 -> Supercomp USB 2.0 TV (em2821)
+- 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821)
+ 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
+ 35 -> Typhoon DVD Maker (em2860)
+ 36 -> NetGMBH Cam (em2860)
+@@ -58,3 +57,7 @@
58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840)
@@ -132,7 +158,7 @@
Module Parameters
=================
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
-index ff12437..48cdf86 100644
+index ff12437..accc376 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -47,7 +47,9 @@ All drivers have the following structure:
@@ -146,7 +172,26 @@
This is a rough schematic of how it all relates:
-@@ -134,7 +136,7 @@ The recommended approach is as follows:
+@@ -82,12 +84,14 @@ You must register the device instance:
+ v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
+
+ Registration will initialize the v4l2_device struct and link dev->driver_data
+-to v4l2_dev. Registration will also set v4l2_dev->name to a value derived from
+-dev (driver name followed by the bus_id, to be precise). You may change the
+-name after registration if you want.
++to v4l2_dev. If v4l2_dev->name is empty then it will be set to a value derived
++from dev (driver name followed by the bus_id, to be precise). If you set it
++up before calling v4l2_device_register then it will be untouched. If dev is
++NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register.
+
+ The first 'dev' argument is normally the struct device pointer of a pci_dev,
+-usb_device or platform_device.
++usb_device or platform_device. It is rare for dev to be NULL, but it happens
++with ISA devices, for example.
+
+ You unregister with:
+
+@@ -134,7 +138,7 @@ The recommended approach is as follows:
static atomic_t drv_instance = ATOMIC_INIT(0);
@@ -155,7 +200,7 @@
const struct pci_device_id *pci_id)
{
...
-@@ -218,7 +220,7 @@ to add new ops and categories.
+@@ -218,7 +222,7 @@ to add new ops and categories.
A sub-device driver initializes the v4l2_subdev struct using:
@@ -164,7 +209,7 @@
Afterwards you need to initialize subdev->name with a unique name and set the
module owner. This is done for you if you use the i2c helper functions.
-@@ -226,7 +228,7 @@ module owner. This is done for you if you use the i2c helper functions.
+@@ -226,7 +230,7 @@ module owner. This is done for you if you use the i2c helper functions.
A device (bridge) driver needs to register the v4l2_subdev with the
v4l2_device:
@@ -173,7 +218,7 @@
This can fail if the subdev module disappeared before it could be registered.
After this function was called successfully the subdev->dev field points to
-@@ -234,17 +236,17 @@ the v4l2_device.
+@@ -234,17 +238,17 @@ the v4l2_device.
You can unregister a sub-device using:
@@ -195,7 +240,7 @@
The macro will to the right NULL pointer checks and returns -ENODEV if subdev
is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is
-@@ -252,12 +254,12 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
+@@ -252,19 +256,19 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
It is also possible to call all or a subset of the sub-devices:
@@ -210,7 +255,15 @@
Any error except -ENOIOCTLCMD will exit the loop with that error. If no
errors (except -ENOIOCTLCMD) occured, then 0 is returned.
-@@ -340,6 +342,12 @@ Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
+
+ The second argument to both calls is a group ID. If 0, then all subdevs are
+ called. If non-zero, then only those whose group ID match that value will
+-be called. Before a bridge driver registers a subdev it can set subdev->grp_id
++be called. Before a bridge driver registers a subdev it can set sd->grp_id
+ to whatever value it wants (it's 0 by default). This value is owned by the
+ bridge driver and the sub-device driver will never modify or use it.
+
+@@ -340,6 +344,12 @@ Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
is called. This will unregister the sub-device from the bridge driver. It is
safe to call this even if the sub-device was never registered.
@@ -223,7 +276,7 @@
The bridge driver also has some helper functions it can use:
-@@ -499,8 +507,8 @@ There are a few useful helper functions:
+@@ -499,8 +509,8 @@ There are a few useful helper functions:
You can set/get driver private data in the video_device struct using:
@@ -234,7 +287,7 @@
Note that you can safely call video_set_drvdata() before calling
video_register_device().
-@@ -519,3 +527,103 @@ void *video_drvdata(struct file *file);
+@@ -519,3 +529,103 @@ void *video_drvdata(struct file *file);
You can go from a video_device struct to the v4l2_device struct using:
struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
@@ -347,6 +400,94 @@
0x0a17 0x004e Pentax Optio 50
0x041e 0x405d Creative DiVi CAM 516
+0x08ca 0x2102 Aiptek DV T300
+diff --git a/arch/arm/plat-mxc/include/mach/mx3_camera.h b/arch/arm/plat-mxc/include/mach/mx3_camera.h
+new file mode 100644
+index 0000000..36d7ff2
+--- /dev/null
++++ b/arch/arm/plat-mxc/include/mach/mx3_camera.h
+@@ -0,0 +1,52 @@
++/*
++ * mx3_camera.h - i.MX3x camera driver header file
++ *
++ * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg at denx.de>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * 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, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
[...70905 lines suppressed...]
+- return 0;
+- case VIDIOCSFREQ:
+- if(copy_from_user(&tea->freq, arg, sizeof(tea->freq)))
+- return -EFAULT;
+- snd_tea575x_set_freq(tea);
+- return 0;
+- case VIDIOCGAUDIO:
+- {
+- struct video_audio v;
+- memset(&v, 0, sizeof(v));
+- strcpy(v.name, "Radio");
+- if(copy_to_user(arg,&v, sizeof(v)))
+- return -EFAULT;
++ }
++ return -EINVAL;
++}
++
++static int vidioc_g_ctrl(struct file *file, void *priv,
++ struct v4l2_control *ctrl)
++{
++ struct snd_tea575x *tea = video_drvdata(file);
++
++ switch (ctrl->id) {
++ case V4L2_CID_AUDIO_MUTE:
++ if (tea->ops->mute) {
++ ctrl->value = tea->mute;
+ return 0;
+ }
+- case VIDIOCSAUDIO:
+- {
+- struct video_audio v;
+- if(copy_from_user(&v, arg, sizeof(v)))
+- return -EFAULT;
+- if (tea->ops->mute)
+- tea->ops->mute(tea,
+- (v.flags &
+- VIDEO_AUDIO_MUTE) ? 1 : 0);
+- if(v.audio)
+- return -EINVAL;
++ }
++ return -EINVAL;
++}
++
++static int vidioc_s_ctrl(struct file *file, void *priv,
++ struct v4l2_control *ctrl)
++{
++ struct snd_tea575x *tea = video_drvdata(file);
++
++ switch (ctrl->id) {
++ case V4L2_CID_AUDIO_MUTE:
++ if (tea->ops->mute) {
++ tea->ops->mute(tea, ctrl->value);
++ tea->mute = 1;
+ return 0;
+ }
+- default:
+- return -ENOIOCTLCMD;
+ }
++ return -EINVAL;
++}
++
++static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
++{
++ *i = 0;
++ return 0;
+ }
+
+-static void snd_tea575x_release(struct video_device *vfd)
++static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
+ {
++ if (i != 0)
++ return -EINVAL;
++ return 0;
+ }
+
+ static int snd_tea575x_exclusive_open(struct file *file)
+@@ -189,50 +260,91 @@ static int snd_tea575x_exclusive_release(struct file *file)
+ return 0;
+ }
+
++static const struct v4l2_file_operations tea575x_fops = {
++ .owner = THIS_MODULE,
++ .open = snd_tea575x_exclusive_open,
++ .release = snd_tea575x_exclusive_release,
++ .ioctl = video_ioctl2,
++};
++
++static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
++ .vidioc_querycap = vidioc_querycap,
++ .vidioc_g_tuner = vidioc_g_tuner,
++ .vidioc_s_tuner = vidioc_s_tuner,
++ .vidioc_g_audio = vidioc_g_audio,
++ .vidioc_s_audio = vidioc_s_audio,
++ .vidioc_g_input = vidioc_g_input,
++ .vidioc_s_input = vidioc_s_input,
++ .vidioc_g_frequency = vidioc_g_frequency,
++ .vidioc_s_frequency = vidioc_s_frequency,
++ .vidioc_queryctrl = vidioc_queryctrl,
++ .vidioc_g_ctrl = vidioc_g_ctrl,
++ .vidioc_s_ctrl = vidioc_s_ctrl,
++};
++
++static struct video_device tea575x_radio = {
++ .name = "tea575x-tuner",
++ .fops = &tea575x_fops,
++ .ioctl_ops = &tea575x_ioctl_ops,
++ .release = video_device_release,
++};
++
+ /*
+ * initialize all the tea575x chips
+ */
+ void snd_tea575x_init(struct snd_tea575x *tea)
+ {
++ int retval;
+ unsigned int val;
++ struct video_device *tea575x_radio_inst;
+
+ val = tea->ops->read(tea);
+ if (val == 0x1ffffff || val == 0) {
+- snd_printk(KERN_ERR "Cannot find TEA575x chip\n");
++ snd_printk(KERN_ERR
++ "tea575x-tuner: Cannot find TEA575x chip\n");
+ return;
+ }
+
+- memset(&tea->vd, 0, sizeof(tea->vd));
+- strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio");
+- tea->vd.release = snd_tea575x_release;
+- video_set_drvdata(&tea->vd, tea);
+- tea->vd.fops = &tea->fops;
+ tea->in_use = 0;
+- tea->fops.owner = tea->card->module;
+- tea->fops.open = snd_tea575x_exclusive_open;
+- tea->fops.release = snd_tea575x_exclusive_release;
+- tea->fops.ioctl = snd_tea575x_ioctl;
+- if (video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->dev_nr - 1) < 0) {
+- snd_printk(KERN_ERR "unable to register tea575x tuner\n");
++ tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40;
++ tea->freq = 90500 * 16; /* 90.5Mhz default */
++
++ tea575x_radio_inst = video_device_alloc();
++ if (tea575x_radio_inst == NULL) {
++ printk(KERN_ERR "tea575x-tuner: not enough memory\n");
+ return;
+ }
+- tea->vd_registered = 1;
+
+- tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40;
+- tea->freq = 90500 * 16; /* 90.5Mhz default */
++ memcpy(tea575x_radio_inst, &tea575x_radio, sizeof(tea575x_radio));
++
++ strcpy(tea575x_radio.name, tea->tea5759 ?
++ "TEA5759 radio" : "TEA5757 radio");
++
++ video_set_drvdata(tea575x_radio_inst, tea);
++
++ retval = video_register_device(tea575x_radio_inst,
++ VFL_TYPE_RADIO, radio_nr);
++ if (retval) {
++ printk(KERN_ERR "tea575x-tuner: can't register video device!\n");
++ kfree(tea575x_radio_inst);
++ return;
++ }
+
+ snd_tea575x_set_freq(tea);
+
+ /* mute on init */
+- if (tea->ops->mute)
++ if (tea->ops->mute) {
+ tea->ops->mute(tea, 1);
++ tea->mute = 1;
++ }
++ tea->vd = tea575x_radio_inst;
+ }
+
+ void snd_tea575x_exit(struct snd_tea575x *tea)
+ {
+- if (tea->vd_registered) {
+- video_unregister_device(&tea->vd);
+- tea->vd_registered = 0;
++ if (tea->vd) {
++ video_unregister_device(tea->vd);
++ tea->vd = NULL;
+ }
+ }
+
+diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
+index 82b9bdd..6cc18bf 100644
+--- a/sound/pci/Kconfig
++++ b/sound/pci/Kconfig
+@@ -487,7 +487,7 @@ config SND_FM801
+ config SND_FM801_TEA575X_BOOL
+ bool "ForteMedia FM801 + TEA5757 tuner"
+ depends on SND_FM801
+- depends on VIDEO_V4L1=y || VIDEO_V4L1=SND_FM801
++ depends on VIDEO_V4L2=y || VIDEO_V4L2=SND_FM801
+ help
+ Say Y here to include support for soundcards based on the ForteMedia
+ FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
linux-2.6.29-lirc.patch:
Index: linux-2.6.29-lirc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6.29-lirc.patch,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -r1.3 -r1.3.6.1
--- linux-2.6.29-lirc.patch 30 Jan 2009 19:15:58 -0000 1.3
+++ linux-2.6.29-lirc.patch 5 Mar 2009 01:30:25 -0000 1.3.6.1
@@ -1,30 +1,57 @@
+Linux Infrared Remote Control drivers -- http://www.lirc.org
+
+From http://git.wilsonet.com/linux-2.6-lirc.git/
+
+Signed-off-by: Jarod Wilson <jarod at redhat.com>
+
+---
+ MAINTAINERS | 9 +
drivers/input/Kconfig | 2 +
drivers/input/Makefile | 2 +
drivers/input/lirc/Kconfig | 118 +++
drivers/input/lirc/Makefile | 21 +
drivers/input/lirc/lirc.h | 100 +++
- drivers/input/lirc/lirc_bt829.c | 381 +++++++++
- drivers/input/lirc/lirc_dev.c | 754 ++++++++++++++++++
- drivers/input/lirc/lirc_dev.h | 178 +++++
- drivers/input/lirc/lirc_i2c.c | 649 ++++++++++++++++
- drivers/input/lirc/lirc_igorplugusb.c | 554 +++++++++++++
- drivers/input/lirc/lirc_imon.c | 1369 ++++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_it87.c | 984 +++++++++++++++++++++++
+ drivers/input/lirc/lirc_bt829.c | 383 +++++++++
+ drivers/input/lirc/lirc_dev.c | 853 +++++++++++++++++++
+ drivers/input/lirc/lirc_dev.h | 180 ++++
+ drivers/input/lirc/lirc_i2c.c | 649 ++++++++++++++
+ drivers/input/lirc/lirc_igorplugusb.c | 556 ++++++++++++
+ drivers/input/lirc/lirc_imon.c | 1487 +++++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_it87.c | 984 ++++++++++++++++++++++
drivers/input/lirc/lirc_it87.h | 116 +++
- drivers/input/lirc/lirc_ite8709.c | 539 +++++++++++++
- drivers/input/lirc/lirc_mceusb.c | 784 +++++++++++++++++++
- drivers/input/lirc/lirc_mceusb2.c | 1119 ++++++++++++++++++++++++++
- drivers/input/lirc/lirc_parallel.c | 709 +++++++++++++++++
+ drivers/input/lirc/lirc_ite8709.c | 539 ++++++++++++
+ drivers/input/lirc/lirc_mceusb.c | 747 +++++++++++++++++
+ drivers/input/lirc/lirc_mceusb2.c | 1099 ++++++++++++++++++++++++
+ drivers/input/lirc/lirc_parallel.c | 709 ++++++++++++++++
drivers/input/lirc/lirc_parallel.h | 26 +
- drivers/input/lirc/lirc_sasem.c | 933 ++++++++++++++++++++++
- drivers/input/lirc/lirc_serial.c | 1321 +++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_sir.c | 1294 ++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_streamzap.c | 772 ++++++++++++++++++
- drivers/input/lirc/lirc_ttusbir.c | 396 ++++++++++
- drivers/input/lirc/lirc_zilog.c | 1382 +++++++++++++++++++++++++++++++++
-
- 24 files changed, 14503 insertions(+), 0 deletions(-)
+ drivers/input/lirc/lirc_sasem.c | 931 +++++++++++++++++++++
+ drivers/input/lirc/lirc_serial.c | 1321 +++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_sir.c | 1294 ++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_streamzap.c | 775 +++++++++++++++++
+ drivers/input/lirc/lirc_ttusbir.c | 398 +++++++++
+ drivers/input/lirc/lirc_zilog.c | 1382 ++++++++++++++++++++++++++++++
+ 25 files changed, 14681 insertions(+), 0 deletions(-)
+diff --git a/MAINTAINERS b/MAINTAINERS
+index 59fd2d1..ad1b16c 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -2749,6 +2749,15 @@ W: http://www.pasemi.com/
+ L: linuxppc-dev at ozlabs.org
+ S: Supported
+
++LINUX INFRARED REMOTE CONTROL DRIVERS (LIRC)
++P: Jarod Wilson
++M: jarod at redhat.com
++P: Christoph Bartelmus
++M: lirc at bartelmus.de
++W: http://www.lirc.org/
++L: lirc-list at lists.sourceforge.net
++S: Maintained
++
+ LINUX SECURITY MODULE (LSM) FRAMEWORK
+ P: Chris Wright
+ M: chrisw at sous-sol.org
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 5f9d860..2ba0904 100644
--- a/drivers/input/Kconfig
@@ -39,7 +66,7 @@
endif
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
-index 98c4f9a..6a1049b 100644
+index 4c9c745..99e2b5e 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -25,3 +25,5 @@ obj-$(CONFIG_INPUT_MISC) += misc/
@@ -201,7 +228,7 @@
+obj-$(CONFIG_LIRC_ZILOG) += lirc_zilog.o
diff --git a/drivers/input/lirc/lirc.h b/drivers/input/lirc/lirc.h
new file mode 100644
-index 0000000..b6d124e
+index 0000000..599b21c
--- /dev/null
+++ b/drivers/input/lirc/lirc.h
@@ -0,0 +1,100 @@
@@ -270,27 +297,27 @@
+
+/*** IOCTL commands for lirc driver ***/
+
-+#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32)
++#define LIRC_GET_FEATURES _IOR('i', 0x00000000, unsigned long)
+
-+#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
-+#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
-+#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
-+#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
-+#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
-+#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
-+#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
++#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, unsigned long)
++#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, unsigned long)
++#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, unsigned int)
++#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, unsigned int)
++#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, unsigned int)
++#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, unsigned int)
++#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, unsigned int)
+
+/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
-+#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
++#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, unsigned long)
+
-+#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32)
-+#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32)
++#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, unsigned long)
++#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, unsigned long)
+/* Note: these can reset the according pulse_width */
-+#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
-+#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
-+#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
-+#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
-+#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
++#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, unsigned int)
++#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, unsigned int)
++#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, unsigned int)
++#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, unsigned int)
++#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, unsigned int)
+
+/*
+ * to set a range use
@@ -299,18 +326,18 @@
+ * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
+ */
+
-+#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
-+#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
++#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, unsigned int)
++#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, unsigned int)
+
+#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
+
+#endif
diff --git a/drivers/input/lirc/lirc_bt829.c b/drivers/input/lirc/lirc_bt829.c
new file mode 100644
-index 0000000..581f6e2
+index 0000000..c3852f2
--- /dev/null
+++ b/drivers/input/lirc/lirc_bt829.c
-@@ -0,0 +1,381 @@
+@@ -0,0 +1,383 @@
+/*
+ * Remote control driver for the TV-card based on bt829
+ *
@@ -364,11 +391,13 @@
+#define DATA_PCI_OFF 0x7FFC00
+#define WAIT_CYCLE 20
+
++#define DRIVER_NAME "lirc_bt829"
++
+static int debug;
-+#define dprintk(fmt, args...) \
-+ do { \
-+ if (debug) \
-+ printk(KERN_DEBUG fmt, ## args); \
++#define dprintk(fmt, args...) \
++ do { \
++ if (debug) \
++ printk(KERN_DEBUG DRIVER_NAME ": "fmt, ## args); \
+ } while (0)
+
+static int atir_minor;
@@ -383,20 +412,20 @@
+ my_dev = pci_get_device(PCI_VENDOR_ID_ATI,
+ PCI_DEVICE_ID_ATI_264VT, NULL);
+ if (my_dev) {
-+ printk(KERN_ERR "ATIR: Using device: %s\n",
++ printk(KERN_ERR DRIVER_NAME "Using device: %s\n",
+ pci_name(my_dev));
+ pci_addr_phys = 0;
+ if (my_dev->resource[0].flags & IORESOURCE_MEM) {
+ pci_addr_phys = my_dev->resource[0].start;
-+ printk(KERN_INFO "ATIR memory at 0x%08X \n",
++ printk(KERN_INFO DRIVER_NAME "memory at 0x%08X \n",
+ (unsigned int)pci_addr_phys);
+ }
+ if (pci_addr_phys == 0) {
-+ printk(KERN_ERR "ATIR no memory resource ?\n");
++ printk(KERN_ERR DRIVER_NAME "no memory resource ?\n");
+ return NULL;
+ }
+ } else {
-+ printk(KERN_ERR "ATIR: pci_prob failed\n");
++ printk(KERN_ERR DRIVER_NAME "pci_probe failed\n");
+ return NULL;
+ }
+ return my_dev;
@@ -409,7 +438,7 @@
+ status = poll_main();
+ key = (status >> 8) & 0xFF;
+ if (status & 0xFF) {
-+ dprintk("ATIR reading key %02X\n", key);
++ dprintk("reading key %02X\n", key);
+ lirc_buffer_write(buf, &key);
+ return 0;
+ }
@@ -418,13 +447,13 @@
+
+static int atir_set_use_inc(void *data)
+{
-+ dprintk("ATIR driver is opened\n");
++ dprintk("driver is opened\n");
+ return 0;
+}
+
+static void atir_set_use_dec(void *data)
+{
-+ dprintk("ATIR driver is closed\n");
++ dprintk("driver is closed\n");
+}
+
+int init_module(void)
@@ -451,10 +480,10 @@
+
+ atir_minor = lirc_register_driver(&atir_driver);
+ if (atir_minor < 0) {
-+ printk(KERN_ERR "lirc_bt829: failed to register driver!\n");
++ printk(KERN_ERR DRIVER_NAME "failed to register driver!\n");
+ return atir_minor;
+ }
-+ dprintk("ATIR driver is registered on minor %d\n", atir_minor);
++ dprintk("driver is registered on minor %d\n", atir_minor);
+
+ return 0;
+}
@@ -470,7 +499,7 @@
+{
+ pci_addr_lin = ioremap(pci_addr_phys + DATA_PCI_OFF, 0x400);
+ if (pci_addr_lin == 0) {
-+ printk(KERN_INFO "atir: pci mem must be mapped\n");
++ printk(KERN_INFO DRIVER_NAME "pci mem must be mapped\n");
+ return 0;
+ }
+ return 1;
@@ -690,14 +719,14 @@
+MODULE_DESCRIPTION("IR remote driver for bt829 based TV cards");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_dev.c b/drivers/input/lirc/lirc_dev.c
new file mode 100644
-index 0000000..e7b52c4
+index 0000000..dddd999
--- /dev/null
+++ b/drivers/input/lirc/lirc_dev.c
-@@ -0,0 +1,754 @@
+@@ -0,0 +1,853 @@
+/*
+ * LIRC base driver
+ *
@@ -735,6 +764,10 @@
+#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/cdev.h>
++#include <linux/smp_lock.h>
++#ifdef CONFIG_COMPAT
++#include <linux/compat.h>
++#endif
+
+#include "lirc.h"
+#include "lirc_dev.h"
@@ -861,6 +894,9 @@
+ .write = lirc_dev_fop_write,
+ .poll = lirc_dev_fop_poll,
+ .ioctl = lirc_dev_fop_ioctl,
++#ifdef CONFIG_COMPAT
++ .compat_ioctl = lirc_dev_fop_compat_ioctl,
++#endif
+ .open = lirc_dev_fop_open,
+ .release = lirc_dev_fop_close,
+ .owner = THIS_MODULE,
@@ -1000,9 +1036,8 @@
+ d->name[sizeof(d->name)-1] = '\0';
+
+ bytes_in_key = BITS_TO_LONGS(d->code_length);
-+
-+ chunk_size = d->chunk_size ? d->chunk_size : bytes_in_key;
+ buffer_size = d->buffer_size ? d->buffer_size : BUFLEN / bytes_in_key;
++ chunk_size = d->chunk_size ? d->chunk_size : bytes_in_key;
+
+ if (d->rbuf) {
+ ir->buf = d->rbuf;
@@ -1277,8 +1312,7 @@
+ */
+ break;
+ case LIRC_GET_LENGTH:
-+ result = put_user((unsigned long)ir->d.code_length,
-+ (unsigned long *)arg);
++ result = put_user(ir->d.code_length, (unsigned long *)arg);
+ break;
+ default:
+ result = -EINVAL;
@@ -1291,6 +1325,100 @@
+}
+EXPORT_SYMBOL(lirc_dev_fop_ioctl);
+
++#ifdef CONFIG_COMPAT
++#define LIRC_GET_FEATURES_COMPAT32 _IOR('i', 0x00000000, __u32)
++
++#define LIRC_GET_SEND_MODE_COMPAT32 _IOR('i', 0x00000001, __u32)
++#define LIRC_GET_REC_MODE_COMPAT32 _IOR('i', 0x00000002, __u32)
++
++#define LIRC_GET_LENGTH_COMPAT32 _IOR('i', 0x0000000f, __u32)
++
++#define LIRC_SET_SEND_MODE_COMPAT32 _IOW('i', 0x00000011, __u32)
++#define LIRC_SET_REC_MODE_COMPAT32 _IOW('i', 0x00000012, __u32)
++
++long lirc_dev_fop_compat_ioctl(struct file *file,
++ unsigned int cmd32,
++ unsigned long arg)
++{
++ mm_segment_t old_fs;
++ int ret;
++ unsigned long val;
++ unsigned int cmd;
++
++ switch (cmd32) {
++ case LIRC_GET_FEATURES_COMPAT32:
++ case LIRC_GET_SEND_MODE_COMPAT32:
++ case LIRC_GET_REC_MODE_COMPAT32:
++ case LIRC_GET_LENGTH_COMPAT32:
++ case LIRC_SET_SEND_MODE_COMPAT32:
++ case LIRC_SET_REC_MODE_COMPAT32:
++ /*
++ * These commands expect (unsigned long *) arg
++ * but the 32-bit app supplied (__u32 *).
++ * Conversion is required.
++ */
++ if (get_user(val, (__u32 *)compat_ptr(arg)))
++ return -EFAULT;
++ lock_kernel();
++ /*
++ * tell lirc_dev_fop_ioctl that it's safe to use the pointer
++ * to val which is in kernel address space and not in
++ * user address space.
++ */
++ old_fs = get_fs();
++ set_fs(KERNEL_DS);
++
++ cmd = _IOC(_IOC_DIR(cmd32), _IOC_TYPE(cmd32), _IOC_NR(cmd32),
++ (_IOC_TYPECHECK(unsigned long)));
++ ret = lirc_dev_fop_ioctl(file->f_path.dentry->d_inode, file,
++ cmd, (unsigned long)(&val));
++
++ set_fs(old_fs);
++ unlock_kernel();
++ switch (cmd) {
++ case LIRC_GET_FEATURES:
++ case LIRC_GET_SEND_MODE:
++ case LIRC_GET_REC_MODE:
++ case LIRC_GET_LENGTH:
++ if (!ret && put_user(val, (__u32 *)compat_ptr(arg)))
++ return -EFAULT;
++ break;
++ }
++ return ret;
++
++ case LIRC_GET_SEND_CARRIER:
++ case LIRC_GET_REC_CARRIER:
++ case LIRC_GET_SEND_DUTY_CYCLE:
++ case LIRC_GET_REC_DUTY_CYCLE:
++ case LIRC_GET_REC_RESOLUTION:
++ case LIRC_SET_SEND_CARRIER:
++ case LIRC_SET_REC_CARRIER:
++ case LIRC_SET_SEND_DUTY_CYCLE:
++ case LIRC_SET_REC_DUTY_CYCLE:
++ case LIRC_SET_TRANSMITTER_MASK:
++ case LIRC_SET_REC_DUTY_CYCLE_RANGE:
++ case LIRC_SET_REC_CARRIER_RANGE:
++ /*
++ * These commands expect (unsigned int *)arg
++ * so no problems here. Just handle the locking.
++ */
++ lock_kernel();
++ cmd = cmd32;
++ ret = lirc_dev_fop_ioctl(file->f_path.dentry->d_inode,
++ file, cmd, arg);
++ unlock_kernel();
++ return ret;
++ default:
++ /* unknown */
++ printk(KERN_ERR "lirc_dev: %s(%s:%d): Unknown cmd %08x\n",
++ __func__, current->comm, current->pid, cmd32);
++ return -ENOIOCTLCMD;
++ }
++}
++EXPORT_SYMBOL(lirc_dev_fop_compat_ioctl);
++#endif
++
++
+ssize_t lirc_dev_fop_read(struct file *file,
+ char *buffer,
+ size_t length,
@@ -1450,14 +1578,14 @@
+MODULE_AUTHOR("Artur Lipowski");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_dev.h b/drivers/input/lirc/lirc_dev.h
new file mode 100644
-index 0000000..bf05a7c
+index 0000000..b12d519
--- /dev/null
+++ b/drivers/input/lirc/lirc_dev.h
-@@ -0,0 +1,178 @@
+@@ -0,0 +1,180 @@
+/*
+ * LIRC base driver
+ *
@@ -1544,12 +1672,12 @@
+struct lirc_driver {
+ char name[40];
+ int minor;
-+ int code_length;
++ unsigned long code_length;
++ unsigned int buffer_size; /* in chunks holding one code each */
+ int sample_rate;
+ unsigned long features;
+
+ unsigned int chunk_size;
-+ unsigned int buffer_size; /* in chunks */
+
+ void *data;
+ int (*add_to_buf) (void *data, struct lirc_buffer *buf);
@@ -1634,11 +1762,13 @@
+ loff_t *ppos);
+ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,
+ loff_t *ppos);
++long lirc_dev_fop_compat_ioctl(struct file *file, unsigned int cmd32,
++ unsigned long arg);
+
+#endif
diff --git a/drivers/input/lirc/lirc_i2c.c b/drivers/input/lirc/lirc_i2c.c
new file mode 100644
-index 0000000..01a4ced
+index 0000000..dedf415
--- /dev/null
+++ b/drivers/input/lirc/lirc_i2c.c
@@ -0,0 +1,649 @@
@@ -2283,20 +2413,20 @@
+ "Ulrich Mueller, Stefan Jahn, Jerome Brock");
+MODULE_LICENSE("GPL");
+
-+module_param(minor, int, 0444);
++module_param(minor, int, S_IRUGO);
+MODULE_PARM_DESC(minor, "Preferred minor device number");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
+module_init(lirc_i2c_init);
+module_exit(lirc_i2c_exit);
diff --git a/drivers/input/lirc/lirc_igorplugusb.c b/drivers/input/lirc/lirc_igorplugusb.c
new file mode 100644
-index 0000000..7dd8844
+index 0000000..ff49bdd
--- /dev/null
+++ b/drivers/input/lirc/lirc_igorplugusb.c
-@@ -0,0 +1,554 @@
+@@ -0,0 +1,556 @@
+/*
+ * lirc_igorplugusb - USB remote support for LIRC
+ *
@@ -2725,7 +2855,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->sample_rate = sample_rate; /* per second */
+ driver->add_to_buf = &usb_remote_poll;
-+ driver->dev = &dev->dev;
++ driver->dev = &intf->dev;
+ driver->owner = THIS_MODULE;
+
+ init_waitqueue_head(&ir->wait_out);
@@ -2759,11 +2889,13 @@
+ do_gettimeofday(&ir->last_time);
+
+ if (dev->descriptor.iManufacturer
-+ && usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ && usb_string(dev, dev->descriptor.iManufacturer,
++ buf, sizeof(buf)) > 0)
++ strlcpy(name, buf, sizeof(name));
+ if (dev->descriptor.iProduct
-+ && usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ && usb_string(dev, dev->descriptor.iProduct, buf, sizeof(buf)) > 0)
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+ printk(DRIVER_NAME "[%d]: %s on usb%d:%d\n", devnum, name,
+ dev->bus->busnum, devnum);
+
@@ -2848,17 +2980,17 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, usb_remote_id_table);
+
-+module_param(sample_rate, int, 0644);
++module_param(sample_rate, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(sample_rate, "Sampling rate in Hz (default: 100)");
+
diff --git a/drivers/input/lirc/lirc_imon.c b/drivers/input/lirc/lirc_imon.c
new file mode 100644
-index 0000000..a0d052a
+index 0000000..05cb293
--- /dev/null
+++ b/drivers/input/lirc/lirc_imon.c
-@@ -0,0 +1,1369 @@
+@@ -0,0 +1,1487 @@
+/*
-+ * lirc_imon.c: LIRC/VFD/LCD driver for Ahanix/Soundgraph IMON IR/VFD/LCD
++ * lirc_imon.c: LIRC/VFD/LCD driver for Ahanix/Soundgraph iMON IR/VFD/LCD
+ * including the iMON PAD model
+ *
+ * Copyright(C) 2004 Venky Raju(dev at venky.ws)
@@ -2885,6 +3017,7 @@
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/usb.h>
++#include <linux/time.h>
+
+#include "lirc.h"
+#include "lirc_dev.h"
@@ -2912,7 +3045,11 @@
+static void usb_rx_callback(struct urb *urb);
+static void usb_tx_callback(struct urb *urb);
+
-+/* Display file_operations function prototypes */
++/* suspend/resume support */
++static int imon_resume(struct usb_interface *intf);
++static int imon_suspend(struct usb_interface *intf, pm_message_t message);
++
++/* display file_operations function prototypes */
+static int display_open(struct inode *inode, struct file *file);
+static int display_close(struct inode *inode, struct file *file);
+
@@ -2937,14 +3074,14 @@
+struct imon_context {
+ struct usb_device *usbdev;
+ int display_supported; /* not all controllers do */
-+ int display_isopen; /* Display port has been opened */
++ int display_isopen; /* display port has been opened */
+ int ir_isopen; /* IR port open */
+ int ir_isassociating; /* IR port open for association */
+ int dev_present; /* USB device presence */
+ struct mutex lock; /* to lock this object */
+ wait_queue_head_t remove_ok; /* For unexpected USB disconnects */
+
-+ int display_proto_6p; /* Display requires 6th packet */
++ int display_proto_6p; /* display requires 6th packet */
+ int ir_onboard_decode; /* IR signals decoded onboard */
+
+ struct lirc_driver *driver;
@@ -2970,7 +3107,7 @@
+ } tx;
+};
+
-+/* Display file operations. Nb: lcd_write will be subbed in as needed later */
++/* display file operations. Nb: lcd_write will be subbed in as needed later */
+static struct file_operations display_fops = {
+ .owner = THIS_MODULE,
+ .open = &display_open,
@@ -2985,7 +3122,7 @@
+ IMON_DISPLAY_TYPE_NONE,
+};
+
-+/* USB Device ID for IMON USB Control Board */
++/* USB Device ID for iMON USB Control Board */
+static struct usb_device_id imon_usb_id_table[] = {
+ /* iMON USB Control Board (IR & VFD) */
+ { USB_DEVICE(0x0aa8, 0xffda) },
@@ -2995,7 +3132,7 @@
+ { USB_DEVICE(0x04e8, 0xff30) },
+ /* iMON USB Control Board (IR & VFD) */
+ { USB_DEVICE(0x15c2, 0xffda) },
-+ /* iMON USB Control Board (IR & LCD) *and* iMon Knob (IR only) */
++ /* iMON USB Control Board (IR & LCD) *and* iMON Knob (IR only) */
+ { USB_DEVICE(0x15c2, 0xffdc) },
+ /* iMON USB Control Board (IR & LCD) */
+ { USB_DEVICE(0x15c2, 0x0034) },
@@ -3033,7 +3170,7 @@
+static unsigned char display_packet6[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };
+
-+/* newer iMon models use control endpoints */
++/* newer iMON models use control endpoints */
+static struct usb_device_id ctl_ep_device_list[] = {
+ { USB_DEVICE(0x15c2, 0x0034) },
+ { USB_DEVICE(0x15c2, 0x0036) },
@@ -3046,7 +3183,7 @@
+ {}
+};
+
-+/* iMon LCD models user a different write op */
++/* iMON LCD models user a different write op */
+static struct usb_device_id lcd_device_list[] = {
+ { USB_DEVICE(0x15c2, 0xffdc) },
+ { USB_DEVICE(0x15c2, 0x0034) },
@@ -3055,7 +3192,7 @@
+ {}
+};
+
-+/* iMon devices with front panel buttons need a larger buffer */
++/* iMON devices with front panel buttons need a larger buffer */
+static struct usb_device_id large_buffer_list[] = {
+ { USB_DEVICE(0x15c2, 0x0038) },
+ { USB_DEVICE(0x15c2, 0x0045) },
@@ -3075,7 +3212,7 @@
+ {}
+};
+
-+/* Some iMon devices have no lcd/vfd, don't set one up */
++/* Some iMON devices have no lcd/vfd, don't set one up */
+static struct usb_device_id ir_only_list[] = {
+ { USB_DEVICE(0x0aa8, 0x8001) },
+ { USB_DEVICE(0x04e8, 0xff30) },
@@ -3092,6 +3229,8 @@
+ .name = MOD_NAME,
+ .probe = imon_probe,
+ .disconnect = imon_disconnect,
++ .suspend = imon_suspend,
++ .resume = imon_resume,
+ .id_table = imon_usb_id_table,
+};
+
@@ -3117,9 +3256,9 @@
+MODULE_VERSION(MOD_VERSION);
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, imon_usb_id_table);
-+module_param(debug, int, 0);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)");
-+module_param(display_type, int, 0);
++module_param(display_type, int, S_IRUGO);
+MODULE_PARM_DESC(display_type, "Type of attached display. 0=autodetect, "
+ "1=vfd, 2=lcd, 3=none (default: autodetect)");
+
@@ -3152,7 +3291,7 @@
+}
+
+/**
-+ * Called when the Display device (e.g. /dev/lcd0)
++ * Called when the display device (e.g. /dev/lcd0)
+ * is opened by the application.
+ */
+static int display_open(struct inode *inode, struct file *file)
@@ -3185,15 +3324,15 @@
+ mutex_lock(&context->lock);
+
+ if (!context->display_supported) {
-+ err("%s: Display not supported by device", __func__);
++ err("%s: display not supported by device", __func__);
+ retval = -ENODEV;
+ } else if (context->display_isopen) {
-+ err("%s: Display port is already open", __func__);
++ err("%s: display port is already open", __func__);
+ retval = -EBUSY;
+ } else {
+ context->display_isopen = 1;
+ file->private_data = context;
-+ printk(KERN_INFO "Display port opened\n");
++ printk(KERN_INFO "display port opened\n");
+ }
+
+ mutex_unlock(&context->lock);
@@ -3204,7 +3343,7 @@
+}
+
+/**
-+ * Called when the Display device (e.g. /dev/lcd0)
++ * Called when the display device (e.g. /dev/lcd0)
+ * is closed by the application.
+ */
+static int display_close(struct inode *inode, struct file *file)
@@ -3222,14 +3361,14 @@
+ mutex_lock(&context->lock);
+
+ if (!context->display_supported) {
-+ err("%s: Display not supported by device", __func__);
++ err("%s: display not supported by device", __func__);
+ retval = -ENODEV;
+ } else if (!context->display_isopen) {
-+ err("%s: Display is not open", __func__);
++ err("%s: display is not open", __func__);
+ retval = -EIO;
+ } else {
+ context->display_isopen = 0;
-+ printk(KERN_INFO "Display port closed\n");
++ printk(KERN_INFO "display port closed\n");
+ if (!context->dev_present && !context->ir_isopen) {
+ /*
+ * Device disconnected before close and IR port is not
@@ -3247,7 +3386,7 @@
+}
+
+/**
-+ * Sends a packet to the Display.
++ * Sends a packet to the display.
+ */
+static int send_packet(struct imon_context *context)
+{
@@ -3426,7 +3565,7 @@
+
+
+/**
-+ * Writes data to the VFD. The IMON VFD is 2x16 characters
++ * Writes data to the VFD. The iMON VFD is 2x16 characters
+ * and requires data in 5 consecutive USB interrupt packets,
+ * each packet but the last carrying 7 bytes.
+ *
@@ -3698,18 +3837,113 @@
+ return;
+}
+
++static inline int tv2int(const struct timeval *a, const struct timeval *b)
++{
++ int usecs = 0;
++ int sec = 0;
++
++ if (b->tv_usec > a->tv_usec) {
++ usecs = 1000000;
++ sec--;
++ }
++
++ usecs += a->tv_usec - b->tv_usec;
++
++ sec += a->tv_sec - b->tv_sec;
++ sec *= 1000;
++ usecs /= 1000;
++ sec += usecs;
++
++ if (sec < 0)
++ sec = 1000;
++
++ return sec;
++}
++
++/**
++ * The directional pad is overly sensitive in keyboard mode, so we do some
++ * interesting contortions to make it less touchy.
++ */
++#define IMON_PAD_TIMEOUT 1000 /* in msecs */
++#define IMON_PAD_THRESHOLD 80 /* 160x160 square */
++static int stabilize(int a, int b)
++{
++ struct timeval ct;
++ static struct timeval prev_time = {0, 0};
++ static struct timeval hit_time = {0, 0};
++ static int x, y, prev_result, hits;
++ int result = 0;
++ int msec, msec_hit;
++
++ do_gettimeofday(&ct);
++ msec = tv2int(&ct, &prev_time);
++ msec_hit = tv2int(&ct, &hit_time);
++
++ if (msec > 100) {
++ x = 0;
++ y = 0;
++ hits = 0;
++ }
++
++ x += a;
++ y += b;
++
++ prev_time = ct;
++
++ if (abs(x) > IMON_PAD_THRESHOLD || abs(y) > IMON_PAD_THRESHOLD) {
++ if (abs(y) > abs(x))
++ result = (y > 0) ? 0x7F : 0x80;
++ else
++ result = (x > 0) ? 0x7F00 : 0x8000;
++
++ x = 0;
++ y = 0;
++
++ if (result == prev_result) {
++ hits++;
++
++ if (hits > 3) {
++ switch (result) {
++ case 0x7F:
++ y = 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x80:
++ y -= 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x7F00:
++ x = 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x8000:
++ x -= 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ }
++ }
++
++ if (hits == 2 && msec_hit < IMON_PAD_TIMEOUT) {
++ result = 0;
++ hits = 1;
++ }
++ } else {
++ prev_result = result;
++ hits = 1;
++ hit_time = ct;
++ }
++ }
++
++ return result;
++}
++
+/**
+ * Process the incoming packet
+ */
+static void incoming_packet(struct imon_context *context,
-+ struct urb *urb)
++ struct urb *urb)
+{
+ int len = urb->actual_length;
+ unsigned char *buf = urb->transfer_buffer;
+ int octet, bit;
+ unsigned char mask;
-+ int chunk_num;
-+ int i;
++ int i, chunk_num, dir;
+
+ /*
+ * we need to add some special handling for
@@ -3731,17 +3965,11 @@
+ * try to ignore when they get too close
+ */
+ if ((buf[1] == 0) && ((buf[2] != 0) || (buf[3] != 0))) {
-+ int y = (int)(char)buf[2];
-+ int x = (int)(char)buf[3];
-+ if (abs(abs(x) - abs(y)) < 3) {
++ dir = stabilize((int)(char)buf[2], (int)(char)buf[3]);
++ if (!dir)
+ return;
-+ } else if (abs(y) > abs(x)) {
-+ buf[2] = 0x00;
-+ buf[3] = (y > 0) ? 0x7f : 0x80;
-+ } else {
-+ buf[3] = 0x00;
-+ buf[2] = (x > 0) ? 0x7f : 0x80;
-+ }
++ buf[2] = dir & 0xFF;
++ buf[3] = (dir >> 8) & 0xFF;
+ }
+ }
+
@@ -3903,7 +4131,7 @@
+ struct imon_context *context = NULL;
+ int i;
+
-+ printk(KERN_INFO "%s: found IMON device\n", __func__);
++ printk(KERN_INFO "%s: found iMON device\n", __func__);
+
+ /*
+ * If it's the LCD, as opposed to the VFD, we just need to replace
@@ -3930,7 +4158,7 @@
+ /*
+ * Scan the endpoint list and set:
+ * first input endpoint = IR endpoint
-+ * first output endpoint = Display endpoint
++ * first output endpoint = display endpoint
+ */
+ for (i = 0; i < num_endpts && !(ir_ep_found && display_ep_found); ++i) {
+ struct usb_endpoint_descriptor *ep;
@@ -3963,7 +4191,7 @@
+
+ /*
+ * If we didn't find a display endpoint, this is probably one of the
-+ * newer iMon devices that use control urb instead of interrupt
++ * newer iMON devices that use control urb instead of interrupt
+ */
+ if (!display_ep_found) {
+ if (usb_match_id(interface, ctl_ep_device_list)) {
@@ -3977,7 +4205,7 @@
+ }
+
+ /*
-+ * Some iMon receivers have no display. Unfortunately, it seems
++ * Some iMON receivers have no display. Unfortunately, it seems
+ * that SoundGraph recycles device IDs between devices both with
+ * and without... :\
+ */
@@ -4006,7 +4234,7 @@
+ ir_onboard_decode);
+ }
+
-+ /* Determine if Display requires 6 packets */
++ /* Determine if display requires 6 packets */
+ if (display_ep_found) {
+ if (usb_match_id(interface, display_proto_6p_list))
+ display_proto_6p = 1;
@@ -4020,13 +4248,13 @@
+
+ context = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
+ if (!context) {
-+ err("%s: kmalloc failed for context", __func__);
++ err("%s: kzalloc failed for context", __func__);
+ alloc_status = 1;
+ goto alloc_status_switch;
+ }
+ driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
+ if (!driver) {
-+ err("%s: kmalloc failed for lirc_driver", __func__);
++ err("%s: kzalloc failed for lirc_driver", __func__);
+ alloc_status = 2;
+ goto alloc_status_switch;
+ }
@@ -4050,7 +4278,7 @@
+ if (display_ep_found) {
+ tx_urb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!tx_urb) {
-+ err("%s: usb_alloc_urb failed for Display urb",
++ err("%s: usb_alloc_urb failed for display urb",
+ __func__);
+ alloc_status = 6;
+ goto alloc_status_switch;
@@ -4071,7 +4299,7 @@
+ driver->rbuf = rbuf;
+ driver->set_use_inc = ir_open;
+ driver->set_use_dec = ir_close;
-+ driver->dev = &usbdev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_lock(&context->lock);
@@ -4115,11 +4343,11 @@
+
+ if (display_ep_found && context->display_supported) {
+ if (debug)
-+ printk(KERN_INFO "Registering Display with sysfs\n");
++ printk(KERN_INFO "Registering display with sysfs\n");
+ if (usb_register_dev(interface, &imon_class)) {
+ /* Not a fatal error, so ignore */
+ printk(KERN_INFO "%s: could not get a minor number for "
-+ "Display\n", __func__);
++ "display\n", __func__);
+ }
+ }
+
@@ -4203,6 +4431,27 @@
+ printk(KERN_INFO "%s: iMON device disconnected\n", __func__);
+}
+
++static int imon_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct imon_context *context = usb_get_intfdata(intf);
++
++ if (context->ir_isopen)
++ usb_kill_urb(context->rx_urb);
++
++ return 0;
++}
++
++static int imon_resume(struct usb_interface *intf)
++{
++ int rc = 0;
++ struct imon_context *context = usb_get_intfdata(intf);
++
++ if (context->ir_isopen)
++ rc = usb_submit_urb(context->rx_urb, GFP_ATOMIC);
++
++ return rc;
++}
++
+static int __init imon_init(void)
+{
+ int rc;
@@ -4215,6 +4464,7 @@
+ err("%s: usb register failed(%d)", __func__, rc);
+ return -ENODEV;
+ }
++
+ return 0;
+}
+
@@ -4228,7 +4478,7 @@
+module_exit(imon_exit);
diff --git a/drivers/input/lirc/lirc_it87.c b/drivers/input/lirc/lirc_it87.c
new file mode 100644
-index 0000000..3a3484c
+index 0000000..232ba97
--- /dev/null
+++ b/drivers/input/lirc/lirc_it87.c
@@ -0,0 +1,984 @@
@@ -5181,24 +5431,24 @@
+MODULE_AUTHOR("Hans-Gunter Lutke Uphues");
+MODULE_LICENSE("GPL");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O base address (default: 0x310)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 9)");
+#else
+MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 7)");
+#endif
+
-+module_param(it87_enable_demodulator, bool, 0444);
++module_param(it87_enable_demodulator, bool, S_IRUGO);
+MODULE_PARM_DESC(it87_enable_demodulator,
+ "Receiver demodulator enable/disable (1/0), default: 0");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
-+module_param(digimatrix, bool, 0644);
++module_param(digimatrix, bool, S_IRUGO | S_IWUSR);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(digimatrix,
+ "Asus Digimatrix it87 compat. enable/disable (1/0), default: 1");
@@ -5208,7 +5458,7 @@
+#endif
+
+
-+module_param(it87_freq, int, 0444);
++module_param(it87_freq, int, S_IRUGO);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(it87_freq,
+ "Carrier demodulator frequency (kHz), (default: 36)");
@@ -5340,7 +5590,7 @@
+/********************************* ITE IT87xx ************************/
diff --git a/drivers/input/lirc/lirc_ite8709.c b/drivers/input/lirc/lirc_ite8709.c
new file mode 100644
-index 0000000..6a544ec
+index 0000000..3d53181
--- /dev/null
+++ b/drivers/input/lirc/lirc_ite8709.c
@@ -0,0 +1,539 @@
@@ -5881,14 +6131,14 @@
+MODULE_AUTHOR("Grégory Lardière");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_mceusb.c b/drivers/input/lirc/lirc_mceusb.c
new file mode 100644
-index 0000000..16f9757
+index 0000000..2e94699
--- /dev/null
+++ b/drivers/input/lirc/lirc_mceusb.c
-@@ -0,0 +1,784 @@
+@@ -0,0 +1,747 @@
+/*
+ * USB Microsoft IR Transceiver driver - 0.2
+ *
@@ -5980,15 +6230,9 @@
+ struct urb *write_urb; /* the urb used to send data */
+ __u8 bulk_out_endpointAddr; /* the address of bulk out endpoint */
+
-+ atomic_t write_busy; /* true iff write urb is busy */
-+ struct completion write_finished; /* wait for the write to finish */
-+
+ wait_queue_head_t wait_q; /* for timeouts */
-+ int open_count; /* number of times this port has been opened */
+ struct mutex lock; /* locks this structure */
+
-+ int present; /* if the device is not disconnected */
-+
+ struct lirc_driver *driver;
+
+ int lircdata[256]; /* place to store data until lirc processes it */
@@ -6037,21 +6281,6 @@
+ .id_table = mceusb_table,
+};
+
-+
-+static void usb_mceusb_debug_data(const char *function, int size,
-+ const unsigned char *data)
-+{
-+ int i;
-+ if (!debug)
-+ return;
-+
-+ printk(KERN_DEBUG __FILE__": %s - length = %d, data = ",
-+ function, size);
-+ for (i = 0; i < size; ++i)
-+ printk(KERN_DEBUG "%.2x ", data[i]);
-+ printk(KERN_DEBUG "\n");
-+}
-+
+static void mceusb_delete(struct mceusb_device *dev)
+{
+ dprintk("%s", __func__);
@@ -6193,8 +6422,6 @@
+ /* handle signals and USB disconnects */
+ if (signal_pending(current))
+ return dev->lirccnt ? dev->lirccnt : -EINTR;
-+ if (!dev->udev)
-+ return -ENODEV;
+
+ bulkidx = 0;
+
@@ -6375,12 +6602,6 @@
+
+ mutex_lock(&dev->lock);
+
-+ /* verify device still present */
-+ if (dev->udev == NULL) {
-+ mutex_unlock(&dev->lock);
-+ return -ENODEV;
-+ }
-+
+ if (!dev->lirccnt) {
+ int res;
+ dev->lircidx = 0;
@@ -6561,7 +6782,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->sample_rate = 80; /* sample at 100hz (10ms) */
+ driver->add_to_buf = &mceusb_add_to_buf;
-+ driver->dev = &udev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+ if (lirc_register_driver(driver) < 0) {
+ kfree(driver);
@@ -6623,14 +6844,6 @@
+ /* unhook lirc things */
+ lirc_unregister_driver(minor);
+ kfree(dev->driver);
-+ /* terminate an ongoing write */
-+ if (atomic_read(&dev->write_busy)) {
-+ usb_kill_urb(dev->write_urb);
-+ wait_for_completion(&dev->write_finished);
-+ }
-+
-+ /* prevent device read, write and ioctl */
-+ dev->present = 0;
+
+ mutex_unlock(&dev->lock);
+ mceusb_delete(dev);
@@ -6671,14 +6884,14 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, mceusb_table);
+
-+module_param(debug, int, 0644);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_mceusb2.c b/drivers/input/lirc/lirc_mceusb2.c
new file mode 100644
-index 0000000..8bc9263
+index 0000000..0551adf
--- /dev/null
+++ b/drivers/input/lirc/lirc_mceusb2.c
-@@ -0,0 +1,1119 @@
+@@ -0,0 +1,1099 @@
+/*
+ * LIRC driver for Philips eHome USB Infrared Transceiver
+ * and the Microsoft MCE 2005 Remote Control
@@ -6733,7 +6946,7 @@
+ "MCE 2005 Remote Control driver for LIRC"
+#define DRIVER_NAME "lirc_mceusb2"
+
-+#define USB_BUFLEN 16 /* USB reception buffer length */
++#define USB_BUFLEN 32 /* USB reception buffer length */
+#define LIRCBUF_SIZE 256 /* LIRC work buffer length */
+
+/* MCE constants */
@@ -6794,8 +7007,6 @@
+#define VENDOR_COMPRO 0x185b
+
+static struct usb_device_id mceusb_dev_table[] = {
-+ /* Philips eHome Infrared Transceiver */
-+ { USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
+ /* Philips Infrared Transceiver - Sahara branded */
+ { USB_DEVICE(VENDOR_PHILIPS, 0x0608) },
+ /* Philips Infrared Transceiver - HP branded */
@@ -6806,6 +7017,8 @@
+ { USB_DEVICE(VENDOR_PHILIPS, 0x060f) },
+ /* Philips Infrared Transceiver - Spinel plus */
+ { USB_DEVICE(VENDOR_PHILIPS, 0x0613) },
++ /* Philips eHome Infrared Transceiver */
++ { USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
+ /* SMK/Toshiba G83C0004D410 */
+ { USB_DEVICE(VENDOR_SMK, 0x031d) },
+ /* SMK eHome Infrared Transceiver (Sony VAIO) */
@@ -7145,26 +7358,8 @@
+ case 0:
+ for (i = 0; i < buf_len; i++) {
+ /* decode mce packets of the form (84),AA,BB,CC,DD */
-+ switch (ir->buf_in[i]) {
-+
++ if (ir->buf_in[i] >= 0x80 && ir->buf_in[i] <= 0x9e) {
+ /* data headers */
-+ case 0x90: /* used Pinnacle Remote Kit */
-+ case 0x8F:
-+ case 0x8E:
-+ case 0x8D:
-+ case 0x8C:
-+ case 0x8B:
-+ case 0x8A:
-+ case 0x89:
-+ case 0x88:
-+ case 0x87:
-+ case 0x86:
-+ case 0x85:
-+ case 0x84:
-+ case 0x83:
-+ case 0x82:
-+ case 0x81:
-+ case 0x80:
+ /* decode packet data */
+ packet_len = ir->buf_in[i] &
+ MCE_PACKET_LENGTH_MASK;
@@ -7190,10 +7385,8 @@
+ }
+
+ i += packet_len;
-+ break;
-+
++ } else if (ir->buf_in[i] == MCE_CONTROL_HEADER) {
+ /* status header (0x9F) */
-+ case MCE_CONTROL_HEADER:
+ /*
+ * A transmission containing one or
+ * more consecutive ir commands always
@@ -7215,9 +7408,6 @@
+
+ /* end decode loop */
+ i = buf_len;
-+ break;
-+ default:
-+ break;
+ }
+ }
+
@@ -7596,7 +7786,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->code_length = sizeof(int) * 8;
+ driver->fops = &lirc_fops;
-+ driver->dev = &dev->dev;
++ driver->dev = &intf->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_init(&ir->lock);
@@ -7647,11 +7837,14 @@
+ ir->usb_ep_out = ep_out;
+
+ if (dev->descriptor.iManufacturer
-+ && usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ && usb_string(dev, dev->descriptor.iManufacturer,
++ buf, sizeof(buf)) > 0)
++ strlcpy(name, buf, sizeof(name));
+ if (dev->descriptor.iProduct
-+ && usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ && usb_string(dev, dev->descriptor.iProduct,
++ buf, sizeof(buf)) > 0)
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+ printk(DRIVER_NAME "[%d]: %s on usb%d:%d\n", devnum, name,
+ dev->bus->busnum, devnum);
+
@@ -7796,11 +7989,11 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, mceusb_dev_table);
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_parallel.c b/drivers/input/lirc/lirc_parallel.c
new file mode 100644
-index 0000000..b66c57f
+index 0000000..07d0d02
--- /dev/null
+++ b/drivers/input/lirc/lirc_parallel.c
@@ -0,0 +1,709 @@
@@ -8499,19 +8692,19 @@
+MODULE_AUTHOR("Christoph Bartelmus");
+MODULE_LICENSE("GPL");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3bc, 0x378 or 0x278)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (7 or 5)");
+
-+module_param(tx_mask, int, 0444);
++module_param(tx_mask, int, S_IRUGO);
+MODULE_PARM_DESC(tx_maxk, "Transmitter mask (default: 0x01)");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
-+module_param(check_pselecd, bool, 0644);
++module_param(check_pselecd, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Check for printer (default: 0)");
diff --git a/drivers/input/lirc/lirc_parallel.h b/drivers/input/lirc/lirc_parallel.h
new file mode 100644
@@ -8547,10 +8740,10 @@
+#endif
diff --git a/drivers/input/lirc/lirc_sasem.c b/drivers/input/lirc/lirc_sasem.c
new file mode 100644
-index 0000000..e26cda2
+index 0000000..270f8ff
--- /dev/null
+++ b/drivers/input/lirc/lirc_sasem.c
-@@ -0,0 +1,933 @@
+@@ -0,0 +1,931 @@
+/*
+ * lirc_sasem.c - USB remote support for LIRC
+ * Version 0.5
@@ -8678,8 +8871,6 @@
+ .write = &vfd_write,
+ .ioctl = &vfd_ioctl,
+ .release = &vfd_close,
-+ .read = lirc_dev_fop_read,
-+ .poll = lirc_dev_fop_poll,
+};
+
+/* USB Device ID for Sasem USB Control Board */
@@ -8715,7 +8906,7 @@
+MODULE_AUTHOR(MOD_AUTHOR);
+MODULE_DESCRIPTION(MOD_DESC);
+MODULE_LICENSE("GPL");
-+module_param(debug, int, 0);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes (default: no)");
+
+static void delete_context(struct sasem_context *context)
@@ -9299,13 +9490,13 @@
+
+ context = kzalloc(sizeof(struct sasem_context), GFP_KERNEL);
+ if (!context) {
-+ err("%s: kmalloc failed for context", __func__);
++ err("%s: kzalloc failed for context", __func__);
+ alloc_status = 1;
+ goto alloc_status_switch;
+ }
+ driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
+ if (!driver) {
-+ err("%s: kmalloc failed for lirc_driver", __func__);
++ err("%s: kzalloc failed for lirc_driver", __func__);
+ alloc_status = 2;
+ goto alloc_status_switch;
+ }
@@ -9347,7 +9538,7 @@
+ driver->rbuf = rbuf;
+ driver->set_use_inc = ir_open;
+ driver->set_use_dec = ir_close;
-+ driver->dev = &dev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_lock(&context->lock);
@@ -9486,7 +9677,7 @@
+module_exit(sasem_exit);
diff --git a/drivers/input/lirc/lirc_serial.c b/drivers/input/lirc/lirc_serial.c
new file mode 100644
-index 0000000..643c762
+index 0000000..3e9292e
--- /dev/null
+++ b/drivers/input/lirc/lirc_serial.c
@@ -0,0 +1,1321 @@
@@ -10371,7 +10562,7 @@
+ /* If pin is high, then this must be an active low receiver. */
+ if (sense == -1) {
+ /* wait 1/2 sec for the power supply */
-+ msleep(HZ/2);
++ msleep(jiffies_to_msecs(HZ/2));
+
+ /*
+ * probe 9 times every 0.04s, collect "votes" for
@@ -10384,13 +10575,13 @@
+ nlow++;
+ else
+ nhigh++;
-+ msleep(HZ/25);
++ msleep(jiffies_to_msecs(HZ/25));
+ }
+ sense = (nlow >= nhigh ? 1 : 0);
-+ printk(KERN_INFO LIRC_DRIVER_NAME ": auto-detected active "
++ printk(KERN_INFO LIRC_DRIVER_NAME ": auto-detected active "
+ "%s receiver\n", sense ? "low" : "high");
+ } else
-+ printk(KERN_INFO LIRC_DRIVER_NAME ": Manually using active "
++ printk(KERN_INFO LIRC_DRIVER_NAME ": Manually using active "
+ "%s receiver\n", sense ? "low" : "high");
+
+ return 0;
@@ -10769,16 +10960,16 @@
+ "Christoph Bartelmus, Andrei Tanas");
+MODULE_LICENSE("GPL");
+
-+module_param(type, int, 0444);
++module_param(type, int, S_IRUGO);
+MODULE_PARM_DESC(type, "Hardware type (0 = home-brew, 1 = IRdeo,"
+ " 2 = IRdeo Remote, 3 = AnimaX, 4 = IgorPlug,"
+ " 5 = NSLU2 RX:CTS2/TX:GreenLED)");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3f8 or 0x2f8)");
+
+/* some architectures (e.g. intel xscale) have memory mapped registers */
-+module_param(iommap, bool, 0444);
++module_param(iommap, bool, S_IRUGO);
+MODULE_PARM_DESC(iommap, "physical base for memory mapped I/O"
+ " (0 = no memory mapped io)");
+
@@ -10787,33 +10978,33 @@
+ * on 32bit word boundaries.
+ * See linux-kernel/serial/8250.c serial_in()/out()
+ */
-+module_param(ioshift, int, 0444);
++module_param(ioshift, int, S_IRUGO);
+MODULE_PARM_DESC(ioshift, "shift I/O register offset (0 = no shift)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (4 or 3)");
+
-+module_param(share_irq, bool, 0444);
++module_param(share_irq, bool, S_IRUGO);
+MODULE_PARM_DESC(share_irq, "Share interrupts (0 = off, 1 = on)");
+
-+module_param(sense, bool, 0444);
++module_param(sense, bool, S_IRUGO);
+MODULE_PARM_DESC(sense, "Override autodetection of IR receiver circuit"
+ " (0 = active high, 1 = active low )");
+
+#ifdef CONFIG_LIRC_SERIAL_TRANSMITTER
-+module_param(txsense, bool, 0444);
++module_param(txsense, bool, S_IRUGO);
+MODULE_PARM_DESC(txsense, "Sense of transmitter circuit"
+ " (0 = active high, 1 = active low )");
+#endif
+
-+module_param(softcarrier, bool, 0444);
++module_param(softcarrier, bool, S_IRUGO);
+MODULE_PARM_DESC(softcarrier, "Software carrier (0 = off, 1 = on, default on)");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_sir.c b/drivers/input/lirc/lirc_sir.c
new file mode 100644
-index 0000000..093cfd2
+index 0000000..306c77a
--- /dev/null
+++ b/drivers/input/lirc/lirc_sir.c
@@ -0,0 +1,1294 @@
@@ -12096,27 +12287,27 @@
+MODULE_LICENSE("GPL");
+
+#ifdef LIRC_ON_SA1100
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (16)");
+#else
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3f8 or 0x2f8)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (4 or 3)");
+
-+module_param(threshold, int, 0444);
++module_param(threshold, int, S_IRUGO);
+MODULE_PARM_DESC(threshold, "space detection threshold (3)");
+#endif
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_streamzap.c b/drivers/input/lirc/lirc_streamzap.c
new file mode 100644
-index 0000000..cb05b58
+index 0000000..6db4310
--- /dev/null
+++ b/drivers/input/lirc/lirc_streamzap.c
-@@ -0,0 +1,772 @@
+@@ -0,0 +1,775 @@
+/*
+ * Streamzap Remote Control driver
+ *
@@ -12333,7 +12524,7 @@
+ (unsigned char *) &data);
+ }
+ if (sz->timer_running) {
-+ sz->delay_timer.expires += timer_inc;
++ sz->delay_timer.expires = jiffies + timer_inc;
+ add_timer(&sz->delay_timer);
+ }
+ } else {
@@ -12358,7 +12549,7 @@
+ lirc_buffer_write(&sz->lirc_buf,
+ (unsigned char *) &data);
+ } else {
-+ dprintk("buffer overflow\n", sz->driver.minor);
++ dprintk("buffer overflow", sz->driver.minor);
+ }
+ }
+ if (!empty)
@@ -12395,7 +12586,7 @@
+}
+
+static void push_full_pulse(struct usb_streamzap *sz,
-+ unsigned char value)
++ unsigned char value)
+{
+ int pulse;
+
@@ -12422,23 +12613,23 @@
+ sz->sum = 0;
+ }
+
-+ pulse = ((int) value)*STREAMZAP_RESOLUTION;
-+ pulse += STREAMZAP_RESOLUTION/2;
++ pulse = ((int) value) * STREAMZAP_RESOLUTION;
++ pulse += STREAMZAP_RESOLUTION / 2;
+ sz->sum += pulse;
+ pulse |= PULSE_BIT;
+
-+ dprintk("p %u", sz->driver.minor, pulse&PULSE_MASK);
++ dprintk("p %u", sz->driver.minor, pulse & PULSE_MASK);
+ push(sz, (char *)&pulse);
+}
+
+static void push_half_pulse(struct usb_streamzap *sz,
-+ unsigned char value)
++ unsigned char value)
+{
+ push_full_pulse(sz, (value & STREAMZAP_PULSE_MASK)>>4);
+}
+
+static void push_full_space(struct usb_streamzap *sz,
-+ unsigned char value)
++ unsigned char value)
+{
+ int space;
+
@@ -12450,7 +12641,7 @@
+}
+
+static void push_half_space(struct usb_streamzap *sz,
-+ unsigned char value)
++ unsigned char value)
+{
+ push_full_space(sz, value & STREAMZAP_SPACE_MASK);
+}
@@ -12641,7 +12832,7 @@
+ sz->driver.set_use_inc = &streamzap_use_inc;
+ sz->driver.set_use_dec = &streamzap_use_dec;
+ sz->driver.fops = &streamzap_fops;
-+ sz->driver.dev = &udev->dev;
++ sz->driver.dev = &interface->dev;
+ sz->driver.owner = THIS_MODULE;
+
+ sz->idle = 1;
@@ -12663,12 +12854,15 @@
+ sz->endpoint->bInterval);
+
+ if (udev->descriptor.iManufacturer
-+ && usb_string(udev, udev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ && usb_string(udev, udev->descriptor.iManufacturer,
++ buf, sizeof(buf)) > 0)
++ strlcpy(name, buf, sizeof(name));
+
+ if (udev->descriptor.iProduct
-+ && usb_string(udev, udev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ && usb_string(udev, udev->descriptor.iProduct,
++ buf, sizeof(buf)) > 0)
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+
+ printk(KERN_INFO DRIVER_NAME "[%d]: %s on usb%d:%d attached\n",
+ sz->driver.minor, name,
@@ -12761,7 +12955,7 @@
+
+ switch (cmd) {
+ case LIRC_GET_REC_RESOLUTION:
-+ result = put_user(STREAMZAP_RESOLUTION, (unsigned long *) arg);
++ result = put_user(STREAMZAP_RESOLUTION, (unsigned int *) arg);
+ if (result)
+ return result;
+ break;
@@ -12815,7 +13009,7 @@
+{
+ struct usb_streamzap *sz = usb_get_intfdata(intf);
+
-+ printk(DRIVER_NAME "[%d]: suspend\n", sz->driver.minor);
++ printk(KERN_INFO DRIVER_NAME "[%d]: suspend\n", sz->driver.minor);
+ if (sz->in_use) {
+ if (sz->flush) {
+ sz->flush = 0;
@@ -12887,14 +13081,14 @@
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_ttusbir.c b/drivers/input/lirc/lirc_ttusbir.c
new file mode 100644
-index 0000000..8e65ee7
+index 0000000..4d18084
--- /dev/null
+++ b/drivers/input/lirc/lirc_ttusbir.c
-@@ -0,0 +1,396 @@
+@@ -0,0 +1,398 @@
+/*
+ * lirc_ttusbir.c
+ *
@@ -12957,7 +13151,7 @@
+static void set_use_dec(void *data);
+
+static int num_urbs = 2;
-+module_param(num_urbs, int, 0444);
++module_param(num_urbs, int, S_IRUGO);
+MODULE_PARM_DESC(num_urbs,
+ "Number of URBs in queue. Try to increase to 4 in case "
+ "of problems (default: 2; minimum: 2)");
@@ -13204,6 +13398,8 @@
+ ttusbir->driver.rbuf = &ttusbir->rbuf;
+ ttusbir->driver.set_use_inc = set_use_inc;
+ ttusbir->driver.set_use_dec = set_use_dec;
++ ttusbir->driver.fops = NULL;
++ ttusbir->driver.dev = &intf->dev;
+ ttusbir->driver.owner = THIS_MODULE;
+ ttusbir->driver.features = LIRC_CAN_REC_MODE2;
+ ttusbir->minor = lirc_register_driver(&ttusbir->driver);
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/sources,v
retrieving revision 1.976.2.5
retrieving revision 1.976.2.6
diff -u -r1.976.2.5 -r1.976.2.6
--- sources 25 Feb 2009 21:26:01 -0000 1.976.2.5
+++ sources 5 Mar 2009 01:30:25 -0000 1.976.2.6
@@ -1,3 +1,2 @@
d351e44709c9810b85e29b877f50968a linux-2.6.28.tar.bz2
-26f67d99666834cc579094619821d3c8 patch-2.6.29-rc6.bz2
-d693f91cabf1acbd4dd6b737bf72351e patch-2.6.29-rc6-git2.bz2
+9404c2ead603a80a3aad6361b5fc5413 patch-2.6.29-rc7.bz2
Index: upstream
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/upstream,v
retrieving revision 1.888.2.4
retrieving revision 1.888.2.5
diff -u -r1.888.2.4 -r1.888.2.5
--- upstream 25 Feb 2009 21:26:01 -0000 1.888.2.4
+++ upstream 5 Mar 2009 01:30:25 -0000 1.888.2.5
@@ -1,3 +1,2 @@
linux-2.6.28.tar.bz2
-patch-2.6.29-rc6.bz2
-patch-2.6.29-rc6-git2.bz2
+patch-2.6.29-rc7.bz2
xen.pvops.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.1.2.7 -r 1.1.2.8 xen.pvops.patch
Index: xen.pvops.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.patch,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- xen.pvops.patch 25 Feb 2009 23:14:05 -0000 1.1.2.7
+++ xen.pvops.patch 5 Mar 2009 01:30:26 -0000 1.1.2.8
@@ -1601,7 +1601,7 @@
+More details can be found in the source code, in the
+kernel/tracing/*.c files.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 319785b..5e7b9e4 100644
+index 54f21a5..dd35cb7 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -49,6 +49,7 @@ parameter is applicable:
@@ -1626,7 +1626,17 @@
com20020= [HW,NET] ARCnet - COM20020 chipset
Format:
-@@ -1045,6 +1048,15 @@ and is between 256 and 4096 characters. It is defined in the file
+@@ -604,6 +607,9 @@ and is between 256 and 4096 characters. It is defined in the file
+
+ debug_objects [KNL] Enable object debugging
+
++ no_debug_objects
++ [KNL] Disable object debugging
++
+ debugpat [X86] Enable PAT debugging
+
+ decnet.addr= [HW,NET]
+@@ -1047,6 +1053,15 @@ and is between 256 and 4096 characters. It is defined in the file
use the HighMem zone if it exists, and the Normal
zone if it does not.
@@ -1642,6 +1652,21 @@
movablecore=nn[KMG] [KNL,X86-32,IA-64,PPC,X86-64] This parameter
is similar to kernelcore except it specifies the
amount of memory used for migratable allocations.
+@@ -1310,8 +1325,13 @@ and is between 256 and 4096 characters. It is defined in the file
+
+ memtest= [KNL,X86] Enable memtest
+ Format: <integer>
+- range: 0,4 : pattern number
+ default : 0 <disable>
++ Specifies the number of memtest passes to be
++ performed. Each pass selects another test
++ pattern from a given set of patterns. Memtest
++ fills the memory with this pattern, validates
++ memory contents and reserves bad memory
++ regions that are detected.
+
+ meye.*= [HW] Set MotionEye Camera parameters
+ See Documentation/video4linux/meye.txt.
diff --git a/Documentation/kmemcheck.txt b/Documentation/kmemcheck.txt
new file mode 100644
index 0000000..a848d49
@@ -2002,6 +2027,151 @@
+Groups are scheduled at once and can be used with PERF_RECORD_GROUP
+to record multi-dimensional timestamps.
+
+diff --git a/Documentation/scheduler/00-INDEX b/Documentation/scheduler/00-INDEX
+index aabcc3a..3c00c9c 100644
+--- a/Documentation/scheduler/00-INDEX
++++ b/Documentation/scheduler/00-INDEX
+@@ -2,8 +2,6 @@
+ - this file.
+ sched-arch.txt
+ - CPU Scheduler implementation hints for architecture specific code.
+-sched-coding.txt
+- - reference for various scheduler-related methods in the O(1) scheduler.
+ sched-design-CFS.txt
+ - goals, design and implementation of the Complete Fair Scheduler.
+ sched-domains.txt
+diff --git a/Documentation/scheduler/sched-coding.txt b/Documentation/scheduler/sched-coding.txt
+deleted file mode 100644
+index cbd8db7..0000000
+--- a/Documentation/scheduler/sched-coding.txt
++++ /dev/null
+@@ -1,126 +0,0 @@
+- Reference for various scheduler-related methods in the O(1) scheduler
+- Robert Love <rml at tech9.net>, MontaVista Software
+-
+-
+-Note most of these methods are local to kernel/sched.c - this is by design.
+-The scheduler is meant to be self-contained and abstracted away. This document
+-is primarily for understanding the scheduler, not interfacing to it. Some of
+-the discussed interfaces, however, are general process/scheduling methods.
+-They are typically defined in include/linux/sched.h.
+-
+-
+-Main Scheduling Methods
+------------------------
+-
+-void load_balance(runqueue_t *this_rq, int idle)
+- Attempts to pull tasks from one cpu to another to balance cpu usage,
+- if needed. This method is called explicitly if the runqueues are
+- imbalanced or periodically by the timer tick. Prior to calling,
+- the current runqueue must be locked and interrupts disabled.
+-
+-void schedule()
+- The main scheduling function. Upon return, the highest priority
+- process will be active.
+-
+-
+-Locking
+--------
+-
+-Each runqueue has its own lock, rq->lock. When multiple runqueues need
+-to be locked, lock acquires must be ordered by ascending &runqueue value.
+-
+-A specific runqueue is locked via
+-
+- task_rq_lock(task_t pid, unsigned long *flags)
+-
+-which disables preemption, disables interrupts, and locks the runqueue pid is
+-running on. Likewise,
+-
+- task_rq_unlock(task_t pid, unsigned long *flags)
+-
+-unlocks the runqueue pid is running on, restores interrupts to their previous
+-state, and reenables preemption.
+-
+-The routines
+-
+- double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
+-
+-and
+-
+- double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
+-
+-safely lock and unlock, respectively, the two specified runqueues. They do
+-not, however, disable and restore interrupts. Users are required to do so
+-manually before and after calls.
+-
+-
+-Values
+-------
+-
+-MAX_PRIO
+- The maximum priority of the system, stored in the task as task->prio.
+- Lower priorities are higher. Normal (non-RT) priorities range from
+- MAX_RT_PRIO to (MAX_PRIO - 1).
+-MAX_RT_PRIO
+- The maximum real-time priority of the system. Valid RT priorities
+- range from 0 to (MAX_RT_PRIO - 1).
+-MAX_USER_RT_PRIO
+- The maximum real-time priority that is exported to user-space. Should
+- always be equal to or less than MAX_RT_PRIO. Setting it less allows
+- kernel threads to have higher priorities than any user-space task.
+-MIN_TIMESLICE
+-MAX_TIMESLICE
+- Respectively, the minimum and maximum timeslices (quanta) of a process.
+-
+-Data
+-----
+-
+-struct runqueue
+- The main per-CPU runqueue data structure.
+-struct task_struct
+- The main per-process data structure.
+-
+-
+-General Methods
+----------------
+-
+-cpu_rq(cpu)
+- Returns the runqueue of the specified cpu.
+-this_rq()
+- Returns the runqueue of the current cpu.
+-task_rq(pid)
+- Returns the runqueue which holds the specified pid.
+-cpu_curr(cpu)
+- Returns the task currently running on the given cpu.
+-rt_task(pid)
+- Returns true if pid is real-time, false if not.
+-
+-
+-Process Control Methods
+------------------------
+-
+-void set_user_nice(task_t *p, long nice)
+- Sets the "nice" value of task p to the given value.
+-int setscheduler(pid_t pid, int policy, struct sched_param *param)
+- Sets the scheduling policy and parameters for the given pid.
+-int set_cpus_allowed(task_t *p, unsigned long new_mask)
+- Sets a given task's CPU affinity and migrates it to a proper cpu.
+- Callers must have a valid reference to the task and assure the
+- task not exit prematurely. No locks can be held during the call.
+-set_task_state(tsk, state_value)
+- Sets the given task's state to the given value.
+-set_current_state(state_value)
+- Sets the current task's state to the given value.
+-void set_tsk_need_resched(struct task_struct *tsk)
+- Sets need_resched in the given task.
+-void clear_tsk_need_resched(struct task_struct *tsk)
+- Clears need_resched in the given task.
+-void set_need_resched()
+- Sets need_resched in the current task.
[...29195 lines suppressed...]
++ Bzip2 uses a large amount of memory. For modern kernels you
++ will need at least 8MB RAM or more for booting.
++
++config INITRAMFS_COMPRESSION_LZMA
++ bool "LZMA"
++ depends on RD_LZMA
++ help
++ The most recent compression algorithm.
++ Its ratio is best, decompression speed is between the other
++ two. Compression is slowest. The initramfs size is about 33%
++ smaller with LZMA in comparison to gzip.
++
++endchoice
+diff --git a/usr/Makefile b/usr/Makefile
+index 201f27f..b84894b 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -6,13 +6,25 @@ klibcdirs:;
+ PHONY += klibcdirs
+
+
++# No compression
++suffix_$(CONFIG_INITRAMFS_COMPRESSION_NONE) =
++
++# Gzip, but no bzip2
++suffix_$(CONFIG_INITRAMFS_COMPRESSION_GZIP) = .gz
++
++# Bzip2
++suffix_$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) = .bz2
++
++# Lzma
++suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma
++
+ # Generate builtin.o based on initramfs_data.o
+-obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
++obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data$(suffix_y).o
+
+-# initramfs_data.o contains the initramfs_data.cpio.gz image.
++# initramfs_data.o contains the compressed initramfs_data.cpio image.
+ # The image is included using .incbin, a dependency which is not
+ # tracked automatically.
+-$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
++$(obj)/initramfs_data$(suffix_y).o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE
+
+ #####
+ # Generate the initramfs cpio archive
+@@ -25,28 +37,28 @@ ramfs-args := \
+ $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
+ $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
+
+-# .initramfs_data.cpio.gz.d is used to identify all files included
++# .initramfs_data.cpio.d is used to identify all files included
+ # in initramfs and to detect if any files are added/removed.
+ # Removed files are identified by directory timestamp being updated
+ # The dependency list is generated by gen_initramfs.sh -l
+-ifneq ($(wildcard $(obj)/.initramfs_data.cpio.gz.d),)
+- include $(obj)/.initramfs_data.cpio.gz.d
++ifneq ($(wildcard $(obj)/.initramfs_data.cpio.d),)
++ include $(obj)/.initramfs_data.cpio.d
+ endif
+
+ quiet_cmd_initfs = GEN $@
+ cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
+
+-targets := initramfs_data.cpio.gz
++targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio
+ # do not try to update files included in initramfs
+ $(deps_initramfs): ;
+
+ $(deps_initramfs): klibcdirs
+-# We rebuild initramfs_data.cpio.gz if:
+-# 1) Any included file is newer then initramfs_data.cpio.gz
++# We rebuild initramfs_data.cpio if:
++# 1) Any included file is newer then initramfs_data.cpio
+ # 2) There are changes in which files are included (added or deleted)
+-# 3) If gen_init_cpio are newer than initramfs_data.cpio.gz
++# 3) If gen_init_cpio are newer than initramfs_data.cpio
+ # 4) arguments to gen_initramfs.sh changes
+-$(obj)/initramfs_data.cpio.gz: $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
+- $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.gz.d
++$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
++ $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d
+ $(call if_changed,initfs)
+
+diff --git a/usr/initramfs_data.S b/usr/initramfs_data.S
+index c2e1ad4..7c6973d 100644
+--- a/usr/initramfs_data.S
++++ b/usr/initramfs_data.S
+@@ -26,5 +26,5 @@ SECTIONS
+ */
+
+ .section .init.ramfs,"a"
+-.incbin "usr/initramfs_data.cpio.gz"
++.incbin "usr/initramfs_data.cpio"
+
+diff --git a/usr/initramfs_data.bz2.S b/usr/initramfs_data.bz2.S
+new file mode 100644
+index 0000000..bc54d09
+--- /dev/null
++++ b/usr/initramfs_data.bz2.S
+@@ -0,0 +1,29 @@
++/*
++ initramfs_data includes the compressed binary that is the
++ filesystem used for early user space.
++ Note: Older versions of "as" (prior to binutils 2.11.90.0.23
++ released on 2001-07-14) dit not support .incbin.
++ If you are forced to use older binutils than that then the
++ following trick can be applied to create the resulting binary:
++
++
++ ld -m elf_i386 --format binary --oformat elf32-i386 -r \
++ -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
++ ld -m elf_i386 -r -o built-in.o initramfs_data.o
++
++ initramfs_data.scr looks like this:
++SECTIONS
++{
++ .init.ramfs : { *(.data) }
++}
++
++ The above example is for i386 - the parameters vary from architectures.
++ Eventually look up LDFLAGS_BLOB in an older version of the
++ arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
++
++ Using .incbin has the advantage over ld that the correct flags are set
++ in the ELF header, as required by certain architectures.
++*/
++
++.section .init.ramfs,"a"
++.incbin "usr/initramfs_data.cpio.bz2"
+diff --git a/usr/initramfs_data.gz.S b/usr/initramfs_data.gz.S
+new file mode 100644
+index 0000000..890c8dd
+--- /dev/null
++++ b/usr/initramfs_data.gz.S
+@@ -0,0 +1,29 @@
++/*
++ initramfs_data includes the compressed binary that is the
++ filesystem used for early user space.
++ Note: Older versions of "as" (prior to binutils 2.11.90.0.23
++ released on 2001-07-14) dit not support .incbin.
++ If you are forced to use older binutils than that then the
++ following trick can be applied to create the resulting binary:
++
++
++ ld -m elf_i386 --format binary --oformat elf32-i386 -r \
++ -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
++ ld -m elf_i386 -r -o built-in.o initramfs_data.o
++
++ initramfs_data.scr looks like this:
++SECTIONS
++{
++ .init.ramfs : { *(.data) }
++}
++
++ The above example is for i386 - the parameters vary from architectures.
++ Eventually look up LDFLAGS_BLOB in an older version of the
++ arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
++
++ Using .incbin has the advantage over ld that the correct flags are set
++ in the ELF header, as required by certain architectures.
++*/
++
++.section .init.ramfs,"a"
++.incbin "usr/initramfs_data.cpio.gz"
+diff --git a/usr/initramfs_data.lzma.S b/usr/initramfs_data.lzma.S
+new file mode 100644
+index 0000000..e11469e
+--- /dev/null
++++ b/usr/initramfs_data.lzma.S
+@@ -0,0 +1,29 @@
++/*
++ initramfs_data includes the compressed binary that is the
++ filesystem used for early user space.
++ Note: Older versions of "as" (prior to binutils 2.11.90.0.23
++ released on 2001-07-14) dit not support .incbin.
++ If you are forced to use older binutils than that then the
++ following trick can be applied to create the resulting binary:
++
++
++ ld -m elf_i386 --format binary --oformat elf32-i386 -r \
++ -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
++ ld -m elf_i386 -r -o built-in.o initramfs_data.o
++
++ initramfs_data.scr looks like this:
++SECTIONS
++{
++ .init.ramfs : { *(.data) }
++}
++
++ The above example is for i386 - the parameters vary from architectures.
++ Eventually look up LDFLAGS_BLOB in an older version of the
++ arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
++
++ Using .incbin has the advantage over ld that the correct flags are set
++ in the ELF header, as required by certain architectures.
++*/
++
++.section .init.ramfs,"a"
++.incbin "usr/initramfs_data.cpio.lzma"
xen.pvops.post.patch:
Index: xen.pvops.post.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.post.patch,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- xen.pvops.post.patch 25 Feb 2009 21:26:02 -0000 1.1.2.3
+++ xen.pvops.post.patch 5 Mar 2009 01:30:27 -0000 1.1.2.4
@@ -35,6 +35,815 @@
static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
#endif
+--- a/drivers/gpu/drm/drm_proc.c 2009-03-04 21:07:25.000000000 +0000
++++ b/drivers/gpu/drm/drm_proc.c 2009-03-04 21:20:20.000000000 +0000
+@@ -37,697 +37,195 @@
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
++#include <linux/seq_file.h>
+ #include "drmP.h"
+
+-static int drm_name_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_vm_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_clients_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_queues_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_bufs_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_vblank_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_gem_name_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-static int drm_gem_object_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-#if DRM_DEBUG_CODE
+-static int drm_vma_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data);
+-#endif
++/***************************************************
++ * Initialization, etc.
++ **************************************************/
+
+ /**
+ * Proc file list.
+ */
+-static struct drm_proc_list {
+- const char *name; /**< file name */
+- int (*f) (char *, char **, off_t, int, int *, void *); /**< proc callback*/
+- u32 driver_features; /**< Required driver features for this entry */
+-} drm_proc_list[] = {
++static struct drm_info_list drm_proc_list[] = {
+ {"name", drm_name_info, 0},
+- {"mem", drm_mem_info, 0},
+ {"vm", drm_vm_info, 0},
+ {"clients", drm_clients_info, 0},
+ {"queues", drm_queues_info, 0},
+ {"bufs", drm_bufs_info, 0},
+- {"vblank", drm_vblank_info, 0},
+ {"gem_names", drm_gem_name_info, DRIVER_GEM},
+ {"gem_objects", drm_gem_object_info, DRIVER_GEM},
+ #if DRM_DEBUG_CODE
+- {"vma", drm_vma_info},
++ {"vma", drm_vma_info, 0},
+ #endif
+ };
+-
+ #define DRM_PROC_ENTRIES ARRAY_SIZE(drm_proc_list)
+
++static int drm_proc_open(struct inode *inode, struct file *file)
++{
++ struct drm_info_node* node = PDE(inode)->data;
++
++ return single_open(file, node->info_ent->show, node);
++}
++
++static const struct file_operations drm_proc_fops = {
++ .owner = THIS_MODULE,
++ .open = drm_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++
++
+ /**
+- * Initialize the DRI proc filesystem for a device.
++ * Initialize a given set of proc files for a device
+ *
+- * \param dev DRM device.
+- * \param minor device minor number.
++ * \param files The array of files to create
++ * \param count The number of files given
+ * \param root DRI proc dir entry.
+- * \param dev_root resulting DRI device proc dir entry.
+- * \return root entry pointer on success, or NULL on failure.
++ * \param minor device minor number
++ * \return Zero on success, non-zero on failure
+ *
+- * Create the DRI proc root entry "/proc/dri", the device proc root entry
+- * "/proc/dri/%minor%/", and each entry in proc_list as
+- * "/proc/dri/%minor%/%name%".
++ * Create a given set of proc files represented by an array of
++ * gdm_proc_lists in the given root directory.
+ */
+-int drm_proc_init(struct drm_minor *minor, int minor_id,
+- struct proc_dir_entry *root)
++int drm_proc_create_files(struct drm_info_list *files, int count,
++ struct proc_dir_entry *root, struct drm_minor *minor)
+ {
+ struct drm_device *dev = minor->dev;
+ struct proc_dir_entry *ent;
+- int i, j, ret;
++ struct drm_info_node *tmp;
+ char name[64];
++ int i, ret;
+
+- sprintf(name, "%d", minor_id);
+- minor->dev_root = proc_mkdir(name, root);
+- if (!minor->dev_root) {
+- DRM_ERROR("Cannot create /proc/dri/%s\n", name);
+- return -1;
+- }
+-
+- for (i = 0; i < DRM_PROC_ENTRIES; i++) {
+- u32 features = drm_proc_list[i].driver_features;
++ for (i = 0; i < count; i++) {
++ u32 features = files[i].driver_features;
+
+ if (features != 0 &&
+ (dev->driver->driver_features & features) != features)
+ continue;
+
+- ent = create_proc_entry(drm_proc_list[i].name,
+- S_IFREG | S_IRUGO, minor->dev_root);
++ tmp = drm_alloc(sizeof(struct drm_info_node), _DRM_DRIVER);
++ ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root);
+ if (!ent) {
+ DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
+- name, drm_proc_list[i].name);
++ name, files[i].name);
++ drm_free(tmp, sizeof(struct drm_info_node),
++ _DRM_DRIVER);
+ ret = -1;
+ goto fail;
+ }
+- ent->read_proc = drm_proc_list[i].f;
+- ent->data = minor;
+- }
+
+- if (dev->driver->proc_init) {
+- ret = dev->driver->proc_init(minor);
+- if (ret) {
+- DRM_ERROR("DRM: Driver failed to initialize "
+- "/proc/dri.\n");
+- goto fail;
+- }
++ ent->proc_fops = &drm_proc_fops;
++ ent->data = tmp;
++ tmp->minor = minor;
++ tmp->info_ent = &files[i];
++ list_add(&(tmp->list), &(minor->proc_nodes.list));
+ }
+-
+ return 0;
+- fail:
+
+- for (j = 0; j < i; j++)
+- remove_proc_entry(drm_proc_list[i].name,
+- minor->dev_root);
+- remove_proc_entry(name, root);
+- minor->dev_root = NULL;
++fail:
++ for (i = 0; i < count; i++)
++ remove_proc_entry(drm_proc_list[i].name, minor->proc_root);
+ return ret;
+ }
+
+ /**
+- * Cleanup the proc filesystem resources.
++ * Initialize the DRI proc filesystem for a device
+ *
+- * \param minor device minor number.
++ * \param dev DRM device
++ * \param minor device minor number
+ * \param root DRI proc dir entry.
+- * \param dev_root DRI device proc dir entry.
+- * \return always zero.
++ * \param dev_root resulting DRI device proc dir entry.
++ * \return root entry pointer on success, or NULL on failure.
+ *
+- * Remove all proc entries created by proc_init().
++ * Create the DRI proc root entry "/proc/dri", the device proc root entry
++ * "/proc/dri/%minor%/", and each entry in proc_list as
++ * "/proc/dri/%minor%/%name%".
+ */
+-int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root)
++int drm_proc_init(struct drm_minor *minor, int minor_id,
++ struct proc_dir_entry *root)
+ {
+ struct drm_device *dev = minor->dev;
+- int i;
+ char name[64];
++ int ret;
+
+- if (!root || !minor->dev_root)
+- return 0;
+-
+- if (dev->driver->proc_cleanup)
+- dev->driver->proc_cleanup(minor);
+-
+- for (i = 0; i < DRM_PROC_ENTRIES; i++)
+- remove_proc_entry(drm_proc_list[i].name, minor->dev_root);
+- sprintf(name, "%d", minor->index);
+- remove_proc_entry(name, root);
+-
+- return 0;
+-}
+-
+-/**
+- * Called when "/proc/dri/.../name" is read.
+- *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
+- *
+- * Prints the device name together with the bus id if available.
+- */
+-static int drm_name_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_master *master = minor->master;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- if (!master)
+- return 0;
+-
+- *start = &buf[offset];
+- *eof = 0;
+-
+- if (master->unique) {
+- DRM_PROC_PRINT("%s %s %s\n",
+- dev->driver->pci_driver.name,
+- pci_name(dev->pdev), master->unique);
+- } else {
+- DRM_PROC_PRINT("%s %s\n", dev->driver->pci_driver.name,
+- pci_name(dev->pdev));
++ INIT_LIST_HEAD(&minor->proc_nodes.list);
++ sprintf(name, "%d", minor_id);
++ minor->proc_root = proc_mkdir(name, root);
++ if (!minor->proc_root) {
++ DRM_ERROR("Cannot create /proc/dri/%s\n", name);
++ return -1;
+ }
+
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Called when "/proc/dri/.../vm" is read.
+- *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
+- *
+- * Prints information about all mappings in drm_device::maplist.
+- */
+-static int drm__vm_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+- struct drm_map *map;
+- struct drm_map_list *r_list;
+-
+- /* Hardcoded from _DRM_FRAME_BUFFER,
+- _DRM_REGISTERS, _DRM_SHM, _DRM_AGP, and
+- _DRM_SCATTER_GATHER and _DRM_CONSISTENT */
+- const char *types[] = { "FB", "REG", "SHM", "AGP", "SG", "PCI" };
+- const char *type;
+- int i;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
++ ret = drm_proc_create_files(drm_proc_list, DRM_PROC_ENTRIES,
++ minor->proc_root, minor);
++ if (ret) {
++ remove_proc_entry(name, root);
++ minor->proc_root = NULL;
++ DRM_ERROR("Failed to create core drm proc files\n");
++ return ret;
+ }
+
+- *start = &buf[offset];
+- *eof = 0;
+-
+- DRM_PROC_PRINT("slot offset size type flags "
+- "address mtrr\n\n");
+- i = 0;
+- list_for_each_entry(r_list, &dev->maplist, head) {
+- map = r_list->map;
+- if (!map)
+- continue;
+- if (map->type < 0 || map->type > 5)
+- type = "??";
+- else
+- type = types[map->type];
+- DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx ",
+- i,
+- map->offset,
+- map->size, type, map->flags,
+- (unsigned long) r_list->user_token);
+- if (map->mtrr < 0) {
+- DRM_PROC_PRINT("none\n");
+- } else {
+- DRM_PROC_PRINT("%4d\n", map->mtrr);
++ if (dev->driver->proc_init) {
++ ret = dev->driver->proc_init(minor);
++ if (ret) {
++ DRM_ERROR("DRM: Driver failed to initialize "
++ "/proc/dri.\n");
++ return ret;
+ }
+- i++;
+- }
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Simply calls _vm_info() while holding the drm_device::struct_mutex lock.
+- */
+-static int drm_vm_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__vm_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
+-}
+-
+-/**
+- * Called when "/proc/dri/.../queues" is read.
+- *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
+- */
+-static int drm__queues_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+- int i;
+- struct drm_queue *q;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+ }
+-
+- *start = &buf[offset];
+- *eof = 0;
+-
+- DRM_PROC_PRINT(" ctx/flags use fin"
+- " blk/rw/rwf wait flushed queued"
+- " locks\n\n");
+- for (i = 0; i < dev->queue_count; i++) {
+- q = dev->queuelist[i];
+- atomic_inc(&q->use_count);
+- DRM_PROC_PRINT_RET(atomic_dec(&q->use_count),
+- "%5d/0x%03x %5d %5d"
+- " %5d/%c%c/%c%c%c %5Zd\n",
+- i,
+- q->flags,
+- atomic_read(&q->use_count),
+- atomic_read(&q->finalization),
+- atomic_read(&q->block_count),
+- atomic_read(&q->block_read) ? 'r' : '-',
+- atomic_read(&q->block_write) ? 'w' : '-',
+- waitqueue_active(&q->read_queue) ? 'r' : '-',
+- waitqueue_active(&q->
+- write_queue) ? 'w' : '-',
+- waitqueue_active(&q->
+- flush_queue) ? 'f' : '-',
+- DRM_BUFCOUNT(&q->waitlist));
+- atomic_dec(&q->use_count);
+- }
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Simply calls _queues_info() while holding the drm_device::struct_mutex lock.
+- */
+-static int drm_queues_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__queues_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
++ return 0;
+ }
+
+-/**
+- * Called when "/proc/dri/.../bufs" is read.
+- *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
+- */
+-static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
++int drm_proc_remove_files(struct drm_info_list *files, int count,
++ struct drm_minor *minor)
+ {
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+- struct drm_device_dma *dma = dev->dma;
++ struct list_head *pos, *q;
++ struct drm_info_node *tmp;
+ int i;
+
+- if (!dma || offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- *start = &buf[offset];
+- *eof = 0;
+-
+- DRM_PROC_PRINT(" o size count free segs pages kB\n\n");
+- for (i = 0; i <= DRM_MAX_ORDER; i++) {
+- if (dma->bufs[i].buf_count)
+- DRM_PROC_PRINT("%2d %8d %5d %5d %5d %5d %5ld\n",
+- i,
+- dma->bufs[i].buf_size,
+- dma->bufs[i].buf_count,
+- atomic_read(&dma->bufs[i]
+- .freelist.count),
+- dma->bufs[i].seg_count,
+- dma->bufs[i].seg_count
+- * (1 << dma->bufs[i].page_order),
+- (dma->bufs[i].seg_count
+- * (1 << dma->bufs[i].page_order))
+- * PAGE_SIZE / 1024);
+- }
+- DRM_PROC_PRINT("\n");
+- for (i = 0; i < dma->buf_count; i++) {
+- if (i && !(i % 32))
+- DRM_PROC_PRINT("\n");
+- DRM_PROC_PRINT(" %d", dma->buflist[i]->list);
++ for (i = 0; i < count; i++) {
++ list_for_each_safe(pos, q, &minor->proc_nodes.list) {
++ tmp = list_entry(pos, struct drm_info_node, list);
++ if (tmp->info_ent == &files[i]) {
++ remove_proc_entry(files[i].name,
++ minor->proc_root);
++ list_del(pos);
++ drm_free(tmp, sizeof(struct drm_info_node),
++ _DRM_DRIVER);
++ }
++ }
+ }
+- DRM_PROC_PRINT("\n");
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Simply calls _bufs_info() while holding the drm_device::struct_mutex lock.
+- */
+-static int drm_bufs_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__bufs_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
++ return 0;
+ }
+
+ /**
+- * Called when "/proc/dri/.../vblank" is read.
++ * Cleanup the proc filesystem resources.
+ *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
+- */
+-static int drm__vblank_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+- int crtc;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- *start = &buf[offset];
+- *eof = 0;
+-
+- for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
+- DRM_PROC_PRINT("CRTC %d enable: %d\n",
+- crtc, atomic_read(&dev->vblank_refcount[crtc]));
+- DRM_PROC_PRINT("CRTC %d counter: %d\n",
+- crtc, drm_vblank_count(dev, crtc));
+- DRM_PROC_PRINT("CRTC %d last wait: %d\n",
+- crtc, dev->last_vblank_wait[crtc]);
+- DRM_PROC_PRINT("CRTC %d in modeset: %d\n",
+- crtc, dev->vblank_inmodeset[crtc]);
+- }
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Simply calls _vblank_info() while holding the drm_device::struct_mutex lock.
+- */
+-static int drm_vblank_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__vblank_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
+-}
+-
+-/**
+- * Called when "/proc/dri/.../clients" is read.
++ * \param minor device minor number.
++ * \param root DRI proc dir entry.
++ * \param dev_root DRI device proc dir entry.
++ * \return always zero.
+ *
+- * \param buf output buffer.
+- * \param start start of output data.
+- * \param offset requested start offset.
+- * \param request requested number of bytes.
+- * \param eof whether there is no more data to return.
+- * \param data private data.
+- * \return number of written bytes.
++ * Remove all proc entries created by proc_init().
+ */
+-static int drm__clients_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data)
++int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root)
+ {
+- struct drm_minor *minor = (struct drm_minor *) data;
+ struct drm_device *dev = minor->dev;
+- int len = 0;
+- struct drm_file *priv;
++ char name[64];
+
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
++ if (!root || !minor->proc_root)
+ return 0;
+- }
+-
+- *start = &buf[offset];
+- *eof = 0;
+
+- DRM_PROC_PRINT("a dev pid uid magic ioctls\n\n");
+- list_for_each_entry(priv, &dev->filelist, lhead) {
+- DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n",
+- priv->authenticated ? 'y' : 'n',
+- priv->minor->index,
+- priv->pid,
+- priv->uid, priv->magic, priv->ioctl_count);
+- }
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-/**
+- * Simply calls _clients_info() while holding the drm_device::struct_mutex lock.
+- */
+-static int drm_clients_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__clients_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
+-}
+-
+-struct drm_gem_name_info_data {
+- int len;
+- char *buf;
+- int eof;
+-};
++ if (dev->driver->proc_cleanup)
++ dev->driver->proc_cleanup(minor);
+
+-static int drm_gem_one_name_info(int id, void *ptr, void *data)
+-{
+- struct drm_gem_object *obj = ptr;
+- struct drm_gem_name_info_data *nid = data;
++ drm_proc_remove_files(drm_proc_list, DRM_PROC_ENTRIES, minor);
+
+- DRM_INFO("name %d size %zd\n", obj->name, obj->size);
+- if (nid->eof)
+- return 0;
++ sprintf(name, "%d", minor->index);
++ remove_proc_entry(name, root);
+
+- nid->len += sprintf(&nid->buf[nid->len],
+- "%6d %8zd %7d %8d\n",
+- obj->name, obj->size,
+- atomic_read(&obj->handlecount.refcount),
+- atomic_read(&obj->refcount.refcount));
+- if (nid->len > DRM_PROC_LIMIT) {
+- nid->eof = 1;
+- return 0;
+- }
+ return 0;
+ }
+
+-static int drm_gem_name_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- struct drm_gem_name_info_data nid;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- nid.len = sprintf(buf, " name size handles refcount\n");
+- nid.buf = buf;
+- nid.eof = 0;
+- idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, &nid);
+-
+- *start = &buf[offset];
+- *eof = 0;
+- if (nid.len > request + offset)
+- return request;
+- *eof = 1;
+- return nid.len - offset;
+-}
+-
+-static int drm_gem_object_info(char *buf, char **start, off_t offset,
+- int request, int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- *start = &buf[offset];
+- *eof = 0;
+- DRM_PROC_PRINT("%d objects\n", atomic_read(&dev->object_count));
+- DRM_PROC_PRINT("%d object bytes\n", atomic_read(&dev->object_memory));
+- DRM_PROC_PRINT("%d pinned\n", atomic_read(&dev->pin_count));
+- DRM_PROC_PRINT("%d pin bytes\n", atomic_read(&dev->pin_memory));
+- DRM_PROC_PRINT("%d gtt bytes\n", atomic_read(&dev->gtt_memory));
+- DRM_PROC_PRINT("%d gtt total\n", dev->gtt_total);
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-#if DRM_DEBUG_CODE
+-
+-static int drm__vma_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int len = 0;
+- struct drm_vma_entry *pt;
+- struct vm_area_struct *vma;
+-#if defined(__i386__)
+- unsigned int pgprot;
+-#endif
+-
+- if (offset > DRM_PROC_LIMIT) {
+- *eof = 1;
+- return 0;
+- }
+-
+- *start = &buf[offset];
+- *eof = 0;
+-
+- DRM_PROC_PRINT("vma use count: %d, high_memory = %p, 0x%llx\n",
+- atomic_read(&dev->vma_count),
+- high_memory, (u64)virt_to_phys(high_memory));
+- list_for_each_entry(pt, &dev->vmalist, head) {
+- if (!(vma = pt->vma))
+- continue;
+- DRM_PROC_PRINT("\n%5d 0x%08lx-0x%08lx %c%c%c%c%c%c 0x%08lx000",
+- pt->pid,
+- vma->vm_start,
+- vma->vm_end,
+- vma->vm_flags & VM_READ ? 'r' : '-',
+- vma->vm_flags & VM_WRITE ? 'w' : '-',
+- vma->vm_flags & VM_EXEC ? 'x' : '-',
+- vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
+- vma->vm_flags & VM_LOCKED ? 'l' : '-',
+- vma->vm_flags & VM_IO ? 'i' : '-',
+- vma->vm_pgoff);
+-
+-#if defined(__i386__)
+- pgprot = pgprot_val(vma->vm_page_prot);
+- DRM_PROC_PRINT(" %c%c%c%c%c%c%c%c%c",
+- pgprot & _PAGE_PRESENT ? 'p' : '-',
+- pgprot & _PAGE_RW ? 'w' : 'r',
+- pgprot & _PAGE_USER ? 'u' : 's',
+- pgprot & _PAGE_PWT ? 't' : 'b',
+- pgprot & _PAGE_PCD ? 'u' : 'c',
+- pgprot & _PAGE_ACCESSED ? 'a' : '-',
+- pgprot & _PAGE_DIRTY ? 'd' : '-',
+- pgprot & _PAGE_PSE ? 'm' : 'k',
+- pgprot & _PAGE_GLOBAL ? 'g' : 'l');
+-#endif
+- DRM_PROC_PRINT("\n");
+- }
+-
+- if (len > request + offset)
+- return request;
+- *eof = 1;
+- return len - offset;
+-}
+-
+-static int drm_vma_info(char *buf, char **start, off_t offset, int request,
+- int *eof, void *data)
+-{
+- struct drm_minor *minor = (struct drm_minor *) data;
+- struct drm_device *dev = minor->dev;
+- int ret;
+-
+- mutex_lock(&dev->struct_mutex);
+- ret = drm__vma_info(buf, start, offset, request, eof, data);
+- mutex_unlock(&dev->struct_mutex);
+- return ret;
+-}
+-#endif
--- a/localversion-tip 2009-02-17 19:49:34.000000000 +0000
+++ /dev/null 2009-02-17 18:08:14.005240123 +0000
@@ -1 +0,0 @@
xen.pvops.pre.patch:
Index: xen.pvops.pre.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.pre.patch,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- xen.pvops.pre.patch 25 Feb 2009 21:26:02 -0000 1.1.2.3
+++ xen.pvops.pre.patch 5 Mar 2009 01:30:27 -0000 1.1.2.4
@@ -2,6 +2,8 @@
Affected patches;
drm-modesetting-radeon.patch - arch/x86/mm/pat.c
linux-2.6-debug-nmi-timeout.patch - arch/x86/kernel/nmi.c (moved to arch/x86/kernel/apic/nmi.c)
+linux-2.6-defaults-pci_no_msi.patch - drivers/pci/pci.h
+drm-next.patch - drivers/gpu/drm/drm_proc.c
--- a/arch/x86/mm/pat.c 2009-02-14 12:49:46.000000000 +0000
+++ b/arch/x86/mm/pat.c 2009-02-14 09:16:34.000000000 +0000
@@ -38,3 +40,812 @@
static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
#endif
+--- a/drivers/gpu/drm/drm_proc.c 2009-03-04 18:43:07.000000000 +0000
++++ b/drivers/gpu/drm/drm_proc.c 2009-03-04 18:35:48.000000000 +0000
+@@ -37,195 +37,697 @@
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+-#include <linux/seq_file.h>
+ #include "drmP.h"
+
+-/***************************************************
+- * Initialization, etc.
+- **************************************************/
++static int drm_name_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_vm_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_clients_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_queues_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_bufs_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_vblank_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_gem_name_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++static int drm_gem_object_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++#if DRM_DEBUG_CODE
++static int drm_vma_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data);
++#endif
+
+ /**
+ * Proc file list.
+ */
+-static struct drm_info_list drm_proc_list[] = {
++static struct drm_proc_list {
++ const char *name; /**< file name */
++ int (*f) (char *, char **, off_t, int, int *, void *); /**< proc callback*/
++ u32 driver_features; /**< Required driver features for this entry */
++} drm_proc_list[] = {
+ {"name", drm_name_info, 0},
++ {"mem", drm_mem_info, 0},
+ {"vm", drm_vm_info, 0},
+ {"clients", drm_clients_info, 0},
+ {"queues", drm_queues_info, 0},
+ {"bufs", drm_bufs_info, 0},
++ {"vblank", drm_vblank_info, 0},
+ {"gem_names", drm_gem_name_info, DRIVER_GEM},
+ {"gem_objects", drm_gem_object_info, DRIVER_GEM},
+ #if DRM_DEBUG_CODE
+- {"vma", drm_vma_info, 0},
++ {"vma", drm_vma_info},
+ #endif
+ };
+-#define DRM_PROC_ENTRIES ARRAY_SIZE(drm_proc_list)
+-
+-static int drm_proc_open(struct inode *inode, struct file *file)
+-{
+- struct drm_info_node* node = PDE(inode)->data;
+-
+- return single_open(file, node->info_ent->show, node);
+-}
+-
+-static const struct file_operations drm_proc_fops = {
+- .owner = THIS_MODULE,
+- .open = drm_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+-};
+
++#define DRM_PROC_ENTRIES ARRAY_SIZE(drm_proc_list)
+
+ /**
+- * Initialize a given set of proc files for a device
++ * Initialize the DRI proc filesystem for a device.
+ *
+- * \param files The array of files to create
+- * \param count The number of files given
++ * \param dev DRM device.
++ * \param minor device minor number.
+ * \param root DRI proc dir entry.
+- * \param minor device minor number
+- * \return Zero on success, non-zero on failure
++ * \param dev_root resulting DRI device proc dir entry.
++ * \return root entry pointer on success, or NULL on failure.
+ *
+- * Create a given set of proc files represented by an array of
+- * gdm_proc_lists in the given root directory.
++ * Create the DRI proc root entry "/proc/dri", the device proc root entry
++ * "/proc/dri/%minor%/", and each entry in proc_list as
++ * "/proc/dri/%minor%/%name%".
+ */
+-int drm_proc_create_files(struct drm_info_list *files, int count,
+- struct proc_dir_entry *root, struct drm_minor *minor)
++int drm_proc_init(struct drm_minor *minor, int minor_id,
++ struct proc_dir_entry *root)
+ {
+ struct drm_device *dev = minor->dev;
+ struct proc_dir_entry *ent;
+- struct drm_info_node *tmp;
++ int i, j, ret;
+ char name[64];
+- int i, ret;
+
+- for (i = 0; i < count; i++) {
+- u32 features = files[i].driver_features;
++ sprintf(name, "%d", minor_id);
++ minor->dev_root = proc_mkdir(name, root);
++ if (!minor->dev_root) {
++ DRM_ERROR("Cannot create /proc/dri/%s\n", name);
++ return -1;
++ }
++
++ for (i = 0; i < DRM_PROC_ENTRIES; i++) {
++ u32 features = drm_proc_list[i].driver_features;
+
+ if (features != 0 &&
+ (dev->driver->driver_features & features) != features)
+ continue;
+
+- tmp = drm_alloc(sizeof(struct drm_info_node), _DRM_DRIVER);
+- ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root);
++ ent = create_proc_entry(drm_proc_list[i].name,
++ S_IFREG | S_IRUGO, minor->dev_root);
+ if (!ent) {
+ DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
+- name, files[i].name);
+- drm_free(tmp, sizeof(struct drm_info_node),
+- _DRM_DRIVER);
++ name, drm_proc_list[i].name);
+ ret = -1;
+ goto fail;
+ }
++ ent->read_proc = drm_proc_list[i].f;
++ ent->data = minor;
++ }
+
+- ent->proc_fops = &drm_proc_fops;
+- ent->data = tmp;
+- tmp->minor = minor;
+- tmp->info_ent = &files[i];
+- list_add(&(tmp->list), &(minor->proc_nodes.list));
++ if (dev->driver->proc_init) {
++ ret = dev->driver->proc_init(minor);
++ if (ret) {
++ DRM_ERROR("DRM: Driver failed to initialize "
++ "/proc/dri.\n");
++ goto fail;
++ }
+ }
++
+ return 0;
++ fail:
+
+-fail:
+- for (i = 0; i < count; i++)
+- remove_proc_entry(drm_proc_list[i].name, minor->proc_root);
++ for (j = 0; j < i; j++)
++ remove_proc_entry(drm_proc_list[i].name,
++ minor->dev_root);
++ remove_proc_entry(name, root);
++ minor->dev_root = NULL;
+ return ret;
+ }
+
+ /**
+- * Initialize the DRI proc filesystem for a device
++ * Cleanup the proc filesystem resources.
+ *
+- * \param dev DRM device
+- * \param minor device minor number
++ * \param minor device minor number.
+ * \param root DRI proc dir entry.
+- * \param dev_root resulting DRI device proc dir entry.
+- * \return root entry pointer on success, or NULL on failure.
++ * \param dev_root DRI device proc dir entry.
++ * \return always zero.
+ *
+- * Create the DRI proc root entry "/proc/dri", the device proc root entry
+- * "/proc/dri/%minor%/", and each entry in proc_list as
+- * "/proc/dri/%minor%/%name%".
++ * Remove all proc entries created by proc_init().
+ */
+-int drm_proc_init(struct drm_minor *minor, int minor_id,
+- struct proc_dir_entry *root)
++int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root)
+ {
+ struct drm_device *dev = minor->dev;
++ int i;
+ char name[64];
+- int ret;
+
+- INIT_LIST_HEAD(&minor->proc_nodes.list);
+- sprintf(name, "%d", minor_id);
+- minor->proc_root = proc_mkdir(name, root);
+- if (!minor->proc_root) {
+- DRM_ERROR("Cannot create /proc/dri/%s\n", name);
+- return -1;
++ if (!root || !minor->dev_root)
++ return 0;
++
++ if (dev->driver->proc_cleanup)
++ dev->driver->proc_cleanup(minor);
++
++ for (i = 0; i < DRM_PROC_ENTRIES; i++)
++ remove_proc_entry(drm_proc_list[i].name, minor->dev_root);
++ sprintf(name, "%d", minor->index);
++ remove_proc_entry(name, root);
++
++ return 0;
++}
++
++/**
++ * Called when "/proc/dri/.../name" is read.
++ *
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
++ *
++ * Prints the device name together with the bus id if available.
++ */
++static int drm_name_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_master *master = minor->master;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
+ }
+
+- ret = drm_proc_create_files(drm_proc_list, DRM_PROC_ENTRIES,
+- minor->proc_root, minor);
+- if (ret) {
+- remove_proc_entry(name, root);
+- minor->proc_root = NULL;
+- DRM_ERROR("Failed to create core drm proc files\n");
+- return ret;
++ if (!master)
++ return 0;
++
++ *start = &buf[offset];
++ *eof = 0;
++
++ if (master->unique) {
++ DRM_PROC_PRINT("%s %s %s\n",
++ dev->driver->pci_driver.name,
++ pci_name(dev->pdev), master->unique);
++ } else {
++ DRM_PROC_PRINT("%s %s\n", dev->driver->pci_driver.name,
++ pci_name(dev->pdev));
+ }
+
+- if (dev->driver->proc_init) {
+- ret = dev->driver->proc_init(minor);
+- if (ret) {
+- DRM_ERROR("DRM: Driver failed to initialize "
+- "/proc/dri.\n");
+- return ret;
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++/**
++ * Called when "/proc/dri/.../vm" is read.
++ *
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
++ *
++ * Prints information about all mappings in drm_device::maplist.
++ */
++static int drm__vm_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++ struct drm_map *map;
++ struct drm_map_list *r_list;
++
++ /* Hardcoded from _DRM_FRAME_BUFFER,
++ _DRM_REGISTERS, _DRM_SHM, _DRM_AGP, and
++ _DRM_SCATTER_GATHER and _DRM_CONSISTENT */
++ const char *types[] = { "FB", "REG", "SHM", "AGP", "SG", "PCI" };
++ const char *type;
++ int i;
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ *start = &buf[offset];
++ *eof = 0;
++
++ DRM_PROC_PRINT("slot offset size type flags "
++ "address mtrr\n\n");
++ i = 0;
++ list_for_each_entry(r_list, &dev->maplist, head) {
++ map = r_list->map;
++ if (!map)
++ continue;
++ if (map->type < 0 || map->type > 5)
++ type = "??";
++ else
++ type = types[map->type];
++ DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx ",
++ i,
++ map->offset,
++ map->size, type, map->flags,
++ (unsigned long) r_list->user_token);
++ if (map->mtrr < 0) {
++ DRM_PROC_PRINT("none\n");
++ } else {
++ DRM_PROC_PRINT("%4d\n", map->mtrr);
+ }
++ i++;
+ }
+- return 0;
++
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
+ }
+
+-int drm_proc_remove_files(struct drm_info_list *files, int count,
+- struct drm_minor *minor)
++/**
++ * Simply calls _vm_info() while holding the drm_device::struct_mutex lock.
++ */
++static int drm_vm_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__vm_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++
++/**
++ * Called when "/proc/dri/.../queues" is read.
++ *
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
++ */
++static int drm__queues_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data)
+ {
+- struct list_head *pos, *q;
+- struct drm_info_node *tmp;
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
+ int i;
++ struct drm_queue *q;
+
+- for (i = 0; i < count; i++) {
+- list_for_each_safe(pos, q, &minor->proc_nodes.list) {
+- tmp = list_entry(pos, struct drm_info_node, list);
+- if (tmp->info_ent == &files[i]) {
+- remove_proc_entry(files[i].name,
+- minor->proc_root);
+- list_del(pos);
+- drm_free(tmp, sizeof(struct drm_info_node),
+- _DRM_DRIVER);
+- }
+- }
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
+ }
+- return 0;
++
++ *start = &buf[offset];
++ *eof = 0;
++
++ DRM_PROC_PRINT(" ctx/flags use fin"
++ " blk/rw/rwf wait flushed queued"
++ " locks\n\n");
++ for (i = 0; i < dev->queue_count; i++) {
++ q = dev->queuelist[i];
++ atomic_inc(&q->use_count);
++ DRM_PROC_PRINT_RET(atomic_dec(&q->use_count),
++ "%5d/0x%03x %5d %5d"
++ " %5d/%c%c/%c%c%c %5Zd\n",
++ i,
++ q->flags,
++ atomic_read(&q->use_count),
++ atomic_read(&q->finalization),
++ atomic_read(&q->block_count),
++ atomic_read(&q->block_read) ? 'r' : '-',
++ atomic_read(&q->block_write) ? 'w' : '-',
++ waitqueue_active(&q->read_queue) ? 'r' : '-',
++ waitqueue_active(&q->
++ write_queue) ? 'w' : '-',
++ waitqueue_active(&q->
++ flush_queue) ? 'f' : '-',
++ DRM_BUFCOUNT(&q->waitlist));
++ atomic_dec(&q->use_count);
++ }
++
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
+ }
+
+ /**
+- * Cleanup the proc filesystem resources.
++ * Simply calls _queues_info() while holding the drm_device::struct_mutex lock.
++ */
++static int drm_queues_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__queues_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++
++/**
++ * Called when "/proc/dri/.../bufs" is read.
+ *
+- * \param minor device minor number.
+- * \param root DRI proc dir entry.
+- * \param dev_root DRI device proc dir entry.
+- * \return always zero.
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
++ */
++static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++ struct drm_device_dma *dma = dev->dma;
++ int i;
++
++ if (!dma || offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ *start = &buf[offset];
++ *eof = 0;
++
++ DRM_PROC_PRINT(" o size count free segs pages kB\n\n");
++ for (i = 0; i <= DRM_MAX_ORDER; i++) {
++ if (dma->bufs[i].buf_count)
++ DRM_PROC_PRINT("%2d %8d %5d %5d %5d %5d %5ld\n",
++ i,
++ dma->bufs[i].buf_size,
++ dma->bufs[i].buf_count,
++ atomic_read(&dma->bufs[i]
++ .freelist.count),
++ dma->bufs[i].seg_count,
++ dma->bufs[i].seg_count
++ * (1 << dma->bufs[i].page_order),
++ (dma->bufs[i].seg_count
++ * (1 << dma->bufs[i].page_order))
++ * PAGE_SIZE / 1024);
++ }
++ DRM_PROC_PRINT("\n");
++ for (i = 0; i < dma->buf_count; i++) {
++ if (i && !(i % 32))
++ DRM_PROC_PRINT("\n");
++ DRM_PROC_PRINT(" %d", dma->buflist[i]->list);
++ }
++ DRM_PROC_PRINT("\n");
++
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++/**
++ * Simply calls _bufs_info() while holding the drm_device::struct_mutex lock.
++ */
++static int drm_bufs_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__bufs_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++
++/**
++ * Called when "/proc/dri/.../vblank" is read.
+ *
+- * Remove all proc entries created by proc_init().
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
+ */
+-int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root)
++static int drm__vblank_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
+ {
++ struct drm_minor *minor = (struct drm_minor *) data;
+ struct drm_device *dev = minor->dev;
+- char name[64];
++ int len = 0;
++ int crtc;
+
+- if (!root || !minor->proc_root)
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
+ return 0;
++ }
+
+- if (dev->driver->proc_cleanup)
+- dev->driver->proc_cleanup(minor);
++ *start = &buf[offset];
++ *eof = 0;
+
+- drm_proc_remove_files(drm_proc_list, DRM_PROC_ENTRIES, minor);
++ for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
++ DRM_PROC_PRINT("CRTC %d enable: %d\n",
++ crtc, atomic_read(&dev->vblank_refcount[crtc]));
++ DRM_PROC_PRINT("CRTC %d counter: %d\n",
++ crtc, drm_vblank_count(dev, crtc));
++ DRM_PROC_PRINT("CRTC %d last wait: %d\n",
++ crtc, dev->last_vblank_wait[crtc]);
++ DRM_PROC_PRINT("CRTC %d in modeset: %d\n",
++ crtc, dev->vblank_inmodeset[crtc]);
++ }
+
+- sprintf(name, "%d", minor->index);
+- remove_proc_entry(name, root);
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++/**
++ * Simply calls _vblank_info() while holding the drm_device::struct_mutex lock.
++ */
++static int drm_vblank_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__vblank_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++
++/**
++ * Called when "/proc/dri/.../clients" is read.
++ *
++ * \param buf output buffer.
++ * \param start start of output data.
++ * \param offset requested start offset.
++ * \param request requested number of bytes.
++ * \param eof whether there is no more data to return.
++ * \param data private data.
++ * \return number of written bytes.
++ */
++static int drm__clients_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++ struct drm_file *priv;
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ *start = &buf[offset];
++ *eof = 0;
+
++ DRM_PROC_PRINT("a dev pid uid magic ioctls\n\n");
++ list_for_each_entry(priv, &dev->filelist, lhead) {
++ DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n",
++ priv->authenticated ? 'y' : 'n',
++ priv->minor->index,
++ priv->pid,
++ priv->uid, priv->magic, priv->ioctl_count);
++ }
++
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++/**
++ * Simply calls _clients_info() while holding the drm_device::struct_mutex lock.
++ */
++static int drm_clients_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__clients_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++
++struct drm_gem_name_info_data {
++ int len;
++ char *buf;
++ int eof;
++};
++
++static int drm_gem_one_name_info(int id, void *ptr, void *data)
++{
++ struct drm_gem_object *obj = ptr;
++ struct drm_gem_name_info_data *nid = data;
++
++ DRM_INFO("name %d size %zd\n", obj->name, obj->size);
++ if (nid->eof)
++ return 0;
++
++ nid->len += sprintf(&nid->buf[nid->len],
++ "%6d %8zd %7d %8d\n",
++ obj->name, obj->size,
++ atomic_read(&obj->handlecount.refcount),
++ atomic_read(&obj->refcount.refcount));
++ if (nid->len > DRM_PROC_LIMIT) {
++ nid->eof = 1;
++ return 0;
++ }
+ return 0;
+ }
+
++static int drm_gem_name_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ struct drm_gem_name_info_data nid;
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ nid.len = sprintf(buf, " name size handles refcount\n");
++ nid.buf = buf;
++ nid.eof = 0;
++ idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, &nid);
++
++ *start = &buf[offset];
++ *eof = 0;
++ if (nid.len > request + offset)
++ return request;
++ *eof = 1;
++ return nid.len - offset;
++}
++
++static int drm_gem_object_info(char *buf, char **start, off_t offset,
++ int request, int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ *start = &buf[offset];
++ *eof = 0;
++ DRM_PROC_PRINT("%d objects\n", atomic_read(&dev->object_count));
++ DRM_PROC_PRINT("%d object bytes\n", atomic_read(&dev->object_memory));
++ DRM_PROC_PRINT("%d pinned\n", atomic_read(&dev->pin_count));
++ DRM_PROC_PRINT("%d pin bytes\n", atomic_read(&dev->pin_memory));
++ DRM_PROC_PRINT("%d gtt bytes\n", atomic_read(&dev->gtt_memory));
++ DRM_PROC_PRINT("%d gtt total\n", dev->gtt_total);
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++#if DRM_DEBUG_CODE
++
++static int drm__vma_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int len = 0;
++ struct drm_vma_entry *pt;
++ struct vm_area_struct *vma;
++#if defined(__i386__)
++ unsigned int pgprot;
++#endif
++
++ if (offset > DRM_PROC_LIMIT) {
++ *eof = 1;
++ return 0;
++ }
++
++ *start = &buf[offset];
++ *eof = 0;
++
++ DRM_PROC_PRINT("vma use count: %d, high_memory = %p, 0x%08lx\n",
++ atomic_read(&dev->vma_count),
++ high_memory, virt_to_phys(high_memory));
++ list_for_each_entry(pt, &dev->vmalist, head) {
++ if (!(vma = pt->vma))
++ continue;
++ DRM_PROC_PRINT("\n%5d 0x%08lx-0x%08lx %c%c%c%c%c%c 0x%08lx000",
++ pt->pid,
++ vma->vm_start,
++ vma->vm_end,
++ vma->vm_flags & VM_READ ? 'r' : '-',
++ vma->vm_flags & VM_WRITE ? 'w' : '-',
++ vma->vm_flags & VM_EXEC ? 'x' : '-',
++ vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
++ vma->vm_flags & VM_LOCKED ? 'l' : '-',
++ vma->vm_flags & VM_IO ? 'i' : '-',
++ vma->vm_pgoff);
++
++#if defined(__i386__)
++ pgprot = pgprot_val(vma->vm_page_prot);
++ DRM_PROC_PRINT(" %c%c%c%c%c%c%c%c%c",
++ pgprot & _PAGE_PRESENT ? 'p' : '-',
++ pgprot & _PAGE_RW ? 'w' : 'r',
++ pgprot & _PAGE_USER ? 'u' : 's',
++ pgprot & _PAGE_PWT ? 't' : 'b',
++ pgprot & _PAGE_PCD ? 'u' : 'c',
++ pgprot & _PAGE_ACCESSED ? 'a' : '-',
++ pgprot & _PAGE_DIRTY ? 'd' : '-',
++ pgprot & _PAGE_PSE ? 'm' : 'k',
++ pgprot & _PAGE_GLOBAL ? 'g' : 'l');
++#endif
++ DRM_PROC_PRINT("\n");
++ }
++
++ if (len > request + offset)
++ return request;
++ *eof = 1;
++ return len - offset;
++}
++
++static int drm_vma_info(char *buf, char **start, off_t offset, int request,
++ int *eof, void *data)
++{
++ struct drm_minor *minor = (struct drm_minor *) data;
++ struct drm_device *dev = minor->dev;
++ int ret;
++
++ mutex_lock(&dev->struct_mutex);
++ ret = drm__vma_info(buf, start, offset, request, eof, data);
++ mutex_unlock(&dev->struct_mutex);
++ return ret;
++}
++#endif
--- drm-edid-revision-0-should-be-valid.patch DELETED ---
--- linux-2.6-iwlwifi-dma-direction.patch DELETED ---
--- linux-2.6-libertas-netpriv-fixes.patch DELETED ---
--- patch-2.6.29-rc6-git2.bz2.sign DELETED ---
--- patch-2.6.29-rc6.bz2.sign DELETED ---
More information about the fedora-extras-commits
mailing list