rpms/kernel/devel drm-next.patch, 1.13, 1.14 drm-page-flip.patch, 1.3, 1.4 drm-vga-arb.patch, 1.5, 1.6 kernel.spec, 1.1734, 1.1735

Dave Airlie airlied at fedoraproject.org
Tue Aug 25 00:53:29 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12468

Modified Files:
	drm-page-flip.patch drm-vga-arb.patch kernel.spec 
Added Files:
	drm-next.patch 
Log Message:
* Tue Aug 25 2009 Dave Airlie <airlied at redhat.com>
- pull in drm-next tree + rebase around it


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.13 -r 1.14 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	25 Aug 2009 00:53:28 -0000	1.14
@@ -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_ */

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.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- drm-page-flip.patch	12 Aug 2009 21:13:59 -0000	1.3
+++ drm-page-flip.patch	25 Aug 2009 00:53:29 -0000	1.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
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- drm-vga-arb.patch	5 Aug 2009 00:18:52 -0000	1.5
+++ drm-vga-arb.patch	25 Aug 2009 00:53:29 -0000	1.6
@@ -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.1734
retrieving revision 1.1735
diff -u -p -r1.1734 -r1.1735
--- kernel.spec	25 Aug 2009 00:43:51 -0000	1.1734
+++ kernel.spec	25 Aug 2009 00:53:29 -0000	1.1735
@@ -680,6 +680,7 @@ 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
@@ -1303,6 +1304,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
@@ -1997,6 +1999,9 @@ fi
 # and build.
 
 %changelog
+* 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
 




More information about the scm-commits mailing list