rpms/xorg-x11-drv-nouveau/F-11 nouveau-fb-resize.patch, NONE, 1.1 nouveau-multiple-xserver.patch, 1.2, 1.3 nouveau-nv50-fb-accel.patch, 1.2, 1.3 nouveau-nv50-nva0-noaccel.patch, 1.2, 1.3 nouveau-store-vbios.patch, 1.2, 1.3 nouveau-transition-hack.patch, 1.2, 1.3 xorg-x11-drv-nouveau.spec, 1.39, 1.40

Ben Skeggs bskeggs at fedoraproject.org
Fri Apr 17 01:48:17 UTC 2009


Author: bskeggs

Update of /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32473

Modified Files:
	nouveau-multiple-xserver.patch nouveau-nv50-fb-accel.patch 
	nouveau-nv50-nva0-noaccel.patch nouveau-store-vbios.patch 
	nouveau-transition-hack.patch xorg-x11-drv-nouveau.spec 
Added Files:
	nouveau-fb-resize.patch 
Log Message:
* Fri Apr 17 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-28.20090417gitfa2f111
- avoid post-beta hangs experienced by many people (rh#495764, rh#493222).
  - the bug here was relatively harmless, but exposed a more serious issue
    which has been fixed in libdrm-2.4.6-6.fc11
- kms: speed up transitions, they could take a couple of seconds previously
- framebuffer resize support (rh#495838, rh#487356, lots of dups)



nouveau-fb-resize.patch:

--- NEW FILE nouveau-fb-resize.patch ---
>From 9189921f9822579246be05eec4f97e04cc609e7f Mon Sep 17 00:00:00 2001
From: Ben Skeggs <skeggsb at caspar.localdomain>
Date: Tue, 14 Apr 2009 09:23:07 +1000
Subject: [PATCH 6/6] f11: support framebuffer resize without driver pixmaps

---
 src/drmmode_display.c |   75 +++++++++++++++++++++++++++++++--
 src/nouveau_exa.c     |    8 ++-
 src/nv50_randr.c      |    6 +++
 src/nv_crtc.c         |   16 ++++++-
 src/nv_driver.c       |  108 ++++++++++++++++++++++++++++++++++++++++++++++---
 src/nv_type.h         |    9 ++++-
 6 files changed, 205 insertions(+), 17 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index ca1a60b..c666c9f 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1069,6 +1069,59 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
 }
 
 static Bool
+nv_xf86crtc_resize(ScrnInfoPtr pScrn, int width, int height)
+{
+	ScreenPtr pScreen = pScrn->pScreen;
+	NVPtr pNv = NVPTR(pScrn);
+	const int cpp = pScrn->bitsPerPixel >> 3;
+	int pitch = NOUVEAU_ALIGN(width * cpp, 256);
+	int ret = 0;
+	PixmapPtr ppix;
+
+	if (pScrn->virtualX == width && pScrn->virtualY == height &&
+	    (pNv->NoAccel || pNv->exa_onscreen))
+		return TRUE;
+
+	if (!pNv->dev)
+		goto out_done;
+
+	nouveau_fb_free(pScrn);
+
+	ret = nouveau_fb_alloc(pScrn, pitch, height, cpp);
+	if (ret) {
+		width = pScrn->virtualX;
+		height = pScrn->virtualY;
+		pitch = (*pScreen->GetScreenPixmap)(pScreen)->devKind;
+
+		ret = nouveau_fb_alloc(pScrn, pitch, height, cpp);
+		/* famous last words: "this should never happen!" */
+		if (ret)
+			FatalError("couldn't allocate framebuffer!\n");
+
+		ret = -ENOMEM;
+	}
+
+out_done:
+	if (!ret && pNv->ShadowFB) {
+		xfree(pNv->ShadowPtr);
+		pNv->ShadowPtr = xalloc(pitch * height);
+		pNv->ShadowPitch = pitch;
+	}
+
+	ppix = (*pScreen->GetScreenPixmap)(pScreen);
+
+	(*pScreen->ModifyPixmapHeader)(ppix, width, height, -1, -1, pitch,
+				       (!pNv->NoAccel || pNv->ShadowFB) ?
+				       pNv->ShadowPtr : pNv->FBMap);
+	pScrn->pixmapPrivate.ptr = ppix->devPrivate.ptr;
+
+	pScrn->virtualX = width;
+	pScrn->virtualY = height;
+	pScrn->displayWidth = pitch / cpp;
+	return ret == 0;
+}
+
+static Bool
 drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 {
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -1083,10 +1136,23 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	ErrorF("resize called %d %d\n", width, height);
 
 	if (!pNv->exa_driver_pixmaps) {
-		if (width > scrn->virtualX || height > scrn->virtualY)
+		if (!nv_xf86crtc_resize(scrn, width, height))
 			return FALSE;
 
-		scrn->displayWidth = NOUVEAU_ALIGN(width, 64);
+		if (drmmode->fb_id)
+			drmModeRmFB(drmmode->fd, drmmode->fb_id);
+		drmmode->fb_id = 0;
+
+		for (i = 0; i < config->num_crtc; i++) {
+			xf86CrtcPtr crtc = config->crtc[i];
+
+			if (!crtc->enabled)
+				continue;
+			
+			xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation,
+					crtc->x, crtc->y);
+		}
+
 		return TRUE;
 	}
 
@@ -1149,7 +1215,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
 
 Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 {
-	xf86CrtcConfigPtr   xf86_config;
+	xf86CrtcConfigPtr xf86_config;
 	drmmode_ptr drmmode;
 	int i;
 
@@ -1173,8 +1239,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 	for (i = 0; i < drmmode->mode_res->count_connectors; i++)
 		drmmode_output_init(pScrn, drmmode, i);
 
-	xf86InitialConfiguration(pScrn, NVPTR(pScrn)->exa_driver_pixmaps);
-
+	xf86InitialConfiguration(pScrn, TRUE);
 	return TRUE;
 }
 
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index aee2794..6da7d36 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -279,7 +279,10 @@ nouveau_exa_prepare_access(PixmapPtr ppix, int index)
 	} else
 	if (ppix == pScreen->GetScreenPixmap(pScreen)) {
 		nouveau_bo_map(pNv->scanout, NOUVEAU_BO_RDWR);
-		ppix->devPrivate.ptr = pNv->scanout->map;
+		if (pNv->scanout != pNv->FB)
+			ppix->devPrivate.ptr = pNv->scanout->map;
+		else
+			ppix->devPrivate.ptr = pNv->FB->map + pNv->exa_onscreen->offset; 
 	} else {
 		/* force migration */
 		return FALSE;
@@ -543,10 +546,9 @@ Bool
 nouveau_exa_pixmap_is_onscreen(PixmapPtr ppix)
 {
 	ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
-	NVPtr pNv = NVPTR(pScrn);
 	unsigned long offset = exaGetPixmapOffset(ppix);
 
-	if (offset < pNv->EXADriverPtr->offScreenBase)
+	if (offset == 0)
 		return TRUE;
 
 	return FALSE;
diff --git a/src/nv50_randr.c b/src/nv50_randr.c
index 6c19780..f44d286 100644
--- a/src/nv50_randr.c
+++ b/src/nv50_randr.c
@@ -289,8 +289,14 @@ nv50_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
 {
 	ScrnInfoPtr pScrn = crtc->scrn;
 	NV50CrtcPrivatePtr nv_crtc = crtc->driver_private;
+	NVPtr pNv = NVPTR(pScrn);
 
 	nv_crtc->crtc->SetFBOffset(nv_crtc->crtc, x, y);
+	if (nv_crtc->crtc->front_buffer &&
+	    nv_crtc->crtc->front_buffer != pNv->scanout) {
+		nv_crtc->crtc->SetFB(nv_crtc->crtc, pNv->scanout);
+		nv_crtc->crtc->ModeSet(nv_crtc->crtc, &crtc->mode);
+	}
 
 	NV50DisplayCommand(pScrn, NV50_UPDATE_DISPLAY, 0);
 }
diff --git a/src/nv_crtc.c b/src/nv_crtc.c
index 1d50874..cfa06e1 100644
--- a/src/nv_crtc.c
+++ b/src/nv_crtc.c
@@ -1154,7 +1154,10 @@ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y)
 	ScrnInfoPtr pScrn = crtc->scrn;
 	NVPtr pNv = NVPTR(pScrn);    
 	struct nouveau_crtc *nv_crtc = to_nouveau_crtc(crtc);
-	uint32_t start = (y * pScrn->displayWidth + x) * pScrn->bitsPerPixel / 8;
+	uint32_t cpp = pScrn->bitsPerPixel / 8;
+	uint32_t start = (y * pScrn->displayWidth + x) * cpp;
+	uint32_t pitch = pScrn->displayWidth * cpp;
+	NVCrtcRegPtr regp = &pNv->ModeReg.crtc_reg[nv_crtc->head];
 
 	if (crtc->rotatedData != NULL) /* we do not exist on the real framebuffer */
 #if NOUVEAU_EXA_PIXMAPS
@@ -1162,8 +1165,17 @@ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y)
 #else
 		start = pNv->FB->offset + nv_crtc->shadow->offset; /* We do exist relative to the framebuffer */
 #endif
-	else
+	else {
+		if (pNv->exa_onscreen)
+			start += pNv->exa_onscreen->offset;
 		start += pNv->FB->offset;
+	}
+
+	regp->CRTC[NV_CIO_CR_OFFSET_INDEX] = pitch >> 3;
+	regp->CRTC[NV_CIO_CRE_RPC0_INDEX] =
+		XLATE(pitch >> 3, 8, NV_CIO_CRE_RPC0_OFFSET_10_8);
+	crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX);
+	crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX);
 
 	start &= ~3;
 	pNv->ModeReg.crtc_reg[nv_crtc->head].fb_start = start;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index f097fb9..0cc81ae 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -900,16 +900,112 @@ Bool NVI2CInit(ScrnInfoPtr pScrn)
 	return TRUE;
 }
 
+void
+nouveau_fb_free(ScrnInfoPtr pScrn)
+{
+	ScreenPtr pScreen = pScrn->pScreen;
+	NVPtr pNv = NVPTR(pScrn);
+
+	if (!pNv->NoAccel && pNv->exa_onscreen) {
+		exaOffscreenFree(pScreen, pNv->exa_onscreen);
+		pNv->exa_onscreen = NULL;
+	}
+
+	if (pNv->scanout && pNv->FB != pNv->scanout)
+		nouveau_bo_ref(NULL, &pNv->scanout);
+}
+
+int
+nouveau_fb_alloc(ScrnInfoPtr pScrn, int pitch, int height, int cpp)
+{
+	ScreenPtr pScreen = pScrn->pScreen;
+	NVPtr pNv = NVPTR(pScrn);
+	int ret;
+
+	if (!pNv->NoAccel) {
+		pNv->exa_onscreen = exaOffscreenAlloc(pScreen, pitch * height,
+						      256, TRUE, NULL, NULL);
+		if (!pNv->exa_onscreen)
+			return -ENOMEM;
+	}
+
+	if (!pNv->scanout) {
+		ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
+				     256, pitch * height, &pNv->scanout);
+		if (ret) {
+			nouveau_fb_free(pScrn);
+			return ret;
+		}
+	}
+
+
+	return 0;
+}
+
 static Bool
 nv_xf86crtc_resize(ScrnInfoPtr pScrn, int width, int height)
 {
-#if 0
-	do not change virtual* for now, as it breaks multihead server regeneration
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "nv_xf86crtc_resize is called with %dx%d resolution.\n", width, height);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+	ScreenPtr pScreen = pScrn->pScreen;
+	NVPtr pNv = NVPTR(pScrn);
+	const int cpp = pScrn->bitsPerPixel >> 3;
+	int pitch = NOUVEAU_ALIGN(width * cpp, 256);
+	int ret = 0, i;
+	PixmapPtr ppix;
+
+	if (pScrn->virtualX == width && pScrn->virtualY == height &&
+	    (pNv->NoAccel || pNv->exa_onscreen))
+		return TRUE;
+
+	if (!pNv->dev)
+		goto out_done;
+
+	nouveau_fb_free(pScrn);
+
+	ret = nouveau_fb_alloc(pScrn, pitch, height, cpp);
+	if (ret) {
+		width = pScrn->virtualX;
+		height = pScrn->virtualY;
+		pitch = (*pScreen->GetScreenPixmap)(pScreen)->devKind;
+
+		ret = nouveau_fb_alloc(pScrn, pitch, height, cpp);
+		/* famous last words: "this should never happen!" */
+		if (ret)
+			FatalError("couldn't allocate framebuffer!\n");
+
+		ret = -ENOMEM;
+	}
+
+out_done:
+
+	if (!ret && pNv->ShadowFB) {
+		xfree(pNv->ShadowPtr);
+		pNv->ShadowPtr = xalloc(pitch * height);
+		pNv->ShadowPitch = pitch;
+	}
+
+	ppix = pScreen->GetScreenPixmap(pScreen);
+
+	(*pScreen->ModifyPixmapHeader)(ppix, width, height, -1, -1, pitch,
+				       (!pNv->NoAccel || pNv->ShadowFB) ?
+				       pNv->ShadowPtr : pNv->FBMap);
+	pScrn->pixmapPrivate.ptr = ppix->devPrivate.ptr;
+
 	pScrn->virtualX = width;
 	pScrn->virtualY = height;
-#endif
-	return TRUE;
+	pScrn->displayWidth = pitch / cpp;
+
+	for (i = 0; i < config->num_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+
+		if (!crtc->enabled)
+			continue;
+		
+		xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation,
+				crtc->x, crtc->y);
+	}
+
+	return ret == 0;
 }
 
 static const xf86CrtcConfigFuncsRec nv_xf86crtc_config_funcs = {
@@ -1423,7 +1519,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
 		} else
 			nv50_output_create(pScrn); /* create randr-1.2 "outputs". */
 
-		if (!xf86InitialConfiguration(pScrn, FALSE))
+		if (!xf86InitialConfiguration(pScrn, TRUE))
 			NVPreInitFail("No valid modes.\n");
 	}
 
diff --git a/src/nv_type.h b/src/nv_type.h
index 5396cc8..1a9b9ed 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -304,8 +304,11 @@ typedef struct _NVRec {
     volatile CARD8 *PDIO1;
 
     uint8_t cur_head;
+
     ExaDriverPtr	EXADriverPtr;
     Bool		exa_driver_pixmaps;
+    ExaOffscreenArea *  exa_onscreen;
+
     ScreenBlockHandlerProcPtr BlockHandler;
     CloseScreenProcPtr  CloseScreen;
     /* Cursor */
@@ -494,11 +497,15 @@ nouveau_pixmap_offset(PixmapPtr ppix)
 {
 	ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
 	NVPtr pNv = NVPTR(pScrn);
+	unsigned offset;
 
 	if (pNv->exa_driver_pixmaps)
 		return 0;
 
-	return exaGetPixmapOffset(ppix);
+	offset = exaGetPixmapOffset(ppix);
+	if (offset == 0)
+		offset = pNv->exa_onscreen->offset;
+	return offset;
 }
 
 #endif /* __NV_STRUCT_H__ */
-- 
1.6.2.2


nouveau-multiple-xserver.patch:

Index: nouveau-multiple-xserver.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/nouveau-multiple-xserver.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nouveau-multiple-xserver.patch	15 Apr 2009 06:19:01 -0000	1.2
+++ nouveau-multiple-xserver.patch	17 Apr 2009 01:48:16 -0000	1.3
@@ -1,4 +1,4 @@
-From 5e1a05537d929b011bac973a36dfb17d5cbce85d Mon Sep 17 00:00:00 2001
+From 7811f9211a960dd6396f8e29964dcde2aec6f2e5 Mon Sep 17 00:00:00 2001
 From: Ben Skeggs <skeggsb at gmail.com>
 Date: Mon, 13 Apr 2009 19:25:25 +1000
 Subject: [PATCH 3/6] f11: hack to support multiple xserver instances

nouveau-nv50-fb-accel.patch:

Index: nouveau-nv50-fb-accel.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/nouveau-nv50-fb-accel.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nouveau-nv50-fb-accel.patch	15 Apr 2009 06:19:01 -0000	1.2
+++ nouveau-nv50-fb-accel.patch	17 Apr 2009 01:48:16 -0000	1.3
@@ -1,4 +1,4 @@
-From 9e7354b890c093698c602d178f7920b92f0d046b Mon Sep 17 00:00:00 2001
+From ae25ecbcb06ea2e32af8c7268ce138645d02274f Mon Sep 17 00:00:00 2001
 From: Ben Skeggs <skeggsb at gmail.com>
 Date: Mon, 13 Apr 2009 19:30:38 +1000
 Subject: [PATCH 4/6] nv50/f11: accelerate front-buffer rendering, linear shadow for scanout
@@ -30,7 +30,7 @@
  			 nouveau_output.h \
  			 nouveau_connector.h \
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index c315a70..55f7468 100644
+index 4909e51..ca1a60b 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -214,8 +214,8 @@ drmmode_fb_copy_sw(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
@@ -53,7 +53,7 @@
  	drmFree(fb);
  }
  
-@@ -289,7 +289,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+@@ -380,7 +380,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
  		ret = drmModeAddFB(drmmode->fd,
  				   pScrn->virtualX, pScrn->virtualY,
  				   pScrn->depth, pScrn->bitsPerPixel,

nouveau-nv50-nva0-noaccel.patch:

Index: nouveau-nv50-nva0-noaccel.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/nouveau-nv50-nva0-noaccel.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nouveau-nv50-nva0-noaccel.patch	15 Apr 2009 06:19:01 -0000	1.2
+++ nouveau-nv50-nva0-noaccel.patch	17 Apr 2009 01:48:17 -0000	1.3
@@ -1,4 +1,4 @@
-From 5243a670b6d728d94a86a340062e287a267b9a10 Mon Sep 17 00:00:00 2001
+From 49567300354f9bee9271e9e6ec9332c8fe713973 Mon Sep 17 00:00:00 2001
 From: Ben Skeggs <skeggsb at gmail.com>
 Date: Mon, 13 Apr 2009 20:20:39 +1000
 Subject: [PATCH 5/6] nv50/f11: disable acceleration on NVAx chipsets

nouveau-store-vbios.patch:

Index: nouveau-store-vbios.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/nouveau-store-vbios.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nouveau-store-vbios.patch	15 Apr 2009 06:19:01 -0000	1.2
+++ nouveau-store-vbios.patch	17 Apr 2009 01:48:17 -0000	1.3
@@ -1,4 +1,4 @@
-From 0b64ce0faefd2a87d46699ff1255e39d0051f115 Mon Sep 17 00:00:00 2001
+From 0a32a04139e0711a0aa2bb4c7885f24b3a963d0c Mon Sep 17 00:00:00 2001
 From: Ben Skeggs <skeggsb at gmail.com>
 Date: Mon, 13 Apr 2009 19:13:26 +1000
 Subject: [PATCH 2/6] bios/f11: store a copy of used vbios image in /var/run

nouveau-transition-hack.patch:

Index: nouveau-transition-hack.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/nouveau-transition-hack.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nouveau-transition-hack.patch	15 Apr 2009 06:19:01 -0000	1.2
+++ nouveau-transition-hack.patch	17 Apr 2009 01:48:17 -0000	1.3
@@ -1,17 +1,17 @@
-From 0a328a89d65f3b6a98fbf49cefd3deb4f3521254 Mon Sep 17 00:00:00 2001
+From 48c76f574f059d7d98f18baf10e798d8bfd5b968 Mon Sep 17 00:00:00 2001
 From: Ben Skeggs <skeggsb at gmail.com>
 Date: Mon, 13 Apr 2009 19:12:25 +1000
 Subject: [PATCH 1/6] kms/f11: hack in transition support without driver pixmaps
 
 ---
- src/drmmode_display.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 51 insertions(+), 2 deletions(-)
+ src/drmmode_display.c |  144 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 142 insertions(+), 2 deletions(-)
 
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index aa8befe..c315a70 100644
+index aa8befe..4909e51 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
-@@ -185,6 +185,51 @@ drmmode_fb_pixmap(ScrnInfoPtr pScrn, int id, int *w, int *h)
+@@ -185,6 +185,139 @@ drmmode_fb_pixmap(ScrnInfoPtr pScrn, int id, int *w, int *h)
  }
  
  static void
@@ -60,22 +60,113 @@
 +}
 +
 +static void
++drmmode_fb_copy_nv50(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
++		     int src_id, int x, int y)
++{
++	drmModeFBPtr fb;
++	NVPtr pNv = NVPTR(pScrn);
++	struct nouveau_channel *chan = pNv->chan;
++	struct nouveau_grobj *eng2d = pNv->Nv2D;
++	struct nouveau_bo *src = NULL, *dst = NULL;
++	struct drm_gem_flink req;
++	int ret;
++
++	/* This is not what this should look like.  Until we can do driver
++	 * pixmaps, this will be a nasty hack!
++	 */
++
++	fb = drmModeGetFB(nouveau_device(pNv->dev)->fd, src_id);
++	if (!fb) {
++		ErrorF("src fb\n");
++		return;
++	}
++
++	req.handle = fb->handle;
++	ret = ioctl(nouveau_device(pNv->dev)->fd, DRM_IOCTL_GEM_FLINK, &req);
++	if (ret) {
++		ErrorF("name bo: %d\n", ret);
++		drmFree(fb);
++		return;
++	}
++
++	ret = nouveau_bo_handle_ref(pNv->dev, req.name, &src);
++	if (ret) {
++		ErrorF("src bo: %d\n", ret);
++		drmFree(fb);
++		return;
++	}
++
++	nouveau_bo_ref(pNv->scanout, &dst);
++
++	BEGIN_RING(chan, eng2d, 0x02ac, 1);
++	OUT_RING  (chan, 3);
++	BEGIN_RING(chan, eng2d, 0x0200, 2);
++	OUT_RING  (chan, pScrn->bitsPerPixel == 16 ? 0xe8 : 0xcf);
++	OUT_RING  (chan, 1);
++	BEGIN_RING(chan, eng2d, 0x0214, 5);
++	OUT_RING  (chan, pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
++	OUT_RING  (chan, pScrn->virtualX);
++	OUT_RING  (chan, pScrn->virtualY);
++	OUT_RELOCh(chan, dst, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
++	OUT_RELOCl(chan, dst, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
++	BEGIN_RING(chan, eng2d, 0x0280, 4);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, pScrn->virtualX);
++	OUT_RING  (chan, pScrn->virtualY);
++	BEGIN_RING(chan, eng2d, 0x0230, 2);
++	OUT_RING  (chan, fb->bpp == 16 ? 0xe8 : 0xcf);
++	OUT_RING  (chan, 1);
++	BEGIN_RING(chan, eng2d, 0x0244, 5);
++	OUT_RING  (chan, fb->pitch);
++	OUT_RING  (chan, fb->width);
++	OUT_RING  (chan, fb->height);
++	OUT_RELOCh(chan, src, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
++	OUT_RELOCl(chan, src, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
++	BEGIN_RING(chan, eng2d, 0x0110, 1);
++	OUT_RING  (chan, 0);
++	BEGIN_RING(chan, eng2d, 0x08b0, 12);
++	OUT_RING  (chan, x);
++	OUT_RING  (chan, y);
++	OUT_RING  (chan, fb->width);
++	OUT_RING  (chan, fb->height);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 1);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 1);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 0);
++	OUT_RING  (chan, 0);
++	FIRE_RING (chan);
++
++	nouveau_bo_map(dst, NOUVEAU_BO_RD);
++	nouveau_bo_unmap(dst);
++	nouveau_bo_ref(NULL, &dst);
++	nouveau_bo_ref(NULL, &src);
++	drmFree(fb);
++}
++
++static void
  drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
  		int x, int y)
  {
-@@ -194,6 +239,11 @@ drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
+@@ -194,6 +327,14 @@ drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
  	PixmapPtr pspix, pdpix;
  	int w, h;
  
 +	if (!pNv->exa_driver_pixmaps) {
++		if (pNv->NoAccel)
 +		drmmode_fb_copy_sw(pScrn, drmmode, dst_id, src_id, x, y);
++		else
++		drmmode_fb_copy_nv50(pScrn, drmmode, dst_id, src_id, x, y);
 +		return;
 +	}
 +
  	pspix = drmmode_fb_pixmap(pScrn, src_id, NULL, NULL);
  	if (!pspix)
  		return;
-@@ -292,8 +342,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+@@ -292,8 +433,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
  	if (drmmode_crtc->rotate_fb_id)
  		fb_id = drmmode_crtc->rotate_fb_id;
  	else


Index: xorg-x11-drv-nouveau.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/F-11/xorg-x11-drv-nouveau.spec,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- xorg-x11-drv-nouveau.spec	15 Apr 2009 06:19:01 -0000	1.39
+++ xorg-x11-drv-nouveau.spec	17 Apr 2009 01:48:17 -0000	1.40
@@ -19,7 +19,7 @@
 # need to set an epoch to get version number in sync with upstream
 Epoch:     1
 Version:   %{nouveau_version}
-Release:   27.%{snapshot}%{?dist}
+Release:   28.%{snapshot}%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -47,6 +47,7 @@
 Patch3: nouveau-nv50-fb-accel.patch
 Patch4: nouveau-nv50-nva0-noaccel.patch
 Patch5: dcbconf_7_4_ignore.diff
+Patch6: nouveau-fb-resize.patch
 
 %description 
 X.Org X11 nouveau video driver.
@@ -60,6 +61,7 @@
 %patch3 -p1 -b .nv50_fb_render
 %patch4 -p1 -b .nva0_noaccel
 %patch5 -p1 -b .dcbconf
+%patch6 -p1 -b .fbresize
 
 %build
 autoreconf -v --install
@@ -83,6 +85,13 @@
 %{_mandir}/man4/nouveau.4*
 
 %changelog
+* Fri Apr 17 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-28.20090417gitfa2f111
+- avoid post-beta hangs experienced by many people (rh#495764, rh#493222).
+  - the bug here was relatively harmless, but exposed a more serious issue
+    which has been fixed in libdrm-2.4.6-6.fc11
+- kms: speed up transitions, they could take a couple of seconds previously
+- framebuffer resize support (rh#495838, rh#487356, lots of dups)
+
 * Wed Apr 15 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-27.20090413git7100c06
 - fix rh#495843
 




More information about the scm-commits mailing list