.gitignore               |    2 
 ChangeLog                |16944 -----------------------------------------------
 Makefile.am              |   15 
 configure.ac             |   35 
 debian/changelog         |    8 
 debian/control           |    2 
 src/Makefile.am          |   35 
 src/drmmode_display.c    |   40 
 src/nouveau_dri2.c       |   19 
 src/nouveau_xv.c         |    4 
 src/nv_accel_common.c    |    5 
 src/nv_driver.c          |  146 
 src/nv_proto.h           |    1 
 src/nv_type.h            |   14 
 src/nvc0_accel.c         |   45 
 src/nvc0_shader.h        |  444 -
 src/nve0_shader.h        |  440 -
 src/shader/.gitignore    |    1 
 src/shader/Makefile      |   30 
 src/shader/exac8nvc0.fp  |   41 
 src/shader/exac8nvc0.fpc |   22 
 src/shader/exac8nve0.fp  |   42 
 src/shader/exac8nve0.fpc |   28 
 src/shader/exacanvc0.fp  |   41 
 src/shader/exacanvc0.fpc |   25 
 src/shader/exacanve0.fp  |   43 
 src/shader/exacanve0.fpc |   30 
 src/shader/exacmnvc0.fp  |   41 
 src/shader/exacmnvc0.fpc |   25 
 src/shader/exacmnve0.fp  |   43 
 src/shader/exacmnve0.fpc |   30 
 src/shader/exas8nvc0.fp  |   37 
 src/shader/exas8nvc0.fpc |   14 
 src/shader/exas8nve0.fp  |   38 
 src/shader/exas8nve0.fpc |   20 
 src/shader/exasanvc0.fp  |   41 
 src/shader/exasanvc0.fpc |   25 
 src/shader/exasanve0.fp  |   43 
 src/shader/exasanve0.fpc |   30 
 src/shader/exascnvc0.fp  |   34 
 src/shader/exascnvc0.fpc |   11 
 src/shader/exascnve0.fp  |   35 
 src/shader/exascnve0.fpc |   14 
 src/shader/videonvc0.fp  |   47 
 src/shader/videonvc0.fpc |   37 
 src/shader/videonve0.fp  |   50 
 src/shader/videonve0.fpc |   44 
 src/shader/xfrm2nvc0.vp  |   63 
 src/shader/xfrm2nvc0.vpc |   69 
 src/shader/xfrm2nve0.vp  |   63 
 src/shader/xfrm2nve0.vpc |   70 
 51 files changed, 1496 insertions(+), 17930 deletions(-)

New commits:
commit a3dd588c4392e59ea52f814f6eb80f4635465b16
Author: Maarten Lankhorst <maarten.lankho...@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.lankho...@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.lankho...@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.lankho...@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.lankho...@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.veli...@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.veli...@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.veli...@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.veli...@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.veli...@gmail.com>
Date:   Sat Feb 16 20:48:44 2013 +0000

    dri1: purge the final references
    
    Signed-off-by: Emil Velikov <emil.l.veli...@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.veli...@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.veli...@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.veli...@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.veli...@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.lankho...@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.veli...@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.veli...@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.lankho...@canonical.com>
Date:   Mon Jun 10 14:29:59 2013 +0200

    fix a xfree from previous patch
    
    Signed-off-by: Maarten Lankhorst <maarten.lankho...@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.lankho...@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.lankho...@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;
 }
 

commit bf72ae1f6574c540f0afc2d7845d41df43507a8f
Author: Ben Skeggs <bske...@redhat.com>
Date:   Wed May 15 22:05:01 2013 +1000

    nve0: envyas isn't overly clever.. avoid short-form instructions
    
    Signed-off-by: Ben Skeggs <bske...@redhat.com>

diff --git a/src/shader/exac8nve0.fp b/src/shader/exac8nve0.fp
index 55cdde2..f4b4e82 100644
--- a/src/shader/exac8nve0.fp
+++ b/src/shader/exac8nve0.fp
@@ -35,8 +35,8 @@ interp mul f32 $r2 a[0x80] $r0 0x0
 tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r2:$r3 ()
 texbar 0x0
 mul ftz rn f32 $r3 $r0 $r1
-mov b32 $r2 $r3
-mov b32 $r1 $r3
-mov b32 $r0 $r3
-exit
+long mov b32 $r2 $r3
+long mov b32 $r1 $r3
+long mov b32 $r0 $r3
+long exit
 #endif
diff --git a/src/shader/exac8nve0.fpc b/src/shader/exac8nve0.fpc
index c7fc3bd..9e5e741 100644
--- a/src/shader/exac8nve0.fpc
+++ b/src/shader/exac8nve0.fpc
@@ -18,7 +18,11 @@
 0xf0000000,
 0x0400dc40,
 0x58000000,
-0x00309c28,
-0x00305c28,
-0x00301c28,
-0x88001dff,
+0x0c009de4,
+0x28000000,
+0x0c005de4,
+0x28000000,
+0x0c001de4,
+0x28000000,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/exacanve0.fp b/src/shader/exacanve0.fp
index dc54771..edeb717 100644
--- a/src/shader/exacanve0.fp
+++ b/src/shader/exacanve0.fp
@@ -39,5 +39,5 @@ mul ftz rn f32 $r3 $r3 $r7
 mul ftz rn f32 $r2 $r2 $r6
 mul ftz rn f32 $r1 $r1 $r5
 mul ftz rn f32 $r0 $r0 $r4
-exit
+long exit
 #endif
diff --git a/src/shader/exacanve0.fpc b/src/shader/exacanve0.fpc
index 52a736d..a8320f0 100644
--- a/src/shader/exacanve0.fpc
+++ b/src/shader/exacanve0.fpc
@@ -26,4 +26,5 @@
 0x58000000,
 0x10001c40,
 0x58000000,
-0x88001dff,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/exacmnve0.fp b/src/shader/exacmnve0.fp
index 5e0edfe..09d22c1 100644
--- a/src/shader/exacmnve0.fp
+++ b/src/shader/exacmnve0.fp
@@ -39,5 +39,5 @@ mul ftz rn f32 $r3 $r3 $r4
 mul ftz rn f32 $r2 $r2 $r4
 mul ftz rn f32 $r1 $r1 $r4
 mul ftz rn f32 $r0 $r0 $r4
-exit
+long exit
 #endif
diff --git a/src/shader/exacmnve0.fpc b/src/shader/exacmnve0.fpc
index 15694a0..5c2d4bf 100644
--- a/src/shader/exacmnve0.fpc
+++ b/src/shader/exacmnve0.fpc
@@ -26,4 +26,5 @@
 0x58000000,
 0x10001c40,
 0x58000000,
-0x88001dff,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/exas8nve0.fp b/src/shader/exas8nve0.fp
index 9f96236..8626d9c 100644
--- a/src/shader/exas8nve0.fp
+++ b/src/shader/exas8nve0.fp
@@ -31,8 +31,8 @@ interp mul f32 $r1 a[0x84] $r0 0x0
 interp mul f32 $r0 a[0x80] $r0 0x0
 tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r0:$r1 ()
 texbar 0x0
-mov b32 $r3 $r0
-mov b32 $r2 $r0
-mov b32 $r1 $r0
-exit
+long mov b32 $r3 $r0
+long mov b32 $r2 $r0
+long mov b32 $r1 $r0
+long exit
 #endif
diff --git a/src/shader/exas8nve0.fpc b/src/shader/exas8nve0.fpc
index 2e487f5..ed4793c 100644
--- a/src/shader/exas8nve0.fpc
+++ b/src/shader/exas8nve0.fpc
@@ -10,7 +10,11 @@
 0x80120000,
 0x00001de6,
 0xf0000000,
-0x0000dc28,
-0x00009c28,
-0x00005c28,
-0x88001dff,
+0x0000dde4,
+0x28000000,
+0x00009de4,
+0x28000000,
+0x00005de4,
+0x28000000,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/exasanve0.fp b/src/shader/exasanve0.fp
index 4ec257b..dea8eab 100644
--- a/src/shader/exasanve0.fp
+++ b/src/shader/exasanve0.fp
@@ -39,5 +39,5 @@ mul ftz rn f32 $r3 $r3 $r4
 mul ftz rn f32 $r2 $r2 $r4
 mul ftz rn f32 $r1 $r1 $r4
 mul ftz rn f32 $r0 $r0 $r4
-exit
+long exit
 #endif
diff --git a/src/shader/exasanve0.fpc b/src/shader/exasanve0.fpc
index 6a4d54b..efc701e 100644
--- a/src/shader/exasanve0.fpc
+++ b/src/shader/exasanve0.fpc
@@ -26,4 +26,5 @@
 0x58000000,
 0x10001c40,
 0x58000000,
-0x88001dff,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/exascnve0.fp b/src/shader/exascnve0.fp
index 5ec8496..355b894 100644
--- a/src/shader/exascnve0.fp
+++ b/src/shader/exascnve0.fp
@@ -31,5 +31,5 @@ interp mul f32 $r1 a[0x84] $r0 0x0
 interp mul f32 $r0 a[0x80] $r0 0x0
 tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
 texbar 0x0
-exit
+long exit
 #endif
diff --git a/src/shader/exascnve0.fpc b/src/shader/exascnve0.fpc
index 5bbd150..24ca7bc 100644
--- a/src/shader/exascnve0.fpc
+++ b/src/shader/exascnve0.fpc
@@ -10,4 +10,5 @@
 0x8013c000,
 0x00001de6,
 0xf0000000,
-0x88001dff,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/videonve0.fp b/src/shader/videonve0.fp
index a6675c9..f761bd5 100644
--- a/src/shader/videonve0.fp
+++ b/src/shader/videonve0.fp
@@ -46,5 +46,5 @@ fma ftz rn f32 $r5 $r0 c0[0x18] $r5
 fma ftz rn f32 $r0 $r1 c0[0x1c] $r3
 fma ftz rn f32 $r2 $r1 c0[0x24] $r5
 fma ftz rn f32 $r1 $r1 c0[0x20] $r4
-exit
+long exit
 #endif
diff --git a/src/shader/videonve0.fpc b/src/shader/videonve0.fpc
index c4f1b09..4df540b 100644
--- a/src/shader/videonve0.fpc
+++ b/src/shader/videonve0.fpc
@@ -40,4 +40,5 @@
 0x300a4000,
 0x80105c40,
 0x30084000,
-0x88001dff,
+0x00001de7,
+0x80000000,
diff --git a/src/shader/xfrm2nve0.vp b/src/shader/xfrm2nve0.vp
index 4e39f53..c949ea6 100644
--- a/src/shader/xfrm2nve0.vp
+++ b/src/shader/xfrm2nve0.vp
@@ -59,5 +59,5 @@ mul ftz rn f32 $r3 $r3 $r4
 mul ftz rn f32 $r0 $r2 c0[0x50]
 mul ftz rn f32 $r1 $r3 c0[0x54]
 st b64 a[0x90] $r0:$r1 0x0 unk39
-exit
+long exit
 #endif
diff --git a/src/shader/xfrm2nve0.vpc b/src/shader/xfrm2nve0.vpc
index c7aee0b..c3462b5 100644
--- a/src/shader/xfrm2nve0.vpc
+++ b/src/shader/xfrm2nve0.vpc
@@ -66,4 +66,5 @@
 0x58004001,
 0x03f01c26,
 0x0a7e0090,
-0x88001dff,
+0x00001de7,
+0x80000000,

commit 41cc2f24c43d2656ac722f594aaebad93e37dfec
Author: Ben Skeggs <bske...@redhat.com>
Date:   Wed May 15 21:13:11 2013 +1000

    nvc0-nve0: decompile shaders into their source, add basic build system
    
    Far, far easier to maintain this way...


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1umhqi-0000gi...@vasks.debian.org

Reply via email to