[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-intel: Changes to 'debian-experimental'



Rebased ref, commits from common ancestor:
commit 99cc8c0c3d1fa88328033c78bddfb23c8d1128ff
Author: Cyril Brulebois <kibi@debian.org>
Date:   Thu Mar 31 04:48:04 2011 +0200

    Upload to experimental.

diff --git a/debian/changelog b/debian/changelog
index 80d8038..e276aa5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-xserver-xorg-video-intel (2:2.14.902-1+exp1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.14.902-1+exp1) experimental; urgency=low
 
   * Rebuild against Xserver 1.10 rc3.
 
- -- Cyril Brulebois <kibi@debian.org>  Thu, 31 Mar 2011 04:44:34 +0200
+ -- Cyril Brulebois <kibi@debian.org>  Thu, 31 Mar 2011 04:47:57 +0200
 
 xserver-xorg-video-intel (2:2.14.902-1) UNRELEASED; urgency=low
 

commit 2597abc859c51b02ba7bff1e5eee4a36faf70811
Author: Cyril Brulebois <kibi@debian.org>
Date:   Thu Mar 31 04:45:57 2011 +0200

    Rebuild against Xserver 1.10 rc3.
    
    Do not fake an upload of 2:2.14.902-1 to unstable, which might only
    happen once xorg-server 1.9.x reaches testing. So keep both last entries
    as UNRELEASED.

diff --git a/debian/changelog b/debian/changelog
index 5209654..80d8038 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-video-intel (2:2.14.902-1+exp1) UNRELEASED; urgency=low
+
+  * Rebuild against Xserver 1.10 rc3.
+
+ -- Cyril Brulebois <kibi@debian.org>  Thu, 31 Mar 2011 04:44:34 +0200
+
 xserver-xorg-video-intel (2:2.14.902-1) UNRELEASED; urgency=low
 
   * New upstream snapshot (2.15 rc2).
diff --git a/debian/control b/debian/control
index ead90dd..b32165f 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends:
  debhelper (>= 8),
  dh-autoreconf,
  pkg-config,
- xserver-xorg-dev (>= 2:1.9.4),
+ xserver-xorg-dev (>= 2:1.9.99.903),
  x11proto-core-dev,
  x11proto-fonts-dev,
  x11proto-xinerama-dev,

commit 4b3d9aa8abd2e995af5e2de3decae28d4111251b
Author: Cyril Brulebois <kibi@debian.org>
Date:   Wed Mar 30 03:16:35 2011 +0200

    Bump changelogs.

diff --git a/ChangeLog b/ChangeLog
index 5f33e75..bd38e98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,146 @@
+commit a2c8442fcb29ef2d0df41518952a2d8df1671070
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 29 11:38:45 2011 +0100
+
+    configure: version bump for 2.14.902 snapshot
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 2f2680793952876c89796174bed53c824fe6d1cb
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 29 11:38:18 2011 +0100
+
+    NEWS: Entry for 2.14.902 snapshot
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 7ccbec801e9ee32fc110db730dfec674a94dea21
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Mar 24 11:06:57 2011 -0700
+
+    Recover from i830_dri2_add_frame_event out-of-memory condition
+    
+    If adding either the frame or client resources fails, we need to clean
+    up afterwards properly.
+    
+    First, add_frame_event needs to internally clean up after itself by
+    undoing any partial execution. Second, the callers need to look at the
+    return value and free the swap/flip info structure when necessary.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Julien Cristau <jcristau@debian.org>
+
+commit ec133abc4bd8caba15ed54e18621b816afb06981
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 24 15:32:50 2011 +0000
+
+    Use the per-generation batch context switch for atomic sequences
+    
+    A modest boost to throughput and reduction in CPU overhead from
+    not flushing the batch on every transition from BLT to RENDER.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 86f23f21ab57fcbc031bcd2b8f432a08ff4cc320
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Mar 23 17:07:49 2011 -0700
+
+    Skip client and drawable resource delete calls when deleting frame event
+    
+    As the frame_event is about to be freed, there's no point in cleaning
+    up references to the drawable and client.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e1ff5182304e00c0d392092069422cae7626cf8d
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Mar 9 17:00:41 2011 -0800
+
+    Handle drawable/client destruction in pending swaps/flips
+    
+    A pending swap or flip holds references to drawables and clients which
+    become invalid when destroyed. Add suitable resources to the database
+    to track those lifetimes and clean up the pending data structure then.
+    
+    Later, when the pending swap or flip occurs, handle a missing drawable
+    by just discarding the flip or swap. Handle a missing client by not
+    sending an event or reply.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit aa0328f342177e33f9c863531712eaa4577b5f2b
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Mar 9 16:23:22 2011 -0800
+
+    dri2: Make DRI2FrameEvent public and use instead of void *
+    
+    Instead of using void * for all of the flip_info and swap_info
+    pointers, just make the underlying structure a public data type and
+    use that.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit ee740778f5d5355c04f6fc4564f598993b106d62
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 16 08:37:24 2011 +0000
+
+    i915/video: Clip indirect Xv output
+    
+    In the case of a singular clip box and rendering onto the front buffer
+    larger than 2048, the clip extents were being ignored.  Here we can
+    simply reduce the size of the indirect pixmap to the clip extents.
+    
+    Reported-by: Michael Chang <mchang@novell.com>
+    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35346
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 014fc7abb7b2cc2110e3ab9a0bd6f7cff2c64c05
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 9 17:10:50 2011 +0000
+
+    dri: Disable page-flip between a tiled buffer and a linear scanout
+    
+    Keith Packard pointed out a loophole that could cause the DDX to end up
+    with a tiled scanout even if the user required a linear framebuffer;
+    that is by using page-flipping we could replace the scanout pixmap with
+    another of our choosing, and not necessarily tiled.
+    
+    Close that loophole by only allowing an exchange of buffers between
+    identical tiling modes. For the common case, this is fine since they
+    will indeed be allocated with the same tiling. For the linear
+    framebuffer case with mesa using a tiled pixmap, we force it to blit
+    onto the scanout instead.
+    
+    Reported-by: Keith Packard <keith.packard@intel.com>
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 049ce4397ddf7fd088ce364cbb53cacf5133176f
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 9 08:27:02 2011 +0000
+
+    Give each user of tiling separate xorg.conf options
+    
+    So that you can indeed allocate a linear framebuffer if you so desire
+    without breaking mesa.
+    
+    Adds:
+    
+    Section "Driver"
+      Option "LinearFramebuffer" "False|True" # default false
+    EndSection
+    
+    to xorg.conf
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0bb1a5f19e09dc553761ddd90bf6319eab94a597
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 9 08:26:44 2011 +0000
+
+    Update priv->stride after bo reallocation
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
 commit 34f9a3335f96b16ef9df6213eb0a586c94f8f05b
 Author: Chris Wilson <chris@chris-wilson.co.uk>
 Date:   Wed Mar 2 17:46:19 2011 +0000
diff --git a/debian/changelog b/debian/changelog
index a4c67d8..5209654 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,6 @@
-xserver-xorg-video-intel (2:2.14.901-1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.14.902-1) UNRELEASED; urgency=low
 
-  * New upstream snapshot (2.15 rc1).
+  * New upstream snapshot (2.15 rc2).
   * Apparently, using libXvMC means adding the name of the library (like
     libI810XvMC.so.1 or libIntelXvMC.so.1) to the libXvMC configuration
     file (/etc/X11/XvMCConfig). Accordingly, remove extraneous symlinks:

commit a2c8442fcb29ef2d0df41518952a2d8df1671070
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 29 11:38:45 2011 +0100

    configure: version bump for 2.14.902 snapshot
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index e837738..b90e071 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.63])
 AC_INIT([xf86-video-intel],
-        [2.14.901],
+        [2.14.902],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 2f2680793952876c89796174bed53c824fe6d1cb
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 29 11:38:18 2011 +0100

    NEWS: Entry for 2.14.902 snapshot
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/NEWS b/NEWS
index c897bfd..d163097 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+Snapshot 2.14.902 (2011-03-29)
+==============================
+This is the second release candidate in preparation for the upcoming
+2.15.0 release. We will appreciate any feedback we can get from
+testing of this snapshot.
+
+As befits testing of release candidates, no major regression was found and
+a couple more bugs have been fixed.
+
+Bugs fixed in this snapshot (compared to 2.14.901)
+--------------------------------------------------
+
+* Clients disappearing with pending swaps
+
+* Incorrect clipping of Xv output on i915 across extended desktops
+  https://bugs.freedesktop.org/show_bug.cgi?id=35346
+
+* Introduction of a LinearFramebuffer option. (Defaults to tiled for
+  performance and power saving.)
+
+
 Snapshot 2.14.901 (2011-03-02)
 ==============================
 This is the first release candidate in preparation for the upcoming

commit 7ccbec801e9ee32fc110db730dfec674a94dea21
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Mar 24 11:06:57 2011 -0700

    Recover from i830_dri2_add_frame_event out-of-memory condition
    
    If adding either the frame or client resources fails, we need to clean
    up afterwards properly.
    
    First, add_frame_event needs to internally clean up after itself by
    undoing any partial execution. Second, the callers need to look at the
    return value and free the swap/flip info structure when necessary.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Julien Cristau <jcristau@debian.org>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 3b80823..16e42f1 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -625,8 +625,10 @@ i830_dri2_add_frame_event(DRI2FrameEventPtr frame_event)
 	if (!AddResource(frame_event->client_id, frame_event_client_type, frame_event))
 		return FALSE;
 
-	if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, frame_event))
+	if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, frame_event)) {
+		FreeResourceByType(frame_event->client_id, frame_event_client_type, TRUE);
 		return FALSE;
+	}
 
 	return TRUE;
 }
@@ -705,7 +707,10 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 	flip_info->event_data = data;
 	flip_info->frame = target_msc;
 
-	i830_dri2_add_frame_event(flip_info);
+	if (!i830_dri2_add_frame_event(flip_info)) {
+	    free(flip_info);
+	    return FALSE;
+	}
 
 	/* Page flip the full screen buffer */
 	back_priv = back->driverPrivate;
@@ -955,11 +960,16 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	swap_info->event_data = data;
 	swap_info->front = front;
 	swap_info->back = back;
+
+	if (!i830_dri2_add_frame_event(swap_info)) {
+	    free(swap_info);
+	    swap_info = NULL;
+	    goto blit_fallback;
+	}
+
 	I830DRI2ReferenceBuffer(front);
 	I830DRI2ReferenceBuffer(back);
 
-	i830_dri2_add_frame_event(swap_info);
-
 	/* Get current count */
 	vbl.request.type = DRM_VBLANK_RELATIVE;
 	if (pipe > 0)

commit ec133abc4bd8caba15ed54e18621b816afb06981
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 24 15:32:50 2011 +0000

    Use the per-generation batch context switch for atomic sequences
    
    A modest boost to throughput and reduction in CPU overhead from
    not flushing the batch on every transition from BLT to RENDER.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_batchbuffer.h b/src/intel_batchbuffer.h
