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

xserver-xorg-video-nouveau: Changes to 'debian-unstable'



 .gitignore                                 |    2 
 ChangeLog                                  |   96 +++++++++++++++++++++++++++
 Makefile.am                                |   15 ++--
 configure.ac                               |   35 +++++++++-
 debian/changelog                           |   14 ++++
 debian/control                             |    2 
 debian/patches/02-link-against-libdrm.diff |   42 ++++++++++++
 debian/patches/series                      |    1 
 debian/rules                               |    4 -
 src/Makefile.am                            |   33 +++++++++
 src/drmmode_display.c                      |   40 ++++++++---
 src/nouveau_dri2.c                         |   19 +----
 src/nv_driver.c                            |  101 ++++++++++++++---------------
 src/nv_type.h                              |    8 --
 src/shader/.gitignore                      |    1 
 15 files changed, 318 insertions(+), 95 deletions(-)

New commits:
commit d0b77bf3d687b320d5262f0c7d04461c4e92c99e
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Fri Jun 14 18:44:50 2013 +0200

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index f4e9efb..2c27520 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.8-1) unstable; urgency=low
 
   [ Maarten Lankhorst ]
   * New upstream release.
@@ -10,7 +10,7 @@ xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
     to avoid potentially insufficient dependencies (Closes: #633786).
   * Enable verbose build logs.
 
- -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 12 Jun 2013 10:58:45 +0200
+ -- Sven Joachim <svenjoac@gmx.de>  Fri, 14 Jun 2013 18:44:34 +0200
 
 xserver-xorg-video-nouveau (1:1.0.7-2) unstable; urgency=low
 

commit d8cff69f2e80b438d806a9fa764d6318b0ab9597
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Fri Jun 14 17:24:59 2013 +0200

    Enable verbose build logs
    
    Explicitly pass --disable-silent-rules to configure, since
    dh_auto_configure does not currently do that, see
    http://bugs.debian.org/680686.

diff --git a/debian/changelog b/debian/changelog
index 526f538..f4e9efb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
   [ Sven Joachim ]
   * New patch 02-link-against-libdrm.diff: link the driver against libdrm
     to avoid potentially insufficient dependencies (Closes: #633786).
+  * Enable verbose build logs.
 
  -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 12 Jun 2013 10:58:45 +0200
 
diff --git a/debian/rules b/debian/rules
index 58cf3bd..906a800 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,9 +4,9 @@ export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
 export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
 export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
 
-# Needed to find ChangeLog:
+# Needed to find ChangeLog, and for verbose build logs:
 override_dh_auto_configure:
-	dh_auto_configure -- CURDIR="$(CURDIR)"
+	dh_auto_configure -- CURDIR="$(CURDIR)" --disable-silent-rules
 
 # Install in debian/tmp to retain control through dh_install:
 override_dh_auto_install:

commit d5d36a098522718af39140a182e284635a5df6a7
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Fri Jun 14 17:17:41 2013 +0200

    New patch 02-link-against-libdrm.diff
    
    Link the driver against libdrm to avoid potentially insufficient
    dependencies.  Patch sent upstream to
    http://lists.freedesktop.org/archives/nouveau/2013-June/012798.html.

diff --git a/debian/changelog b/debian/changelog
index af95226..526f538 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,14 @@
 xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
 
+  [ Maarten Lankhorst ]
   * New upstream release.
   * Replace dependency on x11proto-xf86dri-dev with x11proto-dri2-dev.
     - Upstream removed dri1 dependency.
 
+  [ Sven Joachim ]
+  * New patch 02-link-against-libdrm.diff: link the driver against libdrm
+    to avoid potentially insufficient dependencies (Closes: #633786).
+
  -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 12 Jun 2013 10:58:45 +0200
 
 xserver-xorg-video-nouveau (1:1.0.7-2) unstable; urgency=low
diff --git a/debian/patches/02-link-against-libdrm.diff b/debian/patches/02-link-against-libdrm.diff
new file mode 100644
index 0000000..602562a
--- /dev/null
+++ b/debian/patches/02-link-against-libdrm.diff
@@ -0,0 +1,42 @@
+commit 3a48b65b5bfc9cf4c3049923cfdba18d78097c88
+Author: Sven Joachim <svenjoac@gmx.de>
+Date:   Thu Jun 13 20:33:28 2013 +0200
+
+    Link against libdrm
+    
+    The DDX uses symbols from libdrm but currently does not link against
+    it, but rather relies on indirect linkage from libdrm_nouveau.  This
+    could lead to insufficient dependencies in distribution packages, seen
+    in http://bugs.debian.org/633786.
+    
+    Signed-off-by: Sven Joachim <svenjoac@gmx.de>
+
+diff --git a/configure.ac b/configure.ac
+index 6f7f870..b54b8cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -80,6 +80,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
+ XORG_DRIVER_CHECK_EXT(DRI2, [dri2proto >= 2.6])
+ 
+ # Checks for pkg-config packages
++PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.17])
+ PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.25])
+ AC_SUBST(LIBDRM_NOUVEAU_CFLAGS)
+ AC_SUBST(LIBDRM_NOUVEAU_LIBS)
+diff --git a/src/Makefile.am b/src/Makefile.am
+index f54e135..5836ead 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -23,10 +23,10 @@
+ # -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+ # _ladir passes a dummy rpath to libtool so the thing will actually link
+ # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+-AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @LIBDRM_NOUVEAU_CFLAGS@
++AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @LIBDRM_NOUVEAU_CFLAGS@ @LIBDRM_CFLAGS@
+ nouveau_drv_la_LTLIBRARIES = nouveau_drv.la
+ nouveau_drv_la_LDFLAGS = -module -avoid-version @LIBDRM_NOUVEAU_LIBS@ \
+-			 @LIBUDEV_LIBS@
++			 @LIBUDEV_LIBS@ @LIBDRM_LIBS@
+ nouveau_drv_ladir = @moduledir@/drivers
+ 
+ nouveau_drv_la_SOURCES = \
diff --git a/debian/patches/series b/debian/patches/series
index d6892cf..90907d4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01-set-NV_DRIVER_DATE-from-ChangeLog.diff
+02-link-against-libdrm.diff

commit 2cfc6e127ef852b12528ac3cb1ab3e4917c5f52b
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Wed Jun 12 19:35:18 2013 +0200

    Bump upstream ChangeLog

diff --git a/ChangeLog b/ChangeLog
index f59a678..cb76802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,99 @@
+commit 7f20a6af25ae28452ec9c971bfa2227857e6ee93
+Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+Date:   Wed Jun 12 10:46:39 2013 +0200
+
+    bump to 1.0.8
+
+commit 1fda669c0e5a25eac7f9f1e9a743120cae50ff51
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 20:48:47 2013 +0000
+
+    configure: printout the configuration info
+    
+    Let the bikeshedding begin
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 45dbcaac301efce04d0bb492337f4febf8129ed9
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 20:48:45 2013 +0000
+
+    nouveau: mandate dri2 build
+    
+    Building nouveau without dri2 is just silly
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit ea8d225fe100ecabb72e3cc0a92372f16afb10b3
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 20:48:44 2013 +0000
+
+    dri1: purge the final references
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit b5d1a9bd269c9d2758fee37492cdcccc976fcc3b
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 20:48:43 2013 +0000
+
+    nouveau: Do not load dri {sub,}module
+    
+    Nouveau does not use dri1, thus loading XFree86-DRI is not needed
+    On the other hand, we do use dri2
+    
+    As a side effect, purge the 'set-but-unused' variable pLibDRMVersion
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 7c3f6cd8d6b14aea561fb877f6006d339d156f35
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 20:48:42 2013 +0000
+
+    nouveau: stop using dri1 function DRICreatePCIBusID
+    
+    Step 1 to completely rip out dri1 out of nouveau
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 3b1a45325d5fd46f0e7fad17168742b4c9a2465a
+Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+Date:   Wed Jun 12 10:30:32 2013 +0200
+
+    update makefiles for make distcheck
+
+commit b82aacd3e72b52240181569c8b0abb55c1f716d5
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sat Feb 16 12:48:46 2013 -0800
+
+    configure: require xorg-macros 1.8
+    
+    Explicitly check for xorg-macros 1.8, as a subtle hint
+    to update your build deps if building your own ddx
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 4f667b40f41e311fbe302237efe173bcc24fb8bb
+Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+Date:   Mon Jun 10 14:29:59 2013 +0200
+
+    fix a xfree from previous patch
+    
+    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+
+commit 2e34d11541e1f987c7ca0556592cb16f4d232299
+Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+Date:   Mon Jun 10 13:06:35 2013 +0200
+
+    nouveau: enable support for normal optimus configuration
+    
+    nvd7 has no display engine, only enable sink output capability
+    if there is a crtc.
+    
+    drmmode doesn't work without crtc's, so prevent crashes by skipping
+    the drmmode code in that case.
+    
+    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+
 commit bf72ae1f6574c540f0afc2d7845d41df43507a8f
 Author: Ben Skeggs <bskeggs@redhat.com>
 Date:   Wed May 15 22:05:01 2013 +1000

commit a3dd588c4392e59ea52f814f6eb80f4635465b16
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jun 12 11:16:38 2013 +0200

    Replace dependency on x11proto-xf86dri-dev with x11proto-dri2-dev.
    
    Upstream removed dri1 dependency.

diff --git a/debian/changelog b/debian/changelog
index 6b643e1..5d56bbc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
 
   * New upstream release.
+  * Replace dependency on x11proto-xf86dri-dev with x11proto-dri2-dev.
+    - Upstream removed dri1 dependency.
 
  -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 12 Jun 2013 10:58:45 +0200
 
diff --git a/debian/control b/debian/control
index 4975203..486fc7e 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends:
  x11proto-render-dev,
  x11proto-xext-dev,
  libdrm-dev (>= 2.4.40-1),
- x11proto-xf86dri-dev,
+ x11proto-dri2-dev,
  x11proto-gl-dev,
  mesa-common-dev,
  libudev-dev,

commit dbb64a8e0cade7f8e85f75090d1f1a7ae8980ab8
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jun 12 10:59:11 2013 +0200

    New upstream release.

diff --git a/debian/changelog b/debian/changelog
index 84c8d87..6b643e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-video-nouveau (1:1.0.8-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 12 Jun 2013 10:58:45 +0200
+
 xserver-xorg-video-nouveau (1:1.0.7-1) experimental; urgency=low
 
   [ Maarten Lankhorst ]

commit 7f20a6af25ae28452ec9c971bfa2227857e6ee93
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jun 12 10:46:39 2013 +0200

    bump to 1.0.8

diff --git a/configure.ac b/configure.ac
index 575f69d..bf19d3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-nouveau],
-        [1.0.7],
+        [1.0.8],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-nouveau])
 

commit 1fda669c0e5a25eac7f9f1e9a743120cae50ff51
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 20:48:47 2013 +0000

    configure: printout the configuration info
    
    Let the bikeshedding begin
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/configure.ac b/configure.ac
index 4f9f0b1..575f69d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,3 +132,21 @@ AC_CONFIG_FILES([
 	man/Makefile
 ])
 AC_OUTPUT
+
+dnl
+dnl Output some configuration info for the user
+dnl
+echo ""
+echo "        prefix:              $prefix"
+echo "        exec_prefix:         $exec_prefix"
+echo "        libdir:              $libdir"
+echo "        includedir:          $includedir"
+
+echo ""
+echo "        CFLAGS:              $CFLAGS"
+echo "        CXXFLAGS:            $CXXFLAGS"
+echo "        Macros:              $DEFINES"
+
+echo ""
+echo "        Run '${MAKE-make}' to build xf86-video-nouveau"
+echo ""

commit 45dbcaac301efce04d0bb492337f4febf8129ed9
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 20:48:45 2013 +0000

    nouveau: mandate dri2 build
    
    Building nouveau without dri2 is just silly
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/configure.ac b/configure.ac
index fa4a2dc..4f9f0b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,7 @@ AC_SUBST(LIBDRM_NOUVEAU_CFLAGS)
 AC_SUBST(LIBDRM_NOUVEAU_LIBS)
 
 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8] xproto fontsproto libdrm $REQUIRED_MODULES)
+PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6])
 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
 		  HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
 		  HAVE_XEXTPROTO_71="no")
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 5511b36..3785956 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -7,9 +7,10 @@
 #include "nv_include.h"
 #ifdef DRI2
 #include "dri2.h"
+#else
+#error "This driver requires a DRI2-enabled X server"
 #endif
 
-#if defined(DRI2) && DRI2INFOREC_VERSION >= 3
 struct nouveau_dri2_buffer {
 	DRI2BufferRec base;
 	PixmapPtr ppix;
@@ -817,16 +818,3 @@ nouveau_dri2_fini(ScreenPtr pScreen)
 {
 	DRI2CloseScreen(pScreen);
 }
-#else
-Bool
-nouveau_dri2_init(ScreenPtr pScreen)
-{
-	return TRUE;
-}
-
-void
-nouveau_dri2_fini(ScreenPtr pScreen)
-{
-}
-#endif
-

commit ea8d225fe100ecabb72e3cc0a92372f16afb10b3
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 20:48:44 2013 +0000

    dri1: purge the final references
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/configure.ac b/configure.ac
index 15a6e13..fa4a2dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.25])
 AC_SUBST(LIBDRM_NOUVEAU_CFLAGS)
 AC_SUBST(LIBDRM_NOUVEAU_LIBS)
 
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8] xproto fontsproto libdrm xf86driproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8] xproto fontsproto libdrm $REQUIRED_MODULES)
 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
 		  HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
 		  HAVE_XEXTPROTO_71="no")
diff --git a/src/nv_type.h b/src/nv_type.h
index 13b6672..e6945bc 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -4,16 +4,10 @@
 #include "colormapst.h"
 #include "xf86Cursor.h"
 #include "exa.h"
-#ifdef XF86DRI
-#define _XF86DRI_SERVER_
 #include "xf86drm.h"
-#include "dri.h"
 #include <stdbool.h>
 #include <stdint.h>
 #include "xf86Crtc.h"
-#else
-#error "This driver requires a DRI-enabled X server"
-#endif
 
 #if XF86_CRTC_VERSION >= 5
 #define NOUVEAU_PIXMAP_SHARING 1

commit b5d1a9bd269c9d2758fee37492cdcccc976fcc3b
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 20:48:43 2013 +0000

    nouveau: Do not load dri {sub,}module
    
    Nouveau does not use dri1, thus loading XFree86-DRI is not needed
    On the other hand, we do use dri2
    
    As a side effect, purge the 'set-but-unused' variable pLibDRMVersion
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/src/nv_driver.c b/src/nv_driver.c
index a6a12ec..b83b822 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -651,40 +651,6 @@ NVCloseDRM(ScrnInfoPtr pScrn)
 	nouveau_device_del(&pNv->dev);
 }
 
-static Bool
-NVDRIGetVersion(ScrnInfoPtr pScrn)
-{
-	NVPtr pNv = NVPTR(pScrn);
-	int errmaj, errmin;
-	pointer ret;
-
-	ret = LoadSubModule(pScrn->module, "dri", NULL, NULL, NULL,
-			    NULL, &errmaj, &errmin);
-	if (!ret) {
-		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-				"error %d\n", errmaj);
-		LoaderErrorMsg(pScrn->name, "dri", errmaj, errmin);
-	}
-
-	if (!ret && errmaj != LDR_ONCEONLY)
-		return FALSE;
-
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Loaded DRI module\n");
-
-	/* Check the lib version */
-	if (xf86LoaderCheckSymbol("drmGetLibVersion"))
-		pNv->pLibDRMVersion = drmGetLibVersion(0);
-	if (pNv->pLibDRMVersion == NULL) {
-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		"NVDRIGetVersion failed because libDRM is really "
-		"way to old to even get a version number out of it.\n"
-		"[dri] Disabling DRI.\n");
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
 static void
 nouveau_setup_capabilities(ScrnInfoPtr pScrn)
 {
@@ -778,7 +744,7 @@ NVPreInitDRM(ScrnInfoPtr pScrn)
 	NVPtr pNv = NVPTR(pScrn);
 	int ret;
 
-	if (!NVDRIGetVersion(pScrn))
+	if (!xf86LoadSubModule(pScrn, "dri2"))
 		return FALSE;
 
 	/* Load the kernel module, and open the DRM */
diff --git a/src/nv_type.h b/src/nv_type.h
index 9c403b5..13b6672 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -74,8 +74,6 @@ typedef struct _NVRec {
 
     CARD32              currentRop;
 
-    drmVersionPtr       pLibDRMVersion;
-
 	void *drmmode; /* for KMS */
 
 	/* DRM interface */

commit 7c3f6cd8d6b14aea561fb877f6006d339d156f35
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 20:48:42 2013 +0000

    nouveau: stop using dri1 function DRICreatePCIBusID
    
    Step 1 to completely rip out dri1 out of nouveau
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 38eddac..a6a12ec 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -272,11 +272,13 @@ NVHasKMS(struct pci_device *pci_dev)
 	char *busid;
 	int chipset, ret;
 
-	if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
-		xf86DrvMsg(-1, X_ERROR, "[drm] No DRICreatePCIBusID symbol\n");
-		return FALSE;
-	}
-	busid = DRICreatePCIBusID(pci_dev);
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0)
+	XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d",
+		    pci_dev->domain, pci_dev->bus, pci_dev->dev, pci_dev->func);
+#else
+	busid = XNFprintf("pci:%04x:%02x:%02x.%d",
+			  pci_dev->domain, pci_dev->bus, pci_dev->dev, pci_dev->func);
+#endif
 
 	ret = drmCheckModesettingSupported(busid);
 	if (ret) {

commit 3b1a45325d5fd46f0e7fad17168742b4c9a2465a
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jun 12 10:30:32 2013 +0200

    update makefiles for make distcheck

diff --git a/.gitignore b/.gitignore
index 4ff1108..186b1c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,4 @@ ltmain.sh
 missing
 stamp-h1
 ChangeLog
+INSTALL
diff --git a/Makefile.am b/Makefile.am
index 011c574..032be8a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,11 +20,14 @@
 
 AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src man
+MAINTAINERCLEANFILES = ChangeLog INSTALL
 
-EXTRA_DIST = ChangeLog
+.PHONY: ChangeLog INSTALL
 
-# Always regenerate the changelog
-CLEANFILES = ChangeLog
-ChangeLog: FORCE
-	git log > ChangeLog
-FORCE:
+INSTALL:
+	$(INSTALL_CMD)
+
+ChangeLog:
+	$(CHANGELOG_CMD)
+
+EXTRA_DIST = ChangeLog INSTALL
diff --git a/src/Makefile.am b/src/Makefile.am
index 17c6389..f54e135 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,6 +66,39 @@ EXTRA_DIST = hwdefs/nv_3ddefs.xml.h \
 	     hwdefs/nv50_texture.h \
 	     hwdefs/nvc0_3d.xml.h \
 	     hwdefs/nvc0_m2mf.xml.h \
+	     shader/exac8nvc0.fp \
+	     shader/exac8nvc0.fpc \
+	     shader/exac8nve0.fp \
+	     shader/exac8nve0.fpc \
+	     shader/exacanvc0.fp \
+	     shader/exacanvc0.fpc \
+	     shader/exacanve0.fp \
+	     shader/exacanve0.fpc \
+	     shader/exacmnvc0.fp \
+	     shader/exacmnvc0.fpc \
+	     shader/exacmnve0.fp \
+	     shader/exacmnve0.fpc \
+	     shader/exas8nvc0.fp \
+	     shader/exas8nvc0.fpc \
+	     shader/exas8nve0.fp \
+	     shader/exas8nve0.fpc \
+	     shader/exasanvc0.fp \
+	     shader/exasanvc0.fpc \
+	     shader/exasanve0.fp \
+	     shader/exasanve0.fpc \
+	     shader/exascnvc0.fp \
+	     shader/exascnvc0.fpc \
+	     shader/exascnve0.fp \
+	     shader/exascnve0.fpc \
+	     shader/videonvc0.fp \
+	     shader/videonvc0.fpc \
+	     shader/videonve0.fp \
+	     shader/videonve0.fpc \
+	     shader/xfrm2nvc0.vp \
+	     shader/xfrm2nvc0.vpc \
+	     shader/xfrm2nve0.vp \
+	     shader/xfrm2nve0.vpc \
+	     shader/Makefile \
 	     nouveau_local.h \
 	     nv_const.h \
 	     nv_dma.h \
diff --git a/src/shader/.gitignore b/src/shader/.gitignore
new file mode 100644
index 0000000..2460008
--- /dev/null
+++ b/src/shader/.gitignore
@@ -0,0 +1 @@
+!Makefile

commit b82aacd3e72b52240181569c8b0abb55c1f716d5
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 16 12:48:46 2013 -0800

    configure: require xorg-macros 1.8
    
    Explicitly check for xorg-macros 1.8, as a subtle hint
    to update your build deps if building your own ddx
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/configure.ac b/configure.ac
index 137de9c..15a6e13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,18 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+# Require X.Org server macros (i.e. XORG_DRIVER_CHECK_EXT) to check for required modules
+m4_ifndef([XORG_DRIVER_CHECK_EXT],
+          [m4_fatal([must install xorg-server macros before running autoconf/autogen])])
+
+
 # Checks for programs.
 AC_DISABLE_STATIC
 LT_INIT

commit 4f667b40f41e311fbe302237efe173bcc24fb8bb
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jun 10 14:29:59 2013 +0200

    fix a xfree from previous patch
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8fd1dd0..b9b7164 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1252,7 +1252,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 	if (!drmmode->mode_res->count_connectors ||
 	    !drmmode->mode_res->count_crtcs) {
 		drmModeFreeResources(drmmode->mode_res);
-		xfree(drmmode);
+		free(drmmode);
 		goto done;
 	}
 

commit 2e34d11541e1f987c7ca0556592cb16f4d232299
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jun 10 13:06:35 2013 +0200

    nouveau: enable support for normal optimus configuration
    
    nvd7 has no display engine, only enable sink output capability
    if there is a crtc.
    
    drmmode doesn't work without crtc's, so prevent crashes by skipping
    the drmmode code in that case.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 6033a6d..8fd1dd0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1129,14 +1129,17 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 	ScreenPtr screen = xf86ScrnToScreen(scrn);
 	NVPtr pNv = NVPTR(scrn);
-	drmmode_crtc_private_ptr
-		    drmmode_crtc = xf86_config->crtc[0]->driver_private;
-	drmmode_ptr drmmode = drmmode_crtc->drmmode;
-	uint32_t old_width, old_height, old_pitch, old_fb_id;
+	drmmode_crtc_private_ptr drmmode_crtc = NULL;
+	drmmode_ptr drmmode = NULL;
+	uint32_t old_width, old_height, old_pitch, old_fb_id = 0;
 	struct nouveau_bo *old_bo = NULL;
 	int ret, i, pitch;
 	PixmapPtr ppix;
 
+	if (xf86_config->num_crtc) {
+		drmmode_crtc = xf86_config->crtc[0]->driver_private;
+		drmmode = drmmode_crtc->drmmode;
+	}
 	ErrorF("resize called %d %d\n", width, height);
 
 	if (scrn->virtualX == width && scrn->virtualY == height)
@@ -1145,7 +1148,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	old_width = scrn->virtualX;
 	old_height = scrn->virtualY;
 	old_pitch = scrn->displayWidth;
-	old_fb_id = drmmode->fb_id;
+	if (drmmode)
+		old_fb_id = drmmode->fb_id;
 	nouveau_bo_ref(pNv->scanout, &old_bo);
 	nouveau_bo_ref(NULL, &pNv->scanout);
 
@@ -1162,11 +1166,13 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 
 	nouveau_bo_map(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
 
-	ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
-			   scrn->bitsPerPixel, pitch, pNv->scanout->handle,
-			   &drmmode->fb_id);
-	if (ret)
-		goto fail;
+	if (drmmode) {
+		ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
+				  scrn->bitsPerPixel, pitch, pNv->scanout->handle,
+				  &drmmode->fb_id);
+		if (ret)
+			goto fail;
+	}
 
 	if (pNv->ShadowPtr) {
 		free(pNv->ShadowPtr);
@@ -1214,7 +1220,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	scrn->virtualX = old_width;
 	scrn->virtualY = old_height;
 	scrn->displayWidth = old_pitch;
-	drmmode->fb_id = old_fb_id;
+	if (drmmode)
+		drmmode->fb_id = old_fb_id;
 
 	return FALSE;
 }
@@ -1241,6 +1248,14 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 
 	xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width,
 			     drmmode->mode_res->max_height);
+
+	if (!drmmode->mode_res->count_connectors ||
+	    !drmmode->mode_res->count_crtcs) {
+		drmModeFreeResources(drmmode->mode_res);
+		xfree(drmmode);
+		goto done;
+	}
+
 	for (i = 0; i < drmmode->mode_res->count_crtcs; i++) {
 		if (!xf86IsEntityShared(pScrn->entityList[0]) ||
 		     (pScrn->confScreen->device->screen == i))
@@ -1250,6 +1265,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);
 
+done:
 #ifdef NOUVEAU_PIXMAP_SHARING
 	xf86ProviderSetup(pScrn, NULL, "nouveau");
 #endif
@@ -1280,7 +1296,7 @@ drmmode_remove_fb(ScrnInfoPtr pScrn)
 	drmmode_crtc_private_ptr drmmode_crtc;
 	drmmode_ptr drmmode;
 
-	if (config)
+	if (config && config->num_crtc)
 		crtc = config->crtc[0];
 	if (!crtc)
 		return;
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index e462a86..5511b36 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -266,6 +266,9 @@ can_exchange(DrawablePtr draw, PixmapPtr dst_pix, PixmapPtr src_pix)
 	NVPtr pNv = NVPTR(scrn);
 	int i;
 
+	if (!xf86_config->num_crtc)
+		return FALSE;
+
 	for (i = 0; i < xf86_config->num_crtc; i++) {
 		xf86CrtcPtr crtc = xf86_config->crtc[i];
 		if (crtc->enabled && crtc->rotatedData)
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 8a112db..38eddac 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -426,7 +426,7 @@ NVEnterVT(VT_FUNC_ARGS_DECL)
 	if (ret)
 		ErrorF("Unable to get master: %s\n", strerror(errno));
 
-	if (!xf86SetDesiredModes(pScrn))
+	if (XF86_CRTC_CONFIG_PTR(pScrn)->num_crtc && !xf86SetDesiredModes(pScrn))
 		return FALSE;
 
 	if (pNv->overlayAdaptor && pNv->Architecture != NV_ARCH_04)
@@ -559,7 +559,8 @@ NVCloseScreen(CLOSE_SCREEN_ARGS_DECL)
 	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 	NVPtr pNv = NVPTR(pScrn);
 
-	drmmode_screen_fini(pScreen);
+	if (XF86_CRTC_CONFIG_PTR(pScrn)->num_crtc)
+		drmmode_screen_fini(pScreen);
 
 	if (!pNv->NoAccel)
 		nouveau_dri2_fini(pScreen);
@@ -687,6 +688,7 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
 {
 #ifdef NOUVEAU_PIXMAP_SHARING
 	NVPtr pNv = NVPTR(pScrn);
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
 	uint64_t value;
 	int ret;
 
@@ -695,8 +697,11 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
 	if (ret == 0) {
 		if (value & DRM_PRIME_CAP_EXPORT)
 			pScrn->capabilities |= RR_Capability_SourceOutput;
-		if (value & DRM_PRIME_CAP_IMPORT)
-			pScrn->capabilities |= RR_Capability_SourceOffload | RR_Capability_SinkOutput;
+		if (value & DRM_PRIME_CAP_IMPORT) {
+			pScrn->capabilities |= RR_Capability_SourceOffload;
+			if (xf86_config->num_crtc)
+				pScrn->capabilities |= RR_Capability_SinkOutput;
+		}
 	}
 #endif
 }
@@ -862,8 +867,6 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
 		NVPreInitFail("\n");
 	dev = pNv->dev;
 
-	nouveau_setup_capabilities(pScrn);
-
 	pScrn->chipset = malloc(sizeof(char) * 25);
 	sprintf(pScrn->chipset, "NVIDIA NV%02x", dev->chipset);
 	xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chipset: \"%s\"\n", pScrn->chipset);
@@ -1102,9 +1105,35 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
 	if (!xf86SetGamma(pScrn, gammazeros))
 		NVPreInitFail("\n");
 
-	/* No usable mode */
+#ifdef NOUVEAU_PIXMAP_SHARING
+	/*
+	 * The driver will not work as gpu screen without acceleration enabled.
+	 * To support this usecase modesetting ddx can be used instead.
+	 */
+	if (pNv->NoAccel || pNv->ShadowFB) {
+		/*
+		 * Optimus mode requires acceleration enabled.
+		 * So if no mode is found, or the screen is created
+		 * as a gpu screen the pre init should fail.
+		 */
+		if (pScrn->is_gpu || !pScrn->modes)
+			return FALSE;
+	}
+
+#else
+	/* No usable mode, no optimus config possible */
 	if (!pScrn->modes)
 		return FALSE;
+#endif
+
+	nouveau_setup_capabilities(pScrn);
+
+	if (!pScrn->modes) {
+		pScrn->modes = xf86ModesAdd(pScrn->modes,
+			xf86CVTMode(pScrn->display->virtualX,
+				    pScrn->display->virtualY,
+				    60, 0, 0));
+	}
 
 	/* Set the current mode to the first in the list */
 	pScrn->currentMode = pScrn->modes;
@@ -1389,7 +1418,7 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
 	 * Initialize HW cursor layer. 
 	 * Must follow software cursor initialization.
 	 */
-	if (pNv->HWCursor) { 
+	if (xf86_config->num_crtc && pNv->HWCursor) {
 		ret = drmmode_cursor_init(pScreen);
 		if (ret != TRUE) {
 			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1444,7 +1473,8 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
 	 * Initialize colormap layer.
 	 * Must follow initialization of the default colormap 
 	 */
-	if (!xf86HandleColormaps(pScreen, 256, 8, NVLoadPalette,
+	if (xf86_config->num_crtc &&
+	    !xf86HandleColormaps(pScreen, 256, 8, NVLoadPalette,
 				 NULL, CMAP_PALETTED_TRUECOLOR))
 		return FALSE;
 
@@ -1452,7 +1482,10 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
 	if (serverGeneration == 1)
 		xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
 
-	drmmode_screen_init(pScreen);
+	if (xf86_config->num_crtc)
+		drmmode_screen_init(pScreen);
+	else
+		pNv->glx_vblank = FALSE;
 	return TRUE;


Reply to: