rpms/kernel/devel drm-next.patch, 1.6.6.8, 1.6.6.9 patch-2.6.31-rc7-git4.bz2.sign, NONE, 1.1.4.2 xen-fb-probe-fix.patch, NONE, 1.1.6.2 .cvsignore, 1.1014.2.27, 1.1014.2.28 config-generic, 1.238.6.35, 1.238.6.36 drm-intel-next.patch, 1.4.6.5, 1.4.6.6 drm-nouveau.patch, 1.8.6.15, 1.8.6.16 drm-page-flip.patch, 1.2.6.3, 1.2.6.4 drm-vga-arb.patch, 1.5.2.2, 1.5.2.3 kernel.spec, 1.1294.2.58, 1.1294.2.59 sources, 1.976.2.28, 1.976.2.29 upstream, 1.888.2.27, 1.888.2.28 xen.pvops.patch, 1.1.2.36, 1.1.2.37 patch-2.6.31-rc7-git1.bz2.sign, 1.1.2.2, NONE
myoung
myoung at fedoraproject.org
Wed Aug 26 19:59:04 UTC 2009
Author: myoung
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29358
Modified Files:
Tag: private-myoung-dom0-branch
.cvsignore config-generic drm-intel-next.patch
drm-nouveau.patch drm-page-flip.patch drm-vga-arb.patch
kernel.spec sources upstream xen.pvops.patch
Added Files:
Tag: private-myoung-dom0-branch
drm-next.patch patch-2.6.31-rc7-git4.bz2.sign
xen-fb-probe-fix.patch
Removed Files:
Tag: private-myoung-dom0-branch
patch-2.6.31-rc7-git1.bz2.sign
Log Message:
another pvops update
drm-next.patch:
drivers/gpu/drm/Makefile | 2
drivers/gpu/drm/drm_crtc.c | 76 ++-
drivers/gpu/drm/drm_crtc_helper.c | 44 +
drivers/gpu/drm/drm_drv.c | 4
drivers/gpu/drm/drm_edid.c | 70 ++-
drivers/gpu/drm/drm_encoder_slave.c | 116 +++++
drivers/gpu/drm/drm_modes.c | 424 ++++++++++++++++++-
drivers/gpu/drm/drm_sysfs.c | 28 +
drivers/gpu/drm/i915/i915_dma.c | 35 -
drivers/gpu/drm/i915/intel_lvds.c | 22
drivers/gpu/drm/i915/intel_sdvo.c | 41 -
drivers/gpu/drm/radeon/Makefile | 15
drivers/gpu/drm/radeon/mkregtable.c | 726 ++++++++++++++++++++++++++++++++
drivers/gpu/drm/radeon/r300.c | 45 --
drivers/gpu/drm/radeon/radeon_object.h | 1
drivers/gpu/drm/radeon/radeon_ttm.c | 33 +
drivers/gpu/drm/radeon/reg_srcs/r300 | 728 +++++++++++++++++++++++++++++++++
drivers/gpu/drm/radeon/reg_srcs/rv515 | 486 ++++++++++++++++++++++
drivers/gpu/drm/radeon/rv515.c | 64 --
drivers/gpu/drm/ttm/ttm_bo.c | 295 ++++++++-----
drivers/gpu/drm/ttm/ttm_bo_util.c | 4
drivers/gpu/drm/ttm/ttm_global.c | 4
drivers/gpu/drm/ttm/ttm_memory.c | 508 +++++++++++++++++++----
drivers/gpu/drm/ttm/ttm_module.c | 58 ++
drivers/gpu/drm/ttm/ttm_tt.c | 37 -
include/drm/drmP.h | 50 +-
include/drm/drm_crtc.h | 12
include/drm/drm_encoder_slave.h | 162 +++++++
include/drm/drm_mode.h | 11
include/drm/drm_sysfs.h | 12
include/drm/ttm/ttm_bo_api.h | 13
include/drm/ttm/ttm_bo_driver.h | 94 +++-
include/drm/ttm/ttm_memory.h | 43 +
include/drm/ttm/ttm_module.h | 2
34 files changed, 3763 insertions(+), 502 deletions(-)
View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.6.6.8 -r 1.6.6.9 drm-next.patchIndex: 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 26 Aug 2009 19:58:46 -0000 1.6.6.9
@@ -0,0 +1,6379 @@
+commit 50f153036c9d9e4ae1768d5ca9c2ad4184f7a0b7
+Author: Dave Airlie <airlied at redhat.com>
+Date: Fri Aug 21 13:21:01 2009 +1000
+
+ drm/radeon/kms: generate the safe register tables.
+
+ Previously we just made these offline and included them,
+ but no reason we can't generate them at build time.
+
+ TODO: add rs690 + r100/r200 when done.
+ should we do rs480/rs690 no tcl version?
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 759e4f83f418f4001e724042b4c0e408d615d9ec
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Thu Aug 20 10:29:09 2009 +0200
+
+ drm/ttm: Fixes for "Memory accounting rework."
+
+ ttm:
+ Fix error paths when kobject_add returns an error.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 7f5f4db2d50ea1af8f160686d2e97bbfa5102b4f
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Thu Aug 20 10:29:08 2009 +0200
+
+ drm/ttm: Fixes for "Make parts of a struct ttm_bo_device global"
+
+ ttm:
+ Remove a stray debug printout.
+ Remove a re-init of the lru spinlock at device init.
+
+ radeon:
+ Fix the size of the bo_global allocation.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 51c8b4071d84d46cc100baa5931ad06b2a823c95
+Merge: a987fca... 6c30c53...
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Aug 20 13:38:04 2009 +1000
+
+ Merge Linus master to drm-next
+
+ linux-next conflict reported needed resolution.
+
+ Conflicts:
+ drivers/gpu/drm/drm_crtc.c
+ drivers/gpu/drm/drm_edid.c
+ drivers/gpu/drm/i915/intel_sdvo.c
+ drivers/gpu/drm/radeon/radeon_ttm.c
+ drivers/gpu/drm/ttm/ttm_bo.c
+
+commit a987fcaa805fcb24ba885c2e29fd4fdb6816f08f
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Tue Aug 18 16:51:56 2009 +0200
+
+ ttm: Make parts of a struct ttm_bo_device global.
+
+ Common resources, like memory accounting and swap lists should be
+ global and not per device. Introduce a struct ttm_bo_global to
+ accomodate this, and register it with sysfs. Add a small sysfs interface
+ to return the number of active buffer objects.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at linux.ie>
+
+commit 5fd9cbad3a4ae82c83c55b9c621d156c326724ef
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Mon Aug 17 16:28:39 2009 +0200
+
+ drm/ttm: Memory accounting rework.
+
+ Use inclusive zones to simplify accounting and its sysfs representation.
+ Use DMA32 accounting where applicable.
+
+ Add a sysfs interface to make the heuristically determined limits
+ readable and configurable.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at linux.ie>
+
+commit e9840be8c23601285a70520b4898818f28ce8c2b
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Tue Aug 18 10:27:57 2009 +0200
+
+ drm/ttm: Add a virtual ttm sysfs device.
+
+ The device directory will be the base directory of the
+ sysfs representation of other ttm subsystems.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at linux.ie>
+
+commit 327c225bd548bf7871f116a0baa5ebdac884e452
+Author: Thomas Hellstrom <thellstrom at vmware.com>
+Date: Mon Aug 17 16:28:37 2009 +0200
+
+ drm: Enable drm drivers to add drm sysfs devices.
+
+ Export utility functions for drivers to add specialized devices in the
+ sysfs drm class subdirectory.
+
+ Initially this will be needed form TTM to add a virtual device that
+ handles power management.
+
+ Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
+ Signed-off-by: Dave Airlie <airlied at linux.ie>
+
+commit a0724fcf829e5afb66159ef68cb16a805ea11b42
+Author: Pekka Paalanen <pq at iki.fi>
+Date: Mon Aug 17 01:18:38 2009 +0300
+
+ drm/ttm: optimize bo_kmap_type values
+
+ A micro-optimization on the function ttm_kmap_obj_virtual().
+
+ By defining the values of enum ttm_bo_kmap_obj::bo_kmap_type to have a
+ bit indicating iomem, size of the function ttm_kmap_obj_virtual() will be
+ reduced by 16 bytes on x86_64 (gcc 4.1.2).
+
+ ttm_kmap_obj_virtual() may be heavily used, when buffer objects are
+ accessed via wrappers, that work for both kinds of memory addresses:
+ iomem cookies and kernel virtual.
+
+ Signed-off-by: Pekka Paalanen <pq at iki.fi>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 949ef70e2d1a5c12178875f513df34fc85d91a38
+Author: Pekka Paalanen <pq at iki.fi>
+Date: Mon Aug 17 19:49:19 2009 +0300
+
+ drm/kms: no need to return void value (encoder)
+
+ Cc: Francisco Jerez <currojerez at riseup.net>
+ Signed-off-by: Pekka Paalanen <pq at iki.fi>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 53bd83899f5ba6b0da8f5ef976129273854a72d4
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Wed Jul 1 10:04:40 2009 -0700
+
+ drm: clarify scaling property names
+
+ Now that we're using the scaling property in the Intel driver I noticed
+ that the names were a bit confusing. I've corrected them according to
+ our discussion on IRC and the mailing list, though I've left out
+ potential new additions for a new scaling property with an integer (or
+ two) for the scaling factor. None of the drivers implement that today,
+ but if someone wants to do it, I think it could be done with the
+ addition of a single new type and a new property to describe the
+ scaling factor in the X and Y directions.
+
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+ Acked-by: Alex Deucher <alexdeucher at gmail.com>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 776f3360de6ed246e973577828f725681120fd7a
+Author: Dave Airlie <airlied at linux.ie>
+Date: Wed Aug 19 15:56:37 2009 +1000
+
+ drm: fixup includes in encoder slave header files.
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit 453a7d46dca88704ed88b364c445ff55680a8557
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Wed Aug 19 15:51:55 2009 +1000
+
+ drm: remove root requirement from DRM_IOCTL_SET_VERSION (+ DRM_IOCTL_AUTH_MAGIC)
+
+ Just a DRM_MASTER flag is sufficient here, though maybe this call is
+ totally deprecated anyway (xf86-video-intel still calls it though).
+
+ (airlied: drop ioctl auth_magic as discussed on mailing list also)
+
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit cfcf4738cd6b5d7bed1473acad76d6430cf1fb0a
+Author: Dave Airlie <airlied at redhat.com>
+Date: Thu Aug 13 13:31:54 2009 +1000
+
+ drm: fixup include file in drm_encoder_slave
+
+ Signed-off-by: Dave Airlie <airlied at redhat.com>
+
+commit a75f0236292a5fca65f26efedca48bd07db1834d
[...5986 lines suppressed...]
++ */
++
++struct ttm_bo_global {
++
++ /**
++ * Constant after init.
++ */
++
++ struct kobject kobj;
++ struct ttm_mem_global *mem_glob;
++ struct page *dummy_read_page;
++ struct ttm_mem_shrink shrink;
++ size_t ttm_bo_extra_size;
++ size_t ttm_bo_size;
++ struct mutex device_list_mutex;
++ spinlock_t lru_lock;
++
++ /**
++ * Protected by device_list_mutex.
++ */
++ struct list_head device_list;
++
++ /**
++ * Protected by the lru_lock.
++ */
++ struct list_head swap_lru;
++
++ /**
++ * Internal protection.
++ */
++ atomic_t bo_count;
++};
++
++
++#define TTM_NUM_MEM_TYPES 8
++
++#define TTM_BO_PRIV_FLAG_MOVING 0 /* Buffer object is moving and needs
++ idling before CPU mapping */
++#define TTM_BO_PRIV_FLAG_MAX 1
++/**
++ * struct ttm_bo_device - Buffer object driver device-specific data.
++ *
++ * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver.
+ * @man: An array of mem_type_managers.
+ * @addr_space_mm: Range manager for the device address space.
+ * lru_lock: Spinlock that protects the buffer+device lru lists and
+@@ -399,32 +449,21 @@ struct ttm_bo_device {
+ /*
+ * Constant after bo device init / atomic.
+ */
+-
+- struct ttm_mem_global *mem_glob;
++ struct list_head device_list;
++ struct ttm_bo_global *glob;
+ struct ttm_bo_driver *driver;
+- struct page *dummy_read_page;
+- struct ttm_mem_shrink shrink;
+-
+- size_t ttm_bo_extra_size;
+- size_t ttm_bo_size;
+-
+ rwlock_t vm_lock;
++ struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
+ /*
+ * Protected by the vm lock.
+ */
+- struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
+ struct rb_root addr_space_rb;
+ struct drm_mm addr_space_mm;
+
+ /*
+- * Might want to change this to one lock per manager.
+- */
+- spinlock_t lru_lock;
+- /*
+- * Protected by the lru lock.
++ * Protected by the global:lru lock.
+ */
+ struct list_head ddestroy;
+- struct list_head swap_lru;
+
+ /*
+ * Protected by load / firstopen / lastclose /unload sync.
+@@ -640,6 +679,9 @@ extern int ttm_bo_pci_offset(struct ttm_bo_device *bdev,
+ unsigned long *bus_offset,
+ unsigned long *bus_size);
+
++extern void ttm_bo_global_release(struct ttm_global_reference *ref);
++extern int ttm_bo_global_init(struct ttm_global_reference *ref);
++
+ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
+
+ /**
+@@ -657,7 +699,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
+ * !0: Failure.
+ */
+ extern int ttm_bo_device_init(struct ttm_bo_device *bdev,
+- struct ttm_mem_global *mem_glob,
++ struct ttm_bo_global *glob,
+ struct ttm_bo_driver *driver,
+ uint64_t file_page_offset, bool need_dma32);
+
+diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
+index d8b8f04..6983a7c 100644
+--- a/include/drm/ttm/ttm_memory.h
++++ b/include/drm/ttm/ttm_memory.h
+@@ -32,6 +32,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/wait.h>
+ #include <linux/errno.h>
++#include <linux/kobject.h>
+
+ /**
+ * struct ttm_mem_shrink - callback to shrink TTM memory usage.
+@@ -60,34 +61,33 @@ struct ttm_mem_shrink {
+ * @queue: Wait queue for processes suspended waiting for memory.
+ * @lock: Lock to protect the @shrink - and the memory accounting members,
+ * that is, essentially the whole structure with some exceptions.
+- * @emer_memory: Lowmem memory limit available for root.
+- * @max_memory: Lowmem memory limit available for non-root.
+- * @swap_limit: Lowmem memory limit where the shrink workqueue kicks in.
+- * @used_memory: Currently used lowmem memory.
+- * @used_total_memory: Currently used total (lowmem + highmem) memory.
+- * @total_memory_swap_limit: Total memory limit where the shrink workqueue
+- * kicks in.
+- * @max_total_memory: Total memory available to non-root processes.
+- * @emer_total_memory: Total memory available to root processes.
++ * @zones: Array of pointers to accounting zones.
++ * @num_zones: Number of populated entries in the @zones array.
++ * @zone_kernel: Pointer to the kernel zone.
++ * @zone_highmem: Pointer to the highmem zone if there is one.
++ * @zone_dma32: Pointer to the dma32 zone if there is one.
+ *
+ * Note that this structure is not per device. It should be global for all
+ * graphics devices.
+ */
+
++#define TTM_MEM_MAX_ZONES 2
++struct ttm_mem_zone;
+ struct ttm_mem_global {
++ struct kobject kobj;
+ struct ttm_mem_shrink *shrink;
+ struct workqueue_struct *swap_queue;
+ struct work_struct work;
+ wait_queue_head_t queue;
+ spinlock_t lock;
+- uint64_t emer_memory;
+- uint64_t max_memory;
+- uint64_t swap_limit;
+- uint64_t used_memory;
+- uint64_t used_total_memory;
+- uint64_t total_memory_swap_limit;
+- uint64_t max_total_memory;
+- uint64_t emer_total_memory;
++ struct ttm_mem_zone *zones[TTM_MEM_MAX_ZONES];
++ unsigned int num_zones;
++ struct ttm_mem_zone *zone_kernel;
++#ifdef CONFIG_HIGHMEM
++ struct ttm_mem_zone *zone_highmem;
++#else
++ struct ttm_mem_zone *zone_dma32;
++#endif
+ };
+
+ /**
+@@ -146,8 +146,13 @@ static inline void ttm_mem_unregister_shrink(struct ttm_mem_global *glob,
+ extern int ttm_mem_global_init(struct ttm_mem_global *glob);
+ extern void ttm_mem_global_release(struct ttm_mem_global *glob);
+ extern int ttm_mem_global_alloc(struct ttm_mem_global *glob, uint64_t memory,
+- bool no_wait, bool interruptible, bool himem);
++ bool no_wait, bool interruptible);
+ extern void ttm_mem_global_free(struct ttm_mem_global *glob,
+- uint64_t amount, bool himem);
++ uint64_t amount);
++extern int ttm_mem_global_alloc_page(struct ttm_mem_global *glob,
++ struct page *page,
++ bool no_wait, bool interruptible);
++extern void ttm_mem_global_free_page(struct ttm_mem_global *glob,
++ struct page *page);
+ extern size_t ttm_round_pot(size_t size);
+ #endif
+diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h
+index d1d4338..cf416ae 100644
+--- a/include/drm/ttm/ttm_module.h
++++ b/include/drm/ttm/ttm_module.h
+@@ -32,6 +32,7 @@
+ #define _TTM_MODULE_H_
+
+ #include <linux/kernel.h>
++struct kobject;
+
+ #define TTM_PFX "[TTM] "
+
+@@ -54,5 +55,6 @@ extern void ttm_global_init(void);
+ extern void ttm_global_release(void);
+ extern int ttm_global_item_ref(struct ttm_global_reference *ref);
+ extern void ttm_global_item_unref(struct ttm_global_reference *ref);
++extern struct kobject *ttm_get_kobj(void);
+
+ #endif /* _TTM_MODULE_H_ */
--- NEW FILE patch-2.6.31-rc7-git4.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info
iD4DBQBKlSaJyGugalF9Dw4RAvx8AJkBOxwrd1XXzRAZCf/qEUTX9daFjwCYln/P
K6GN3ry0CMcWKkcjWGgwnA==
=ZSyc
-----END PGP SIGNATURE-----
xen-fb-probe-fix.patch:
xen-fbfront.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- NEW FILE xen-fb-probe-fix.patch ---
As soon as the framebuffer is registered, our methods may be called by the
kernel. This leads to a crash as xenfb_refresh() gets called before we have
the irq.
Connect to the backend before registering our framebuffer with the kernel.
Signed-off-by: Michal Schmidt <mschmidt at redhat.com>
--
Index: linux-git/drivers/video/xen-fbfront.c
===================================================================
--- linux-git.orig/drivers/video/xen-fbfront.c
+++ linux-git/drivers/video/xen-fbfront.c
@@ -454,6 +454,10 @@ static int __devinit xenfb_probe(struct
xenfb_init_shared_page(info, fb_info);
+ ret = xenfb_connect_backend(dev, info);
+ if (ret < 0)
+ goto error;
+
ret = register_framebuffer(fb_info);
if (ret) {
fb_deferred_io_cleanup(fb_info);
@@ -464,10 +468,6 @@ static int __devinit xenfb_probe(struct
}
info->fb_info = fb_info;
- ret = xenfb_connect_backend(dev, info);
- if (ret < 0)
- goto error;
-
xenfb_make_preferred_console();
return 0;
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/.cvsignore,v
retrieving revision 1.1014.2.27
retrieving revision 1.1014.2.28
diff -u -p -r1.1014.2.27 -r1.1014.2.28
--- .cvsignore 24 Aug 2009 20:17:11 -0000 1.1014.2.27
+++ .cvsignore 26 Aug 2009 19:58:45 -0000 1.1014.2.28
@@ -6,4 +6,4 @@ temp-*
kernel-2.6.30
linux-2.6.30.tar.bz2
patch-2.6.31-rc7.bz2
-patch-2.6.31-rc7-git1.bz2
+patch-2.6.31-rc7-git4.bz2
Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.238.6.35
retrieving revision 1.238.6.36
diff -u -p -r1.238.6.35 -r1.238.6.36
--- config-generic 18 Aug 2009 19:26:45 -0000 1.238.6.35
+++ config-generic 26 Aug 2009 19:58:46 -0000 1.238.6.36
@@ -1388,7 +1388,7 @@ CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_DEFAULT_PS=y
-CONFIG_WIMAX=y
+CONFIG_WIMAX=m
CONFIG_WIMAX_DEBUG_LEVEL=8
CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
@@ -4068,3 +4068,4 @@ CONFIG_XEN_GNTDEV=y
CONFIG_XEN_PCI_PASSTHROUGH=y
# CONFIG_XEN_PCI_PASSTHROUGH_DEBUG is not set
# CONFIG_X86_DS_SELFTEST is not set
+# CONFIG_DRM_I2C_CH7006 is not set
drm-intel-next.patch:
intel_crt.c | 4 +++
intel_display.c | 71 +++++++++++---------------------------------------------
intel_dp.c | 12 +++++++++
intel_drv.h | 20 +++++++++++++++
intel_dvo.c | 6 ++++
intel_hdmi.c | 18 +++++++++-----
intel_lvds.c | 2 +
intel_sdvo.c | 13 +++++++++-
intel_tv.c | 2 +
9 files changed, 85 insertions(+), 63 deletions(-)
View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.4.6.5 -r 1.4.6.6 drm-intel-next.patchIndex: drm-intel-next.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-intel-next.patch,v
retrieving revision 1.4.6.5
retrieving revision 1.4.6.6
diff -u -p -r1.4.6.5 -r1.4.6.6
--- drm-intel-next.patch 13 Aug 2009 18:13:03 -0000 1.4.6.5
+++ drm-intel-next.patch 26 Aug 2009 19:58:46 -0000 1.4.6.6
@@ -1,2653 +1,362 @@
-diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 8c47831..50d1f78 100644
---- a/drivers/gpu/drm/i915/i915_dma.c
-+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1186,6 +1186,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- if (ret)
- goto out_iomapfree;
-
-+ dev_priv->wq = create_workqueue("i915");
-+ if (dev_priv->wq == NULL) {
-+ DRM_ERROR("Failed to create our workqueue.\n");
-+ ret = -ENOMEM;
-+ goto out_iomapfree;
-+ }
-+
- /* enable GEM by default */
- dev_priv->has_gem = 1;
-
-@@ -1211,7 +1218,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- if (!I915_NEED_GFX_HWS(dev)) {
- ret = i915_init_phys_hws(dev);
- if (ret != 0)
-- goto out_iomapfree;
-+ goto out_workqueue_free;
- }
-
- i915_get_mem_freq(dev);
-@@ -1245,7 +1252,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- ret = i915_load_modeset_init(dev, prealloc_size, agp_size);
- if (ret < 0) {
- DRM_ERROR("failed to init modeset\n");
-- goto out_rmmap;
-+ goto out_workqueue_free;
- }
- }
-
-@@ -1256,6 +1263,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
-
- return 0;
-
-+out_workqueue_free:
-+ destroy_workqueue(dev_priv->wq);
- out_iomapfree:
- io_mapping_free(dev_priv->mm.gtt_mapping);
- out_rmmap:
-@@ -1269,6 +1278,8 @@ int i915_driver_unload(struct drm_device *dev)
- {
- struct drm_i915_private *dev_priv = dev->dev_private;
-
-+ destroy_workqueue(dev_priv->wq);
-+
- io_mapping_free(dev_priv->mm.gtt_mapping);
- if (dev_priv->mm.gtt_mtrr >= 0) {
- mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
-diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index d087528..7537f57 100644
---- a/drivers/gpu/drm/i915/i915_drv.h
-+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -219,6 +219,7 @@ typedef struct drm_i915_private {
- unsigned int lvds_vbt:1;
- unsigned int int_crt_support:1;
- unsigned int lvds_use_ssc:1;
-+ unsigned int edp_support:1;
- int lvds_ssc_freq;
-
- struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
-@@ -229,6 +230,8 @@ typedef struct drm_i915_private {
-
- spinlock_t error_lock;
- struct drm_i915_error_state *first_error;
-+ struct work_struct error_work;
-+ struct workqueue_struct *wq;
-
- /* Register state */
- u8 saveLBB;
-@@ -888,6 +891,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
- IS_I915GM(dev)))
- #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev))
- #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev))
-+#define SUPPORTS_EDP(dev) (IS_IGDNG_M(dev))
- #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev))
- /* dsparb controlled by hw only */
- #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev))
-diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
-index 5bf4203..140bee1 100644
---- a/drivers/gpu/drm/i915/i915_gem.c
-+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -1570,7 +1570,7 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv,
- }
-
- if (was_empty && !dev_priv->mm.suspended)
-- schedule_delayed_work(&dev_priv->mm.retire_work, HZ);
-+ queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
- return seqno;
- }
-
-@@ -1719,7 +1719,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
- i915_gem_retire_requests(dev);
- if (!dev_priv->mm.suspended &&
- !list_empty(&dev_priv->mm.request_list))
-- schedule_delayed_work(&dev_priv->mm.retire_work, HZ);
-+ queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
- mutex_unlock(&dev->struct_mutex);
- }
-
-diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
-index 9a44bfc..cb3b974 100644
---- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
-+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
-@@ -343,6 +343,8 @@ static int i915_error_state(struct seq_file *m, void *unused)
-
- error = dev_priv->first_error;
-
-+ seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
-+ error->time.tv_usec);
- seq_printf(m, "EIR: 0x%08x\n", error->eir);
- seq_printf(m, " PGTBL_ER: 0x%08x\n", error->pgtbl_er);
- seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
-diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 7ba23a6..83aee80 100644
---- a/drivers/gpu/drm/i915/i915_irq.c
-+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -290,6 +290,35 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev)
- return ret;
- }
-
-+/**
-+ * i915_error_work_func - do process context error handling work
-+ * @work: work struct
-+ *
-+ * Fire an error uevent so userspace can see that a hang or error
-+ * was detected.
-+ */
-+static void i915_error_work_func(struct work_struct *work)
-+{
-+ drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
-+ error_work);
-+ struct drm_device *dev = dev_priv->dev;
-+ char *event_string = "ERROR=1";
-+ char *envp[] = { event_string, NULL };
-+
-+ DRM_DEBUG("generating error event\n");
-+
-+ kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
-+}
-+
-+/**
-+ * i915_capture_error_state - capture an error record for later analysis
-+ * @dev: drm device
-+ *
-+ * Should be called when an error is detected (either a hang or an error
-+ * interrupt) to capture error state from the time of the error. Fills
-+ * out a structure which becomes available in debugfs for user level tools
-+ * to pick up.
-+ */
- static void i915_capture_error_state(struct drm_device *dev)
- {
- struct drm_i915_private *dev_priv = dev->dev_private;
-@@ -325,12 +354,137 @@ static void i915_capture_error_state(struct drm_device *dev)
- error->acthd = I915_READ(ACTHD_I965);
- }
-
-+ do_gettimeofday(&error->time);
-+
- dev_priv->first_error = error;
-
- out:
- spin_unlock_irqrestore(&dev_priv->error_lock, flags);
- }
-
-+/**
-+ * i915_handle_error - handle an error interrupt
-+ * @dev: drm device
-+ *
-+ * Do some basic checking of regsiter state at error interrupt time and
-+ * dump it to the syslog. Also call i915_capture_error_state() to make
-+ * sure we get a record and make it available in debugfs. Fire a uevent
-+ * so userspace knows something bad happened (should trigger collection
-+ * of a ring dump etc.).
-+ */
-+static void i915_handle_error(struct drm_device *dev)
-+{
-+ struct drm_i915_private *dev_priv = dev->dev_private;
-+ u32 eir = I915_READ(EIR);
-+ u32 pipea_stats = I915_READ(PIPEASTAT);
-+ u32 pipeb_stats = I915_READ(PIPEBSTAT);
-+
-+ i915_capture_error_state(dev);
-+
-+ printk(KERN_ERR "render error detected, EIR: 0x%08x\n",
-+ eir);
[...2568 lines suppressed...]
-+
-+ sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
-+ encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
-+ connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
-+ sdvo_priv->is_lvds = true;
-+ } else {
-+
-+ unsigned char bytes[2];
-+
-+ sdvo_priv->controlled_output = 0;
-+ memcpy(bytes, &sdvo_priv->caps.output_flags, 2);
-+ DRM_DEBUG_KMS(I915_SDVO,
-+ "%s: Unknown SDVO output type (0x%02x%02x)\n",
-+ SDVO_NAME(sdvo_priv),
-+ bytes[0], bytes[1]);
-+ ret = false;
-+ }
-+
-+ if (ret && registered)
-+ ret = drm_sysfs_connector_add(connector) == 0 ? true : false;
-+
-+
-+ return ret;
-+
-+}
-+
- bool intel_sdvo_init(struct drm_device *dev, int output_device)
- {
- struct drm_connector *connector;
- struct intel_output *intel_output;
- struct intel_sdvo_priv *sdvo_priv;
-
-- int connector_type;
- u8 ch[0x40];
- int i;
-- int encoder_type;
+ unsigned char bytes[2];
+@@ -2009,6 +2019,7 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
+ bytes[0], bytes[1]);
+ ret = false;
+ }
++ intel_output->crtc_mask = (1 << 0) | (1 << 1);
- intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL);
+ if (ret && registered)
+ ret = drm_sysfs_connector_add(connector) == 0 ? true : false;
+diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
+index da4ab4d..2fbe13a 100644
+--- a/drivers/gpu/drm/i915/intel_tv.c
++++ b/drivers/gpu/drm/i915/intel_tv.c
+@@ -1718,6 +1718,7 @@ intel_tv_init(struct drm_device *dev)
if (!intel_output) {
-@@ -1925,88 +2075,28 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
- intel_output->ddc_bus->algo = &intel_sdvo_i2c_bit_algo;
-
- /* In defaut case sdvo lvds is false */
-- sdvo_priv->is_lvds = false;
- intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
-
-- if (sdvo_priv->caps.output_flags &
-- (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
-- if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
-- sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS0;
-- else
-- sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
--
-- encoder_type = DRM_MODE_ENCODER_TMDS;
-- connector_type = DRM_MODE_CONNECTOR_DVID;
--
-- if (intel_sdvo_get_supp_encode(intel_output,
-- &sdvo_priv->encode) &&
-- intel_sdvo_get_digital_encoding_mode(intel_output) &&
-- sdvo_priv->is_hdmi) {
-- /* enable hdmi encoding mode if supported */
-- intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI);
-- intel_sdvo_set_colorimetry(intel_output,
-- SDVO_COLORIMETRY_RGB256);
-- connector_type = DRM_MODE_CONNECTOR_HDMIA;
-- }
-- }
-- else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
-- {
-- sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
-- encoder_type = DRM_MODE_ENCODER_TVDAC;
-- connector_type = DRM_MODE_CONNECTOR_SVIDEO;
-- sdvo_priv->is_tv = true;
-- intel_output->needs_tv_clock = true;
-- }
-- else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
-- {
-- sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
-- encoder_type = DRM_MODE_ENCODER_DAC;
-- connector_type = DRM_MODE_CONNECTOR_VGA;
-- }
-- else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
-- {
-- sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
-- encoder_type = DRM_MODE_ENCODER_DAC;
-- connector_type = DRM_MODE_CONNECTOR_VGA;
-- }
-- else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0)
-- {
-- sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
-- encoder_type = DRM_MODE_ENCODER_LVDS;
-- connector_type = DRM_MODE_CONNECTOR_LVDS;
-- sdvo_priv->is_lvds = true;
-- }
-- else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
-- {
-- sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
-- encoder_type = DRM_MODE_ENCODER_LVDS;
-- connector_type = DRM_MODE_CONNECTOR_LVDS;
-- sdvo_priv->is_lvds = true;
-- }
-- else
-- {
-- unsigned char bytes[2];
--
-- sdvo_priv->controlled_output = 0;
-- memcpy (bytes, &sdvo_priv->caps.output_flags, 2);
-- DRM_DEBUG_KMS(I915_SDVO,
-- "%s: Unknown SDVO output type (0x%02x%02x)\n",
-- SDVO_NAME(sdvo_priv),
-- bytes[0], bytes[1]);
-- encoder_type = DRM_MODE_ENCODER_NONE;
-- connector_type = DRM_MODE_CONNECTOR_Unknown;
-+ if (intel_sdvo_output_setup(intel_output,
-+ sdvo_priv->caps.output_flags) != true) {
-+ DRM_DEBUG("SDVO output failed to setup on SDVO%c\n",
-+ output_device == SDVOB ? 'B' : 'C');
- goto err_i2c;
+ return;
}
-
+
connector = &intel_output->base;
- drm_connector_init(dev, connector, &intel_sdvo_connector_funcs,
-- connector_type);
-+ connector->connector_type);
-+
- drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs);
- connector->interlace_allowed = 0;
- connector->doublescan_allowed = 0;
- connector->display_info.subpixel_order = SubPixelHorizontalRGB;
-
-- drm_encoder_init(dev, &intel_output->enc, &intel_sdvo_enc_funcs, encoder_type);
-+ drm_encoder_init(dev, &intel_output->enc,
-+ &intel_sdvo_enc_funcs, intel_output->enc.encoder_type);
-+
- drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs);
+ drm_connector_init(dev, connector, &intel_tv_connector_funcs,
+@@ -1729,6 +1730,7 @@ intel_tv_init(struct drm_device *dev)
drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
-diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
-index a43c98e..da4ab4d 100644
---- a/drivers/gpu/drm/i915/intel_tv.c
-+++ b/drivers/gpu/drm/i915/intel_tv.c
-@@ -1490,6 +1490,27 @@ static struct input_res {
- {"1920x1080", 1920, 1080},
- };
-
-+/*
-+ * Chose preferred mode according to line number of TV format
-+ */
-+static void
-+intel_tv_chose_preferred_modes(struct drm_connector *connector,
-+ struct drm_display_mode *mode_ptr)
-+{
-+ struct intel_output *intel_output = to_intel_output(connector);
-+ const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
-+
-+ if (tv_mode->nbr_end < 480 && mode_ptr->vdisplay == 480)
-+ mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+ else if (tv_mode->nbr_end > 480) {
-+ if (tv_mode->progressive == true && tv_mode->nbr_end < 720) {
-+ if (mode_ptr->vdisplay == 720)
-+ mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+ } else if (mode_ptr->vdisplay == 1080)
-+ mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+ }
-+}
-+
- /**
- * Stub get_modes function.
- *
-@@ -1544,6 +1565,7 @@ intel_tv_get_modes(struct drm_connector *connector)
- mode_ptr->clock = (int) tmp;
-
- mode_ptr->type = DRM_MODE_TYPE_DRIVER;
-+ intel_tv_chose_preferred_modes(connector, mode_ptr);
- drm_mode_probed_add(connector, mode_ptr);
- count++;
- }
+ tv_priv = (struct intel_tv_priv *)(intel_output + 1);
+ intel_output->type = INTEL_OUTPUT_TVOUT;
++ intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT);
+ intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1));
+ intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT);
+ intel_output->dev_priv = tv_priv;
drm-nouveau.patch:
drivers/gpu/drm/Kconfig | 44
drivers/gpu/drm/Makefile | 2
drivers/gpu/drm/drm_bufs.c | 28
drivers/gpu/drm/i2c/Makefile | 4
drivers/gpu/drm/i2c/ch7006_drv.c | 529
drivers/gpu/drm/i2c/ch7006_mode.c | 473
drivers/gpu/drm/i2c/ch7006_priv.h | 340
drivers/gpu/drm/nouveau/Makefile | 27
drivers/gpu/drm/nouveau/nouveau_backlight.c | 155
drivers/gpu/drm/nouveau/nouveau_bios.c | 5190 ++++++
drivers/gpu/drm/nouveau/nouveau_bios.h | 235
drivers/gpu/drm/nouveau/nouveau_bo.c | 620
drivers/gpu/drm/nouveau/nouveau_calc.c | 626
drivers/gpu/drm/nouveau/nouveau_channel.c | 518
drivers/gpu/drm/nouveau/nouveau_connector.c | 628
drivers/gpu/drm/nouveau/nouveau_connector.h | 55
drivers/gpu/drm/nouveau/nouveau_crtc.h | 92
drivers/gpu/drm/nouveau/nouveau_display.c | 115
drivers/gpu/drm/nouveau/nouveau_dma.c | 206
drivers/gpu/drm/nouveau/nouveau_dma.h | 148
drivers/gpu/drm/nouveau/nouveau_drv.c | 374
drivers/gpu/drm/nouveau/nouveau_drv.h | 1182 +
drivers/gpu/drm/nouveau/nouveau_encoder.h | 64
drivers/gpu/drm/nouveau/nouveau_fb.h | 47
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 933 +
drivers/gpu/drm/nouveau/nouveau_fbcon.h | 49
drivers/gpu/drm/nouveau/nouveau_fence.c | 261
drivers/gpu/drm/nouveau/nouveau_gem.c | 936 +
drivers/gpu/drm/nouveau/nouveau_hw.c | 1077 +
drivers/gpu/drm/nouveau/nouveau_hw.h | 441
drivers/gpu/drm/nouveau/nouveau_i2c.c | 256
drivers/gpu/drm/nouveau/nouveau_i2c.h | 45
drivers/gpu/drm/nouveau/nouveau_ioc32.c | 72
drivers/gpu/drm/nouveau/nouveau_irq.c | 674
drivers/gpu/drm/nouveau/nouveau_mem.c | 565
drivers/gpu/drm/nouveau/nouveau_notifier.c | 194
drivers/gpu/drm/nouveau/nouveau_object.c | 1276 +
drivers/gpu/drm/nouveau/nouveau_reg.h | 834 +
drivers/gpu/drm/nouveau/nouveau_sgdma.c | 317
drivers/gpu/drm/nouveau/nouveau_state.c | 826 +
drivers/gpu/drm/nouveau/nouveau_swmthd.h | 33
drivers/gpu/drm/nouveau/nouveau_ttm.c | 131
drivers/gpu/drm/nouveau/nv04_crtc.c | 1018 +
drivers/gpu/drm/nouveau/nv04_cursor.c | 70
drivers/gpu/drm/nouveau/nv04_dac.c | 525
drivers/gpu/drm/nouveau/nv04_dfp.c | 611
drivers/gpu/drm/nouveau/nv04_display.c | 291
drivers/gpu/drm/nouveau/nv04_fb.c | 21
drivers/gpu/drm/nouveau/nv04_fbcon.c | 292
drivers/gpu/drm/nouveau/nv04_fifo.c | 295
drivers/gpu/drm/nouveau/nv04_graph.c | 583
drivers/gpu/drm/nouveau/nv04_instmem.c | 207
drivers/gpu/drm/nouveau/nv04_mc.c | 20
drivers/gpu/drm/nouveau/nv04_timer.c | 51
drivers/gpu/drm/nouveau/nv04_tv.c | 304
drivers/gpu/drm/nouveau/nv10_fb.c | 24
drivers/gpu/drm/nouveau/nv10_fifo.c | 177
drivers/gpu/drm/nouveau/nv10_graph.c | 945 +
drivers/gpu/drm/nouveau/nv17_tv.c | 660
drivers/gpu/drm/nouveau/nv17_tv.h | 156
drivers/gpu/drm/nouveau/nv17_tv_modes.c | 582
drivers/gpu/drm/nouveau/nv20_graph.c | 784
drivers/gpu/drm/nouveau/nv40_fb.c | 62
drivers/gpu/drm/nouveau/nv40_fifo.c | 223
drivers/gpu/drm/nouveau/nv40_graph.c | 2203 ++
drivers/gpu/drm/nouveau/nv40_mc.c | 38
drivers/gpu/drm/nouveau/nv50_crtc.c | 815 +
drivers/gpu/drm/nouveau/nv50_cursor.c | 151
drivers/gpu/drm/nouveau/nv50_dac.c | 299
drivers/gpu/drm/nouveau/nv50_display.c | 855 +
drivers/gpu/drm/nouveau/nv50_display.h | 46
drivers/gpu/drm/nouveau/nv50_evo.h | 113
drivers/gpu/drm/nouveau/nv50_fbcon.c | 256
drivers/gpu/drm/nouveau/nv50_fifo.c | 475
drivers/gpu/drm/nouveau/nv50_graph.c | 437
drivers/gpu/drm/nouveau/nv50_grctx.h |22284 ++++++++++++++++++++++++++++
drivers/gpu/drm/nouveau/nv50_instmem.c | 499
drivers/gpu/drm/nouveau/nv50_mc.c | 40
drivers/gpu/drm/nouveau/nv50_sor.c | 253
drivers/gpu/drm/nouveau/nvreg.h | 535
drivers/gpu/drm/ttm/ttm_bo.c | 4
include/drm/Kbuild | 1
include/drm/drmP.h | 2
include/drm/i2c/ch7006.h | 86
include/drm/nouveau_drm.h | 216
85 files changed, 58110 insertions(+), 21 deletions(-)
View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.8.6.15 -r 1.8.6.16 drm-nouveau.patchIndex: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.8.6.15
retrieving revision 1.8.6.16
diff -u -p -r1.8.6.15 -r1.8.6.16
--- drm-nouveau.patch 11 Aug 2009 18:55:08 -0000 1.8.6.15
+++ drm-nouveau.patch 26 Aug 2009 19:58:47 -0000 1.8.6.16
@@ -1,8 +1,8 @@
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
-index 39b393d..5ea10e5 100644
+index 39b393d..49b21cc 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
-@@ -143,3 +143,33 @@ config DRM_SAVAGE
+@@ -143,3 +143,47 @@ 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.
@@ -36,15 +36,30 @@ index 39b393d..5ea10e5 100644
+ Say Y here if you want to control the backlight of your display
+ (e.g. a laptop panel).
+
++menu "I2C encoder or helper chips"
++ depends on DRM
++
++config DRM_I2C_CH7006
++ tristate "Chrontel ch7006 TV encoder"
++ default m if DRM_NOUVEAU
++ help
++ Support for Chrontel ch7006 and similar TV encoders, found
++ on some nVidia video cards.
++
++ This driver is currently only useful if you're also using
++ the nouveau driver.
++
++endmenu
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
-index fe23f29..4c6a38d 100644
+index 5f0aec4..f0ef455 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
-@@ -27,3 +27,4 @@ obj-$(CONFIG_DRM_I915) += i915/
+@@ -27,3 +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/
++obj-y += i2c/
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 6246e3f..436e2fe 100644
--- a/drivers/gpu/drm/drm_bufs.c
@@ -103,9 +118,1379 @@ index 6246e3f..436e2fe 100644
(map->type == _DRM_SHM));
if (ret) {
if (map->type == _DRM_REGISTERS)
+diff --git a/drivers/gpu/drm/i2c/Makefile b/drivers/gpu/drm/i2c/Makefile
+new file mode 100644
+index 0000000..6d2abaf
+--- /dev/null
++++ b/drivers/gpu/drm/i2c/Makefile
+@@ -0,0 +1,4 @@
++ccflags-y := -Iinclude/drm
++
++ch7006-y := ch7006_drv.o ch7006_mode.o
++obj-$(CONFIG_DRM_I2C_CH7006) += ch7006.o
+diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
+new file mode 100644
+index 0000000..47421ba
+--- /dev/null
++++ b/drivers/gpu/drm/i2c/ch7006_drv.c
+@@ -0,0 +1,529 @@
++/*
++ * Copyright (C) 2009 Francisco Jerez.
++ * All Rights Reserved.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial
++ * portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++#include "ch7006_priv.h"
++
++/* DRM encoder functions */
++
++static void ch7006_encoder_set_config(struct drm_encoder *encoder,
++ void *params)
++{
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++
++ priv->params = params;
++}
++
++static void ch7006_encoder_destroy(struct drm_encoder *encoder)
++{
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++
++ drm_property_destroy(encoder->dev, priv->scale_property);
++
++ kfree(priv);
++ to_encoder_slave(encoder)->slave_priv = NULL;
++
++ drm_i2c_encoder_destroy(encoder);
++}
++
++static void ch7006_encoder_dpms(struct drm_encoder *encoder, int mode)
++{
++ struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++ struct ch7006_state *state = &priv->state;
++
++ ch7006_dbg(client, "\n");
++
++ if (mode == priv->last_dpms)
++ return;
++ priv->last_dpms = mode;
++
++ ch7006_setup_power_state(encoder);
++
++ ch7006_load_reg(client, state, CH7006_POWER);
++}
++
++static void ch7006_encoder_save(struct drm_encoder *encoder)
++{
++ struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++
++ ch7006_dbg(client, "\n");
++
++ ch7006_state_save(client, &priv->saved_state);
++}
++
++static void ch7006_encoder_restore(struct drm_encoder *encoder)
++{
++ struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++
++ ch7006_dbg(client, "\n");
++
++ ch7006_state_load(client, &priv->saved_state);
++}
++
++static bool ch7006_encoder_mode_fixup(struct drm_encoder *encoder,
++ struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++
++ /* The ch7006 is painfully picky with the input timings so no
++ * custom modes for now... */
++
++ priv->mode = ch7006_lookup_mode(encoder, mode);
++
++ return !!priv->mode;
++}
++
++static int ch7006_encoder_mode_valid(struct drm_encoder *encoder,
++ struct drm_display_mode *mode)
++{
++ if (ch7006_lookup_mode(encoder, mode))
++ return MODE_OK;
++ else
++ return MODE_BAD;
++}
++
++static void ch7006_encoder_mode_set(struct drm_encoder *encoder,
++ struct drm_display_mode *drm_mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
++ struct ch7006_priv *priv = to_ch7006_priv(encoder);
++ struct ch7006_encoder_params *params = priv->params;
++ struct ch7006_state *state = &priv->state;
++ uint8_t *regs = state->regs;
++ struct ch7006_mode *mode = priv->mode;
++ struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
++ int start_active;
++
++ ch7006_dbg(client, "\n");
++
++ regs[CH7006_DISPMODE] = norm->dispmode | mode->dispmode;
++ regs[CH7006_BWIDTH] = 0;
++ regs[CH7006_INPUT_FORMAT] = bitf(CH7006_INPUT_FORMAT_FORMAT,
[...14498 lines suppressed...]
++#define NV_PRAMDAC_TV_VSYNC_DELAY 0x00680728
++#define NV_PRAMDAC_TV_HTOTAL 0x0068072c
++#define NV_PRAMDAC_TV_HSKEW 0x00680730
++#define NV_PRAMDAC_TV_HSYNC_DELAY 0x00680734
++#define NV_PRAMDAC_TV_HSYNC_DELAY2 0x00680738
++
++#define NV_PRAMDAC_TV_SETUP 0x00680700
++
+#define NV_PRAMDAC_FP_VDISPLAY_END 0x00680800
+#define NV_PRAMDAC_FP_VTOTAL 0x00680804
+#define NV_PRAMDAC_FP_VCRTC 0x00680808
@@ -54217,6 +58206,7 @@ index 0000000..90623b0
+# define NV_PRAMDAC_FP_TG_CONTROL_WIDTH_12 (1 << 24)
+# define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_POS (1 << 28)
+# define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_DISABLE (2 << 28)
++#define NV_PRAMDAC_FP_MARGIN_COLOR 0x0068084c
+#define NV_PRAMDAC_850 0x00680850
+#define NV_PRAMDAC_85C 0x0068085c
+#define NV_PRAMDAC_FP_DEBUG_0 0x00680880
@@ -54242,12 +58232,16 @@ index 0000000..90623b0
+# define NV_PRAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE (1 << 16)
+#define NV_PRAMDAC_FP_TMDS_DATA 0x006808b4
+
++#define NV_PRAMDAC_8C0 0x006808c0
++
+/* Some kind of switch */
+#define NV_PRAMDAC_900 0x00680900
+#define NV_PRAMDAC_A20 0x00680A20
+#define NV_PRAMDAC_A24 0x00680A24
+#define NV_PRAMDAC_A34 0x00680A34
+
++#define NV_PRAMDAC_CTV 0x00680c00
++
+/* names fabricated from NV_USER_DAC info */
+#define NV_PRMDIO_PIXEL_MASK 0x006813c6
+# define NV_PRMDIO_PIXEL_MASK_MASK 0xff
@@ -54335,10 +58329,10 @@ index 0000000..90623b0
+
+#endif
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
-index 6538d42..ebc9532 100644
+index 87c0625..863ac5e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
-@@ -89,6 +89,7 @@ int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible)
+@@ -123,6 +123,7 @@ int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible)
}
return 0;
}
@@ -54346,7 +58340,7 @@ index 6538d42..ebc9532 100644
static void ttm_bo_add_to_lru(struct ttm_buffer_object *bo)
{
-@@ -843,6 +844,7 @@ int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait)
+@@ -883,6 +884,7 @@ int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait)
return ret;
}
@@ -54354,7 +58348,7 @@ index 6538d42..ebc9532 100644
int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
uint32_t proposed_placement,
-@@ -1628,12 +1630,14 @@ int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait)
+@@ -1722,12 +1724,14 @@ int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait)
ttm_bo_unreserve(bo);
return ret;
}
@@ -54379,10 +58373,10 @@ index b940fdf..cfa6af4 100644
unifdef-y += via_drm.h
+unifdef-y += nouveau_drm.h
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 45b67d9..46e72e9 100644
+index e0f1c1f..84e2fa6 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
-@@ -1216,6 +1216,8 @@ extern void drm_idlelock_release(struct drm_lock_data *lock_data);
+@@ -1240,6 +1240,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) */
@@ -54391,12 +58385,104 @@ index 45b67d9..46e72e9 100644
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, resource_size_t offset,
+diff --git a/include/drm/i2c/ch7006.h b/include/drm/i2c/ch7006.h
+new file mode 100644
+index 0000000..8390b43
+--- /dev/null
++++ b/include/drm/i2c/ch7006.h
+@@ -0,0 +1,86 @@
++/*
++ * Copyright (C) 2009 Francisco Jerez.
++ * All Rights Reserved.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial
++ * portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++#ifndef __DRM_I2C_CH7006_H__
++#define __DRM_I2C_CH7006_H__
++
++/**
++ * struct ch7006_encoder_params
++ *
++ * Describes how the ch7006 is wired up with the GPU. It should be
++ * used as the @params parameter of its @set_config method.
++ *
++ * See "http://www.chrontel.com/pdf/7006.pdf" for their precise
++ * meaning.
++ */
++struct ch7006_encoder_params {
++ enum {
++ CH7006_FORMAT_RGB16 = 0,
++ CH7006_FORMAT_YCrCb24m16,
++ CH7006_FORMAT_RGB24m16,
++ CH7006_FORMAT_RGB15,
++ CH7006_FORMAT_RGB24m12C,
++ CH7006_FORMAT_RGB24m12I,
++ CH7006_FORMAT_RGB24m8,
++ CH7006_FORMAT_RGB16m8,
++ CH7006_FORMAT_RGB15m8,
++ CH7006_FORMAT_YCrCb24m8,
++ } input_format;
++
++ enum {
++ CH7006_CLOCK_SLAVE = 0,
++ CH7006_CLOCK_MASTER,
++ } clock_mode;
++
++ enum {
++ CH7006_CLOCK_EDGE_NEG = 0,
++ CH7006_CLOCK_EDGE_POS,
++ } clock_edge;
++
++ int xcm, pcm;
++
++ enum {
++ CH7006_SYNC_SLAVE = 0,
++ CH7006_SYNC_MASTER,
++ } sync_direction;
++
++ enum {
++ CH7006_SYNC_SEPARATED = 0,
++ CH7006_SYNC_EMBEDDED,
++ } sync_encoding;
++
++ enum {
++ CH7006_POUT_1_8V = 0,
++ CH7006_POUT_3_3V,
++ } pout_level;
++
++ enum {
++ CH7006_ACTIVE_HSYNC = 0,
++ CH7006_ACTIVE_DSTART,
++ } active_detect;
++};
++
++#endif
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
new file mode 100644
-index 0000000..3e52b24
+index 0000000..2050357
--- /dev/null
+++ b/include/drm/nouveau_drm.h
-@@ -0,0 +1,214 @@
+@@ -0,0 +1,216 @@
+/*
+ * Copyright 2005 Stephane Marchesin.
+ * All Rights Reserved.
@@ -54549,9 +58635,11 @@ index 0000000..3e52b24
+ uint32_t offset;
+ uint32_t nr_buffers;
+ uint32_t nr_relocs;
-+ uint32_t pad0;
++ uint32_t nr_dwords;
+ uint64_t buffers;
+ uint64_t relocs;
++ uint32_t suffix0;
++ uint32_t suffix1;
+};
+
+struct drm_nouveau_gem_pin {
drm-page-flip.patch:
drivers/gpu/drm/drm_crtc.c | 169 +++++++++++++++++++++++++++++++-
drivers/gpu/drm/drm_crtc_helper.c | 12 ++
drivers/gpu/drm/drm_drv.c | 1
drivers/gpu/drm/drm_fops.c | 68 ++++++++++++
drivers/gpu/drm/drm_irq.c | 43 ++++++++
drivers/gpu/drm/i915/i915_drv.c | 1
drivers/gpu/drm/i915/intel_display.c | 24 +++-
drivers/gpu/drm/nouveau/nv04_crtc.c | 2
drivers/gpu/drm/nouveau/nv50_crtc.c | 2
drivers/gpu/drm/radeon/radeon_display.c | 3
include/drm/drm.h | 25 ++++
include/drm/drmP.h | 32 ++++++
include/drm/drm_crtc.h | 27 +++++
include/drm/drm_crtc_helper.h | 4
include/drm/drm_mode.h | 16 +++
15 files changed, 415 insertions(+), 14 deletions(-)
Index: drm-page-flip.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-page-flip.patch,v
retrieving revision 1.2.6.3
retrieving revision 1.2.6.4
diff -u -p -r1.2.6.3 -r1.2.6.4
--- drm-page-flip.patch 13 Aug 2009 18:13:04 -0000 1.2.6.3
+++ drm-page-flip.patch 26 Aug 2009 19:58:48 -0000 1.2.6.4
@@ -1,34 +1,6 @@
-commit f2884697ef0e0064a189d5baacf565d6742687f1
-Author: Kristian Høgsberg <krh at hinata.local>
-Date: Mon Jul 13 09:07:19 2009 -0400
-
- Add modesetting pageflip ioctl and corresponding drm event
-
- This patch adds a vblank synced pageflip ioctl for to the modesetting
- family of ioctls. The ioctl takes a crtc and an fb and schedules a
- pageflip to the new fb at the next coming vertical blank event. This
- feature lets userspace implement tear-free updating of the screen contents
- with hw-guaranteed low latency page flipping.
-
- The ioctl is asynchronous in that it returns immediately and then later
- notifies the client by making an event available for reading on the drm fd.
- This lets applications add the drm fd to their main loop and handle other
- tasks while waiting for the flip to happen. The event includes the time
- of the flip, the frame counter and a 64 bit opaque token provided by
- user space in the ioctl.
-
- Based on work and suggestions from
- Jesse Barnes <jbarnes at virtuousgeek.org>,
- Jakob Bornecrantz <wallbraker at gmail.com>,
- Chris Wilson <chris at chris-wilson.co.uk>
-
- Signed-off-by: Kristian Høgsberg <krh at redhat.com>
- Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
-
-diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
-index 8fab789..f598ce0 100644
---- a/drivers/gpu/drm/drm_crtc.c
-+++ b/drivers/gpu/drm/drm_crtc.c
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc.c.pf linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc.c.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc.c 2009-08-25 09:52:41.000000000 +1000
@@ -34,6 +34,8 @@
#include "drmP.h"
#include "drm_crtc.h"
@@ -38,7 +10,7 @@ index 8fab789..f598ce0 100644
struct drm_prop_enum_list {
int type;
char *name;
-@@ -342,6 +344,34 @@ void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
+@@ -329,6 +331,34 @@ void drm_framebuffer_cleanup(struct drm_
EXPORT_SYMBOL(drm_framebuffer_cleanup);
/**
@@ -73,7 +45,7 @@ index 8fab789..f598ce0 100644
* drm_crtc_init - Initialise a new CRTC object
* @dev: DRM device
* @crtc: CRTC object to init
-@@ -352,17 +382,19 @@ EXPORT_SYMBOL(drm_framebuffer_cleanup);
+@@ -339,17 +369,19 @@ EXPORT_SYMBOL(drm_framebuffer_cleanup);
*
* Inits a new object created as base part of an driver crtc object.
*/
@@ -94,7 +66,7 @@ index 8fab789..f598ce0 100644
mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_crtc_init);
-@@ -381,6 +413,9 @@ void drm_crtc_cleanup(struct drm_crtc *crtc)
+@@ -368,6 +400,9 @@ void drm_crtc_cleanup(struct drm_crtc *c
{
struct drm_device *dev = crtc->dev;
@@ -104,7 +76,7 @@ index 8fab789..f598ce0 100644
if (crtc->gamma_store) {
kfree(crtc->gamma_store);
crtc->gamma_store = NULL;
-@@ -388,6 +423,7 @@ void drm_crtc_cleanup(struct drm_crtc *crtc)
+@@ -375,6 +410,7 @@ void drm_crtc_cleanup(struct drm_crtc *c
drm_mode_object_put(dev, &crtc->base);
list_del(&crtc->head);
@@ -112,7 +84,7 @@ index 8fab789..f598ce0 100644
dev->mode_config.num_crtc--;
}
EXPORT_SYMBOL(drm_crtc_cleanup);
-@@ -2452,3 +2488,134 @@ out:
+@@ -2478,3 +2514,134 @@ out:
mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -247,11 +219,10 @@ index 8fab789..f598ce0 100644
+
+ return ret;
+}
-diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
-index 3da9cfa..5a26bab 100644
---- a/drivers/gpu/drm/drm_crtc_helper.c
-+++ b/drivers/gpu/drm/drm_crtc_helper.c
-@@ -868,8 +868,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc_helper.c.pf linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc_helper.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc_helper.c.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_crtc_helper.c 2009-08-25 09:52:41.000000000 +1000
+@@ -874,8 +874,10 @@ int drm_crtc_helper_set_config(struct dr
old_fb = set->crtc->fb;
if (set->crtc->fb != set->fb)
set->crtc->fb = set->fb;
@@ -262,7 +233,7 @@ index 3da9cfa..5a26bab 100644
if (ret != 0)
goto fail_set_mode;
}
-@@ -1095,3 +1097,13 @@ int drm_helper_resume_force_mode(struct drm_device *dev)
+@@ -1101,3 +1103,13 @@ int drm_helper_resume_force_mode(struct
return 0;
}
EXPORT_SYMBOL(drm_helper_resume_force_mode);
@@ -276,11 +247,10 @@ index 3da9cfa..5a26bab 100644
+ return crtc_funcs->mode_set_base(crtc, x, y, old_fb);
+}
+EXPORT_SYMBOL(drm_crtc_helper_set_base);
-diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index b39d7bf..c66c993 100644
---- a/drivers/gpu/drm/drm_drv.c
-+++ b/drivers/gpu/drm/drm_drv.c
-@@ -145,6 +145,7 @@ static struct drm_ioctl_desc drm_ioctls[] = {
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_drv.c.pf linux-2.6.30.noarch/drivers/gpu/drm/drm_drv.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_drv.c.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_drv.c 2009-08-25 09:52:41.000000000 +1000
+@@ -145,6 +145,7 @@ static struct drm_ioctl_desc drm_ioctls[
DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW),
@@ -288,11 +258,10 @@ index b39d7bf..c66c993 100644
};
#define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
-diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
-index 251bc0e..dcd9c66 100644
---- a/drivers/gpu/drm/drm_fops.c
-+++ b/drivers/gpu/drm/drm_fops.c
-@@ -257,6 +257,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_fops.c.pf linux-2.6.30.noarch/drivers/gpu/drm/drm_fops.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_fops.c.pf 2009-08-25 09:35:48.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_fops.c 2009-08-25 09:52:41.000000000 +1000
+@@ -257,6 +257,8 @@ static int drm_open_helper(struct inode
INIT_LIST_HEAD(&priv->lhead);
INIT_LIST_HEAD(&priv->fbs);
@@ -301,7 +270,7 @@ index 251bc0e..dcd9c66 100644
if (dev->driver->driver_features & DRIVER_GEM)
drm_gem_open(dev, priv);
-@@ -429,6 +431,9 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -429,6 +431,9 @@ int drm_release(struct inode *inode, str
{
struct drm_file *file_priv = filp->private_data;
struct drm_device *dev = file_priv->minor->dev;
@@ -311,7 +280,7 @@ index 251bc0e..dcd9c66 100644
int retcode = 0;
lock_kernel();
-@@ -451,6 +456,19 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -451,6 +456,19 @@ int drm_release(struct inode *inode, str
if (file_priv->minor->master)
drm_master_release(dev, filp);
@@ -331,7 +300,7 @@ index 251bc0e..dcd9c66 100644
if (dev->driver->driver_features & DRIVER_GEM)
drm_gem_release(dev, file_priv);
-@@ -544,9 +562,55 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -544,9 +562,55 @@ int drm_release(struct inode *inode, str
}
EXPORT_SYMBOL(drm_release);
@@ -389,10 +358,9 @@ index 251bc0e..dcd9c66 100644
+ return mask;
}
EXPORT_SYMBOL(drm_poll);
-diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
-index b4a3dbc..c7a17f6 100644
---- a/drivers/gpu/drm/drm_irq.c
-+++ b/drivers/gpu/drm/drm_irq.c
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.pf linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.pf 2009-08-25 09:35:48.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c 2009-08-25 09:52:41.000000000 +1000
@@ -34,6 +34,7 @@
*/
@@ -401,7 +369,7 @@ index b4a3dbc..c7a17f6 100644
#include <linux/interrupt.h> /* For task queue support */
-@@ -71,6 +72,44 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
+@@ -71,6 +72,44 @@ int drm_irq_by_busid(struct drm_device *
return 0;
}
@@ -446,7 +414,7 @@ index b4a3dbc..c7a17f6 100644
static void vblank_disable_fn(unsigned long arg)
{
struct drm_device *dev = (struct drm_device *)arg;
-@@ -161,6 +200,8 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
+@@ -161,6 +200,8 @@ int drm_vblank_init(struct drm_device *d
atomic_set(&dev->vblank_refcount[i], 0);
}
@@ -455,7 +423,7 @@ index b4a3dbc..c7a17f6 100644
dev->vblank_disable_allowed = 0;
return 0;
-@@ -626,5 +667,7 @@ void drm_handle_vblank(struct drm_device *dev, int crtc)
+@@ -626,5 +667,7 @@ void drm_handle_vblank(struct drm_device
{
atomic_inc(&dev->_vblank_count[crtc]);
DRM_WAKEUP(&dev->vbl_queue[crtc]);
@@ -463,10 +431,9 @@ index b4a3dbc..c7a17f6 100644
}
EXPORT_SYMBOL(drm_handle_vblank);
+
-diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
-index fc4b68a..322b0f2 100644
---- a/drivers/gpu/drm/i915/i915_drv.c
-+++ b/drivers/gpu/drm/i915/i915_drv.c
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.c.pf linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.c.pf 2009-08-25 09:35:48.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.c 2009-08-25 09:52:41.000000000 +1000
@@ -203,6 +203,7 @@ static struct drm_driver driver = {
.mmap = drm_gem_mmap,
.poll = drm_poll,
@@ -475,11 +442,10 @@ index fc4b68a..322b0f2 100644
#ifdef CONFIG_COMPAT
.compat_ioctl = i915_compat_ioctl,
#endif
-diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index 508838e..697c31a 100644
---- a/drivers/gpu/drm/i915/intel_display.c
-+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -863,6 +863,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.pf linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.pf 2009-08-25 09:35:48.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c 2009-08-25 09:52:41.000000000 +1000
+@@ -917,6 +917,8 @@ intel_pipe_set_base(struct drm_crtc *crt
u32 dspcntr, alignment;
int ret;
@@ -488,7 +454,7 @@ index 508838e..697c31a 100644
/* no fb bound */
if (!crtc->fb) {
DRM_DEBUG("No FB bound\n");
-@@ -898,17 +900,14 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
+@@ -952,17 +954,14 @@ intel_pipe_set_base(struct drm_crtc *crt
BUG();
}
@@ -506,7 +472,7 @@ index 508838e..697c31a 100644
return ret;
}
-@@ -944,7 +943,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
+@@ -998,7 +997,6 @@ intel_pipe_set_base(struct drm_crtc *crt
default:
DRM_ERROR("Unknown color depth\n");
i915_gem_object_unpin(obj);
@@ -514,7 +480,7 @@ index 508838e..697c31a 100644
return -EINVAL;
}
if (IS_I965G(dev)) {
-@@ -972,13 +970,11 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
+@@ -1026,13 +1024,11 @@ intel_pipe_set_base(struct drm_crtc *crt
I915_READ(dspbase);
}
@@ -529,7 +495,7 @@ index 508838e..697c31a 100644
if (!dev->primary->master)
return 0;
-@@ -2364,7 +2360,9 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
+@@ -2605,7 +2601,9 @@ static int intel_crtc_mode_set(struct dr
I915_WRITE(dspcntr_reg, dspcntr);
/* Flush the plane changes */
@@ -539,7 +505,7 @@ index 508838e..697c31a 100644
intel_update_watermarks(dev);
-@@ -2840,6 +2838,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
+@@ -3081,6 +3079,7 @@ static const struct drm_crtc_funcs intel
.gamma_set = intel_crtc_gamma_set,
.set_config = drm_crtc_helper_set_config,
.destroy = intel_crtc_destroy,
@@ -547,7 +513,7 @@ index 508838e..697c31a 100644
};
-@@ -2852,7 +2851,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
+@@ -3093,7 +3092,7 @@ static void intel_crtc_init(struct drm_d
if (intel_crtc == NULL)
return;
@@ -556,7 +522,7 @@ index 508838e..697c31a 100644
drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256);
intel_crtc->pipe = pipe;
-@@ -3071,9 +3070,18 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
+@@ -3327,9 +3326,18 @@ static int intel_user_framebuffer_create
return drm_gem_handle_create(file_priv, object, handle);
}
@@ -575,11 +541,34 @@ index 508838e..697c31a 100644
};
int intel_framebuffer_create(struct drm_device *dev,
-diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
-index 3efcf1a..4d73f0b 100644
---- a/drivers/gpu/drm/radeon/radeon_display.c
-+++ b/drivers/gpu/drm/radeon/radeon_display.c
-@@ -171,6 +171,7 @@ static const struct drm_crtc_funcs radeon_crtc_funcs = {
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv04_crtc.c.pf linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv04_crtc.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv04_crtc.c.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv04_crtc.c 2009-08-25 09:52:41.000000000 +1000
+@@ -1122,7 +1122,7 @@ nv04_crtc_create(struct drm_device *dev,
+ nv_crtc->mode_set.connectors = (struct drm_connector **)(nv_crtc + 1);
+ nv_crtc->mode_set.num_connectors = 0;
+
+- drm_crtc_init(dev, &nv_crtc->base, &nv04_crtc_funcs);
++ drm_crtc_init(dev, &nv_crtc->base, crtc_num, &nv04_crtc_funcs);
+ drm_crtc_helper_add(&nv_crtc->base, &nv04_crtc_helper_funcs);
+ drm_mode_crtc_set_gamma_size(&nv_crtc->base, 256);
+
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv50_crtc.c.pf linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv50_crtc.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv50_crtc.c.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/nouveau/nv50_crtc.c 2009-08-25 09:52:41.000000000 +1000
+@@ -810,7 +810,7 @@ nv50_crtc_create(struct drm_device *dev,
+ crtc->mode_set.connectors = (struct drm_connector **)(crtc + 1);
+ crtc->mode_set.num_connectors = 0;
+
+- drm_crtc_init(dev, &crtc->base, &nv50_crtc_funcs);
++ drm_crtc_init(dev, &crtc->base, index, &nv50_crtc_funcs);
+ drm_crtc_helper_add(&crtc->base, &nv50_crtc_helper_funcs);
+ drm_mode_crtc_set_gamma_size(&crtc->base, 256);
+
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_display.c.pf linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_display.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_display.c.pf 2009-08-25 09:35:49.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_display.c 2009-08-25 09:52:41.000000000 +1000
+@@ -171,6 +171,7 @@ static const struct drm_crtc_funcs radeo
.gamma_set = radeon_crtc_gamma_set,
.set_config = drm_crtc_helper_set_config,
.destroy = radeon_crtc_destroy,
@@ -587,7 +576,7 @@ index 3efcf1a..4d73f0b 100644
};
static void radeon_crtc_init(struct drm_device *dev, int index)
-@@ -183,7 +184,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
+@@ -183,7 +184,7 @@ static void radeon_crtc_init(struct drm_
if (radeon_crtc == NULL)
return;
@@ -596,131 +585,21 @@ index 3efcf1a..4d73f0b 100644
drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
radeon_crtc->crtc_id = index;
-diff --git a/include/drm/drm.h b/include/drm/drm.h
-index 7cb50bd..1920323 100644
---- a/include/drm/drm.h
-+++ b/include/drm/drm.h
-@@ -686,6 +686,7 @@ struct drm_gem_open {
- #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
- #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
- #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
-+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOW( 0xB0, struct drm_mode_page_flip)
-
- /**
- * Device specific ioctls should only be in their respective headers
-@@ -698,6 +699,30 @@ struct drm_gem_open {
- #define DRM_COMMAND_BASE 0x40
- #define DRM_COMMAND_END 0xA0
-
-+/**
-+ * Header for events written back to userspace on the drm fd. The
-+ * type defines the type of event, the length specifies the total
-+ * length of the event (including the header), and user_data is
-+ * typically a 64 bit value passed with the ioctl that triggered the
-+ * event. A read on the drm fd will always only return complete
-+ * events, that is, if for example the read buffer is 100 bytes, and
-+ * there are two 64 byte events pending, only one will be returned.
-+ */
-+struct drm_event {
-+ __u32 type;
-+ __u32 length;
-+};
-+
-+#define DRM_EVENT_MODE_PAGE_FLIP 0x01
-+
-+struct drm_event_page_flip {
-+ struct drm_event base;
-+ __u64 user_data;
-+ __u32 tv_sec;
-+ __u32 tv_usec;
-+ __u32 frame;
-+};
-+
- /* typedef area */
- #ifndef __KERNEL__
- typedef struct drm_clip_rect drm_clip_rect_t;
-diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 45b67d9..4ff43ab 100644
---- a/include/drm/drmP.h
-+++ b/include/drm/drmP.h
-@@ -402,6 +402,14 @@ struct drm_buf_entry {
- struct drm_freelist freelist;
- };
-
-+/* Event queued up for userspace to read */
-+struct drm_pending_event {
-+ struct drm_event *event;
-+ struct list_head link;
-+ struct drm_file *file_priv;
-+ void (*destroy) (struct drm_pending_event *event);
-+};
-+
- /** File private data */
- struct drm_file {
- int authenticated;
-@@ -425,6 +433,9 @@ struct drm_file {
- struct drm_master *master; /* master this node is currently associated with
- N.B. not always minor->master */
- struct list_head fbs;
-+
-+ wait_queue_head_t event_wait;
-+ struct list_head event_list;
- };
-
- /** Wait queue */
-@@ -873,6 +884,16 @@ struct drm_minor {
- struct drm_mode_group mode_group;
- };
-
-+struct drm_pending_flip {
-+ struct drm_pending_event pending_event;
-+ struct drm_framebuffer *old_fb;
-+ struct drm_crtc *crtc;
-+ u32 frame;
-+ int pipe;
-+ struct list_head link;
-+ struct drm_event_page_flip event;
-+};
-+
- /**
- * DRM device structure. This structure represent a complete card that
- * may contain multiple heads.
-@@ -972,6 +993,13 @@ struct drm_device {
-
- u32 max_vblank_count; /**< size of vblank counter register */
+diff -up linux-2.6.30.noarch/include/drm/drm_crtc_helper.h.pf linux-2.6.30.noarch/include/drm/drm_crtc_helper.h
+--- linux-2.6.30.noarch/include/drm/drm_crtc_helper.h.pf 2009-06-10 13:05:27.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drm_crtc_helper.h 2009-08-25 09:52:41.000000000 +1000
+@@ -123,4 +123,8 @@ static inline void drm_connector_helper_
+ }
-+ struct work_struct flip_work;
+ extern int drm_helper_resume_force_mode(struct drm_device *dev);
+
-+ /**
-+ * List of objects waiting on flip completion
-+ */
-+ struct list_head flip_list;
++extern int drm_crtc_helper_set_base(struct drm_crtc *crtc, int x, int y,
++ struct drm_framebuffer *old_fb);
+
- /*@} */
- cycles_t ctx_start;
- cycles_t lck_start;
-@@ -1108,6 +1136,8 @@ extern int drm_lastclose(struct drm_device *dev);
- extern int drm_open(struct inode *inode, struct file *filp);
- extern int drm_stub_open(struct inode *inode, struct file *filp);
- extern int drm_fasync(int fd, struct file *filp, int on);
-+extern ssize_t drm_read(struct file *filp, char __user *buffer,
-+ size_t count, loff_t *offset);
- extern int drm_release(struct inode *inode, struct file *filp);
-
- /* Mapping support (drm_vm.h) */
-@@ -1274,6 +1304,8 @@ extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
- extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
- extern int drm_modeset_ctl(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
-+extern void drm_finish_pending_flip(struct drm_device *dev,
-+ struct drm_pending_flip *f, u32 frame);
-
- /* AGP/GART support (drm_agpsupport.h) */
- extern struct drm_agp_head *drm_agp_init(struct drm_device *dev);
-diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
-index 7300fb8..0b5dc47 100644
---- a/include/drm/drm_crtc.h
-+++ b/include/drm/drm_crtc.h
+ #endif
+diff -up linux-2.6.30.noarch/include/drm/drm_crtc.h.pf linux-2.6.30.noarch/include/drm/drm_crtc.h
+--- linux-2.6.30.noarch/include/drm/drm_crtc.h.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drm_crtc.h 2009-08-25 09:52:41.000000000 +1000
@@ -238,6 +238,12 @@ struct drm_display_info {
};
@@ -791,7 +670,7 @@ index 7300fb8..0b5dc47 100644
/* if you are using the helper */
void *helper_private;
};
-@@ -589,6 +613,7 @@ struct drm_mode_config {
+@@ -595,6 +619,7 @@ struct drm_mode_config {
extern void drm_crtc_init(struct drm_device *dev,
struct drm_crtc *crtc,
@@ -799,31 +678,61 @@ index 7300fb8..0b5dc47 100644
const struct drm_crtc_funcs *funcs);
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
-@@ -736,4 +761,6 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
+@@ -742,6 +767,8 @@ extern int drm_mode_gamma_get_ioctl(stru
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv);
extern bool drm_detect_hdmi_monitor(struct edid *edid);
+extern int drm_mode_page_flip_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv);
- #endif /* __DRM_CRTC_H__ */
-diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
-index 6769ff6..dd10566 100644
---- a/include/drm/drm_crtc_helper.h
-+++ b/include/drm/drm_crtc_helper.h
-@@ -123,4 +123,8 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
- }
+ extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
+ int hdisplay, int vdisplay, int vrefresh,
+ bool reduced, bool interlaced);
+diff -up linux-2.6.30.noarch/include/drm/drm.h.pf linux-2.6.30.noarch/include/drm/drm.h
+--- linux-2.6.30.noarch/include/drm/drm.h.pf 2009-06-10 13:05:27.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drm.h 2009-08-25 09:52:41.000000000 +1000
+@@ -686,6 +686,7 @@ struct drm_gem_open {
+ #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
+ #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
+ #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOW( 0xB0, struct drm_mode_page_flip)
- extern int drm_helper_resume_force_mode(struct drm_device *dev);
+ /**
+ * Device specific ioctls should only be in their respective headers
+@@ -698,6 +699,30 @@ struct drm_gem_open {
+ #define DRM_COMMAND_BASE 0x40
+ #define DRM_COMMAND_END 0xA0
+
++/**
++ * Header for events written back to userspace on the drm fd. The
++ * type defines the type of event, the length specifies the total
++ * length of the event (including the header), and user_data is
++ * typically a 64 bit value passed with the ioctl that triggered the
++ * event. A read on the drm fd will always only return complete
++ * events, that is, if for example the read buffer is 100 bytes, and
++ * there are two 64 byte events pending, only one will be returned.
++ */
++struct drm_event {
++ __u32 type;
++ __u32 length;
++};
+
-+extern int drm_crtc_helper_set_base(struct drm_crtc *crtc, int x, int y,
-+ struct drm_framebuffer *old_fb);
++#define DRM_EVENT_MODE_PAGE_FLIP 0x01
+
- #endif
-diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
-index ae304cc..464b779 100644
---- a/include/drm/drm_mode.h
-+++ b/include/drm/drm_mode.h
-@@ -265,4 +265,20 @@ struct drm_mode_crtc_lut {
++struct drm_event_page_flip {
++ struct drm_event base;
++ __u64 user_data;
++ __u32 tv_sec;
++ __u32 tv_usec;
++ __u32 frame;
++};
++
+ /* typedef area */
+ #ifndef __KERNEL__
+ typedef struct drm_clip_rect drm_clip_rect_t;
+diff -up linux-2.6.30.noarch/include/drm/drm_mode.h.pf linux-2.6.30.noarch/include/drm/drm_mode.h
+--- linux-2.6.30.noarch/include/drm/drm_mode.h.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drm_mode.h 2009-08-25 09:52:41.000000000 +1000
+@@ -268,4 +268,20 @@ struct drm_mode_crtc_lut {
__u64 blue;
};
@@ -844,27 +753,80 @@ index ae304cc..464b779 100644
+};
+
#endif
-diff -up linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv04_crtc.c~ linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv04_crtc.c
---- linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv04_crtc.c~ 2009-07-24 19:38:36.000000000 -0400
-+++ linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv04_crtc.c 2009-07-26 18:06:06.000000000 -0400
-@@ -1014,7 +1014,7 @@ nv04_crtc_create(struct drm_device *dev,
- nv_crtc->mode_set.connectors = (struct drm_connector **)(nv_crtc + 1);
- nv_crtc->mode_set.num_connectors = 0;
+diff -up linux-2.6.30.noarch/include/drm/drmP.h.pf linux-2.6.30.noarch/include/drm/drmP.h
+--- linux-2.6.30.noarch/include/drm/drmP.h.pf 2009-08-25 09:52:20.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drmP.h 2009-08-25 09:52:41.000000000 +1000
+@@ -426,6 +426,14 @@ struct drm_buf_entry {
+ struct drm_freelist freelist;
+ };
-- drm_crtc_init(dev, &nv_crtc->base, &nv04_crtc_funcs);
-+ drm_crtc_init(dev, &nv_crtc->base, crtc_num, &nv04_crtc_funcs);
- drm_crtc_helper_add(&nv_crtc->base, &nv04_crtc_helper_funcs);
- drm_mode_crtc_set_gamma_size(&nv_crtc->base, 256);
++/* Event queued up for userspace to read */
++struct drm_pending_event {
++ struct drm_event *event;
++ struct list_head link;
++ struct drm_file *file_priv;
++ void (*destroy) (struct drm_pending_event *event);
++};
++
+ /** File private data */
+ struct drm_file {
+ int authenticated;
+@@ -449,6 +457,9 @@ struct drm_file {
+ struct drm_master *master; /* master this node is currently associated with
+ N.B. not always minor->master */
+ struct list_head fbs;
++
++ wait_queue_head_t event_wait;
++ struct list_head event_list;
+ };
-diff -up linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv50_crtc.c~ linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv50_crtc.c
---- linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv50_crtc.c~ 2009-07-24 19:38:36.000000000 -0400
-+++ linux-2.6.30.i686/drivers/gpu/drm/nouveau/nv50_crtc.c 2009-07-26 18:06:23.000000000 -0400
-@@ -796,7 +796,7 @@ nv50_crtc_create(struct drm_device *dev,
- crtc->mode_set.connectors = (struct drm_connector **)(crtc + 1);
- crtc->mode_set.num_connectors = 0;
+ /** Wait queue */
+@@ -897,6 +908,16 @@ struct drm_minor {
+ struct drm_mode_group mode_group;
+ };
-- drm_crtc_init(dev, &crtc->base, &nv50_crtc_funcs);
-+ drm_crtc_init(dev, &crtc->base, index, &nv50_crtc_funcs);
- drm_crtc_helper_add(&crtc->base, &nv50_crtc_helper_funcs);
- drm_mode_crtc_set_gamma_size(&crtc->base, 256);
++struct drm_pending_flip {
++ struct drm_pending_event pending_event;
++ struct drm_framebuffer *old_fb;
++ struct drm_crtc *crtc;
++ u32 frame;
++ int pipe;
++ struct list_head link;
++ struct drm_event_page_flip event;
++};
++
+ /**
+ * DRM device structure. This structure represent a complete card that
+ * may contain multiple heads.
+@@ -996,6 +1017,13 @@ struct drm_device {
+
+ u32 max_vblank_count; /**< size of vblank counter register */
+
++ struct work_struct flip_work;
++
++ /**
++ * List of objects waiting on flip completion
++ */
++ struct list_head flip_list;
++
+ /*@} */
+ cycles_t ctx_start;
+ cycles_t lck_start;
+@@ -1132,6 +1160,8 @@ extern int drm_lastclose(struct drm_devi
+ extern int drm_open(struct inode *inode, struct file *filp);
+ extern int drm_stub_open(struct inode *inode, struct file *filp);
+ extern int drm_fasync(int fd, struct file *filp, int on);
++extern ssize_t drm_read(struct file *filp, char __user *buffer,
++ size_t count, loff_t *offset);
+ extern int drm_release(struct inode *inode, struct file *filp);
+ /* Mapping support (drm_vm.h) */
+@@ -1300,6 +1330,8 @@ extern void drm_vblank_pre_modeset(struc
+ extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
+ extern int drm_modeset_ctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv);
++extern void drm_finish_pending_flip(struct drm_device *dev,
++ struct drm_pending_flip *f, u32 frame);
+
+ /* AGP/GART support (drm_agpsupport.h) */
+ extern struct drm_agp_head *drm_agp_init(struct drm_device *dev);
drm-vga-arb.patch:
drivers/gpu/drm/drm_irq.c | 27 +++++++++++++++++++++++++++
drivers/gpu/drm/i915/i915_dma.c | 20 ++++++++++++++++++++
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++++++++
drivers/gpu/drm/i915/intel_drv.h | 1 +
drivers/gpu/drm/radeon/r100.c | 14 ++++++++++++++
drivers/gpu/drm/radeon/radeon.h | 2 ++
drivers/gpu/drm/radeon/radeon_asic.h | 9 +++++++++
drivers/gpu/drm/radeon/radeon_device.c | 19 +++++++++++++++++++
include/drm/drmP.h | 3 +++
11 files changed, 120 insertions(+)
Index: drm-vga-arb.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-vga-arb.patch,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -p -r1.5.2.2 -r1.5.2.3
--- drm-vga-arb.patch 5 Aug 2009 23:00:15 -0000 1.5.2.2
+++ drm-vga-arb.patch 26 Aug 2009 19:58:48 -0000 1.5.2.3
@@ -1,6 +1,6 @@
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.arb linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c
---- linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c 2009-08-05 10:15:15.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.da linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/drm_irq.c 2009-08-25 09:57:03.000000000 +1000
@@ -38,6 +38,7 @@
#include <linux/interrupt.h> /* For task queue support */
@@ -56,18 +56,18 @@ diff -up linux-2.6.30.noarch/drivers/gpu
dev->driver->irq_uninstall(dev);
free_irq(dev->pdev->irq, dev);
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c.arb linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c
---- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c.arb 2009-08-05 07:03:48.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c 2009-08-05 10:15:15.000000000 +1000
-@@ -33,6 +33,7 @@
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c.da linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_dma.c 2009-08-25 09:57:03.000000000 +1000
+@@ -32,6 +32,7 @@
+ #include "intel_drv.h"
#include "i915_drm.h"
#include "i915_drv.h"
-
+#include <linux/vgaarb.h>
- #define I915_DRV "i915_drv"
/* Really want an OS-independent resettable timer. Would like to have
-@@ -984,6 +985,19 @@ static int i915_probe_agp(struct drm_dev
+ * this loop run for (eg) 3 sec, but have the timer reset every time
+@@ -979,6 +980,19 @@ static int i915_probe_agp(struct drm_dev
return 0;
}
@@ -87,7 +87,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
static int i915_load_modeset_init(struct drm_device *dev,
unsigned long prealloc_size,
unsigned long agp_size)
-@@ -1029,6 +1043,11 @@ static int i915_load_modeset_init(struct
+@@ -1024,6 +1038,11 @@ static int i915_load_modeset_init(struct
if (ret)
DRM_INFO("failed to find VBIOS tables\n");
@@ -99,7 +99,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
ret = drm_irq_install(dev);
if (ret)
goto destroy_ringbuffer;
-@@ -1278,6 +1297,7 @@ int i915_driver_unload(struct drm_device
+@@ -1284,6 +1303,7 @@ int i915_driver_unload(struct drm_device
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
drm_irq_uninstall(dev);
@@ -107,10 +107,10 @@ diff -up linux-2.6.30.noarch/drivers/gpu
}
if (dev->pdev->msi_enabled)
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h.arb linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h
---- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h 2009-08-05 10:15:15.000000000 +1000
-@@ -760,6 +760,7 @@ static inline void opregion_enable_asle(
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h.da linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_drv.h 2009-08-25 09:57:03.000000000 +1000
+@@ -761,6 +761,7 @@ static inline void opregion_enable_asle(
/* modesetting */
extern void intel_modeset_init(struct drm_device *dev);
extern void intel_modeset_cleanup(struct drm_device *dev);
@@ -118,9 +118,9 @@ diff -up linux-2.6.30.noarch/drivers/gpu
/**
* Lock test for when it's just for synchronization of ring access.
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h.arb linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h
---- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h 2009-08-05 10:15:15.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h.da linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/i915_reg.h 2009-08-25 09:57:03.000000000 +1000
@@ -30,6 +30,7 @@
* fb aperture size and the amount of pre-reserved memory.
*/
@@ -129,9 +129,9 @@ diff -up linux-2.6.30.noarch/drivers/gpu
#define INTEL_GMCH_ENABLED 0x4
#define INTEL_GMCH_MEM_MASK 0x1
#define INTEL_GMCH_MEM_64M 0x1
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.arb linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c
---- linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c 2009-08-05 10:15:15.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.da linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_display.c 2009-08-25 09:57:03.000000000 +1000
@@ -3871,3 +3871,26 @@ struct drm_encoder *intel_best_encoder(s
return &intel_output->enc;
@@ -159,19 +159,19 @@ diff -up linux-2.6.30.noarch/drivers/gpu
+ pci_write_config_word(bridge_dev, INTEL_GMCH_CTRL, gmch_ctrl);
+ return 0;
+}
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h.arb linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h
---- linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h 2009-08-05 10:15:15.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h.da linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h
+--- linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/i915/intel_drv.h 2009-08-25 09:57:03.000000000 +1000
@@ -161,4 +161,5 @@ extern int intel_framebuffer_create(stru
struct drm_mode_fb_cmd *mode_cmd,
struct drm_framebuffer **fb,
struct drm_gem_object *obj);
+
#endif /* __INTEL_DRV_H__ */
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c.arb linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c
---- linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c.arb 2009-08-05 10:14:23.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c 2009-08-05 10:15:15.000000000 +1000
-@@ -1497,6 +1497,20 @@ void r100_vram_init_sizes(struct radeon_
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c.da linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/r100.c 2009-08-25 09:57:03.000000000 +1000
+@@ -1574,6 +1574,20 @@ void r100_vram_init_sizes(struct radeon_
rdev->mc.real_vram_size = rdev->mc.aper_size;
}
@@ -192,9 +192,9 @@ diff -up linux-2.6.30.noarch/drivers/gpu
void r100_vram_info(struct radeon_device *rdev)
{
r100_vram_get_type(rdev);
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h.arb linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h
---- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h 2009-08-05 10:15:15.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h.da linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h
+--- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_asic.h 2009-08-25 09:57:03.000000000 +1000
@@ -46,6 +46,7 @@ uint32_t r100_mm_rreg(struct radeon_devi
void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
void r100_errata(struct radeon_device *rdev);
@@ -203,7 +203,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
int r100_gpu_reset(struct radeon_device *rdev);
int r100_mc_init(struct radeon_device *rdev);
void r100_mc_fini(struct radeon_device *rdev);
-@@ -84,6 +85,7 @@ static struct radeon_asic r100_asic = {
+@@ -85,6 +86,7 @@ static struct radeon_asic r100_asic = {
.init = &r100_init,
.errata = &r100_errata,
.vram_info = &r100_vram_info,
@@ -211,7 +211,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &r100_gpu_reset,
.mc_init = &r100_mc_init,
.mc_fini = &r100_mc_fini,
-@@ -147,6 +149,7 @@ static struct radeon_asic r300_asic = {
+@@ -149,6 +151,7 @@ static struct radeon_asic r300_asic = {
.init = &r300_init,
.errata = &r300_errata,
.vram_info = &r300_vram_info,
@@ -219,7 +219,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &r300_gpu_reset,
.mc_init = &r300_mc_init,
.mc_fini = &r300_mc_fini,
-@@ -190,6 +193,7 @@ static struct radeon_asic r420_asic = {
+@@ -193,6 +196,7 @@ static struct radeon_asic r420_asic = {
.init = &r300_init,
.errata = &r420_errata,
.vram_info = &r420_vram_info,
@@ -227,7 +227,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &r300_gpu_reset,
.mc_init = &r420_mc_init,
.mc_fini = &r420_mc_fini,
-@@ -240,6 +244,7 @@ static struct radeon_asic rs400_asic = {
+@@ -244,6 +248,7 @@ static struct radeon_asic rs400_asic = {
.init = &r300_init,
.errata = &rs400_errata,
.vram_info = &rs400_vram_info,
@@ -235,7 +235,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &r300_gpu_reset,
.mc_init = &rs400_mc_init,
.mc_fini = &rs400_mc_fini,
-@@ -292,6 +297,7 @@ static struct radeon_asic rs600_asic = {
+@@ -299,6 +304,7 @@ static struct radeon_asic rs600_asic = {
.init = &r300_init,
.errata = &rs600_errata,
.vram_info = &rs600_vram_info,
@@ -243,15 +243,15 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &r300_gpu_reset,
.mc_init = &rs600_mc_init,
.mc_fini = &rs600_mc_fini,
-@@ -337,6 +343,7 @@ static struct radeon_asic rs690_asic = {
- .init = &r300_init,
+@@ -346,6 +352,7 @@ static struct radeon_asic rs690_asic = {
+ .init = &rs690_init,
.errata = &rs690_errata,
.vram_info = &rs690_vram_info,
+ .vga_set_state = &r100_vga_set_state,
.gpu_reset = &r300_gpu_reset,
.mc_init = &rs690_mc_init,
.mc_fini = &rs690_mc_fini,
-@@ -389,6 +396,7 @@ static struct radeon_asic rv515_asic = {
+@@ -399,6 +406,7 @@ static struct radeon_asic rv515_asic = {
.init = &rv515_init,
.errata = &rv515_errata,
.vram_info = &rv515_vram_info,
@@ -259,7 +259,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &rv515_gpu_reset,
.mc_init = &rv515_mc_init,
.mc_fini = &rv515_mc_fini,
-@@ -432,6 +440,7 @@ static struct radeon_asic r520_asic = {
+@@ -445,6 +453,7 @@ static struct radeon_asic r520_asic = {
.init = &rv515_init,
.errata = &r520_errata,
.vram_info = &r520_vram_info,
@@ -267,9 +267,9 @@ diff -up linux-2.6.30.noarch/drivers/gpu
.gpu_reset = &rv515_gpu_reset,
.mc_init = &r520_mc_init,
.mc_fini = &r520_mc_fini,
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c.arb linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c
---- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c 2009-08-05 10:15:29.000000000 +1000
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c.da linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c
+--- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon_device.c 2009-08-25 09:57:03.000000000 +1000
@@ -29,6 +29,7 @@
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
@@ -278,7 +278,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
#include "radeon_reg.h"
#include "radeon.h"
#include "radeon_asic.h"
-@@ -475,7 +476,18 @@ void radeon_combios_fini(struct radeon_d
+@@ -468,7 +469,18 @@ void radeon_combios_fini(struct radeon_d
int radeon_modeset_init(struct radeon_device *rdev);
void radeon_modeset_fini(struct radeon_device *rdev);
@@ -297,7 +297,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
/*
* Radeon device.
*/
-@@ -566,6 +578,12 @@ int radeon_device_init(struct radeon_dev
+@@ -559,6 +571,12 @@ int radeon_device_init(struct radeon_dev
/* Initialize surface registers */
radeon_surface_init(rdev);
@@ -310,7 +310,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
/* TODO: disable VGA need to use VGA request */
/* BIOS*/
if (!radeon_get_bios(rdev)) {
-@@ -700,6 +718,7 @@ void radeon_device_fini(struct radeon_de
+@@ -693,6 +711,7 @@ void radeon_device_fini(struct radeon_de
radeon_agp_fini(rdev);
#endif
radeon_irq_kms_fini(rdev);
@@ -318,10 +318,10 @@ diff -up linux-2.6.30.noarch/drivers/gpu
radeon_fence_driver_fini(rdev);
radeon_clocks_fini(rdev);
radeon_object_fini(rdev);
-diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h.arb linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h
---- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h 2009-08-05 10:15:15.000000000 +1000
-@@ -579,6 +579,7 @@ struct radeon_asic {
+diff -up linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h.da linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h
+--- linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/drivers/gpu/drm/radeon/radeon.h 2009-08-25 09:57:03.000000000 +1000
+@@ -580,6 +580,7 @@ struct radeon_asic {
int (*suspend)(struct radeon_device *rdev);
void (*errata)(struct radeon_device *rdev);
void (*vram_info)(struct radeon_device *rdev);
@@ -329,7 +329,7 @@ diff -up linux-2.6.30.noarch/drivers/gpu
int (*gpu_reset)(struct radeon_device *rdev);
int (*mc_init)(struct radeon_device *rdev);
void (*mc_fini)(struct radeon_device *rdev);
-@@ -879,6 +880,7 @@ static inline void radeon_ring_write(str
+@@ -917,6 +918,7 @@ static inline void radeon_ring_write(str
#define radeon_cs_parse(p) rdev->asic->cs_parse((p))
#define radeon_errata(rdev) (rdev)->asic->errata((rdev))
#define radeon_vram_info(rdev) (rdev)->asic->vram_info((rdev))
@@ -337,10 +337,10 @@ diff -up linux-2.6.30.noarch/drivers/gpu
#define radeon_gpu_reset(rdev) (rdev)->asic->gpu_reset((rdev))
#define radeon_mc_init(rdev) (rdev)->asic->mc_init((rdev))
#define radeon_mc_fini(rdev) (rdev)->asic->mc_fini((rdev))
-diff -up linux-2.6.30.noarch/include/drm/drmP.h.arb linux-2.6.30.noarch/include/drm/drmP.h
---- linux-2.6.30.noarch/include/drm/drmP.h.arb 2009-08-05 10:14:24.000000000 +1000
-+++ linux-2.6.30.noarch/include/drm/drmP.h 2009-08-05 10:15:15.000000000 +1000
-@@ -797,6 +797,9 @@ struct drm_driver {
+diff -up linux-2.6.30.noarch/include/drm/drmP.h.da linux-2.6.30.noarch/include/drm/drmP.h
+--- linux-2.6.30.noarch/include/drm/drmP.h.da 2009-08-25 09:56:33.000000000 +1000
++++ linux-2.6.30.noarch/include/drm/drmP.h 2009-08-25 09:57:03.000000000 +1000
+@@ -821,6 +821,9 @@ struct drm_driver {
int (*gem_init_object) (struct drm_gem_object *obj);
void (*gem_free_object) (struct drm_gem_object *obj);
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1294.2.58
retrieving revision 1.1294.2.59
diff -u -p -r1.1294.2.58 -r1.1294.2.59
--- kernel.spec 24 Aug 2009 21:34:53 -0000 1.1294.2.58
+++ kernel.spec 26 Aug 2009 19:58:48 -0000 1.1294.2.59
@@ -62,7 +62,7 @@ Summary: The Linux kernel
# The rc snapshot level
%define rcrev 7
# The git snapshot level
-%define gitrev 1
+%define gitrev 4
# Set rpm version accordingly
%define rpmversion 2.6.%{upstream_sublevel}
%endif
@@ -683,12 +683,13 @@ Patch1551: linux-2.6-ksm-kvm.patch
Patch1552: linux-2.6-ksm-updates.patch
# nouveau + drm fixes
+Patch1812: drm-next.patch
Patch1813: drm-radeon-pm.patch
Patch1814: drm-nouveau.patch
Patch1818: drm-i915-resume-force-mode.patch
Patch1819: drm-intel-big-hammer.patch
Patch1821: drm-page-flip.patch
-# anholt's tree as of 2009-08-12
+# anholt's tree as of 2009-08-26
Patch1824: drm-intel-next.patch
Patch1825: drm-intel-pm.patch
Patch1826: drm-r600-kms.patch
@@ -725,6 +726,11 @@ Patch11010: via-hwmon-temp-sensor.patch
Patch12010: linux-2.6-dell-laptop-rfkill-fix.patch
Patch12011: linux-2.6-block-silently-error-unsupported-empty-barriers-too.patch
+# fix xen boot
+Patch12020: xen-fb-probe-fix.patch
+
+Patch90000: allow-disabling-ima.diff
+
Patch19997: xen.pvops.pre.patch
Patch19998: xen.pvops.patch
Patch19999: xen.pvops.post.patch
@@ -1309,6 +1315,7 @@ ApplyPatch linux-2.6-block-silently-erro
ApplyPatch linux-2.6-e1000-ich9.patch
# Nouveau DRM + drm fixes
+ApplyPatch drm-next.patch
ApplyPatch drm-r600-kms.patch
ApplyPatch drm-nouveau.patch
@@ -1317,7 +1324,7 @@ ApplyPatch drm-nouveau.patch
ApplyPatch drm-i915-resume-force-mode.patch
ApplyPatch drm-intel-big-hammer.patch
ApplyPatch drm-page-flip.patch
-#ApplyPatch drm-intel-next.patch
+ApplyPatch drm-intel-next.patch
ApplyPatch drm-intel-pm.patch
# VGA arb + drm
@@ -1337,6 +1344,13 @@ ApplyPatch linux-2.6-silence-acpi-blackl
#ApplyPatch linux-2.6-v4l-dvb-experimental.patch
#ApplyPatch linux-2.6-revert-dvb-net-kabi-change.patch
+# Patches headed upstream
+
+# fix xen boot
+ApplyPatch xen-fb-probe-fix.patch
+
+ApplyPatch allow-disabling-ima.diff
+
ApplyPatch xen.pvops.pre.patch
ApplyPatch xen.pvops.patch
ApplyPatch xen.pvops.post.patch
@@ -2006,6 +2020,37 @@ fi
# and build.
%changelog
+* Wed Aug 26 2009 Michael Young <m.a.young at durham.ac.uk>
+- update pvops again
+
+* Wed Aug 26 2009 Chuck Ebbert <cebbert at redhat.com>
+- 2.6.31-rc7-git4
+- Drop patches merged upstream:
+ xen-x86-fix-stackprotect.patch
+ xen-x86-no-stackprotect.patch
+
+* Wed Aug 26 2009 Adam Jackson <ajax at redhat.com>
+- drm-intel-next.patch: Update, various output setup fixes.
+
+* Wed Aug 26 2009 David Woodhouse <David.Woodhouse at intel.com>
+- Make WiMAX modular (#512070)
+
+* Tue Aug 25 2009 Kyle McMartin <kyle at redhat.com>
+- allow-disabling-ima.diff: debugging patch... adds ima=0 kernel
+ param to disable initialization of IMA.
+
+* Tue Aug 25 2009 Ben Skeggs <bskeggs at redhat.com> 2.6.31-0.174.rc7.git2
+- drm-nouveau.patch: upstream update, pre-nv50 tv-out + misc fixes
+
+* Tue Aug 25 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.31-0.173.rc7.git2
+- Fix Xen boot (#508120)
+
+* Tue Aug 25 2009 Dave Airlie <airlied at redhat.com>
+- pull in drm-next tree + rebase around it
+
+* Mon Aug 24 2009 Chuck Ebbert <cebbert at redhat.com>
+- 2.6.31-rc7-git2
+
* Mon Aug 24 2009 Michael Young <m.a.young at durham.ac.uk>
- turn off stackprotector on i686 for a working build
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/sources,v
retrieving revision 1.976.2.28
retrieving revision 1.976.2.29
diff -u -p -r1.976.2.28 -r1.976.2.29
--- sources 24 Aug 2009 20:17:12 -0000 1.976.2.28
+++ sources 26 Aug 2009 19:58:49 -0000 1.976.2.29
@@ -1,3 +1,3 @@
7a80058a6382e5108cdb5554d1609615 linux-2.6.30.tar.bz2
4b991833a7e19a5b65ba3abcbc9de2e0 patch-2.6.31-rc7.bz2
-22d1b4c17bde1034e332dc2505c9f15a patch-2.6.31-rc7-git1.bz2
+8329c25267787e591972e477b113c08b patch-2.6.31-rc7-git4.bz2
Index: upstream
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/upstream,v
retrieving revision 1.888.2.27
retrieving revision 1.888.2.28
diff -u -p -r1.888.2.27 -r1.888.2.28
--- upstream 24 Aug 2009 20:17:12 -0000 1.888.2.27
+++ upstream 26 Aug 2009 19:58:49 -0000 1.888.2.28
@@ -1,3 +1,3 @@
linux-2.6.30.tar.bz2
patch-2.6.31-rc7.bz2
-patch-2.6.31-rc7-git1.bz2
+patch-2.6.31-rc7-git4.bz2
xen.pvops.patch:
arch/x86/Kconfig | 4
arch/x86/include/asm/agp.h | 15
arch/x86/include/asm/e820.h | 2
arch/x86/include/asm/i387.h | 1
arch/x86/include/asm/io.h | 15
arch/x86/include/asm/io_apic.h | 7
arch/x86/include/asm/microcode.h | 9
arch/x86/include/asm/paravirt.h | 718 -------------
arch/x86/include/asm/paravirt_types.h | 722 +++++++++++++
arch/x86/include/asm/pci.h | 8
arch/x86/include/asm/pci_x86.h | 2
arch/x86/include/asm/pgtable.h | 3
arch/x86/include/asm/processor.h | 4
arch/x86/include/asm/tlbflush.h | 6
arch/x86/include/asm/xen/hypercall.h | 44
arch/x86/include/asm/xen/interface.h | 8
arch/x86/include/asm/xen/interface_32.h | 5
arch/x86/include/asm/xen/interface_64.h | 13
arch/x86/include/asm/xen/iommu.h | 12
arch/x86/include/asm/xen/page.h | 16
arch/x86/include/asm/xen/pci.h | 37
arch/x86/kernel/Makefile | 1
arch/x86/kernel/acpi/boot.c | 18
arch/x86/kernel/acpi/processor.c | 4
arch/x86/kernel/acpi/sleep.c | 2
arch/x86/kernel/apic/io_apic.c | 46
arch/x86/kernel/cpu/mtrr/Makefile | 1
arch/x86/kernel/cpu/mtrr/amd.c | 6
arch/x86/kernel/cpu/mtrr/centaur.c | 6
arch/x86/kernel/cpu/mtrr/cyrix.c | 6
arch/x86/kernel/cpu/mtrr/generic.c | 10
arch/x86/kernel/cpu/mtrr/main.c | 19
arch/x86/kernel/cpu/mtrr/mtrr.h | 11
arch/x86/kernel/cpu/mtrr/xen.c | 104 +
arch/x86/kernel/e820.c | 30
arch/x86/kernel/ioport.c | 29
arch/x86/kernel/microcode_core.c | 5
arch/x86/kernel/microcode_xen.c | 200 +++
arch/x86/kernel/paravirt.c | 1
arch/x86/kernel/pci-dma.c | 3
arch/x86/kernel/pci-swiotlb.c | 30
arch/x86/kernel/process.c | 27
arch/x86/kernel/process_32.c | 27
arch/x86/kernel/process_64.c | 33
arch/x86/kernel/setup.c | 4
arch/x86/kernel/traps.c | 33
arch/x86/mm/init_32.c | 42
arch/x86/mm/pat.c | 2
arch/x86/mm/pgtable.c | 10
arch/x86/mm/tlb.c | 35
arch/x86/pci/Makefile | 1
arch/x86/pci/common.c | 18
arch/x86/pci/i386.c | 3
arch/x86/pci/init.c | 6
arch/x86/pci/xen.c | 51
arch/x86/xen/Kconfig | 33
arch/x86/xen/Makefile | 4
arch/x86/xen/apic.c | 57 +
arch/x86/xen/enlighten.c | 75 +
arch/x86/xen/mmu.c | 455 ++++++++
arch/x86/xen/pci-swiotlb.c | 53 +
arch/x86/xen/pci.c | 112 ++
arch/x86/xen/setup.c | 50
arch/x86/xen/smp.c | 2
arch/x86/xen/time.c | 2
arch/x86/xen/vga.c | 67 +
arch/x86/xen/xen-ops.h | 19
block/blk-core.c | 2
drivers/acpi/acpica/hwsleep.c | 17
drivers/acpi/processor_core.c | 29
drivers/acpi/processor_idle.c | 23
drivers/acpi/processor_perflib.c | 10
drivers/acpi/sleep.c | 19
drivers/block/Kconfig | 1
drivers/char/agp/intel-agp.c | 17
drivers/char/hvc_xen.c | 99 +
drivers/net/Kconfig | 1
drivers/pci/Makefile | 2
drivers/pci/xen-iommu.c | 332 ++++++
drivers/xen/Kconfig | 41
drivers/xen/Makefile | 20
drivers/xen/acpi.c | 23
drivers/xen/acpi_processor.c | 447 ++++++++
drivers/xen/balloon.c | 161 ++-
drivers/xen/biomerge.c | 14
drivers/xen/blkback/Makefile | 3
drivers/xen/blkback/blkback.c | 658 ++++++++++++
drivers/xen/blkback/common.h | 137 ++
drivers/xen/blkback/interface.c | 182 +++
drivers/xen/blkback/vbd.c | 118 ++
drivers/xen/blkback/xenbus.c | 542 ++++++++++
drivers/xen/events.c | 413 +++++++
drivers/xen/evtchn.c | 1
drivers/xen/features.c | 2
drivers/xen/grant-table.c | 103 +
drivers/xen/mce.c | 213 ++++
drivers/xen/netback/Makefile | 3
drivers/xen/netback/common.h | 221 ++++
drivers/xen/netback/interface.c | 401 +++++++
drivers/xen/netback/netback.c | 1513 +++++++++++++++++++++++++++++
drivers/xen/netback/xenbus.c | 454 ++++++++
drivers/xen/pci.c | 124 ++
drivers/xen/xenbus/Makefile | 5
drivers/xen/xenbus/xenbus_comms.c | 1
drivers/xen/xenbus/xenbus_probe.c | 380 +------
drivers/xen/xenbus/xenbus_probe.h | 29
drivers/xen/xenbus/xenbus_probe_backend.c | 298 +++++
drivers/xen/xenbus/xenbus_probe_frontend.c | 292 +++++
drivers/xen/xenfs/Makefile | 3
drivers/xen/xenfs/privcmd.c | 403 +++++++
drivers/xen/xenfs/super.c | 98 +
drivers/xen/xenfs/xenfs.h | 3
drivers/xen/xenfs/xenstored.c | 67 +
include/acpi/processor.h | 2
include/asm-generic/pci.h | 2
include/linux/interrupt.h | 1
include/linux/page-flags.h | 18
include/xen/Kbuild | 1
include/xen/acpi.h | 84 +
include/xen/balloon.h | 8
include/xen/blkif.h | 122 ++
include/xen/events.h | 27
include/xen/grant_table.h | 43
include/xen/interface/grant_table.h | 22
include/xen/interface/memory.h | 92 +
include/xen/interface/physdev.h | 51
include/xen/interface/platform.h | 336 ++++++
include/xen/interface/xen-mca.h | 429 ++++++++
include/xen/interface/xen.h | 44
include/xen/privcmd.h | 80 +
include/xen/swiotlb.h | 18
include/xen/xen-ops.h | 11
include/xen/xenbus.h | 2
kernel/irq/manage.c | 3
lib/swiotlb.c | 5
mm/page_alloc.c | 14
136 files changed, 11429 insertions(+), 1315 deletions(-)
Index: xen.pvops.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.patch,v
retrieving revision 1.1.2.36
retrieving revision 1.1.2.37
diff -u -p -r1.1.2.36 -r1.1.2.37
--- xen.pvops.patch 20 Aug 2009 18:50:21 -0000 1.1.2.36
+++ xen.pvops.patch 26 Aug 2009 19:58:49 -0000 1.1.2.37
@@ -1697,10 +1697,10 @@ index b399988..30cbf49 100644
extern void __init dmi_check_skip_isa_align(void);
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
-index 3cc06e3..4595ae2 100644
+index 1674807..3658a86 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
-@@ -394,6 +394,9 @@ static inline unsigned long pages_to_mb(unsigned long npg)
+@@ -402,6 +402,9 @@ static inline unsigned long pages_to_mb(unsigned long npg)
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
remap_pfn_range(vma, vaddr, pfn, size, prot)
@@ -1986,10 +1986,10 @@ index 018a0a4..f334014 100644
unsigned long arbitrary_virt_to_mfn(void *vaddr);
diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
new file mode 100644
-index 0000000..714443b
+index 0000000..cb84abe
--- /dev/null
+++ b/arch/x86/include/asm/xen/pci.h
-@@ -0,0 +1,33 @@
+@@ -0,0 +1,37 @@
+#ifndef _ASM_X86_XEN_PCI_H
+#define _ASM_X86_XEN_PCI_H
+
@@ -1999,24 +1999,28 @@ index 0000000..714443b
+ struct msi_desc *msidesc,
+ int type);
+int xen_destroy_irq(int irq);
-+int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
+#else
+static inline int xen_register_gsi(u32 gsi, int triggering, int polarity)
+{
+ return -1;
+}
+
-+static int xen_create_msi_irq(struct pci_dev *dev,
++static inline int xen_create_msi_irq(struct pci_dev *dev,
+ struct msi_desc *msidesc,
+ int type)
+{
+ return -1;
+}
-+static int xen_destroy_irq(int irq)
++static inline int xen_destroy_irq(int irq)
+{
+ return -1;
+}
-+static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
++#endif
++
++#if defined(CONFIG_PCI_MSI) && defined(CONFIG_XEN_DOM0_PCI)
++int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
++#else
++static inline int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+ return -1;
+}
@@ -2087,6 +2091,28 @@ index 6b8ca3a..d47c54f 100644
mp_lapic_addr = address;
set_fixmap_nocache(FIX_APIC_BASE, address);
+diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
+index d296f4a..721272b 100644
+--- a/arch/x86/kernel/acpi/processor.c
++++ b/arch/x86/kernel/acpi/processor.c
+@@ -11,6 +11,7 @@
+
+ #include <acpi/processor.h>
+ #include <asm/acpi.h>
++#include <asm/xen/hypervisor.h>
+
+ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
+ {
+@@ -78,6 +79,9 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
+ {
+ struct cpuinfo_x86 *c = &cpu_data(pr->id);
+
++ if (xen_pv_domain())
++ c = &cpu_data(0);
++
+ pr->pdc = NULL;
+ if (c->x86_vendor == X86_VENDOR_INTEL)
+ init_intel_pdc(pr, c);
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index ca93638..9eff23c 100644
--- a/arch/x86/kernel/acpi/sleep.c
@@ -2207,21 +2233,6 @@ index d2ed6c5..18d957e 100644
ioapic_res = ioapic_setup_resources();
for (i = 0; i < nr_ioapics; i++) {
if (smp_found_config) {
-diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
-index 3efcb2b..c1f253d 100644
---- a/arch/x86/kernel/cpu/Makefile
-+++ b/arch/x86/kernel/cpu/Makefile
-@@ -7,6 +7,10 @@ ifdef CONFIG_FUNCTION_TRACER
- CFLAGS_REMOVE_common.o = -pg
- endif
-
-+# Make sure load_percpu_segment has no stackprotector
-+nostackp := $(call cc-option, -fno-stack-protector)
-+CFLAGS_common.o := $(nostackp)
-+
- obj-y := intel_cacheinfo.o addon_cpuid_features.o
- obj-y += proc.o capflags.o powerflags.o common.o
- obj-y += vmware.o hypervisor.o
diff --git a/arch/x86/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index f4361b5..404e458 100644
--- a/arch/x86/kernel/cpu/mtrr/Makefile
@@ -2931,7 +2942,7 @@ index 6af96ee..efe3691 100644
swiotlb = 1;
if (swiotlb) {
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index 994dd6a..30803f4 100644
+index 071166a..cbf8440 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -76,16 +76,12 @@ void exit_thread(void)
@@ -3246,7 +3257,7 @@ index 3cd7711..f16903d 100644
}
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
-index e6718bb..f03f6dc 100644
+index 352aa9e..95609e3 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -499,7 +499,7 @@ int free_memtype(u64 start, u64 end)
@@ -3280,7 +3291,7 @@ index ed34f5e..9c58425 100644
{
return (pte_t *)__get_free_page(PGALLOC_GFP);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
-index 821e970..a5c295c 100644
+index c814e14..f68d42f 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -147,13 +147,25 @@ void smp_invalidate_interrupt(struct pt_regs *regs)
@@ -3312,7 +3323,7 @@ index 821e970..a5c295c 100644
leave_mm(cpu);
}
out:
-@@ -217,16 +229,13 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
+@@ -216,16 +228,13 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
flush_tlb_others_ipi(cpumask, mm, va);
}
@@ -3330,7 +3341,7 @@ index 821e970..a5c295c 100644
void flush_tlb_current_task(void)
{
-@@ -275,16 +284,16 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
+@@ -274,16 +283,16 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
preempt_enable();
}
@@ -3557,21 +3568,10 @@ index b83e119..951c924 100644
+ depends on XEN_DOM0 && MICROCODE
\ No newline at end of file
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
-index 172438f..8c2c266 100644
+index 7410640..8c2c266 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
-@@ -5,6 +5,10 @@ CFLAGS_REMOVE_time.o = -pg
- CFLAGS_REMOVE_irq.o = -pg
- endif
-
-+# Make sure early boot has no stackprotector
-+nostackp := $(call cc-option, -fno-stack-protector)
-+CFLAGS_enlighten.o := $(nostackp)
-+
- obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
- time.o xen-asm.o xen-asm_$(BITS).o \
- grant-table.o suspend.o
-@@ -12,3 +16,7 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
+@@ -16,3 +16,7 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
@@ -3644,7 +3644,7 @@ index 0000000..ee0db39
+#endif
+}
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index 0a1700a..2e58099 100644
+index e90540a..1edf6a8 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -64,6 +64,11 @@ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
@@ -3756,60 +3756,16 @@ index 0a1700a..2e58099 100644
.io_delay = xen_io_delay,
/* Xen takes care of %gs when switching to usermode for us */
-@@ -974,10 +1005,6 @@ asmlinkage void __init xen_start_kernel(void)
-
- xen_domain_type = XEN_PV_DOMAIN;
-
-- BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0);
--
-- xen_setup_features();
--
- /* Install Xen paravirt ops */
- pv_info = xen_info;
- pv_init_ops = xen_init_ops;
-@@ -986,8 +1013,15 @@ asmlinkage void __init xen_start_kernel(void)
- pv_apic_ops = xen_apic_ops;
- pv_mmu_ops = xen_mmu_ops;
-
-- xen_init_irq_ops();
-+#ifdef CONFIG_X86_64
-+ /*
-+ * Setup percpu state. We only need to do this for 64-bit
-+ * because 32-bit already has %fs set properly.
-+ */
-+ load_percpu_segment(0);
-+#endif
-
-+ xen_init_irq_ops();
- xen_init_cpuid_mask();
-
- #ifdef CONFIG_X86_LOCAL_APIC
-@@ -997,6 +1031,10 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1000,6 +1031,8 @@ asmlinkage void __init xen_start_kernel(void)
set_xen_basic_apic_ops();
#endif
+ xen_setup_machphys_mapping();
+
-+ xen_setup_features();
-+
- if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {
- pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start;
- pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit;
-@@ -1004,13 +1042,6 @@ asmlinkage void __init xen_start_kernel(void)
+ xen_setup_features();
- machine_ops = xen_machine_ops;
-
--#ifdef CONFIG_X86_64
-- /*
-- * Setup percpu state. We only need to do this for 64-bit
-- * because 32-bit already has %fs set properly.
-- */
-- load_percpu_segment(0);
--#endif
- /*
- * The only reliable way to retain the initial address of the
- * percpu gdt_page is to remember it here, so we can go and
-@@ -1031,6 +1062,8 @@ asmlinkage void __init xen_start_kernel(void)
+ if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {
+@@ -1029,6 +1062,8 @@ asmlinkage void __init xen_start_kernel(void)
if (!xen_initial_domain())
__supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
@@ -3818,7 +3774,7 @@ index 0a1700a..2e58099 100644
#ifdef CONFIG_X86_64
/* Work out if we support NX */
check_efer();
-@@ -1045,6 +1078,7 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1043,6 +1078,7 @@ asmlinkage void __init xen_start_kernel(void)
xen_raw_console_write("mapping kernel into physical memory\n");
pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages);
@@ -3826,7 +3782,7 @@ index 0a1700a..2e58099 100644
init_mm.pgd = pgd;
-@@ -1054,9 +1088,21 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1052,13 +1088,26 @@ asmlinkage void __init xen_start_kernel(void)
if (xen_feature(XENFEAT_supervisor_mode_kernel))
pv_info.kernel_rpl = 0;
@@ -3848,7 +3804,12 @@ index 0a1700a..2e58099 100644
#ifdef CONFIG_X86_32
/* set up basic CPUID stuff */
cpu_detect(&new_cpu_data);
-@@ -1075,6 +1121,16 @@ asmlinkage void __init xen_start_kernel(void)
+ new_cpu_data.hard_math = 1;
++ new_cpu_data.wp_works_ok = 1;
+ new_cpu_data.x86_capability[0] = cpuid_edx(1);
+ #endif
+
+@@ -1073,6 +1122,16 @@ asmlinkage void __init xen_start_kernel(void)
add_preferred_console("xenboot", 0, NULL);
add_preferred_console("tty", 0, NULL);
add_preferred_console("hvc", 0, NULL);
@@ -4532,10 +4493,10 @@ index 0000000..3b96c87
+}
diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
new file mode 100644
-index 0000000..c0ef627
+index 0000000..60bab67
--- /dev/null
+++ b/arch/x86/xen/pci.c
-@@ -0,0 +1,110 @@
+@@ -0,0 +1,112 @@
+#include <linux/kernel.h>
+#include <linux/acpi.h>
+#include <linux/pci.h>
@@ -4625,6 +4586,7 @@ index 0000000..c0ef627
+ }
+}
+
++#ifdef CONFIG_PCI_MSI
+int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+ unsigned int irq;
@@ -4646,6 +4608,7 @@ index 0000000..c0ef627
+ xen_destroy_irq(irq);
+ return ret;
+}
++#endif
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index ad0047f..2439456 100644
--- a/arch/x86/xen/setup.c
@@ -4932,6 +4895,202 @@ index db307a3..c6d845c 100644
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
+diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
+index 84e0f3c..8882c23 100644
+--- a/drivers/acpi/processor_core.c
++++ b/drivers/acpi/processor_core.c
+@@ -58,6 +58,7 @@
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+ #include <acpi/processor.h>
++#include <xen/acpi.h>
+
+ #define ACPI_PROCESSOR_CLASS "processor"
+ #define ACPI_PROCESSOR_DEVICE_NAME "Processor"
+@@ -638,6 +639,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
+
+ pr->id = cpu_index;
+
++ if (xen_pv_domain())
++ pr->id = pr->acpi_id;
++
+ /*
+ * Extra Processor objects may be enumerated on MP systems with
+ * less than the max # of CPUs. They should be ignored _iff
+@@ -712,14 +716,16 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
+ return 0;
+ }
+
+- BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
++ if (!xen_pv_domain())
++ BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
+
+ /*
+ * Buggy BIOS check
+ * ACPI id of processors can be reported wrongly by the BIOS.
+ * Don't trust it blindly
+ */
+- if (per_cpu(processor_device_array, pr->id) != NULL &&
++ if (!xen_pv_domain() &&
++ per_cpu(processor_device_array, pr->id) != NULL &&
+ per_cpu(processor_device_array, pr->id) != device) {
+ printk(KERN_WARNING "BIOS reported wrong ACPI id "
+ "for the processor\n");
+@@ -734,7 +740,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
+ goto end;
+
+ sysdev = get_cpu_sysdev(pr->id);
+- if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
++ if (sysdev != NULL &&
++ sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
+ return -EFAULT;
+
+ /* _PDC call should be done before doing anything else (if reqd.). */
+@@ -751,6 +758,10 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
+
+ acpi_processor_power_init(pr, device);
+
++ result = processor_cntl_xen_prepare(pr);
++ if (result)
++ goto end;
++
+ pr->cdev = thermal_cooling_device_register("Processor", device,
+ &processor_cooling_ops);
+ if (IS_ERR(pr->cdev)) {
+@@ -963,6 +974,10 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
+ if (!pr)
+ return -ENODEV;
+
++ if (processor_cntl_xen())
++ processor_cntl_xen_notify(pr,
++ PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
++
+ if ((pr->id >= 0) && (pr->id < nr_cpu_ids)) {
+ kobject_uevent(&(*device)->dev.kobj, KOBJ_ONLINE);
+ }
+@@ -1002,11 +1017,19 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
+ break;
+ }
+
++ if (processor_cntl_xen())
++ processor_cntl_xen_notify(pr,
++ PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
++
+ if (pr->id >= 0 && (pr->id < nr_cpu_ids)) {
+ kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
+ break;
+ }
+
++ if (processor_cntl_xen())
++ processor_cntl_xen_notify(pr, PROCESSOR_HOTPLUG,
++ HOTPLUG_TYPE_REMOVE);
++
+ result = acpi_processor_start(device);
+ if ((!result) && ((pr->id >= 0) && (pr->id < nr_cpu_ids))) {
+ kobject_uevent(&device->dev.kobj, KOBJ_ONLINE);
+diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
+index 66393d5..da9797e 100644
+--- a/drivers/acpi/processor_idle.c
++++ b/drivers/acpi/processor_idle.c
+@@ -58,6 +58,7 @@
+
+ #include <acpi/acpi_bus.h>
+ #include <acpi/processor.h>
++#include <xen/acpi.h>
+ #include <asm/processor.h>
+
+ #define ACPI_PROCESSOR_CLASS "processor"
+@@ -456,6 +457,10 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
+
+ cx.power = obj->integer.value;
+
++ /* cache control methods to notify xen*/
++ if (processor_cntl_xen_pm())
++ processor_cntl_xen_power_cache(pr->acpi_id, i, reg);
++
+ current_count++;
+ memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
+
+@@ -1143,6 +1148,13 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
+ if (!pr->flags.power_setup_done)
+ return -ENODEV;
+
++ if (processor_cntl_xen_pm()) {
++ acpi_processor_get_power_info(pr);
++ processor_cntl_xen_notify(pr,
++ PROCESSOR_PM_CHANGE, PM_TYPE_IDLE);
++ return ret;
++ }
++
+ cpuidle_pause_and_lock();
+ cpuidle_disable_device(&pr->power.dev);
+ acpi_processor_get_power_info(pr);
+@@ -1206,9 +1218,14 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
+ * platforms that only support C1.
+ */
+ if (pr->flags.power) {
+- acpi_processor_setup_cpuidle(pr);
+- if (cpuidle_register_device(&pr->power.dev))
+- return -EIO;
++ if (processor_cntl_xen_pm())
++ processor_cntl_xen_notify(pr,
++ PROCESSOR_PM_INIT, PM_TYPE_IDLE);
++ else {
++ acpi_processor_setup_cpuidle(pr);
++ if (cpuidle_register_device(&pr->power.dev))
++ return -EIO;
++ }
+
+ printk(KERN_INFO PREFIX "CPU%d (power states:", pr->id);
+ for (i = 1; i <= pr->power.count; i++)
+diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
+index 60e543d..8375075 100644
+--- a/drivers/acpi/processor_perflib.c
++++ b/drivers/acpi/processor_perflib.c
+@@ -38,6 +38,7 @@
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+ #include <acpi/processor.h>
++#include <xen/acpi.h>
+
+ #define ACPI_PROCESSOR_CLASS "processor"
+ #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
+@@ -154,13 +155,16 @@ int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
+ {
+ int ret;
+
+- if (ignore_ppc)
++ if (ignore_ppc && !processor_cntl_xen_pmperf())
+ return 0;
+
+ ret = acpi_processor_get_platform_limit(pr);
+
+ if (ret < 0)
+ return (ret);
++ else if (processor_cntl_xen_pmperf())
++ return processor_cntl_xen_notify(pr,
++ PROCESSOR_PM_CHANGE, PM_TYPE_PERF);
+ else
+ return cpufreq_update_policy(pr->id);
+ }
+@@ -330,7 +334,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
+ return result;
+ }
+
+-static int acpi_processor_get_performance_info(struct acpi_processor *pr)
++int acpi_processor_get_performance_info(struct acpi_processor *pr)
+ {
+ int result = 0;
+ acpi_status status = AE_OK;
+@@ -432,7 +436,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
+
+ EXPORT_SYMBOL(acpi_processor_notify_smm);
+
+-static int acpi_processor_get_psd(struct acpi_processor *pr)
++int acpi_processor_get_psd(struct acpi_processor *pr)
+ {
+ int result = 0;
+ acpi_status status = AE_OK;
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 42159a2..e00b83b 100644
--- a/drivers/acpi/sleep.c
@@ -5216,10 +5375,10 @@ index eba999f..11071ed 100644
void xen_raw_printk(const char *fmt, ...)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
-index 5f6509a..6cd6859 100644
+index 5ce7cba..5a0a4ee 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
-@@ -2763,6 +2763,7 @@ source "drivers/s390/net/Kconfig"
+@@ -2765,6 +2765,7 @@ source "drivers/s390/net/Kconfig"
config XEN_NETDEV_FRONTEND
tristate "Xen network device frontend driver"
depends on XEN
@@ -5579,7 +5738,7 @@ index 0000000..b1a7d93
+}
+
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
-index cab100a..84c3553 100644
+index cab100a..33976f7 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -28,6 +28,29 @@ config XEN_DEV_EVTCHN
@@ -5612,7 +5771,7 @@ index cab100a..84c3553 100644
config XENFS
tristate "Xen filesystem"
depends on XEN
-@@ -60,4 +83,15 @@ config XEN_SYS_HYPERVISOR
+@@ -60,4 +83,20 @@ config XEN_SYS_HYPERVISOR
Create entries under /sys/hypervisor describing the Xen
hypervisor environment. When running native or in another
virtual environment, /sys/hypervisor will still be present,
@@ -5630,11 +5789,16 @@ index cab100a..84c3553 100644
+config XEN_MCE
+ def_bool y
+ depends on XEN_DOM0 && X86_64 && X86_MCE_INTEL
++
++config ACPI_PROCESSOR_XEN
++ bool
++ depends on XEN_DOM0 && ACPI_PROCESSOR && CPU_FREQ
++ default y
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
-index ec2a39b..0e2b9df 100644
+index ec2a39b..2a69a03 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
-@@ -1,9 +1,14 @@
+@@ -1,9 +1,15 @@
-obj-y += grant-table.o features.o events.o manage.o
+obj-y += grant-table.o features.o events.o manage.o biomerge.o
obj-y += xenbus/
@@ -5657,7 +5821,7 @@ index ec2a39b..0e2b9df 100644
+obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o
+obj-$(CONFIG_XEN_S3) += acpi.o
+obj-$(CONFIG_XEN_MCE) += mce.o
-\ No newline at end of file
++obj-$(CONFIG_ACPI_PROCESSOR_XEN) += acpi_processor.o
diff --git a/drivers/xen/acpi.c b/drivers/xen/acpi.c
new file mode 100644
index 0000000..e6d3d0e
@@ -5687,8 +5851,461 @@ index 0000000..e6d3d0e
+
+ return HYPERVISOR_dom0_op(&op);
+}
+diff --git a/drivers/xen/acpi_processor.c b/drivers/xen/acpi_processor.c
+new file mode 100644
+index 0000000..d2b76e9
+--- /dev/null
++++ b/drivers/xen/acpi_processor.c
+@@ -0,0 +1,447 @@
++/*
++ * acpi_processor.c - interface to notify Xen on acpi processor object
++ * info parsing
++ *
++ * Copyright (C) 2008, Intel corporation
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ *
++ * 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.,
++ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/acpi.h>
++#include <linux/pm.h>
++#include <linux/cpu.h>
++
++#include <linux/cpufreq.h>
++#include <acpi/processor.h>
++#include <xen/acpi.h>
++
++#include <asm/xen/hypercall.h>
++#include <asm/xen/hypervisor.h>
++
++static int processor_cntl_xen_get_performance(struct acpi_processor *pr);
++static int xen_hotplug_notifier(struct acpi_processor *pr, int event);
++
++static struct processor_cntl_xen_ops xen_ops = {
++ .hotplug = xen_hotplug_notifier,
++};
++
++static struct acpi_power_register *power_registers[NR_CPUS];
++
++int processor_cntl_xen_power_cache(int cpu, int cx,
++ struct acpi_power_register *reg)
++{
++ struct acpi_power_register *buf;
++
++ if (cpu < 0 || cpu >= NR_CPUS ||
++ cx < 1 || cx > ACPI_PROCESSOR_MAX_POWER) {
++ return -EINVAL;
++ }
++
++ if (power_registers[cpu] == NULL) {
++ buf = kzalloc(ACPI_PROCESSOR_MAX_POWER *
++ sizeof(struct xen_processor_cx), GFP_KERNEL);
++ if (buf == NULL)
++ return -ENOMEM;
++
++ power_registers[cpu] = buf;
++ }
++
++ memcpy(power_registers[cpu]+cx-1, reg, sizeof(*reg));
++
++ return 0;
++}
++
++int processor_cntl_xen(void)
++{
++ return 1;
++}
++
++int processor_cntl_xen_pm(void)
++{
++ return (xen_ops.pm_ops[PM_TYPE_IDLE] != NULL);
++}
++
++int processor_cntl_xen_pmperf(void)
++{
++ return (xen_ops.pm_ops[PM_TYPE_PERF] != NULL);
++}
++
++int processor_cntl_xen_pmthr(void)
++{
++ return (xen_ops.pm_ops[PM_TYPE_THR] != NULL);
++}
++
++static int processor_notify_smm(void)
++{
++ acpi_status status;
++ static int is_done;
++
++ /* only need successfully notify BIOS once */
++ /* avoid double notification which may lead to unexpected result */
++ if (is_done)
++ return 0;
++
++ /* Can't write pstate_cnt to smi_cmd if either value is zero */
++ if ((!acpi_gbl_FADT.smi_command) || (!acpi_gbl_FADT.pstate_control)) {
++ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n"));
++ return 0;
++ }
++
++ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
++ "Writing pstate_cnt [0x%x] to smi_cmd [0x%x]\n",
++ acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
++
++ status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
++ (u32) acpi_gbl_FADT.pstate_control, 8);
++ if (ACPI_FAILURE(status))
++ return status;
++
++ is_done = 1;
++
++ return 0;
++}
++
++int processor_cntl_xen_notify(struct acpi_processor *pr, int event, int type)
++{
++ int ret = -EINVAL;
++
++ switch (event) {
++ case PROCESSOR_PM_INIT:
++ case PROCESSOR_PM_CHANGE:
++ if ((type >= PM_TYPE_MAX) ||
++ !xen_ops.pm_ops[type])
++ break;
++
++ ret = xen_ops.pm_ops[type](pr, event);
++ break;
++ case PROCESSOR_HOTPLUG:
++ if (xen_ops.hotplug)
++ ret = xen_ops.hotplug(pr, type);
++ break;
++ default:
++ printk(KERN_ERR "Unsupport processor events %d.\n", event);
++ break;
++ }
++
++ return ret;
++}
++
++/*
++ * This is called from ACPI processor init, and targeted to hold
++ * some tricky housekeeping jobs to satisfy xen.
++ * For example, we may put dependency parse stub here for idle
++ * and performance state. Those information may be not available
++ * if splitting from dom0 control logic like cpufreq driver.
++ */
++int processor_cntl_xen_prepare(struct acpi_processor *pr)
++{
++
++ /* Initialize performance states */
++ if (processor_cntl_xen_pmperf())
++ processor_cntl_xen_get_performance(pr);
++
++ return 0;
++}
++
++/*
++ * Existing ACPI module does parse performance states at some point,
++ * when acpi-cpufreq driver is loaded which however is something
++ * we'd like to disable to avoid confliction with xen PM
++ * logic. So we have to collect raw performance information here
++ * when ACPI processor object is found and started.
++ */
++static int processor_cntl_xen_get_performance(struct acpi_processor *pr)
++{
++ int ret;
++ struct acpi_processor_performance *perf;
++ struct acpi_psd_package *pdomain;
++
++ if (pr->performance)
++ return -EBUSY;
++
++ perf = kzalloc(sizeof(struct acpi_processor_performance), GFP_KERNEL);
++ if (!perf)
++ return -ENOMEM;
++
++ pr->performance = perf;
++ /* Get basic performance state information */
++ ret = acpi_processor_get_performance_info(pr);
++ if (ret < 0)
++ goto err_out;
++
++ /*
++ * Well, here we need retrieve performance dependency information
++ * from _PSD object. The reason why existing interface is not used
++ * is due to the reason that existing interface sticks to Linux cpu
++ * id to construct some bitmap, however we want to split ACPI
++ * processor objects from Linux cpu id logic. For example, even
++ * when Linux is configured as UP, we still want to parse all ACPI
++ * processor objects to xen. In this case, it's preferred
++ * to use ACPI ID instead.
++ */
++ pdomain = &pr->performance->domain_info;
++ pdomain->num_processors = 0;
++ ret = acpi_processor_get_psd(pr);
++ if (ret < 0) {
++ /*
++ * _PSD is optional - assume no coordination if absent (or
++ * broken), matching native kernels' behavior.
++ */
++ pdomain->num_entries = ACPI_PSD_REV0_ENTRIES;
++ pdomain->revision = ACPI_PSD_REV0_REVISION;
++ pdomain->domain = pr->acpi_id;
++ pdomain->coord_type = DOMAIN_COORD_TYPE_SW_ALL;
++ pdomain->num_processors = 1;
++ }
++
++ /* Some sanity check */
++ if ((pdomain->revision != ACPI_PSD_REV0_REVISION) ||
++ (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) ||
++ ((pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL) &&
++ (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ANY) &&
++ (pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL))) {
++ ret = -EINVAL;
++ goto err_out;
++ }
++
++ /* Last step is to notify BIOS that xen exists */
++ processor_notify_smm();
++
++ processor_cntl_xen_notify(pr, PROCESSOR_PM_INIT, PM_TYPE_PERF);
++
++ return 0;
++err_out:
++ pr->performance = NULL;
++ kfree(perf);
++ return ret;
++}
++
++static inline void xen_convert_pct_reg(struct xen_pct_register *xpct,
++ struct acpi_pct_register *apct)
++{
++ xpct->descriptor = apct->descriptor;
++ xpct->length = apct->length;
++ xpct->space_id = apct->space_id;
++ xpct->bit_width = apct->bit_width;
++ xpct->bit_offset = apct->bit_offset;
++ xpct->reserved = apct->reserved;
++ xpct->address = apct->address;
++}
++
++static inline void xen_convert_pss_states(struct xen_processor_px *xpss,
++ struct acpi_processor_px *apss, int state_count)
++{
++ int i;
++ for (i = 0; i < state_count; i++) {
++ xpss->core_frequency = apss->core_frequency;
++ xpss->power = apss->power;
++ xpss->transition_latency = apss->transition_latency;
++ xpss->bus_master_latency = apss->bus_master_latency;
++ xpss->control = apss->control;
++ xpss->status = apss->status;
++ xpss++;
++ apss++;
++ }
++}
++
++static inline void xen_convert_psd_pack(struct xen_psd_package *xpsd,
++ struct acpi_psd_package *apsd)
++{
++ xpsd->num_entries = apsd->num_entries;
++ xpsd->revision = apsd->revision;
++ xpsd->domain = apsd->domain;
++ xpsd->coord_type = apsd->coord_type;
++ xpsd->num_processors = apsd->num_processors;
++}
++
++static int xen_cx_notifier(struct acpi_processor *pr, int action)
++{
++ int ret, count = 0, i;
++ xen_platform_op_t op = {
++ .cmd = XENPF_set_processor_pminfo,
++ .interface_version = XENPF_INTERFACE_VERSION,
++ .u.set_pminfo.id = pr->acpi_id,
++ .u.set_pminfo.type = XEN_PM_CX,
++ };
++ struct xen_processor_cx *data, *buf;
++ struct acpi_processor_cx *cx;
++ struct acpi_power_register *reg;
++
++ if (action == PROCESSOR_PM_CHANGE)
++ return -EINVAL;
++
++ /* Convert to Xen defined structure and hypercall */
++ buf = kzalloc(pr->power.count * sizeof(struct xen_processor_cx),
++ GFP_KERNEL);
++ if (!buf)
++ return -ENOMEM;
++
++ data = buf;
++ for (i = 1; i <= pr->power.count; i++) {
++ cx = &pr->power.states[i];
++ reg = power_registers[pr->acpi_id]+i-1;
++ /* Skip invalid cstate entry */
++ if (!cx->valid)
++ continue;
++
++ data->type = cx->type;
++ data->latency = cx->latency;
++ data->power = cx->power;
++ data->reg.space_id = reg->space_id;
++ data->reg.bit_width = reg->bit_width;
++ data->reg.bit_offset = reg->bit_offset;
++ data->reg.access_size = reg->reserved;
++ data->reg.address = reg->address;
++
++ /* Get dependency relationships, _CSD is not supported yet */
++ data->dpcnt = 0;
++ set_xen_guest_handle(data->dp, NULL);
++
++ data++;
++ count++;
++ }
++
++ if (!count) {
++ printk(KERN_ERR "No available Cx info for cpu %d\n",
++ pr->acpi_id);
++ kfree(buf);
++ return -EINVAL;
++ }
++
++ op.u.set_pminfo.power.count = count;
++ op.u.set_pminfo.power.flags.bm_control = pr->flags.bm_control;
++ op.u.set_pminfo.power.flags.bm_check = pr->flags.bm_check;
++ op.u.set_pminfo.power.flags.has_cst = pr->flags.has_cst;
++ op.u.set_pminfo.power.flags.power_setup_done =
++ pr->flags.power_setup_done;
++
++ set_xen_guest_handle(op.u.set_pminfo.power.states, buf);
++ ret = HYPERVISOR_dom0_op(&op);
++ kfree(buf);
++ return ret;
++}
++
++static int xen_px_notifier(struct acpi_processor *pr, int action)
++{
++ int ret = -EINVAL;
++ xen_platform_op_t op = {
++ .cmd = XENPF_set_processor_pminfo,
++ .interface_version = XENPF_INTERFACE_VERSION,
++ .u.set_pminfo.id = pr->acpi_id,
++ .u.set_pminfo.type = XEN_PM_PX,
++ };
++ struct xen_processor_performance *perf;
++ struct xen_processor_px *states = NULL;
++ struct acpi_processor_performance *px;
++ struct acpi_psd_package *pdomain;
++
++ if (!pr)
++ return -EINVAL;
++
++ perf = &op.u.set_pminfo.perf;
++ px = pr->performance;
++
++ switch (action) {
++ case PROCESSOR_PM_CHANGE:
++ /* ppc dynamic handle */
++ perf->flags = XEN_PX_PPC;
++ perf->platform_limit = pr->performance_platform_limit;
++
++ ret = HYPERVISOR_dom0_op(&op);
++ break;
++
++ case PROCESSOR_PM_INIT:
++ /* px normal init */
++ perf->flags = XEN_PX_PPC |
++ XEN_PX_PCT |
++ XEN_PX_PSS |
++ XEN_PX_PSD;
++
++ /* ppc */
++ perf->platform_limit = pr->performance_platform_limit;
++
++ /* pct */
++ xen_convert_pct_reg(&perf->control_register,
++ &px->control_register);
++ xen_convert_pct_reg(&perf->status_register,
++ &px->status_register);
++
++ /* pss */
++ perf->state_count = px->state_count;
++ states = kzalloc(px->state_count*sizeof(xen_processor_px_t),
++ GFP_KERNEL);
++ if (!states)
++ return -ENOMEM;
++ xen_convert_pss_states(states, px->states, px->state_count);
++ set_xen_guest_handle(perf->states, states);
++
++ /* psd */
++ pdomain = &px->domain_info;
++ xen_convert_psd_pack(&perf->domain_info, pdomain);
++ if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
++ perf->shared_type = CPUFREQ_SHARED_TYPE_ALL;
++ else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
++ perf->shared_type = CPUFREQ_SHARED_TYPE_ANY;
++ else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
++ perf->shared_type = CPUFREQ_SHARED_TYPE_HW;
++ else {
++ ret = -ENODEV;
++ kfree(states);
++ break;
++ }
++
++ ret = HYPERVISOR_dom0_op(&op);
++ kfree(states);
++ break;
++
++ default:
++ break;
++ }
++
++ return ret;
++}
++
++static int xen_tx_notifier(struct acpi_processor *pr, int action)
++{
++ return -EINVAL;
++}
++static int xen_hotplug_notifier(struct acpi_processor *pr, int event)
++{
++ return -EINVAL;
++}
++
++static int __init xen_acpi_processor_extcntl_init(void)
++{
++ unsigned int pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
++
++ if (!pmbits)
++ return 0;
++ if (pmbits & XEN_PROCESSOR_PM_CX)
++ xen_ops.pm_ops[PM_TYPE_IDLE] = xen_cx_notifier;
++ if (pmbits & XEN_PROCESSOR_PM_PX)
++ xen_ops.pm_ops[PM_TYPE_PERF] = xen_px_notifier;
++ if (pmbits & XEN_PROCESSOR_PM_TX)
++ xen_ops.pm_ops[PM_TYPE_THR] = xen_tx_notifier;
++
++ return 0;
++}
++
++subsys_initcall(xen_acpi_processor_extcntl_init);
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
-index f5bbd9e..939721e 100644
+index f5bbd9e..d2f862d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -43,6 +43,7 @@
@@ -5837,7 +6454,15 @@ index f5bbd9e..939721e 100644
balloon_stats.target_pages = target;
schedule_work(&balloon_worker);
}
-@@ -426,12 +403,10 @@ static int __init balloon_init(void)
+@@ -418,7 +395,6 @@ static struct notifier_block xenstore_notifier;
+ static int __init balloon_init(void)
+ {
+ unsigned long pfn;
+- struct page *page;
+
+ if (!xen_pv_domain())
+ return -ENODEV;
+@@ -426,12 +402,10 @@ static int __init balloon_init(void)
pr_info("xen_balloon: Initialising balloon driver.\n");
balloon_stats.current_pages = min(xen_start_info->nr_pages, max_pfn);
@@ -5850,7 +6475,22 @@ index f5bbd9e..939721e 100644
init_timer(&balloon_timer);
balloon_timer.data = 0;
-@@ -464,6 +439,101 @@ static void balloon_exit(void)
+@@ -441,9 +415,11 @@ static int __init balloon_init(void)
+
+ /* Initialise the balloon with excess memory space. */
+ for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
+- page = pfn_to_page(pfn);
+- if (!PageReserved(page))
+- balloon_append(page);
++ if (page_is_ram(pfn)) {
++ struct page *page = pfn_to_page(pfn);
++ if (!PageReserved(page))
++ balloon_append(page);
++ }
+ }
+
+ target_watch.callback = watch_target;
+@@ -464,6 +440,101 @@ static void balloon_exit(void)
module_exit(balloon_exit);
@@ -5952,7 +6592,7 @@ index f5bbd9e..939721e 100644
#define BALLOON_SHOW(name, format, args...) \
static ssize_t show_##name(struct sys_device *dev, \
struct sysdev_attribute *attr, \
-@@ -476,9 +546,6 @@ module_exit(balloon_exit);
+@@ -476,9 +547,6 @@ module_exit(balloon_exit);
BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high));
@@ -5962,7 +6602,7 @@ index f5bbd9e..939721e 100644
BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(balloon_stats.driver_pages));
static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr,
-@@ -548,7 +615,6 @@ static struct attribute *balloon_info_attrs[] = {
+@@ -548,7 +616,6 @@ static struct attribute *balloon_info_attrs[] = {
&attr_current_kb.attr,
&attr_low_kb.attr,
&attr_high_kb.attr,
@@ -7667,7 +8307,7 @@ index 0000000..650f4b3
+ (void)xenbus_register_backend(&blkback);
+}
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
-index abad71b..e2127bd 100644
+index abad71b..96aebd4 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -16,7 +16,7 @@
@@ -7786,7 +8426,7 @@ index abad71b..e2127bd 100644
if (irq_info[irq].type == IRQT_UNBOUND)
break;
-@@ -350,6 +384,297 @@ static int find_unbound_irq(void)
+@@ -350,6 +384,299 @@ static int find_unbound_irq(void)
return irq;
}
@@ -7985,6 +8625,7 @@ index abad71b..e2127bd 100644
+ return irq;
+}
+
++#ifdef CONFIG_PCI_MSI
+int xen_destroy_irq(int irq)
+{
+ struct irq_desc *desc;
@@ -8070,6 +8711,7 @@ index abad71b..e2127bd 100644
+ spin_unlock(&irq_mapping_update_lock);
+ return irq;
+}
++#endif
+
+int xen_vector_from_irq(unsigned irq)
+{
@@ -8084,7 +8726,7 @@ index abad71b..e2127bd 100644
int bind_evtchn_to_irq(unsigned int evtchn)
{
int irq;
-@@ -409,8 +734,23 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
+@@ -409,8 +736,23 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
return irq;
}
@@ -8109,7 +8751,7 @@ index abad71b..e2127bd 100644
{
struct evtchn_bind_virq bind_virq;
int evtchn, irq;
-@@ -501,6 +841,29 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
+@@ -501,6 +843,29 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
}
EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
@@ -8139,7 +8781,7 @@ index abad71b..e2127bd 100644
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
-@@ -532,6 +895,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
+@@ -532,6 +897,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
if (irq < 0)
return irq;
@@ -8147,7 +8789,7 @@ index abad71b..e2127bd 100644
retval = request_irq(irq, handler, irqflags, devname, dev_id);
if (retval != 0) {
unbind_from_irq(irq);
-@@ -924,13 +1288,38 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
+@@ -924,13 +1290,38 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
.retrigger = retrigger_dynirq,
};
@@ -8187,7 +8829,7 @@ index abad71b..e2127bd 100644
init_evtchn_cpu_bindings();
-@@ -939,4 +1328,6 @@ void __init xen_init_IRQ(void)
+@@ -939,4 +1330,6 @@ void __init xen_init_IRQ(void)
mask_evtchn(i);
irq_ctx_init(smp_processor_id());
@@ -11176,10 +11818,10 @@ index 0000000..a492288
+}
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
new file mode 100644
-index 0000000..5156278
+index 0000000..ae693e7
--- /dev/null
+++ b/drivers/xen/pci.c
-@@ -0,0 +1,116 @@
+@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2009, Intel Corporation.
+ *
@@ -11200,8 +11842,13 @@ index 0000000..5156278
+ */
+
+#include <linux/pci.h>
++
++#include <xen/interface/xen.h>
+#include <xen/interface/physdev.h>
++
++#include <asm/xen/hypervisor.h>
+#include <asm/xen/hypercall.h>
++
+#include "../pci/pci.h"
+
+
@@ -11292,6 +11939,9 @@ index 0000000..5156278
+
+static int __init register_xen_pci_notifier(void)
+{
++ if (!xen_pv_domain())
++ return 0;
++
+ return bus_register_notifier(&pci_bus_type, &device_nb);
+}
+
@@ -13192,6 +13842,19 @@ index 0000000..af10804
+ .read = xsd_read,
+ .release = xsd_release,
+};
+diff --git a/include/acpi/processor.h b/include/acpi/processor.h
+index baf1e0a..f325963 100644
+--- a/include/acpi/processor.h
++++ b/include/acpi/processor.h
+@@ -295,6 +295,8 @@ static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx
+ void acpi_processor_ppc_init(void);
+ void acpi_processor_ppc_exit(void);
+ int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
++int acpi_processor_get_performance_info(struct acpi_processor *pr);
++int acpi_processor_get_psd(struct acpi_processor *pr);
+ #else
+ static inline void acpi_processor_ppc_init(void)
+ {
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index b4326b5..bad75d1 100644
--- a/include/asm-generic/pci.h
@@ -13263,14 +13926,16 @@ index 4e65c16..84ad8f0 100644
+header-y += privcmd.h
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
new file mode 100644
-index 0000000..fea4cfb
+index 0000000..3d73163
--- /dev/null
+++ b/include/xen/acpi.h
-@@ -0,0 +1,23 @@
+@@ -0,0 +1,84 @@
+#ifndef _XEN_ACPI_H
+#define _XEN_ACPI_H
+
+#include <linux/types.h>
++#include <acpi/acpi_drivers.h>
++#include <acpi/processor.h>
+
+#ifdef CONFIG_XEN_S3
+#include <asm/xen/hypervisor.h>
@@ -13289,6 +13954,65 @@ index 0000000..fea4cfb
+int acpi_notify_hypervisor_state(u8 sleep_state,
+ u32 pm1a_cnt, u32 pm1b_cnd);
+
++/*
++ * Following are interfaces for xen acpi processor control
++ */
++
++/* Events notified to xen */
++#define PROCESSOR_PM_INIT 1
++#define PROCESSOR_PM_CHANGE 2
++#define PROCESSOR_HOTPLUG 3
++
++/* Objects for the PM events */
++#define PM_TYPE_IDLE 0
++#define PM_TYPE_PERF 1
++#define PM_TYPE_THR 2
++#define PM_TYPE_MAX 3
++
++/* Processor hotplug events */
++#define HOTPLUG_TYPE_ADD 0
++#define HOTPLUG_TYPE_REMOVE 1
++
++#ifdef CONFIG_ACPI_PROCESSOR_XEN
++
++struct processor_cntl_xen_ops {
++ /* Transfer processor PM events to xen */
++int (*pm_ops[PM_TYPE_MAX])(struct acpi_processor *pr, int event);
++ /* Notify physical processor status to xen */
++ int (*hotplug)(struct acpi_processor *pr, int type);
++};
++
++extern int processor_cntl_xen(void);
++extern int processor_cntl_xen_pm(void);
++extern int processor_cntl_xen_pmperf(void);
++extern int processor_cntl_xen_pmthr(void);
++extern int processor_cntl_xen_prepare(struct acpi_processor *pr);
++extern int processor_cntl_xen_notify(struct acpi_processor *pr,
++ int event, int type);
++extern int processor_cntl_xen_power_cache(int cpu, int cx,
++ struct acpi_power_register *reg);
++#else
++
++static inline int processor_cntl_xen(void) { return 0; }
++static inline int processor_cntl_xen_pm(void) { return 0; }
++static inline int processor_cntl_xen_pmperf(void) { return 0; }
++static inline int processor_cntl_xen_pmthr(void) { return 0; }
++static inline int processor_cntl_xen_notify(struct acpi_processor *pr,
++ int event, int type)
++{
++ return 0;
++}
++static inline int processor_cntl_xen_prepare(struct acpi_processor *pr)
++{
++ return 0;
++}
++static inline int processor_cntl_xen_power_cache(int cpu, int cx,
++ struct acpi_power_register *reg)
++{
++ return 0;
++}
++#endif /* CONFIG_ACPI_PROCESSOR_XEN */
++
+#endif /* _XEN_ACPI_H */
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
new file mode 100644
@@ -13779,10 +14503,10 @@ index cd69391..ac5de37 100644
* hypercall since 0x00030202.
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
new file mode 100644
-index 0000000..83e4714
+index 0000000..6783fce
--- /dev/null
+++ b/include/xen/interface/platform.h
-@@ -0,0 +1,222 @@
+@@ -0,0 +1,336 @@
+/******************************************************************************
+ * platform.h
+ *
@@ -13984,6 +14708,119 @@ index 0000000..83e4714
+typedef struct xenpf_getidletime xenpf_getidletime_t;
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_getidletime_t);
+
++#define XENPF_set_processor_pminfo 54
++
++/* ability bits */
++#define XEN_PROCESSOR_PM_CX 1
++#define XEN_PROCESSOR_PM_PX 2
++#define XEN_PROCESSOR_PM_TX 4
++
++/* cmd type */
++#define XEN_PM_CX 0
++#define XEN_PM_PX 1
++#define XEN_PM_TX 2
++
++/* Px sub info type */
++#define XEN_PX_PCT 1
++#define XEN_PX_PSS 2
++#define XEN_PX_PPC 4
++#define XEN_PX_PSD 8
++
++struct xen_power_register {
++ uint32_t space_id;
++ uint32_t bit_width;
++ uint32_t bit_offset;
++ uint32_t access_size;
++ uint64_t address;
++};
++
++struct xen_processor_csd {
++ uint32_t domain; /* domain number of one dependent group */
++ uint32_t coord_type; /* coordination type */
++ uint32_t num; /* number of processors in same domain */
++};
++typedef struct xen_processor_csd xen_processor_csd_t;
++DEFINE_GUEST_HANDLE_STRUCT(xen_processor_csd);
++
++struct xen_processor_cx {
++ struct xen_power_register reg; /* GAS for Cx trigger register */
++ uint8_t type; /* cstate value, c0: 0, c1: 1, ... */
++ uint32_t latency; /* worst latency (ms) to enter/exit this cstate */
++ uint32_t power; /* average power consumption(mW) */
++ uint32_t dpcnt; /* number of dependency entries */
++ GUEST_HANDLE(xen_processor_csd) dp; /* NULL if no dependency */
++};
++typedef struct xen_processor_cx xen_processor_cx_t;
++DEFINE_GUEST_HANDLE_STRUCT(xen_processor_cx);
++
++struct xen_processor_flags {
++ uint32_t bm_control:1;
++ uint32_t bm_check:1;
++ uint32_t has_cst:1;
++ uint32_t power_setup_done:1;
++ uint32_t bm_rld_set:1;
++};
++
++struct xen_processor_power {
++ uint32_t count; /* number of C state entries in array below */
++ struct xen_processor_flags flags; /* global flags of this processor */
++ GUEST_HANDLE(xen_processor_cx) states; /* supported c states */
++};
++
++struct xen_pct_register {
++ uint8_t descriptor;
++ uint16_t length;
++ uint8_t space_id;
++ uint8_t bit_width;
++ uint8_t bit_offset;
++ uint8_t reserved;
++ uint64_t address;
++};
++
++struct xen_processor_px {
++ uint64_t core_frequency; /* megahertz */
++ uint64_t power; /* milliWatts */
++ uint64_t transition_latency; /* microseconds */
++ uint64_t bus_master_latency; /* microseconds */
++ uint64_t control; /* control value */
++ uint64_t status; /* success indicator */
++};
++typedef struct xen_processor_px xen_processor_px_t;
++DEFINE_GUEST_HANDLE_STRUCT(xen_processor_px);
++
++struct xen_psd_package {
++ uint64_t num_entries;
++ uint64_t revision;
++ uint64_t domain;
++ uint64_t coord_type;
++ uint64_t num_processors;
++};
++
++struct xen_processor_performance {
++ uint32_t flags; /* flag for Px sub info type */
++ uint32_t platform_limit; /* Platform limitation on freq usage */
++ struct xen_pct_register control_register;
++ struct xen_pct_register status_register;
++ uint32_t state_count; /* total available performance states */
++ GUEST_HANDLE(xen_processor_px) states;
++ struct xen_psd_package domain_info;
++ uint32_t shared_type; /* coordination type of this processor */
++};
++typedef struct xen_processor_performance xen_processor_performance_t;
++DEFINE_GUEST_HANDLE_STRUCT(xen_processor_performance);
++
++struct xenpf_set_processor_pminfo {
++ /* IN variables */
++ uint32_t id; /* ACPI CPU ID */
++ uint32_t type; /* {XEN_PM_CX, XEN_PM_PX} */
++ union {
++ struct xen_processor_power power;/* Cx: _CST/_CSD */
++ struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */
++ };
++};
++typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
++DEFINE_GUEST_HANDLE_STRUCT(xenpf_set_processor_pminfo);
++
+struct xen_platform_op {
+ uint32_t cmd;
+ uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -13998,6 +14835,7 @@ index 0000000..83e4714
+ struct xenpf_enter_acpi_sleep enter_acpi_sleep;
+ struct xenpf_change_freq change_freq;
+ struct xenpf_getidletime getidletime;
++ struct xenpf_set_processor_pminfo set_pminfo;
+ uint8_t pad[128];
+ } u;
+};
@@ -14441,7 +15279,7 @@ index 0000000..f31fdab
+
+#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
-index 2befa3e..327db61 100644
+index 2befa3e..812ffd5 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -184,6 +184,8 @@
@@ -14453,7 +15291,7 @@ index 2befa3e..327db61 100644
struct mmuext_op {
unsigned int cmd;
union {
-@@ -449,6 +451,45 @@ struct start_info {
+@@ -449,9 +451,49 @@ struct start_info {
int8_t cmd_line[MAX_GUEST_CMDLINE];
};
@@ -14499,7 +15337,11 @@ index 2befa3e..327db61 100644
/* These flags are passed in the 'flags' field of start_info_t. */
#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
-@@ -461,6 +502,8 @@ typedef uint8_t xen_domain_handle_t[16];
++#define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
+
+ typedef uint64_t cpumap_t;
+
+@@ -461,6 +503,8 @@ typedef uint8_t xen_domain_handle_t[16];
#define __mk_unsigned_long(x) x ## UL
#define mk_unsigned_long(x) __mk_unsigned_long(x)
--- patch-2.6.31-rc7-git1.bz2.sign DELETED ---
More information about the scm-commits
mailing list