index 3f783b0..0d6c3f7 100644
--- a/src/intel_batchbuffer.h
+++ b/src/intel_batchbuffer.h
@@ -63,8 +63,10 @@ static inline void intel_batch_start_atomic(ScrnInfoPtr scrn, unsigned int sz)
 
 	assert(!intel->in_batch_atomic);
 
-	if (intel->current_batch != RENDER_BATCH)
-		intel_batch_submit(scrn, FALSE);
+	if (intel->current_batch != RENDER_BATCH) {
+		if (intel->current_batch && intel->context_switch)
+			intel->context_switch(intel, RENDER_BATCH);
+	}
 
 	intel_batch_require_space(scrn, intel, sz * 4);
 	intel->current_batch = RENDER_BATCH;

commit 86f23f21ab57fcbc031bcd2b8f432a08ff4cc320
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Mar 23 17:07:49 2011 -0700

    Skip client and drawable resource delete calls when deleting frame event
    
    As the frame_event is about to be freed, there's no point in cleaning
    up references to the drawable and client.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index f039e9d..3b80823 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -635,9 +635,9 @@ static void
 i830_dri2_del_frame_event(DRI2FrameEventPtr frame_event)
 {
 	if (frame_event->client_id)
-		FreeResourceByType(frame_event->client_id, frame_event_client_type, FALSE);
+		FreeResourceByType(frame_event->client_id, frame_event_client_type, TRUE);
 	if (frame_event->drawable_id)
-		FreeResourceByType(frame_event->drawable_id, frame_event_drawable_type, FALSE);
+		FreeResourceByType(frame_event->drawable_id, frame_event_drawable_type, TRUE);
 }
 
 static void

commit e1ff5182304e00c0d392092069422cae7626cf8d
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Mar 9 17:00:41 2011 -0800

    Handle drawable/client destruction in pending swaps/flips
    
    A pending swap or flip holds references to drawables and clients which
    become invalid when destroyed. Add suitable resources to the database
    to track those lifetimes and clean up the pending data structure then.
    
    Later, when the pending swap or flip occurs, handle a missing drawable
    by just discarding the flip or swap. Handle a missing client by not
    sending an event or reply.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/src/intel.h b/src/intel.h
index 711449a..4179989 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -472,6 +472,7 @@ enum DRI2FrameEventType {
 
 typedef struct _DRI2FrameEvent {
 	XID drawable_id;
+	XID client_id;	/* fake client ID to track client destruction */
 	ClientPtr client;
 	enum DRI2FrameEventType type;
 	int frame;
diff --git a/src/intel_display.c b/src/intel_display.c
index eb07cf5..4734844 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -1512,7 +1512,7 @@ static const xf86CrtcConfigFuncsRec intel_xf86crtc_config_funcs = {
 
 static void
 intel_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec,
-		       unsigned int tv_usec, DRI2FrameEventPtr event)
+		       unsigned int tv_usec, void *event)
 {
 	I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event);
 }
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 9e8c370..f039e9d 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -577,6 +577,69 @@ I830DRI2DrawablePipe(DrawablePtr pDraw)
 	return pipe;
 }
 
+static RESTYPE	frame_event_client_type, frame_event_drawable_type;
+
+static int
+i830_dri2_frame_event_client_gone(void *data, XID id)
+{
+	DRI2FrameEventPtr	frame_event = data;
+
+	frame_event->client = NULL;
+	frame_event->client_id = None;
+	return Success;
+}
+
+static int
+i830_dri2_frame_event_drawable_gone(void *data, XID id)
+{
+	DRI2FrameEventPtr	frame_event = data;
+
+	frame_event->drawable_id = None;
+	return Success;
+}
+
+static Bool
+i830_dri2_register_frame_event_resource_types(void)
+{
+	frame_event_client_type = CreateNewResourceType(i830_dri2_frame_event_client_gone, "Frame Event Client");
+	if (!frame_event_client_type)
+		return FALSE;
+
+	frame_event_drawable_type = CreateNewResourceType(i830_dri2_frame_event_drawable_gone, "Frame Event Drawable");
+	if (!frame_event_drawable_type)
+		return FALSE;
+
+	return TRUE;
+}
+
+/*
+ * Hook this frame event into the server resource
+ * database so we can clean it up if the drawable or
+ * client exits while the swap is pending
+ */
+static Bool
+i830_dri2_add_frame_event(DRI2FrameEventPtr frame_event)
+{
+	frame_event->client_id = FakeClientID(frame_event->client->index);
+
+	if (!AddResource(frame_event->client_id, frame_event_client_type, frame_event))
+		return FALSE;
+
+	if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, frame_event))
+		return FALSE;
+
+	return TRUE;
+}
+
+static void
+i830_dri2_del_frame_event(DRI2FrameEventPtr frame_event)
+{
+	if (frame_event->client_id)
+		FreeResourceByType(frame_event->client_id, frame_event_client_type, FALSE);
+	if (frame_event->drawable_id)
+		FreeResourceByType(frame_event->drawable_id, frame_event_drawable_type, FALSE);
+}
+
 static void
 I830DRI2ExchangeBuffers(DrawablePtr draw, DRI2BufferPtr front,
 			DRI2BufferPtr back)
@@ -642,11 +705,18 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 	flip_info->event_data = data;
 	flip_info->frame = target_msc;
 
+	i830_dri2_add_frame_event(flip_info);
+
 	/* Page flip the full screen buffer */
 	back_priv = back->driverPrivate;
-	return intel_do_pageflip(intel,
-				 intel_get_pixmap_bo(back_priv->pixmap),
-				 flip_info, ref_crtc_hw_id);
+	if (intel_do_pageflip(intel,
+			      intel_get_pixmap_bo(back_priv->pixmap),
+			      flip_info, ref_crtc_hw_id))
+		return TRUE;
+
+	i830_dri2_del_frame_event(flip_info);
+	free(flip_info);
+	return FALSE;
 }
 
 static Bool
@@ -682,7 +752,7 @@ can_exchange(DRI2BufferPtr front, DRI2BufferPtr back)
 }
 
 void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
-			       unsigned int tv_usec, DRI2FrameEventPtr event)
+			       unsigned int tv_usec, DRI2FrameEventPtr swap_info)
 {
 	DrawablePtr drawable;
 	ScreenPtr screen;
@@ -690,12 +760,16 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 	intel_screen_private *intel;
 	int status;
 
-	status = dixLookupDrawable(&drawable, event->drawable_id, serverClient,
-				   M_ANY, DixWriteAccess);
+	if (!swap_info->drawable_id)
+		status = BadDrawable;
+	else
+		status = dixLookupDrawable(&drawable, swap_info->drawable_id, serverClient,
+					   M_ANY, DixWriteAccess);
 	if (status != Success) {
-		I830DRI2DestroyBuffer(NULL, event->front);
-		I830DRI2DestroyBuffer(NULL, event->back);
-		free(event);
+		i830_dri2_del_frame_event(swap_info);
+		I830DRI2DestroyBuffer(NULL, swap_info->front);
+		I830DRI2DestroyBuffer(NULL, swap_info->back);
+		free(swap_info);
 		return;
 	}
 
@@ -703,28 +777,28 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 	scrn = xf86Screens[screen->myNum];
 	intel = intel_get_screen_private(scrn);
 
-	switch (event->type) {
+	switch (swap_info->type) {
 	case DRI2_FLIP:
 		/* If we can still flip... */
 		if (DRI2CanFlip(drawable) && !intel->shadow_present &&
 		    intel->use_pageflipping &&
-		    can_exchange(event->front, event->back) &&
+		    can_exchange(swap_info->front, swap_info->back) &&
 		    I830DRI2ScheduleFlip(intel,
-					 event->client, drawable, event->front,
-					 event->back, event->event_complete,
-					 event->event_data, event->frame)) {
+					 swap_info->client, drawable, swap_info->front,
+					 swap_info->back, swap_info->event_complete,
+					 swap_info->event_data, swap_info->frame)) {
 			I830DRI2ExchangeBuffers(drawable,
-						event->front, event->back);
+						swap_info->front, swap_info->back);
 			break;
 		}
 		/* else fall through to exchange/blit */
 	case DRI2_SWAP: {
 		int swap_type;
 
-		if (DRI2CanExchange(drawable) && can_exchange(event->front,
-							      event->back)) {
+		if (DRI2CanExchange(drawable) && can_exchange(swap_info->front,
+							      swap_info->back)) {
 			I830DRI2ExchangeBuffers(drawable,
-						event->front, event->back);
+						swap_info->front, swap_info->back);
 			swap_type = DRI2_EXCHANGE_COMPLETE;
 		} else {
 			BoxRec	    box;
@@ -737,17 +811,19 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 			REGION_INIT(pScreen, &region, &box, 0);
 
 			I830DRI2CopyRegion(drawable,
-					   &region, event->front, event->back);
+					   &region, swap_info->front, swap_info->back);
 			swap_type = DRI2_BLIT_COMPLETE;
 		}
-		DRI2SwapComplete(event->client, drawable, frame, tv_sec, tv_usec,
+		DRI2SwapComplete(swap_info->client, drawable, frame, tv_sec, tv_usec,
 				 swap_type,
-				 event->event_complete, event->event_data);
+				 swap_info->client ? swap_info->event_complete : NULL,
+				 swap_info->event_data);
 		break;
 	}
 	case DRI2_WAITMSC:
-		DRI2WaitMSCComplete(event->client, drawable,
-				    frame, tv_sec, tv_usec);
+		if (swap_info->client)
+			DRI2WaitMSCComplete(swap_info->client, drawable,
+					    frame, tv_sec, tv_usec);
 		break;
 	default:
 		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
@@ -756,23 +832,28 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 		break;
 	}
 
-	I830DRI2DestroyBuffer(drawable, event->front);
-	I830DRI2DestroyBuffer(drawable, event->back);
-	free(event);
+	i830_dri2_del_frame_event(swap_info);
+	I830DRI2DestroyBuffer(drawable, swap_info->front);
+	I830DRI2DestroyBuffer(drawable, swap_info->back);
+	free(swap_info);
 }
 
 void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
-			      unsigned int tv_usec, DRI2FrameEventPtr flip)
+			      unsigned int tv_usec, DRI2FrameEventPtr flip_info)
 {
 	DrawablePtr drawable;
 	ScreenPtr screen;
 	ScrnInfoPtr scrn;
 	int status;
 
-	status = dixLookupDrawable(&drawable, flip->drawable_id, serverClient,
-				     M_ANY, DixWriteAccess);
+	if (!flip_info->drawable_id)
+		status = BadDrawable;
+	else
+		status = dixLookupDrawable(&drawable, flip_info->drawable_id, serverClient,
+					   M_ANY, DixWriteAccess);
 	if (status != Success) {
-		free(flip);
+		i830_dri2_del_frame_event(flip_info);
+		free(flip_info);
 		return;
 	}
 
@@ -780,13 +861,13 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 	scrn = xf86Screens[screen->myNum];
 
 	/* We assume our flips arrive in order, so we don't check the frame */
-	switch (flip->type) {
+	switch (flip_info->type) {
 	case DRI2_SWAP:
 		/* Check for too small vblank count of pageflip completion, taking wraparound
 		 * into account. This usually means some defective kms pageflip completion,
 		 * causing wrong (msc, ust) return values and possible visual corruption.
 		 */
-		if ((frame < flip->frame) && (flip->frame - frame < 5)) {
+		if ((frame < flip_info->frame) && (flip_info->frame - frame < 5)) {
 			static int limit = 5;
 
 			/* XXX we are currently hitting this path with older
@@ -795,7 +876,7 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 			if (limit) {
 				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
 					   "%s: Pageflip completion has impossible msc %d < target_msc %d\n",
-					   __func__, frame, flip->frame);
+					   __func__, frame, flip_info->frame);
 				limit--;
 			}
 
@@ -803,9 +884,9 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 			frame = tv_sec = tv_usec = 0;
 		}
 
-		DRI2SwapComplete(flip->client, drawable, frame, tv_sec, tv_usec,
-				 DRI2_FLIP_COMPLETE, flip->event_complete,
-				 flip->event_data);
+		DRI2SwapComplete(flip_info->client, drawable, frame, tv_sec, tv_usec,
+				 DRI2_FLIP_COMPLETE, flip_info->client ? flip_info->event_complete : NULL,
+				 flip_info->event_data);
 	break;
 	default:
 		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
@@ -814,7 +895,8 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 		break;
 	}
 
-	free(flip);
+	i830_dri2_del_frame_event(flip_info);
+	free(flip_info);
 }
 
 /*
@@ -876,6 +958,8 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	I830DRI2ReferenceBuffer(front);
 	I830DRI2ReferenceBuffer(back);
 
+	i830_dri2_add_frame_event(swap_info);
+
 	/* Get current count */
 	vbl.request.type = DRM_VBLANK_RELATIVE;
 	if (pipe > 0)
@@ -1008,6 +1092,7 @@ blit_fallback:
 
 	DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data);
 	if (swap_info) {
+	    i830_dri2_del_frame_event(swap_info);
 	    I830DRI2DestroyBuffer(draw, swap_info->front);
 	    I830DRI2DestroyBuffer(draw, swap_info->back);
 	    free(swap_info);
@@ -1198,6 +1283,8 @@ out_complete:
 }
 #endif
 
+static int dri2_server_generation;
+
 Bool I830DRI2ScreenInit(ScreenPtr screen)
 {
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
@@ -1224,6 +1311,14 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 		return FALSE;
 	}
 
+	if (serverGeneration != dri2_server_generation) {
+	    dri2_server_generation = serverGeneration;
+	    if (!i830_dri2_register_frame_event_resource_types()) {
+		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+			   "Cannot register DRI2 frame event resources\n");
+		return FALSE;
+	    }
+	}
 	intel->deviceName = drmGetDeviceNameFromFd(intel->drmSubFD);
 	memset(&info, '\0', sizeof(info));
 	info.fd = intel->drmSubFD;

commit aa0328f342177e33f9c863531712eaa4577b5f2b
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Mar 9 16:23:22 2011 -0800

    dri2: Make DRI2FrameEvent public and use instead of void *
    
    Instead of using void * for all of the flip_info and swap_info
    pointers, just make the underlying structure a public data type and
    use that.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/src/intel.h b/src/intel.h
index d2a553f..711449a 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -464,9 +464,28 @@ extern int intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crt
 extern int intel_crtc_id(xf86CrtcPtr crtc);
 extern int intel_output_dpms_status(xf86OutputPtr output);
 
+enum DRI2FrameEventType {
+	DRI2_SWAP,
+	DRI2_FLIP,
+	DRI2_WAITMSC,
+};
+
+typedef struct _DRI2FrameEvent {
+	XID drawable_id;
+	ClientPtr client;
+	enum DRI2FrameEventType type;
+	int frame;
+
+	/* for swaps & flips only */
+	DRI2SwapEventPtr event_complete;
+	void *event_data;
+	DRI2BufferPtr front;
+	DRI2BufferPtr back;
+} DRI2FrameEventRec, *DRI2FrameEventPtr;
+
 extern Bool intel_do_pageflip(intel_screen_private *intel,
 			      dri_bo *new_front,
-			      void *data, int ref_crtc_hw_id);
+			      DRI2FrameEventPtr flip_info, int ref_crtc_hw_id);
 
 static inline intel_screen_private *
 intel_get_screen_private(ScrnInfoPtr scrn)
@@ -500,9 +519,9 @@ extern xf86CrtcPtr intel_covering_crtc(ScrnInfoPtr scrn, BoxPtr box,
 Bool I830DRI2ScreenInit(ScreenPtr pScreen);
 void I830DRI2CloseScreen(ScreenPtr pScreen);
 void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
-			       unsigned int tv_usec, void *user_data);
+			       unsigned int tv_usec, DRI2FrameEventPtr flip_info);
 void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
-			      unsigned int tv_usec, void *user_data);
+			      unsigned int tv_usec, DRI2FrameEventPtr flip_info);
 
 extern Bool intel_crtc_on(xf86CrtcPtr crtc);
 int intel_crtc_to_pipe(xf86CrtcPtr crtc);
diff --git a/src/intel_display.c b/src/intel_display.c
index f487a6e..eb07cf5 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -50,7 +50,7 @@ struct intel_mode {
 	int cpp;
 
 	drmEventContext event_context;
-	void *event_data;
+	DRI2FrameEventPtr flip_info;
 	int old_fb_id;
 	int flip_count;
 	unsigned int fe_frame;
@@ -1428,7 +1428,7 @@ fail:
 Bool
 intel_do_pageflip(intel_screen_private *intel,
 		  dri_bo *new_front,
-		  void *data, int ref_crtc_hw_id)
+		  DRI2FrameEventPtr flip_info, int ref_crtc_hw_id)
 {
 	ScrnInfoPtr scrn = intel->scrn;
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -1464,7 +1464,7 @@ intel_do_pageflip(intel_screen_private *intel,
 		if (!config->crtc[i]->enabled)
 			continue;
 
-		mode->event_data = data;
+		mode->flip_info = flip_info;
 		mode->flip_count++;
 
 		crtc = config->crtc[i]->driver_private;
@@ -1512,9 +1512,9 @@ static const xf86CrtcConfigFuncsRec intel_xf86crtc_config_funcs = {
 
 static void
 intel_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec,
-		       unsigned int tv_usec, void *event_data)
+		       unsigned int tv_usec, DRI2FrameEventPtr event)
 {
-	I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event_data);
+	I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event);
 }
 
 static void
@@ -1541,12 +1541,12 @@ intel_page_flip_handler(int fd, unsigned int frame, unsigned int tv_sec,
 	/* Release framebuffer */
 	drmModeRmFB(mode->fd, mode->old_fb_id);
 
-	if (mode->event_data == NULL)
+	if (mode->flip_info == NULL)
 		return;
 
 	/* Deliver cached msc, ust from reference crtc to flip event handler */
 	I830DRI2FlipEventHandler(mode->fe_frame, mode->fe_tv_sec,
-				 mode->fe_tv_usec, mode->event_data);
+				 mode->fe_tv_usec, mode->flip_info);
 }
 
 static void
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 7449232..9e8c370 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -553,24 +553,6 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 
 #if DRI2INFOREC_VERSION >= 4
 
-enum DRI2FrameEventType {
-	DRI2_SWAP,
-	DRI2_FLIP,
-	DRI2_WAITMSC,
-};
-
-typedef struct _DRI2FrameEvent {
-	XID drawable_id;
-	ClientPtr client;
-	enum DRI2FrameEventType type;
-	int frame;
-
-	/* for swaps & flips only */
-	DRI2SwapEventPtr event_complete;
-	void *event_data;
-	DRI2BufferPtr front;
-	DRI2BufferPtr back;
-} DRI2FrameEventRec, *DRI2FrameEventPtr;
 
 static int
 I830DRI2DrawablePipe(DrawablePtr pDraw)
@@ -700,9 +682,8 @@ can_exchange(DRI2BufferPtr front, DRI2BufferPtr back)
 }
 
 void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
-			       unsigned int tv_usec, void *event_data)
+			       unsigned int tv_usec, DRI2FrameEventPtr event)
 {
-	DRI2FrameEventPtr event = event_data;
 	DrawablePtr drawable;
 	ScreenPtr screen;
 	ScrnInfoPtr scrn;
@@ -781,9 +762,8 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
 }
 
 void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
-			      unsigned int tv_usec, void *event_data)
+			      unsigned int tv_usec, DRI2FrameEventPtr flip)
 {
-	DRI2FrameEventPtr flip = event_data;
 	DrawablePtr drawable;
 	ScreenPtr screen;
 	ScrnInfoPtr scrn;

commit ee740778f5d5355c04f6fc4564f598993b106d62
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Mar 16 08:37:24 2011 +0000

    i915/video: Clip indirect Xv output
    
    In the case of a singular clip box and rendering onto the front buffer
    larger than 2048, the clip extents were being ignored.  Here we can
    simply reduce the size of the indirect pixmap to the clip extents.
    
    Reported-by: Michael Chang <mchang@novell.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35346
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/i915_video.c b/src/i915_video.c
index 861bea6..d46c6d1 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -69,7 +69,8 @@ I915DisplayVideoTextured(ScrnInfoPtr scrn,
 		ScreenPtr screen = pixmap->drawable.pScreen;
 
 		target = screen->CreatePixmap(screen,
-					      drw_w, drw_h,
+					      dstRegion->extents.x2 - dxo,
+					      dstRegion->extents.y2 - dyo,
 					      pixmap->drawable.depth,
 					      CREATE_PIXMAP_USAGE_SCRATCH);
 

commit 014fc7abb7b2cc2110e3ab9a0bd6f7cff2c64c05
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Mar 9 17:10:50 2011 +0000

    dri: Disable page-flip between a tiled buffer and a linear scanout
    
    Keith Packard pointed out a loophole that could cause the DDX to end up
    with a tiled scanout even if the user required a linear framebuffer;
    that is by using page-flipping we could replace the scanout pixmap with
    another of our choosing, and not necessarily tiled.
    
    Close that loophole by only allowing an exchange of buffers between
    identical tiling modes. For the common case, this is fine since they
    will indeed be allocated with the same tiling. For the linear
    framebuffer case with mesa using a tiled pixmap, we force it to blit
    onto the scanout instead.
    
    Reported-by: Keith Packard <keith.packard@intel.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 3901aae..7449232 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -674,6 +674,8 @@ can_exchange(DRI2BufferPtr front, DRI2BufferPtr back)
 	I830DRI2BufferPrivatePtr back_priv = back->driverPrivate;
 	PixmapPtr front_pixmap = front_priv->pixmap;
 	PixmapPtr back_pixmap = back_priv->pixmap;
+	struct intel_pixmap *front_intel = intel_get_pixmap_private(front_pixmap);
+	struct intel_pixmap *back_intel = intel_get_pixmap_private(back_pixmap);
 
 	if (front_pixmap->drawable.width != back_pixmap->drawable.width)
 		return FALSE;


Reply to: