rpms/xorg-x11-drv-nouveau/devel .cvsignore, 1.16, 1.17 nouveau-fedora.patch, 1.6, 1.7 sources, 1.17, 1.18 xorg-x11-drv-nouveau.spec, 1.22, 1.23

Ben Skeggs bskeggs at fedoraproject.org
Fri Mar 13 07:44:20 UTC 2009


Author: bskeggs

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

Modified Files:
	.cvsignore nouveau-fedora.patch sources 
	xorg-x11-drv-nouveau.spec 
Log Message:
* Fri Mar 13 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-11.20090313git79d23d8
- kms: dpms fixes
- kms: nicer reporting of output properties to users
- improve init paths, more robust
- support for multiple xservers (fast user switching)




Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/.cvsignore,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- .cvsignore	10 Mar 2009 04:14:27 -0000	1.16
+++ .cvsignore	13 Mar 2009 07:43:49 -0000	1.17
@@ -1 +1 @@
-xf86-video-nouveau-0.0.12-20090310git8f9a580.tar.bz2
+xf86-video-nouveau-0.0.12-20090313git79d23d8.tar.bz2

nouveau-fedora.patch:

Index: nouveau-fedora.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-fedora.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- nouveau-fedora.patch	10 Mar 2009 04:14:28 -0000	1.6
+++ nouveau-fedora.patch	13 Mar 2009 07:43:49 -0000	1.7
@@ -11,10 +11,10 @@
  			 nouveau_output.h \
  			 nouveau_connector.h \
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 081d194..ca229db 100644
+index afca718..a8612e6 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
-@@ -127,6 +127,50 @@ drmmode_crtc_dpms(xf86CrtcPtr drmmode_crtc, int mode)
+@@ -129,6 +129,50 @@ drmmode_crtc_dpms(xf86CrtcPtr drmmode_crtc, int mode)
  
  }
  
@@ -65,7 +65,7 @@
  static Bool
  drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
  		       Rotation rotation, int x, int y)
-@@ -151,7 +195,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+@@ -153,7 +197,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
  		ret = drmModeAddFB(drmmode->fd,
  				   pScrn->virtualX, pScrn->virtualY,
  				   pScrn->depth, pScrn->bitsPerPixel,
@@ -74,7 +74,7 @@
  		if (ret < 0) {
  			ErrorF("failed to add fb\n");
  			return FALSE;
-@@ -204,6 +248,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+@@ -206,6 +250,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
  	fb_id = drmmode->fb_id;
  	if (drmmode_crtc->rotate_fb_id)
  		fb_id = drmmode_crtc->rotate_fb_id;
@@ -88,7 +88,7 @@
  			     fb_id, x, y, output_ids, output_count, &kmode);
  	if (ret)
 diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
-index 93fc3c5..6854b68 100644
+index 93fc3c5..61773db 100644
 --- a/src/nouveau_exa.c
 +++ b/src/nouveau_exa.c
 @@ -265,7 +265,8 @@ nouveau_exa_wait_marker(ScreenPtr pScreen, int marker)
@@ -149,6 +149,24 @@
  		return false;
  
  	return true;
+@@ -406,7 +419,7 @@ nouveau_exa_pixmap_map(PixmapPtr ppix)
+ 	struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
+ 	unsigned delta = nouveau_pixmap_offset(ppix);
+ 
+-	if (bo->tiled) {
++	if (NVPTR(xf86Screens[ppix->drawable.pScreen->myNum])->GART && bo->tiled) {
+ 		struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
+ 
+ 		nvpix->linear = xcalloc(1, ppix->devKind * ppix->drawable.height);
+@@ -428,7 +441,7 @@ nouveau_exa_pixmap_unmap(PixmapPtr ppix)
+ {
+ 	struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
+ 
+-	if (bo->tiled) {
++	if (NVPTR(xf86Screens[ppix->drawable.pScreen->myNum])->GART && bo->tiled) {
+ 		struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
+ 
+ 		NVAccelUploadM2MF(ppix, 0, 0, ppix->drawable.width,
 @@ -608,6 +621,12 @@ nouveau_exa_init(ScreenPtr pScreen)
  		exa->maxY = 2048;
  	}
@@ -497,10 +515,10 @@
  }
  
 diff --git a/src/nv_dri.c b/src/nv_dri.c
-index 796df9b..ac7022b 100644
+index e105639..95ca770 100644
 --- a/src/nv_dri.c
 +++ b/src/nv_dri.c
-@@ -405,7 +405,7 @@ Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn)
+@@ -331,7 +331,7 @@ Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn)
  	pNOUVEAUDRI->depth		= pScrn->depth;
  	pNOUVEAUDRI->bpp		= pScrn->bitsPerPixel;
  
@@ -510,10 +528,59 @@
  	/* back/depth buffers will likely be allocated on a per-drawable
  	 * basis, but these may be useful if we want to support shared back
 diff --git a/src/nv_driver.c b/src/nv_driver.c
-index b4739fa..42df24a 100644
+index ed4d61b..6664373 100644
 --- a/src/nv_driver.c
 +++ b/src/nv_driver.c
-@@ -1583,6 +1583,8 @@ NVMapMemSW(ScrnInfoPtr pScrn)
+@@ -21,6 +21,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <sys/ioctl.h>
+ 
+ #include "nv_include.h"
+ 
+@@ -657,14 +658,27 @@ NV50ReleaseDisplay(ScrnInfoPtr pScrn)
+  */
+ 
+ /* Mandatory */
++static void NVMapMemGART(ScrnInfoPtr);
+ static Bool
+ NVEnterVT(int scrnIndex, int flags)
+ {
+ 	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ 	NVPtr pNv = NVPTR(pScrn);
++	int ret;
+ 
+ 	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NVEnterVT is called.\n");
+ 
++	if (pNv->dev) {
++		ret = ioctl(nouveau_device(pNv->dev)->fd,
++			    DRM_IOCTL_SET_MASTER, NULL);
++		if (ret) {
++			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++				   "Unable to set master\n");
++		}
++
++		NVMapMemGART(pScrn);
++	}
++
+ 	if (!pNv->kms_enable && pNv->randr12_enable)
+ 		NVSave(pScrn);
+ 
+@@ -711,6 +725,12 @@ NVLeaveVT(int scrnIndex, int flags)
+ 
+ 	NVSync(pScrn);
+ 
++	if (pNv->dev) {
++		nouveau_bo_ref(NULL, &pNv->GART);
++
++		ioctl(nouveau_device(pNv->dev)->fd, DRM_IOCTL_DROP_MASTER, NULL);
++	}
++
+ 	if (pNv->kms_enable)
+ 		return;
+ 
+@@ -1585,6 +1605,8 @@ NVMapMemSW(ScrnInfoPtr pScrn)
  		return FALSE;
  	pNv->GART = NULL;
  
@@ -522,15 +589,94 @@
  	ret = nouveau_bo_fake(&dev, Cursor0Offset,
  			      NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
  			      64*1024, pNv->VRAMMap + Cursor0Offset,
-@@ -1628,6 +1630,7 @@ NVMapMem(ScrnInfoPtr pScrn)
+@@ -1625,11 +1647,81 @@ NVMapMemSW(ScrnInfoPtr pScrn)
+ }
+ 
+ static Bool
++NVMapMemSharedFB(ScrnInfoPtr pScrn)
++{
++	NVPtr pNv = NVPTR(pScrn);
++	uint64_t handle, size;
++	void *map;
++	int ret;
++
++	ret = nouveau_device_get_param(pNv->dev, 0xdeadcafe00000001, &handle);
++	if (ret)
++		return FALSE;
++
++	ret = nouveau_device_get_param(pNv->dev, 0xdeadcafe00000002, &size);
++	if (ret)
++		return FALSE;
++
++	if (nouveau_device(pNv->dev)->mm_enabled) {
++		ret = nouveau_bo_handle_ref(pNv->dev, handle, &pNv->FB);
++		if (ret) {
++			ErrorF("%d\n", ret);
++			return FALSE;
++		}
++
++		pNv->FB->size = size;
++		pNv->FB->tiled = (pNv->Architecture == NV_ARCH_50);
++		return TRUE;
++	}
++
++	ret = drmMap(nouveau_device(pNv->dev)->fd, handle >> 32, size, &map);
++	if (ret)
++		return FALSE;
++
++	ret = nouveau_bo_fake(pNv->dev, handle & 0xffffffff, NOUVEAU_BO_VRAM |
++			      NOUVEAU_BO_PIN, size, map, &pNv->FB);
++	if (ret)
++		return FALSE;
++
++	pNv->FB->tiled = (pNv->Architecture == NV_ARCH_50);
++	return TRUE;
++}
++
++static void
++NVMapMemGART(ScrnInfoPtr pScrn) {
++	NVPtr pNv = NVPTR(pScrn);
++	int size;
++
++	if (pNv->AGPSize) {
++		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
++			   "AGPGART: %dMiB available\n",
++			   (unsigned int)(pNv->AGPSize >> 20));
++		if (pNv->AGPSize > (16*1024*1024))
++			size = 16*1024*1024;
++		else
++			/* always leave 512kb for other things like the fifos */
++			size = pNv->AGPSize - 512*1024;
++	} else {
++		size = (4 << 20) - (1 << 18) ;
++		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
++			   "GART: PCI DMA - using %dKiB\n",
++			   size >> 10);
++	}
++
++	if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN, 0,
++			   size, &pNv->GART)) {
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++			   "Unable to allocate GART memory\n");
++	}
++}
++
++static Bool
+ NVMapMem(ScrnInfoPtr pScrn)
+ {
  	NVPtr pNv = NVPTR(pScrn);
  	uint64_t res;
  	int size;
 +	uint32_t flags;
  
- 	if (pNv->NoAccel)
+ 	if (!pNv->dev)
  		return NVMapMemSW(pScrn);
-@@ -1647,8 +1650,11 @@ NVMapMem(ScrnInfoPtr pScrn)
+@@ -1646,41 +1738,45 @@ NVMapMem(ScrnInfoPtr pScrn)
+ 		size = size * (pScrn->bitsPerPixel >> 3);
+ 		size = size * pScrn->virtualY;
+ 	} else {
++		if (NVMapMemSharedFB(pScrn))
++			goto skip_fb;
  		size = pNv->VRAMPhysicalSize / 2;
  	}
  
@@ -544,10 +690,22 @@
  		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
  			   "Failed to allocate framebuffer memory\n");
  		return FALSE;
-@@ -1658,6 +1664,24 @@ NVMapMem(ScrnInfoPtr pScrn)
+ 	}
++skip_fb:
+ 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ 		   "Allocated %dMiB VRAM for framebuffer + offscreen pixmaps, "
  		   "at offset 0x%X\n",
  		   (uint32_t)(pNv->FB->size >> 20), (uint32_t) pNv->FB->offset);
  
+-	if (pNv->AGPSize) {
+-		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+-			   "AGPGART: %dMiB available\n",
+-			   (unsigned int)(pNv->AGPSize >> 20));
+-		if (pNv->AGPSize > (16*1024*1024))
+-			size = 16*1024*1024;
+-		else
+-			/* always leave 512kb for other things like the fifos */
+-			size = pNv->AGPSize - 512*1024;
 +	/* Allocate linear scanout. */
 +	if (pNv->Architecture >= NV_ARCH_50) {
 +		unsigned scanout_size;
@@ -562,14 +720,24 @@
 +				   "Failed to allocate scanout buffer\n");
 +			return FALSE;
 +		}
-+	} else {
+ 	} else {
+-		size = (4 << 20) - (1 << 18) ;
+-		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+-			   "GART: PCI DMA - using %dKiB\n",
+-			   size >> 10);
 +		nouveau_bo_ref(pNv->FB, &pNv->scanout);
-+	}
-+
- 	if (pNv->AGPSize) {
+ 	}
+ 
+-	if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN, 0,
+-			   size, &pNv->GART)) {
+-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+-			   "Unable to allocate GART memory\n");
+-	}
++	NVMapMemGART(pScrn);
+ 	if (pNv->GART) {
  		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- 			   "AGPGART: %dMiB available\n",
-@@ -1756,6 +1780,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
+ 			   "GART: Allocated %dMiB as a scratch buffer\n",
+@@ -1758,6 +1854,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
  	}
  
  	nouveau_bo_ref(NULL, &pNv->FB);
@@ -577,7 +745,7 @@
  	nouveau_bo_ref(NULL, &pNv->GART);
  	nouveau_bo_ref(NULL, &pNv->Cursor);
  	nouveau_bo_ref(NULL, &pNv->Cursor2);
-@@ -2082,10 +2107,11 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+@@ -2078,10 +2175,11 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
  	 * up until X decides to draw something
  	 */
  	if (!pNv->kms_enable) {
@@ -592,7 +760,7 @@
  	}
  
  	if (!pNv->randr12_enable) {
-@@ -2297,6 +2323,15 @@ NVSaveScreen(ScreenPtr pScreen, int mode)
+@@ -2293,6 +2391,15 @@ NVSaveScreen(ScreenPtr pScreen, int mode)
  	bool on = xf86IsUnblank(mode);
  	int i;
  


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/sources,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- sources	10 Mar 2009 04:14:28 -0000	1.17
+++ sources	13 Mar 2009 07:43:49 -0000	1.18
@@ -1 +1 @@
-f2046675f98da002dd324451fd976863  xf86-video-nouveau-0.0.12-20090310git8f9a580.tar.bz2
+9ff23ca87b9a18558308746d1b19ec43  xf86-video-nouveau-0.0.12-20090313git79d23d8.tar.bz2


Index: xorg-x11-drv-nouveau.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/xorg-x11-drv-nouveau.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- xorg-x11-drv-nouveau.spec	10 Mar 2009 04:14:28 -0000	1.22
+++ xorg-x11-drv-nouveau.spec	13 Mar 2009 07:43:49 -0000	1.23
@@ -7,8 +7,8 @@
 # git clone git://git.freedesktop.org/git/nouveau/xf86-video-nouveau
 # git-archive --format=tar --prefix=xf86-video-nouveau-0.0.10/ %{git_version} | bzip2 > xf86-video-nouveau-0.0.10-%{gitdate}.tar.bz2
 
-%define gitdate 20090310
-%define git_version 8f9a580
+%define gitdate 20090313
+%define git_version 79d23d8
 
 %define snapshot %{gitdate}git%{git_version}
 
@@ -19,7 +19,7 @@
 # need to set an epoch to get version number in sync with upstream
 Epoch:     1
 Version:   %{nouveau_version}
-Release:   10.%{snapshot}%{?dist}
+Release:   11.%{snapshot}%{?dist}
 URL:       http://www.x.org
 License: MIT
 Group:     User Interface/X Hardware Support
@@ -75,6 +75,12 @@
 %{_mandir}/man4/nouveau.4*
 
 %changelog
+* Fri Mar 13 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-11.20090313git79d23d8
+- kms: dpms fixes
+- kms: nicer reporting of output properties to users
+- improve init paths, more robust
+- support for multiple xservers (fast user switching)
+
 * Tue Mar 10 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.12-10.20090310git8f9a580
 - upstream update, should fix #455194
 




More information about the fedora-extras-commits mailing list