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

xserver-xorg-video-nouveau: Changes to 'ubuntu'



 debian/changelog                       |   18 +
 debian/patches/101-git-a80785f792.diff |  477 +++++++++++++++++++++++++++++++++
 debian/patches/series                  |    1 
 3 files changed, 496 insertions(+)

New commits:
commit 43a56f086be3d11452dddf69be3c259e04f2c5b7
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue Feb 19 17:39:21 2013 +0100

    Remove individual cherry-picked commits, and sync to git a80785f792 to pick up some fixes.
    
    Mostly import for fixes to reverse prime support.

diff --git a/debian/changelog b/debian/changelog
index edcddf8..f30ada1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,12 @@
-xserver-xorg-video-nouveau (1:1.0.6-0ubuntu2) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.6-0ubuntu3) raring; urgency=low
+
+  * Remove individual patches, sync to git a80785f792 to pick up some fixes.
+    - Mostly import for fixes to reverse prime support.
+  * This hopefully fixes (LP: #1124693)
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Tue, 19 Feb 2013 17:34:52 +0100
+
+xserver-xorg-video-nouveau (1:1.0.6-0ubuntu2) raring; urgency=low
 
   * Cherry-pick upstream patches to sync with git 58284cf32
     - 101-gart-cursor.patch
diff --git a/debian/patches/101-gart-cursor.patch b/debian/patches/101-gart-cursor.patch
deleted file mode 100644
index b246931..0000000
--- a/debian/patches/101-gart-cursor.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit 912d418fdfd2e99eef1e5c631c76dda1d82cf451
-Author: Marcin Slusarz <marcin.slusarz@gmail.com>
-Date:   Mon Jan 21 00:15:38 2013 +0100
-
-    nouveau: put cursor BO in GART
-    
-    Keeping it in VRAM wastes CPU time, because cursor_set ioctl reads
-    handed BO back to RAM, just to write it to actual cursor BO.
-    
-    Here (nv92/core i7), this patch decreases overall cpu usage of
-    drmmode_load_cursor_argb from 4.6ms to ~90us and lets nv50_crtc_cursor_set
-    disappear from perf traces.
-    
-    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-
-diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 429e9cc..06f7a24 100644
---- a/src/drmmode_display.c
-+++ b/src/drmmode_display.c
-@@ -567,7 +567,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
- 						 drmmode->mode_res->crtcs[num]);
- 	drmmode_crtc->drmmode = drmmode;
- 
--	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
-+	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
- 			     64*64*4, NULL, &drmmode_crtc->cursor);
- 	assert(ret == 0);
- 
diff --git a/debian/patches/101-git-a80785f792.diff b/debian/patches/101-git-a80785f792.diff
new file mode 100644
index 0000000..80aaf90
--- /dev/null
+++ b/debian/patches/101-git-a80785f792.diff
@@ -0,0 +1,477 @@
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index 429e9cc..9eca60f 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -42,6 +42,7 @@
+ #include "libudev.h"
+ #endif
+ 
++static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
+ typedef struct {
+     int fd;
+     uint32_t fb_id;
+@@ -345,6 +346,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+ 	drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
+ 
+ 	fb_id = drmmode->fb_id;
++#ifdef NOUVEAU_PIXMAP_SHARING
++	if (crtc->randr_crtc->scanout_pixmap)
++		x = y = 0;
++	else
++#endif
+ 	if (drmmode_crtc->rotate_fb_id) {
+ 		fb_id = drmmode_crtc->rotate_fb_id;
+ 		x = 0;
+@@ -536,6 +542,35 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
+ 	}
+ }
+ 
++#ifdef NOUVEAU_PIXMAP_SHARING
++static Bool
++drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
++{
++	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
++	PixmapPtr screenpix = screen->GetScreenPixmap(screen);
++
++	if (!ppix) {
++		if (crtc->randr_crtc->scanout_pixmap)
++			PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
++		return TRUE;
++	}
++
++	if (ppix->drawable.width > screenpix->drawable.width ||
++	    ppix->drawable.height > screenpix->drawable.height) {
++		Bool ret;
++		ret = drmmode_xf86crtc_resize(crtc->scrn, ppix->drawable.width, ppix->drawable.height);
++		if (ret == FALSE)
++			return FALSE;
++
++		screenpix = screen->GetScreenPixmap(screen);
++		screen->width = screenpix->drawable.width = ppix->drawable.width;
++		screen->height = screenpix->drawable.height = ppix->drawable.height;
++	}
++	PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
++	return TRUE;
++}
++#endif
++
+ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ 	.dpms = drmmode_crtc_dpms,
+ 	.set_mode_major = drmmode_set_mode_major,
+@@ -547,6 +582,10 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ 	.shadow_allocate = drmmode_crtc_shadow_allocate,
+ 	.shadow_destroy = drmmode_crtc_shadow_destroy,
+ 	.gamma_set = drmmode_gamma_set,
++
++#ifdef NOUVEAU_PIXMAP_SHARING
++	.set_scanout_pixmap = drmmode_set_scanout_pixmap,
++#endif
+ };
+ 
+ 
+@@ -567,7 +606,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ 						 drmmode->mode_res->crtcs[num]);
+ 	drmmode_crtc->drmmode = drmmode;
+ 
+-	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
++	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
+ 			     64*64*4, NULL, &drmmode_crtc->cursor);
+ 	assert(ret == 0);
+ 
+diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
+index 036bcff..e462a86 100644
+--- a/src/nouveau_dri2.c
++++ b/src/nouveau_dri2.c
+@@ -134,6 +134,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ {
+ 	struct nouveau_dri2_buffer *src = nouveau_dri2_buffer(pSrcBuffer);
+ 	struct nouveau_dri2_buffer *dst = nouveau_dri2_buffer(pDstBuffer);
++	NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
+ 	RegionPtr pCopyClip;
+ 	GCPtr pGC;
+ 	DrawablePtr src_draw, dst_draw;
+@@ -178,6 +179,23 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ 	}
+ 	pGC->funcs->ChangeClip(pGC, CT_REGION, pCopyClip, 0);
+ 	ValidateGC(dst_draw, pGC);
++
++	/* If this is a full buffer swap or frontbuffer flush, throttle on
++	 * the previous one.
++	 */
++	if (dst->base.attachment == DRI2BufferFrontLeft &&
++	    REGION_NUM_RECTS(pRegion) == 1) {
++		BoxPtr extents = REGION_EXTENTS(pScreen, pRegion);
++		if (extents->x1 == 0 && extents->y1 == 0 &&
++		    extents->x2 == pDraw->width &&
++		    extents->y2 == pDraw->height) {
++			PixmapPtr fpix = get_drawable_pixmap(dst_draw);
++			struct nouveau_bo *bo = nouveau_pixmap_bo(fpix);
++			if (bo)
++				nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
++		}
++	}
++
+ 	pGC->ops->CopyArea(src_draw, dst_draw, pGC, 0, 0,
+ 			   pDraw->width, pDraw->height, off_x, off_y);
+ 
+diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
+index 8191aeb..bcc0d4e 100644
+--- a/src/nouveau_exa.c
++++ b/src/nouveau_exa.c
+@@ -139,6 +139,11 @@ nouveau_exa_create_pixmap(ScreenPtr pScreen, int width, int height, int depth,
+ 		return NULL;
+ 	}
+ 
++#ifdef NOUVEAU_PIXMAP_SHARING
++	if ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED)
++		nvpix->shared = TRUE;
++#endif
++
+ 	return nvpix;
+ }
+ 
+diff --git a/src/nv30_exa.c b/src/nv30_exa.c
+index 95509bc..21586e9 100644
+--- a/src/nv30_exa.c
++++ b/src/nv30_exa.c
+@@ -820,146 +820,146 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn)
+ 	PUSH_DATA (push, 4096<<16);
+ 
+ 	PUSH_DATAu(push, pNv->scratch, PFP_PASS, 2 * 4);
+-	PUSH_DATA (push, 0x18009e80); /* txph r0, a[tex0], t[0] */
+-	PUSH_DATA (push, 0x1c9dc801);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x3fe1c800);
+-	PUSH_DATA (push, 0x1802be83); /* txph r1, a[tex1], t[1] */
+-	PUSH_DATA (push, 0x1c9dc801); /* exit */
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x3fe1c800);
++	PUSH_DATAs(push, 0x18009e80); /* txph r0, a[tex0], t[0] */
++	PUSH_DATAs(push, 0x1c9dc801);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x3fe1c800);
++	PUSH_DATAs(push, 0x1802be83); /* txph r1, a[tex1], t[1] */
++	PUSH_DATAs(push, 0x1c9dc801); /* exit */
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x3fe1c800);
+ 
+ 	PUSH_DATAu(push, pNv->scratch, PFP_NV12_BILINEAR, 8 * 4);
+-	PUSH_DATA (push, 0x17028200); /* texr r0.x, a[tex0], t[1] */
+-	PUSH_DATA (push, 0x1c9dc801);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x3fe1c800);
+-	PUSH_DATA (push, 0x04000e02); /* madr r1.xyz, r0.x, imm.x, imm.yzww */
+-	PUSH_DATA (push, 0x1c9c0000);
+-	PUSH_DATA (push, 0x00000002);
+-	PUSH_DATA (push, 0x0001f202);
+-	PUSH_DATA (push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
+-	PUSH_DATA (push, 0xbf5ee393);
+-	PUSH_DATA (push, 0x3f078fef);
+-	PUSH_DATA (push, 0xbf8a6762);
+-	PUSH_DATA (push, 0x1704ac80); /* texr r0.yz, a[tex1], t[2] */
+-	PUSH_DATA (push, 0x1c9dc801);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x3fe1c800);
+-	PUSH_DATA (push, 0x04000e02); /* madr r1.xyz, r0.y, imm, r1 */
+-	PUSH_DATA (push, 0x1c9cab00);
+-	PUSH_DATA (push, 0x0001c802);
+-	PUSH_DATA (push, 0x0001c804);
+-	PUSH_DATA (push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
+-	PUSH_DATA (push, 0xbec890d6);
+-	PUSH_DATA (push, 0x40011687);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x04000e81); /* madr r0.xyz, r0.z, imm, r1 */
+-	PUSH_DATA (push, 0x1c9d5500);
+-	PUSH_DATA (push, 0x0001c802);
+-	PUSH_DATA (push, 0x0001c804);
+-	PUSH_DATA (push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
+-	PUSH_DATA (push, 0xbf501a37);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
++	PUSH_DATAs(push, 0x17028200); /* texr r0.x, a[tex0], t[1] */
++	PUSH_DATAs(push, 0x1c9dc801);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x3fe1c800);
++	PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.x, imm.x, imm.yzww */
++	PUSH_DATAs(push, 0x1c9c0000);
++	PUSH_DATAs(push, 0x00000002);
++	PUSH_DATAs(push, 0x0001f202);
++	PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
++	PUSH_DATAs(push, 0xbf5ee393);
++	PUSH_DATAs(push, 0x3f078fef);
++	PUSH_DATAs(push, 0xbf8a6762);
++	PUSH_DATAs(push, 0x1704ac80); /* texr r0.yz, a[tex1], t[2] */
++	PUSH_DATAs(push, 0x1c9dc801);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x3fe1c800);
++	PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.y, imm, r1 */
++	PUSH_DATAs(push, 0x1c9cab00);
++	PUSH_DATAs(push, 0x0001c802);
++	PUSH_DATAs(push, 0x0001c804);
++	PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
++	PUSH_DATAs(push, 0xbec890d6);
++	PUSH_DATAs(push, 0x40011687);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x04000e81); /* madr r0.xyz, r0.z, imm, r1 */
++	PUSH_DATAs(push, 0x1c9d5500);
++	PUSH_DATAs(push, 0x0001c802);
++	PUSH_DATAs(push, 0x0001c804);
++	PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
++	PUSH_DATAs(push, 0xbf501a37);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
+ 
+ 	PUSH_DATAu(push, pNv->scratch, PFP_NV12_BICUBIC, 24 * 4);
+-	PUSH_DATA (push, 0x01008604); /* movr r2.xy, a[tex0] */
+-	PUSH_DATA (push, 0x1c9dc801);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x03000600); /* addr r0.xy, r2, imm.x */
+-	PUSH_DATA (push, 0x1c9dc808);
+-	PUSH_DATA (push, 0x00000002);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x3f000000); /* { 0.50, 0.00, 0.00, 0.00 } */
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x17000e06); /* texr r3.xyz, r0, t[0] */
+-	PUSH_DATA (push, 0x1c9dc800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x17000e00); /* texr r0.xyz, r0.y, t[0] */
+-	PUSH_DATA (push, 0x1c9caa00);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x02000a02); /* mulr r1.xz, r3.xxyy, imm.xxyy */
+-	PUSH_DATA (push, 0x1c9ca00c);
+-	PUSH_DATA (push, 0x0000a002);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
+-	PUSH_DATA (push, 0x3f800000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x02001402); /* mulr r1.yw, r0.xxyy, imm.xxyy */
+-	PUSH_DATA (push, 0x1c9ca000);
+-	PUSH_DATA (push, 0x0000a002);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
+-	PUSH_DATA (push, 0x3f800000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x03001e04); /* addr r2, r2.xyxy, r1 */
+-	PUSH_DATA (push, 0x1c9c8808);
+-	PUSH_DATA (push, 0x0001c804);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x17020200); /* texr r0.x, r2, t[1] */
+-	PUSH_DATA (push, 0x1c9dc808);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x17020402); /* texr r1.y, r2.xwxw, t[1] */
+-	PUSH_DATA (push, 0x1c9d9808);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x17020202); /* texr r1.x, r2.zyxy, t[1] */
+-	PUSH_DATA (push, 0x1c9c8c08);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x1f400280); /* lrph r0.x, r0.z, r0, r1.y */
+-	PUSH_DATA (push, 0x1c9d5400);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0000aa04);
+-	PUSH_DATA (push, 0x17020400); /* texr r0.y, r2.zwzz, t[1] */
+-	PUSH_DATA (push, 0x1c9d5c08);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x1f400480); /* lrph r0.y, r0.z, r1.x, r0 */
+-	PUSH_DATA (push, 0x1c9d5400);
+-	PUSH_DATA (push, 0x00000004);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x1f400280); /* lrph r0.x, r3.z, r0, r0.y */
+-	PUSH_DATA (push, 0x1c9d540c);
+-	PUSH_DATA (push, 0x0001c900);
+-	PUSH_DATA (push, 0x0000ab00);
+-	PUSH_DATA (push, 0x04400e80); /* madh r0.xyz, r0.x, imm.x, imm.yzww */
+-	PUSH_DATA (push, 0x1c9c0100);
+-	PUSH_DATA (push, 0x00000002);
+-	PUSH_DATA (push, 0x0001f202);
+-	PUSH_DATA (push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
+-	PUSH_DATA (push, 0xbf5ee393);
+-	PUSH_DATA (push, 0x3f078fef);
+-	PUSH_DATA (push, 0xbf8a6762);
+-	PUSH_DATA (push, 0x1704ac02); /* texr r1.yz, a[tex1], t[2] */
+-	PUSH_DATA (push, 0x1c9dc801);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x0001c800);
+-	PUSH_DATA (push, 0x04400e80); /* madh r0.xyz, r1.y, imm, r0 */
+-	PUSH_DATA (push, 0x1c9caa04);
+-	PUSH_DATA (push, 0x0001c802);
+-	PUSH_DATA (push, 0x0001c900);
+-	PUSH_DATA (push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
+-	PUSH_DATA (push, 0xbec890d6);
+-	PUSH_DATA (push, 0x40011687);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x04400e81); /* madh r0.xyz, r1.z, imm, r0 */
+-	PUSH_DATA (push, 0x1c9d5404);
+-	PUSH_DATA (push, 0x0001c802);
+-	PUSH_DATA (push, 0x0001c900);
+-	PUSH_DATA (push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
+-	PUSH_DATA (push, 0xbf501a37);
+-	PUSH_DATA (push, 0x00000000);
+-	PUSH_DATA (push, 0x00000000);
++	PUSH_DATAs(push, 0x01008604); /* movr r2.xy, a[tex0] */
++	PUSH_DATAs(push, 0x1c9dc801);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x03000600); /* addr r0.xy, r2, imm.x */
++	PUSH_DATAs(push, 0x1c9dc808);
++	PUSH_DATAs(push, 0x00000002);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x3f000000); /* { 0.50, 0.00, 0.00, 0.00 } */
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x17000e06); /* texr r3.xyz, r0, t[0] */
++	PUSH_DATAs(push, 0x1c9dc800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x17000e00); /* texr r0.xyz, r0.y, t[0] */
++	PUSH_DATAs(push, 0x1c9caa00);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x02000a02); /* mulr r1.xz, r3.xxyy, imm.xxyy */
++	PUSH_DATAs(push, 0x1c9ca00c);
++	PUSH_DATAs(push, 0x0000a002);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
++	PUSH_DATAs(push, 0x3f800000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x02001402); /* mulr r1.yw, r0.xxyy, imm.xxyy */
++	PUSH_DATAs(push, 0x1c9ca000);
++	PUSH_DATAs(push, 0x0000a002);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
++	PUSH_DATAs(push, 0x3f800000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x03001e04); /* addr r2, r2.xyxy, r1 */
++	PUSH_DATAs(push, 0x1c9c8808);
++	PUSH_DATAs(push, 0x0001c804);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x17020200); /* texr r0.x, r2, t[1] */
++	PUSH_DATAs(push, 0x1c9dc808);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x17020402); /* texr r1.y, r2.xwxw, t[1] */
++	PUSH_DATAs(push, 0x1c9d9808);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x17020202); /* texr r1.x, r2.zyxy, t[1] */
++	PUSH_DATAs(push, 0x1c9c8c08);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x1f400280); /* lrph r0.x, r0.z, r0, r1.y */
++	PUSH_DATAs(push, 0x1c9d5400);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0000aa04);
++	PUSH_DATAs(push, 0x17020400); /* texr r0.y, r2.zwzz, t[1] */
++	PUSH_DATAs(push, 0x1c9d5c08);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x1f400480); /* lrph r0.y, r0.z, r1.x, r0 */
++	PUSH_DATAs(push, 0x1c9d5400);
++	PUSH_DATAs(push, 0x00000004);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x1f400280); /* lrph r0.x, r3.z, r0, r0.y */
++	PUSH_DATAs(push, 0x1c9d540c);
++	PUSH_DATAs(push, 0x0001c900);
++	PUSH_DATAs(push, 0x0000ab00);
++	PUSH_DATAs(push, 0x04400e80); /* madh r0.xyz, r0.x, imm.x, imm.yzww */
++	PUSH_DATAs(push, 0x1c9c0100);
++	PUSH_DATAs(push, 0x00000002);
++	PUSH_DATAs(push, 0x0001f202);
++	PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
++	PUSH_DATAs(push, 0xbf5ee393);
++	PUSH_DATAs(push, 0x3f078fef);
++	PUSH_DATAs(push, 0xbf8a6762);
++	PUSH_DATAs(push, 0x1704ac02); /* texr r1.yz, a[tex1], t[2] */
++	PUSH_DATAs(push, 0x1c9dc801);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x0001c800);
++	PUSH_DATAs(push, 0x04400e80); /* madh r0.xyz, r1.y, imm, r0 */
++	PUSH_DATAs(push, 0x1c9caa04);
++	PUSH_DATAs(push, 0x0001c802);
++	PUSH_DATAs(push, 0x0001c900);
++	PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
++	PUSH_DATAs(push, 0xbec890d6);
++	PUSH_DATAs(push, 0x40011687);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x04400e81); /* madh r0.xyz, r1.z, imm, r0 */
++	PUSH_DATAs(push, 0x1c9d5404);
++	PUSH_DATAs(push, 0x0001c802);
++	PUSH_DATAs(push, 0x0001c900);
++	PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
++	PUSH_DATAs(push, 0xbf501a37);
++	PUSH_DATAs(push, 0x00000000);
++	PUSH_DATAs(push, 0x00000000);
+ 
+ 	return TRUE;
+ }
+diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
+index 57e52ff..b06fe0c 100644
+--- a/src/nv_accel_common.c
++++ b/src/nv_accel_common.c
+@@ -35,10 +35,19 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
+ 	NVPtr pNv = NVPTR(scrn);
+ 	Bool scanout = (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT);
+ 	Bool tiled = (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED);
++	Bool shared = FALSE;
+ 	union nouveau_bo_config cfg = {};
+ 	int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
+ 	int cpp = bpp / 8, ret;
+ 
++#ifdef NOUVEAU_PIXMAP_SHARING
++	shared = ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED);
++#endif
++
++	flags = NOUVEAU_BO_MAP;
++	if (bpp >= 8)
++		flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
++
+ 	if (pNv->Architecture >= NV_ARCH_50) {
+ 		if (scanout) {
+ 			if (pNv->tiled_scanout) {
+@@ -48,9 +57,9 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
+ 				*pitch = NOUVEAU_ALIGN(width * cpp, 256);
+ 			}
+ 		} else {
+-			if (bpp >= 8)
++			if (bpp >= 8 && !shared)
+ 				tiled = TRUE;
+-			*pitch = NOUVEAU_ALIGN(width * cpp, 64);
++			*pitch = NOUVEAU_ALIGN(width * cpp, shared ? 256 : 64);
+ 		}
+ 	} else {
+ 		if (scanout && pNv->tiled_scanout)
+diff --git a/src/nv_driver.c b/src/nv_driver.c
+index f14c847..9f62fe2 100644
+--- a/src/nv_driver.c
++++ b/src/nv_driver.c
+@@ -452,7 +452,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+ {
+ 	RegionRec pixregion;
+ 
+-	PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
++	PixmapRegionInit(&pixregion, dirty->slave_dst);
+ 
+ 	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ 	PixmapSyncDirtyHelper(dirty, &pixregion);
+@@ -676,7 +676,7 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
+ 		if (value & DRM_PRIME_CAP_EXPORT)
+ 			pScrn->capabilities |= RR_Capability_SourceOutput;
+ 		if (value & DRM_PRIME_CAP_IMPORT)
+-			pScrn->capabilities |= RR_Capability_SourceOffload;
++			pScrn->capabilities |= RR_Capability_SourceOffload | RR_Capability_SinkOutput;
+ 	}
+ #endif
+ }
diff --git a/debian/patches/102-frame-throttle.patch b/debian/patches/102-frame-throttle.patch
deleted file mode 100644
index 4c4c48d..0000000
--- a/debian/patches/102-frame-throttle.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-commit 58284cf32778d54cde139423450bc33360784503
-Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
-Date:   Tue Jan 29 16:38:21 2013 +1000
-
-    dri2: fix missing frame throttle on copy_region buffer swaps
-    
-    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-
-diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
-index 036bcff..0c2bdab 100644
---- a/src/nouveau_dri2.c
-+++ b/src/nouveau_dri2.c
-@@ -134,6 +134,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
- {
- 	struct nouveau_dri2_buffer *src = nouveau_dri2_buffer(pSrcBuffer);
- 	struct nouveau_dri2_buffer *dst = nouveau_dri2_buffer(pDstBuffer);
-+	NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
- 	RegionPtr pCopyClip;
- 	GCPtr pGC;
- 	DrawablePtr src_draw, dst_draw;
-@@ -178,6 +179,22 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
- 	}
- 	pGC->funcs->ChangeClip(pGC, CT_REGION, pCopyClip, 0);
- 	ValidateGC(dst_draw, pGC);
-+
-+	/* If this is a full buffer swap or frontbuffer flush, throttle on
-+	 * the previous one.
-+	 */
-+	if (dst->base.attachment == DRI2BufferFrontLeft &&
-+	    REGION_NUM_RECTS(pRegion) == 1) {
-+		BoxPtr extents = REGION_EXTENTS(pScreen, pRegion);
-+		if (extents->x1 == 0 && extents->y1 == 0 &&
-+		    extents->x2 == pDraw->width &&
-+		    extents->y2 == pDraw->height) {
-+			struct nouveau_bo *bo = nouveau_pixmap_bo(dst->ppix);
-+			if (bo)
-+				nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
-+		}
-+	}
-+
- 	pGC->ops->CopyArea(src_draw, dst_draw, pGC, 0, 0,
- 			   pDraw->width, pDraw->height, off_x, off_y);
- 
diff --git a/debian/patches/103-reverse-optimus.patch b/debian/patches/103-reverse-optimus.patch
deleted file mode 100644
index de80b7e..0000000
--- a/debian/patches/103-reverse-optimus.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From de1cb49bec079fb350ef2fe7d47ed7ec20f6b26c Mon Sep 17 00:00:00 2001
-From: Dave Airlie <airlied@redhat.com>
-Date: Mon, 7 Jan 2013 15:28:53 +1000
-Subject: [PATCH] nouveau: add reverse prime support
-
-This allows the nvidia card to scanout Intel cards rendering.
-
-Signed-off-by: Dave Airlie <airlied@redhat.com>
----
- src/drmmode_display.c | 35 ++++++++++++++++++++++++++++++++++-
- src/nv_driver.c       |  4 ++--
- 2 files changed, 36 insertions(+), 3 deletions(-)
-
-diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 429e9cc..39d0151 100644
---- a/src/drmmode_display.c
-+++ b/src/drmmode_display.c
-@@ -42,6 +42,7 @@
- #include "libudev.h"
- #endif
- 
-+static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
- typedef struct {
-     int fd;
-     uint32_t fb_id;
-@@ -345,7 +346,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
- 	drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
- 
- 	fb_id = drmmode->fb_id;
--	if (drmmode_crtc->rotate_fb_id) {
-+	if (crtc->randr_crtc->scanout_pixmap)
-+		x = y = 0;
-+	else if (drmmode_crtc->rotate_fb_id) {
- 		fb_id = drmmode_crtc->rotate_fb_id;
- 		x = 0;
- 		y = 0;
-@@ -536,6 +539,34 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
- 	}
- }
- 
-+static Bool
-+drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
-+{
-+	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
-+	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-+	PixmapPtr screenpix = screen->GetScreenPixmap(screen);
-+
-+	if (!ppix) {
-+		if (crtc->randr_crtc->scanout_pixmap)
-+			PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
-+		return TRUE;
-+	}
-+
-+	if (ppix->drawable.width > screenpix->drawable.width ||
-+	    ppix->drawable.height > screenpix->drawable.height) {
-+		Bool ret;
-+		ret = drmmode_xf86crtc_resize(crtc->scrn, ppix->drawable.width, ppix->drawable.height);
-+		if (ret == FALSE)
-+			return FALSE;
-+
-+		screenpix = screen->GetScreenPixmap(screen);
-+		screen->width = screenpix->drawable.width = ppix->drawable.width;
-+		screen->height = screenpix->drawable.height = ppix->drawable.height;
-+	}
-+	PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
-+	return TRUE;
-+}
-+
- static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
- 	.dpms = drmmode_crtc_dpms,
- 	.set_mode_major = drmmode_set_mode_major,
-@@ -547,6 +578,8 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
- 	.shadow_allocate = drmmode_crtc_shadow_allocate,
- 	.shadow_destroy = drmmode_crtc_shadow_destroy,
- 	.gamma_set = drmmode_gamma_set,
-+
-+	.set_scanout_pixmap = drmmode_set_scanout_pixmap,
- };
- 
- 
-diff --git a/src/nv_driver.c b/src/nv_driver.c
-index f14c847..9f62fe2 100644
---- a/src/nv_driver.c
-+++ b/src/nv_driver.c
-@@ -452,7 +452,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
- {
- 	RegionRec pixregion;
- 
--	PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
-+	PixmapRegionInit(&pixregion, dirty->slave_dst);
- 
- 	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
- 	PixmapSyncDirtyHelper(dirty, &pixregion);
-@@ -676,7 +676,7 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
- 		if (value & DRM_PRIME_CAP_EXPORT)
- 			pScrn->capabilities |= RR_Capability_SourceOutput;
- 		if (value & DRM_PRIME_CAP_IMPORT)
--			pScrn->capabilities |= RR_Capability_SourceOffload;
-+			pScrn->capabilities |= RR_Capability_SourceOffload | RR_Capability_SinkOutput;
- 	}
- #endif
- }
--- 
-1.8.1
-
diff --git a/debian/patches/series b/debian/patches/series
index 9df121a..fdf7b34 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,6 +3,4 @@
 # Ubuntu patches
 
 100-vblank-on.diff
-101-gart-cursor.patch
-102-frame-throttle.patch
-103-reverse-optimus.patch
+101-git-a80785f792.diff

commit 40385035b843974ca15a7f0527ff71d7ec214d10
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jan 30 14:18:43 2013 +0100

    Cherry-pick upstream patches to sync with git 58284cf32
    
    * Cherry-pick upstream patches to sync with git 58284cf32
      - 101-gart-cursor.patch
      - 102-frame-throttle.patch
    * Add patch to enable reverse-optimus support
      - 103-reverse-optimus.patch

diff --git a/debian/changelog b/debian/changelog
index bf53fa1..edcddf8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+xserver-xorg-video-nouveau (1:1.0.6-0ubuntu2) UNRELEASED; urgency=low
+
+  * Cherry-pick upstream patches to sync with git 58284cf32
+    - 101-gart-cursor.patch
+    - 102-frame-throttle.patch
+  * Add patch to enable reverse-optimus support
+    - 103-reverse-optimus.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 30 Jan 2013 14:16:30 +0100
+
 xserver-xorg-video-nouveau (1:1.0.6-0ubuntu1) raring; urgency=low
 
   * Sync from unreleased debian experimental git.
diff --git a/debian/patches/101-gart-cursor.patch b/debian/patches/101-gart-cursor.patch
new file mode 100644
index 0000000..b246931
--- /dev/null
+++ b/debian/patches/101-gart-cursor.patch
@@ -0,0 +1,28 @@
+commit 912d418fdfd2e99eef1e5c631c76dda1d82cf451
+Author: Marcin Slusarz <marcin.slusarz@gmail.com>
+Date:   Mon Jan 21 00:15:38 2013 +0100
+
+    nouveau: put cursor BO in GART
+    
+    Keeping it in VRAM wastes CPU time, because cursor_set ioctl reads
+    handed BO back to RAM, just to write it to actual cursor BO.
+    
+    Here (nv92/core i7), this patch decreases overall cpu usage of
+    drmmode_load_cursor_argb from 4.6ms to ~90us and lets nv50_crtc_cursor_set
+    disappear from perf traces.
+    
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index 429e9cc..06f7a24 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -567,7 +567,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ 						 drmmode->mode_res->crtcs[num]);
+ 	drmmode_crtc->drmmode = drmmode;
+ 
+-	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
++	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
+ 			     64*64*4, NULL, &drmmode_crtc->cursor);
+ 	assert(ret == 0);
+ 
diff --git a/debian/patches/102-frame-throttle.patch b/debian/patches/102-frame-throttle.patch
new file mode 100644
index 0000000..4c4c48d
--- /dev/null
+++ b/debian/patches/102-frame-throttle.patch
@@ -0,0 +1,43 @@
+commit 58284cf32778d54cde139423450bc33360784503
+Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
+Date:   Tue Jan 29 16:38:21 2013 +1000
+
+    dri2: fix missing frame throttle on copy_region buffer swaps
+    
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
+diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
+index 036bcff..0c2bdab 100644
+--- a/src/nouveau_dri2.c
++++ b/src/nouveau_dri2.c
+@@ -134,6 +134,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ {
+ 	struct nouveau_dri2_buffer *src = nouveau_dri2_buffer(pSrcBuffer);
+ 	struct nouveau_dri2_buffer *dst = nouveau_dri2_buffer(pDstBuffer);
++	NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
+ 	RegionPtr pCopyClip;
+ 	GCPtr pGC;
+ 	DrawablePtr src_draw, dst_draw;
+@@ -178,6 +179,22 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ 	}
+ 	pGC->funcs->ChangeClip(pGC, CT_REGION, pCopyClip, 0);
+ 	ValidateGC(dst_draw, pGC);
++
++	/* If this is a full buffer swap or frontbuffer flush, throttle on
++	 * the previous one.
++	 */
++	if (dst->base.attachment == DRI2BufferFrontLeft &&
++	    REGION_NUM_RECTS(pRegion) == 1) {
++		BoxPtr extents = REGION_EXTENTS(pScreen, pRegion);
++		if (extents->x1 == 0 && extents->y1 == 0 &&
++		    extents->x2 == pDraw->width &&
++		    extents->y2 == pDraw->height) {
++			struct nouveau_bo *bo = nouveau_pixmap_bo(dst->ppix);
++			if (bo)
++				nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
++		}
++	}
++
+ 	pGC->ops->CopyArea(src_draw, dst_draw, pGC, 0, 0,
+ 			   pDraw->width, pDraw->height, off_x, off_y);
+ 
diff --git a/debian/patches/103-reverse-optimus.patch b/debian/patches/103-reverse-optimus.patch
new file mode 100644
index 0000000..de80b7e
--- /dev/null
+++ b/debian/patches/103-reverse-optimus.patch
@@ -0,0 +1,105 @@
+From de1cb49bec079fb350ef2fe7d47ed7ec20f6b26c Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@redhat.com>
+Date: Mon, 7 Jan 2013 15:28:53 +1000
+Subject: [PATCH] nouveau: add reverse prime support
+
+This allows the nvidia card to scanout Intel cards rendering.
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+---
+ src/drmmode_display.c | 35 ++++++++++++++++++++++++++++++++++-
+ src/nv_driver.c       |  4 ++--
+ 2 files changed, 36 insertions(+), 3 deletions(-)
+
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index 429e9cc..39d0151 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -42,6 +42,7 @@
+ #include "libudev.h"
+ #endif
+ 
++static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
+ typedef struct {
+     int fd;
+     uint32_t fb_id;
+@@ -345,7 +346,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+ 	drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
+ 
+ 	fb_id = drmmode->fb_id;
+-	if (drmmode_crtc->rotate_fb_id) {
++	if (crtc->randr_crtc->scanout_pixmap)
++		x = y = 0;
++	else if (drmmode_crtc->rotate_fb_id) {
+ 		fb_id = drmmode_crtc->rotate_fb_id;
+ 		x = 0;
+ 		y = 0;
+@@ -536,6 +539,34 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
+ 	}
+ }
+ 
++static Bool
++drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
++{
++	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
++	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
++	PixmapPtr screenpix = screen->GetScreenPixmap(screen);
++
++	if (!ppix) {
++		if (crtc->randr_crtc->scanout_pixmap)
++			PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
++		return TRUE;
++	}
++
++	if (ppix->drawable.width > screenpix->drawable.width ||
++	    ppix->drawable.height > screenpix->drawable.height) {
++		Bool ret;
++		ret = drmmode_xf86crtc_resize(crtc->scrn, ppix->drawable.width, ppix->drawable.height);
++		if (ret == FALSE)
++			return FALSE;
++
++		screenpix = screen->GetScreenPixmap(screen);
++		screen->width = screenpix->drawable.width = ppix->drawable.width;
++		screen->height = screenpix->drawable.height = ppix->drawable.height;
++	}
++	PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
++	return TRUE;
++}
++
+ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ 	.dpms = drmmode_crtc_dpms,
+ 	.set_mode_major = drmmode_set_mode_major,
+@@ -547,6 +578,8 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ 	.shadow_allocate = drmmode_crtc_shadow_allocate,
+ 	.shadow_destroy = drmmode_crtc_shadow_destroy,
+ 	.gamma_set = drmmode_gamma_set,
++
++	.set_scanout_pixmap = drmmode_set_scanout_pixmap,
+ };
+ 
+ 
+diff --git a/src/nv_driver.c b/src/nv_driver.c
+index f14c847..9f62fe2 100644
+--- a/src/nv_driver.c
++++ b/src/nv_driver.c
+@@ -452,7 +452,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+ {
+ 	RegionRec pixregion;
+ 
+-	PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
++	PixmapRegionInit(&pixregion, dirty->slave_dst);
+ 
+ 	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ 	PixmapSyncDirtyHelper(dirty, &pixregion);
+@@ -676,7 +676,7 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
+ 		if (value & DRM_PRIME_CAP_EXPORT)
+ 			pScrn->capabilities |= RR_Capability_SourceOutput;
+ 		if (value & DRM_PRIME_CAP_IMPORT)
+-			pScrn->capabilities |= RR_Capability_SourceOffload;
++			pScrn->capabilities |= RR_Capability_SourceOffload | RR_Capability_SinkOutput;
+ 	}
+ #endif
+ }
+-- 
+1.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index e8e209c..9df121a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,6 @@
 # Ubuntu patches
 
 100-vblank-on.diff
+101-gart-cursor.patch
+102-frame-throttle.patch
+103-reverse-optimus.patch


Reply to: