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

[SRM] Approval for xserver-xorg-video-intel/2:2.13.0-6



Hi,

please consider the following changes to the intel driver for squeeze:
| xserver-xorg-video-intel (2:2.13.0-6) stable; urgency=low
| 
|   * Cherry-pick from upstream:
|     - 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>  Fri, 18 Feb 2011 14:03:12 +0100

The first fix is quite trivial and also applied to current master
until yesterday, it was cherry-picked for unstable as well.

  http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-intel.git;a=commitdiff;h=7d59555f72d059b75dde91db8047e6195d0d334a

The second fix is (user-contributed) backports:

  http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-intel.git;a=commitdiff;h=91af3c5ead6157ed065ccd3e3cc413c945182488
  http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-intel.git;a=commitdiff;h=bdca7df8d4238f0630aeda75ed02461d76a5ea05


I've reproduced both issues on my laptop, verified the fixes worked
fine, and I haven't noticed any regression.

The full source debdiff is attached.

KiBi.
diff -u xserver-xorg-video-intel-2.13.0/debian/changelog xserver-xorg-video-intel-2.13.0/debian/changelog
--- xserver-xorg-video-intel-2.13.0/debian/changelog
+++ xserver-xorg-video-intel-2.13.0/debian/changelog
@@ -1,3 +1,16 @@
+xserver-xorg-video-intel (2:2.13.0-6) stable; urgency=low
+
+  * Cherry-pick from upstream:
+    - 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>  Fri, 18 Feb 2011 14:03:12 +0100
+
 xserver-xorg-video-intel (2:2.13.0-5) unstable; urgency=low
 
   [ Julien Cristau ]
only in patch2:
unchanged:
--- xserver-xorg-video-intel-2.13.0.orig/src/intel_dri.c
+++ xserver-xorg-video-intel-2.13.0/src/intel_dri.c
@@ -71,6 +71,21 @@
 	unsigned int attachment;
 } I830DRI2BufferPrivateRec, *I830DRI2BufferPrivatePtr;
 
+static uint32_t pixmap_flink(PixmapPtr pixmap)
+{
+	struct intel_pixmap *priv = intel_get_pixmap_private(pixmap);
+	uint32_t name;
+
+	if (priv == NULL || priv->bo == NULL)
+		return 0;
+
+	if (dri_bo_flink(priv->bo, &name) != 0)
+		return 0;
+
+	priv->pinned = 1;
+	return name;
+}
+
 #if DRI2INFOREC_VERSION < 2
 
 static DRI2BufferPtr
@@ -81,10 +96,9 @@
 	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 +158,7 @@
 		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 +203,6 @@
 	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 +264,7 @@
 	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);
only in patch2:
unchanged:
--- xserver-xorg-video-intel-2.13.0.orig/src/intel.h
+++ xserver-xorg-video-intel-2.13.0/src/intel.h
@@ -169,6 +169,7 @@
 	uint8_t tiling;
 	int8_t busy :2;
 	int8_t batch_write :1;
+	int8_t pinned :1;
 };
 
 #if HAS_DEVPRIVATEKEYREC
only in patch2:
unchanged:
--- xserver-xorg-video-intel-2.13.0.orig/src/intel_uxa.c
+++ xserver-xorg-video-intel-2.13.0/src/intel_uxa.c
@@ -767,7 +767,8 @@
 	} 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 @@
 		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,
only in patch2:
unchanged:
--- xserver-xorg-video-intel-2.13.0.orig/uxa/uxa-render.c
+++ xserver-xorg-video-intel-2.13.0/uxa/uxa-render.c
@@ -460,12 +460,12 @@
 }
 
 static PicturePtr
-uxa_picture_for_pixman_format(ScreenPtr pScreen,
+uxa_picture_for_pixman_format(ScreenPtr screen,
 			      pixman_format_code_t format,
 			      int width, int height)
 {
-	PicturePtr pPicture;
-	PixmapPtr pPixmap;
+	PicturePtr picture;
+	PixmapPtr pixmap;
 	int error;
 
 	if (format == PIXMAN_a1)
@@ -475,24 +475,29 @@
 	if (PIXMAN_FORMAT_A(format) == 0)
 	    format = PIXMAN_a8r8g8b8;
 
-	pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height,
-					   PIXMAN_FORMAT_DEPTH(format),
-					   UXA_CREATE_PIXMAP_FOR_MAP);
-	if (!pPixmap)
+	pixmap = screen->CreatePixmap(screen, width, height,
+					PIXMAN_FORMAT_DEPTH(format),
+					UXA_CREATE_PIXMAP_FOR_MAP);
+	if (!pixmap)
 		return 0;
 
-	pPicture = CreatePicture(0, &pPixmap->drawable,
-				 PictureMatchFormat(pScreen,
-						    PIXMAN_FORMAT_DEPTH(format),
-						    format),
-				 0, 0, serverClient, &error);
-	(*pScreen->DestroyPixmap) (pPixmap);
-	if (!pPicture)
+	if (!uxa_pixmap_is_offscreen(pixmap)) {
+		screen->DestroyPixmap(pixmap);
 		return 0;
+	}
 
-	ValidatePicture(pPicture);
+	picture = CreatePicture(0, &pixmap->drawable,
+				PictureMatchFormat(screen,
+						   PIXMAN_FORMAT_DEPTH(format),
+						   format),
+				0, 0, serverClient, &error);
+	screen->DestroyPixmap(pixmap);
+	if (!picture)
+		return 0;
+
+	ValidatePicture(picture);
 
-	return pPicture;
+	return picture;
 }
 
 static PicturePtr

Attachment: signature.asc
Description: Digital signature


Reply to: