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

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



 debian/changelog |    4 ++++
 src/intel.h      |    1 +
 src/intel_dri.c  |   25 ++++++++++++++++++-------
 src/intel_uxa.c  |    5 +++--
 4 files changed, 26 insertions(+), 9 deletions(-)

New commits:
commit c0550da101d965e4ea222cd80a54270459008238
Author: Cyril Brulebois <kibi@debian.org>
Date:   Fri Feb 18 11:36:31 2011 +0100

    Document the cherry-picks (Closes: #602207).

diff --git a/debian/changelog b/debian/changelog
index 0ccd091..1943862 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,10 @@ xserver-xorg-video-intel (2:2.13.0-6) UNRELEASED; urgency=low
     - uxa: Fallback if the temporary is too large
   * This fixes a null pointer dereference with some rendering operations
     involving large pictures (Closes: #613830). Thanks, Enrico!
+  * Cherry-pick from upstream, thanks to Bjørn Mork:
+    - Don't replace the scanout bo through PutImage
+    - dri: Fix the use of the uninitialised bo for flink
+  * These should fix issues with SDL (Closes: #602207).
 
  -- Cyril Brulebois <kibi@debian.org>  Thu, 17 Feb 2011 23:20:47 +0100
 

commit 7d59555f72d059b75dde91db8047e6195d0d334a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Jan 2 09:06:28 2011 +0000

    dri: Fix the use of the uninitialised bo for flink
    
    Reported-by: Jeff Chua <jeff.chua.linux@gmail.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    (cherry picked from commit 537fa55ed2449e91f3dd1e04abc720c6818d7227)
    
    Signed-off-by: Bjørn Mork <bjorn@mork.no>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 49d83da..1c151bf 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -75,12 +75,11 @@ static uint32_t pixmap_flink(PixmapPtr pixmap)
 {
 	struct intel_pixmap *priv = intel_get_pixmap_private(pixmap);
 	uint32_t name;
-	dri_bo *bo;
 
 	if (priv == NULL || priv->bo == NULL)
 		return 0;
 
-	if (dri_bo_flink(bo, &name) != 0)
+	if (dri_bo_flink(priv->bo, &name) != 0)
 		return 0;
 
 	priv->pinned = 1;

commit bdca7df8d4238f0630aeda75ed02461d76a5ea05
Author: Bjørn Mork <bjorn@mork.no>
Date:   Sat Jan 15 14:01:19 2011 +0100

    Don't replace the scanout bo through PutImage
    
    As the bo may be pinned for either use by the scanout or through sharing
    with another application, under those circumstances we cannot replace
    the bo itself but must force the blit for PutImage.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31367
    Reported-and-tested-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    [backport of commit 53fbc9f1]
    Signed-off-by: Bjørn Mork <bjorn@mork.no>

diff --git a/src/intel.h b/src/intel.h
index b816aeb..93a3524 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -169,6 +169,7 @@ struct intel_pixmap {
 	uint8_t tiling;
 	int8_t busy :2;
 	int8_t batch_write :1;
+	int8_t pinned :1;
 };
 
 #if HAS_DEVPRIVATEKEYREC
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 9804272..49d83da 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -71,6 +71,22 @@ typedef struct {
 	unsigned int attachment;
 } I830DRI2BufferPrivateRec, *I830DRI2BufferPrivatePtr;
 
+static uint32_t pixmap_flink(PixmapPtr pixmap)
+{
+	struct intel_pixmap *priv = intel_get_pixmap_private(pixmap);
+	uint32_t name;
+	dri_bo *bo;
+
+	if (priv == NULL || priv->bo == NULL)
+		return 0;
+
+	if (dri_bo_flink(bo, &name) != 0)
+		return 0;
+
+	priv->pinned = 1;
+	return name;
+}
+
 #if DRI2INFOREC_VERSION < 2
 
 static DRI2BufferPtr
@@ -81,10 +97,9 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	DRI2BufferPtr buffers;
-	dri_bo *bo;
-	int i;
 	I830DRI2BufferPrivatePtr privates;
 	PixmapPtr pixmap, pDepthPixmap;
+	int i;
 
 	buffers = calloc(count, sizeof *buffers);
 	if (buffers == NULL)
@@ -144,8 +159,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 		privates[i].pixmap = pixmap;
 		privates[i].attachment = attachments[i];
 
-		bo = intel_get_pixmap_bo(pixmap);
-		if (bo == NULL || dri_bo_flink(bo, &buffers[i].name) != 0) {
+		if ((buffers[i].name = pixmap_flink(pixmap)) == 0) {
 			/* failed to name buffer */
 			screen->DestroyPixmap(pixmap);
 			goto unwind;
@@ -190,7 +204,6 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	DRI2Buffer2Ptr buffer;
-	dri_bo *bo;
 	I830DRI2BufferPrivatePtr privates;
 	PixmapPtr pixmap;
 
@@ -252,8 +265,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 	privates->pixmap = pixmap;
 	privates->attachment = attachment;
 
-	bo = intel_get_pixmap_bo(pixmap);
-	if (bo == NULL || dri_bo_flink(bo, &buffer->name) != 0) {
+	if ((buffer->name = pixmap_flink(pixmap)) == 0) {
 		/* failed to name buffer */
 		screen->DestroyPixmap(pixmap);
 		free(privates);
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index ef4c553..b3d8d31 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -767,7 +767,8 @@ static Bool intel_uxa_put_image(PixmapPtr pixmap,
 	} else {
 		ScreenPtr screen = pixmap->drawable.pScreen;
 
-		if (x == 0 && y == 0 &&
+		if (!priv->pinned &&
+		    x == 0 && y == 0 &&
 		    w == pixmap->drawable.width &&
 		    h == pixmap->drawable.height)
 		{
@@ -1263,7 +1264,7 @@ void intel_uxa_create_screen_resources(ScreenPtr screen)
 		if (bo != NULL) {
 			PixmapPtr pixmap = screen->GetScreenPixmap(screen);
 			intel_set_pixmap_bo(pixmap, bo);
-			intel_get_pixmap_private(pixmap)->busy = 1;
+			intel_get_pixmap_private(pixmap)->pinned = 1;
 			screen->ModifyPixmapHeader(pixmap,
 						   scrn->virtualX,
 						   scrn->virtualY,


Reply to: