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

xserver-xorg-video-intel: Changes to 'debian-experimental'



 Makefile.am                             |    2 
 README                                  |    2 
 RELEASING                               |   13 ++
 configure.ac                            |   11 ++
 debian/README.source                    |   73 ++++++++++++++++
 debian/changelog                        |   27 ++++++
 debian/control                          |    5 -
 debian/patches/01_gen_pci_ids.diff      |   14 ---
 debian/patches/series                   |    1 
 debian/rules                            |    5 -
 debian/xserver-xorg-video-intel.install |    1 
 debian/xsfbs/repack.sh                  |   32 +++++++
 debian/xsfbs/xsfbs.sh                   |   68 ---------------
 src/bios_reader/bios_reader.c           |    4 
 src/drmmode_display.c                   |   10 ++
 src/i810_reg.h                          |   42 +++++++++
 src/i830.h                              |    8 +
 src/i830_batchbuffer.c                  |    4 
 src/i830_batchbuffer.h                  |   11 ++
 src/i830_bios.c                         |    4 
 src/i830_cursor.c                       |    8 -
 src/i830_debug.c                        |   10 ++
 src/i830_dri.c                          |   35 --------
 src/i830_driver.c                       |  139 ++++++++++++++++++++++++--------
 src/i830_exa.c                          |   30 +++++-
 src/i830_memory.c                       |   59 ++++++++-----
 src/i830_render.c                       |    2 
 src/i830_video.c                        |   54 +++++++-----
 src/i915_render.c                       |    2 
 src/i915_video.c                        |   18 +++-
 src/i965_render.c                       |   32 ++++---
 src/i965_video.c                        |   13 +-
 32 files changed, 490 insertions(+), 249 deletions(-)

New commits:
commit b906537a59231558df38f3b419cb8c9175a64ffa
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu May 28 20:10:45 2009 +0200

    Prepare changelog for upload

diff --git a/debian/changelog b/debian/changelog
index 2c84a16..b437ef7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-intel (2:2.7.99.1-2) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.7.99.1-2) experimental; urgency=low
 
   [ Julien Cristau ]
   * Pull from upstream git branch 'master', commit 8e942b70.
@@ -9,7 +9,7 @@ xserver-xorg-video-intel (2:2.7.99.1-2) UNRELEASED; urgency=low
   [ David Nusinow ]
   * Add README.source
 
- -- Julien Cristau <jcristau@debian.org>  Thu, 28 May 2009 19:59:57 +0200
+ -- Julien Cristau <jcristau@debian.org>  Thu, 28 May 2009 20:10:30 +0200
 
 xserver-xorg-video-intel (2:2.7.99.1-1) experimental; urgency=low
 

commit a62f285b090b58fa5989b9ea686a5974263cd272
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu May 28 20:01:40 2009 +0200

    Adding README.source means we can bump Standards-Version

diff --git a/debian/changelog b/debian/changelog
index aeb5698..2c84a16 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,15 @@
 xserver-xorg-video-intel (2:2.7.99.1-2) UNRELEASED; urgency=low
 
+  [ Julien Cristau ]
   * Pull from upstream git branch 'master', commit 8e942b70.
   * Bump libdrm-dev build-dep to 2.4.11.
   * Merge changes from 2:2.7.1-1.
+  * Bump Standards-Version to 3.8.1.
+
+  [ David Nusinow ]
+  * Add README.source
 
- -- Julien Cristau <jcristau@debian.org>  Thu, 28 May 2009 19:33:42 +0200
+ -- Julien Cristau <jcristau@debian.org>  Thu, 28 May 2009 19:59:57 +0200
 
 xserver-xorg-video-intel (2:2.7.99.1-1) experimental; urgency=low
 
diff --git a/debian/control b/debian/control
index 94ecc86..ca2f3f5 100644
--- a/debian/control
+++ b/debian/control
@@ -23,7 +23,7 @@ Build-Depends:
  automake,
  libtool,
  xutils-dev
-Standards-Version: 3.7.3
+Standards-Version: 3.8.1
 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-intel
 Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-intel.git
 

commit b7629672eff3a2d89332f8f867c114cd404ec879
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu May 28 19:50:55 2009 +0200

    Cleanup libtool macros

diff --git a/debian/rules b/debian/rules
index f693995..e58d55a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -64,6 +64,7 @@ clean: xsfclean
 	rm -f $$(find -name Makefile.in)
 	rm -f compile config.guess config.sub configure depcomp install-sh
 	rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in mkinstalldirs
+	rm -f m4/lt* m4/libtool.m4
 
 	dh_clean
 

commit 5d8b35a26638622af0c1cabd78f1a150dd81775d
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu May 28 19:34:55 2009 +0200

    Update changelog, bump libdrm-dev b-dep

diff --git a/debian/changelog b/debian/changelog
index 7c324bc..5d0aad7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-intel (2:2.7.99.1-2) UNRELEASED; urgency=low
+
+  * Pull from upstream git branch 'master', commit 8e942b70.
+  * Bump libdrm-dev build-dep to 2.4.11.
+
+ -- Julien Cristau <jcristau@debian.org>  Thu, 28 May 2009 19:33:42 +0200
+
 xserver-xorg-video-intel (2:2.7.99.1-1) experimental; urgency=low
 
   * New upstream release candidate.
diff --git a/debian/control b/debian/control
index eb42702..a83dab5 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,7 @@ Build-Depends:
  x11proto-randr-dev (>= 1.2),
  x11proto-render-dev,
  x11proto-xinerama-dev,
- libdrm-dev (>= 2.4.6),
+ libdrm-dev (>= 2.4.11),
  x11proto-xf86dri-dev,
  libpciaccess-dev (>= 0.8.0+git20071002),
  dpkg-dev (>= 1.14.17),

commit 8e942b70cb9a784b3f1311affd6fc74c4bcf68bb
Author: Carl Worth <cworth@cworth.org>
Date:   Thu May 21 13:12:52 2009 -0700

    Revert "Rely on BO pixmaps being present in acceleration paths."
    
    This reverts commit 4653a7db622ad54a3182d93c81331765d930db34.
    
    Eric was getting a little too ambitious about our brave, new world.
    We do still want the driver to work with old, non-GEM kernels
    after all.

diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 0283438..4903b8c 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -102,9 +102,16 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
 			      uint32_t delta)
 {
     dri_bo *bo = i830_get_pixmap_bo(pPixmap);
+    uint32_t offset;
     assert(pI830->batch_ptr != NULL);
     assert(intel_batch_space(pI830) >= 4);
-    intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
+    if (bo) {
+	intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
+	return;
+    }
+    offset = intel_get_pixmap_offset(pPixmap);
+    *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = offset + delta;
+    pI830->batch_used += 4;
 }
 
 #define OUT_BATCH(dword) intel_batch_emit_dword(pI830, dword)
diff --git a/src/i965_render.c b/src/i965_render.c
index 7583af1..e527f11 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -923,7 +923,6 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
     struct brw_surface_state_padded *ss;
     struct brw_surface_state local_ss;
     dri_bo *pixmap_bo = i830_get_pixmap_bo(pPixmap);
-    uint32_t write_domain, read_domains;
 
     ss = (struct brw_surface_state_padded *)ss_bo->virtual + ss_index;
 
@@ -953,7 +952,10 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
     local_ss.ss0.vert_line_stride_ofs = 0;
     local_ss.ss0.mipmap_layout_mode = 0;
     local_ss.ss0.render_cache_read_mode = 0;
-    local_ss.ss1.base_addr = pixmap_bo->offset;
+    if (pixmap_bo != NULL)
+	local_ss.ss1.base_addr = pixmap_bo->offset;
+    else
+	local_ss.ss1.base_addr = intel_get_pixmap_offset(pPixmap);
 
     local_ss.ss2.mip_count = 0;
     local_ss.ss2.render_target_rotation = 0;
@@ -965,20 +967,22 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
 
     memcpy(ss, &local_ss, sizeof(local_ss));
 
+    if (pixmap_bo != NULL) {
+	uint32_t write_domain, read_domains;
 
-    if (is_dst) {
-	write_domain = I915_GEM_DOMAIN_RENDER;
-	read_domains = I915_GEM_DOMAIN_RENDER;
-    } else {
-	write_domain = 0;
-	read_domains = I915_GEM_DOMAIN_SAMPLER;
+	if (is_dst) {
+	    write_domain = I915_GEM_DOMAIN_RENDER;
+	    read_domains = I915_GEM_DOMAIN_RENDER;
+	} else {
+	    write_domain = 0;
+	    read_domains = I915_GEM_DOMAIN_SAMPLER;
+	}
+	dri_bo_emit_reloc(ss_bo, read_domains, write_domain,
+			  0,
+			  ss_index * sizeof(*ss) +
+			  offsetof(struct brw_surface_state, ss1),
+			  pixmap_bo);
     }
-    drm_intel_bo_emit_reloc(ss_bo,
-			    ss_index * sizeof(*ss) +
-			    offsetof(struct brw_surface_state, ss1),
-			    pixmap_bo,
-			    0,
-			    read_domains, write_domain);
 }
 
 static void

commit 1a039f4371bec455cad43f0fb7b329f2ee09a974
Author: Eric Anholt <eric@anholt.net>
Date:   Mon Apr 27 17:45:02 2009 -0700

    Fold GEM detection into DRM master open.
    
    We don't have anything to do with the DRM unless it's GEM-enabled, unless
    we were to support GEM-but-not-DRI2, which doesn't seem useful.
    
    Compilation fixes by Carl Worth <cworth@cworth.org>

diff --git a/src/i830_driver.c b/src/i830_driver.c
index ef4d575..0b6bb71 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1420,7 +1420,8 @@ i830_open_drm_master(ScrnInfoPtr scrn)
     struct pci_device *dev = i830->PciInfo;
     char *busid;
     drmSetVersion sv;
-    int err;
+    struct drm_i915_getparam gp;
+    int err, has_gem;
 
     /* We wish we had asprintf, but all we get is XNFprintf. */
     busid = XNFprintf("pci:%04x:%02x:%02x.%d",
@@ -1428,6 +1429,7 @@ i830_open_drm_master(ScrnInfoPtr scrn)
 
     i830->drmSubFD = drmOpen("i915", busid);
     if (i830->drmSubFD == -1) {
+	xfree(busid);
 	xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 		   "[drm] Failed to open DRM device for %s\n", busid);
 	return FALSE;
@@ -1449,6 +1451,19 @@ i830_open_drm_master(ScrnInfoPtr scrn)
 	return FALSE;
     }
 
+    has_gem = FALSE;
+    gp.param = I915_PARAM_HAS_GEM;
+    gp.value = &has_gem;
+    (void)drmCommandWriteRead(i830->drmSubFD, DRM_I915_GETPARAM,
+			      &gp, sizeof(gp));
+    if (!has_gem) {
+	xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+		   "[drm] Failed to detect GEM.  Kernel 2.6.28 required.\n");
+	drmClose(i830->drmSubFD);
+	i830->drmSubFD = -1;
+	return FALSE;
+    }
+
     return TRUE;
 }
 
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 99b9fc8..5e07213 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -368,9 +368,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long size)
 {
     I830Ptr pI830 = I830PTR(pScrn);
     i830_memory *start, *end;
-    struct drm_i915_getparam gp;
     struct drm_i915_setparam sp;
-    int has_gem;
 
     start = xcalloc(1, sizeof(*start));
     if (start == NULL)
@@ -407,24 +405,12 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long size)
 
     pI830->memory_list = start;
 
-    has_gem = FALSE;
-
-    if (pI830->directRenderingType >= DRI_DRI2)
-    {
-	has_gem = FALSE;
-	gp.param = I915_PARAM_HAS_GEM;
-	gp.value = &has_gem;
-    
-	(void)drmCommandWriteRead(pI830->drmSubFD, DRM_I915_GETPARAM,
-				  &gp, sizeof(gp));
-    }
-
     /* Now that we have our manager set up, initialize the kernel MM if
      * possible, covering almost all of the aperture.  We need libdri interface
      * 5.4 or newer so we can rely on the lock being held after DRIScreenInit,
      * rather than after DRIFinishScreenInit.
      */
-    if (pI830->directRenderingType == DRI_DRI2 && has_gem) {
+    if (pI830->directRenderingType == DRI_DRI2) {
 	int mmsize;
 
 	/* Take over all of the graphics aperture minus enough to for

commit a04a51c9bb6066454e0fda3c7897f97dab436358
Author: Eric Anholt <eric@anholt.net>
Date:   Mon Apr 27 17:29:36 2009 -0700

    Open the DRM and keep the handle throughout server startup to finish.
    
    This will let us configure the server from start to finish with the
    most pertinent information available (KMS vs UMS, DRI2 vs non-DRI).  Also,
    we now close the DRI2 fd at terminate, which we didn't before.
    
    This duplicates some code from DRI1 for getting a master FD like I'd done in
    DRI2, but given that we weren't loading DRI1 ourselves, this is also a
    bogosity cleanup, and avoids allocating the extra DRI1 private.

diff --git a/src/i830_dri.c b/src/i830_dri.c
index 0648249..fc059df 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -329,7 +329,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
     DRI2InfoRec info;
-    char *p, buf[64];
+    char *p;
     int i;
     struct stat sbuf;
     dev_t d;
@@ -355,36 +355,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
     }
 #endif
 
-    sprintf(buf, "pci:%04x:%02x:%02x.%d",
-	    pI830->PciInfo->domain,
-	    pI830->PciInfo->bus,
-	    pI830->PciInfo->dev,
-	    pI830->PciInfo->func);
-
-    /* Use the already opened (master) fd from modesetting */
-    if (pI830->use_drm_mode) {
-	info.fd = pI830->drmSubFD;
-    } else {
-	info.fd = drmOpen("i915", buf);
-	drmSetVersion sv;
-	int err;
-
-	/* Check that what we opened was a master or a master-capable FD,
-	 * by setting the version of the interface we'll use to talk to it.
-	 * (see DRIOpenDRMMaster() in DRI1)
-	 */
-	sv.drm_di_major = 1;
-	sv.drm_di_minor = 1;
-	sv.drm_dd_major = -1;
-	err = drmSetInterfaceVersion(info.fd, &sv);
-	if (err != 0)
-	    return FALSE;
-    }
-
-    if (info.fd < 0) {
-	xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to open DRM device\n");
-	return FALSE;
-    }
+    info.fd = pI830->drmSubFD;
 
     /* The whole drmOpen thing is a fiasco and we need to find a way
      * back to just using open(2).  For now, however, lets just make
@@ -423,8 +394,6 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
 
     info.CopyRegion = I830DRI2CopyRegion;
 
-    pI830->drmSubFD = info.fd;
-
     return DRI2ScreenInit(pScreen, &info);
 }
 
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 854ad0f..ef4d575 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1414,28 +1414,61 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 }
 
 static Bool
-I830DrmModeInit(ScrnInfoPtr pScrn)
+i830_open_drm_master(ScrnInfoPtr scrn)
 {
-    I830Ptr pI830 = I830PTR(pScrn);
-    char *bus_id;
-    int ret;
+    I830Ptr i830 = I830PTR(scrn);
+    struct pci_device *dev = i830->PciInfo;
+    char *busid;
+    drmSetVersion sv;
+    int err;
+
+    /* We wish we had asprintf, but all we get is XNFprintf. */
+    busid = XNFprintf("pci:%04x:%02x:%02x.%d",
+		      dev->domain, dev->bus, dev->dev, dev->func);
+
+    i830->drmSubFD = drmOpen("i915", busid);
+    if (i830->drmSubFD == -1) {
+	xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+		   "[drm] Failed to open DRM device for %s\n", busid);
+	return FALSE;
+    }
 
-    pI830->accel = ACCEL_UXA;
+    xfree(busid);
 
-    bus_id = DRICreatePCIBusID(pI830->PciInfo);
+    /* Check that what we opened was a master or a master-capable FD,
+     * by setting the version of the interface we'll use to talk to it.
+     * (see DRIOpenDRMMaster() in DRI1)
+     */
+    sv.drm_di_major = 1;
+    sv.drm_di_minor = 1;
+    sv.drm_dd_major = -1;
+    err = drmSetInterfaceVersion(i830->drmSubFD, &sv);
+    if (err != 0) {
+	drmClose(i830->drmSubFD);
+	i830->drmSubFD = -1;
+	return FALSE;
+    }
 
-    /* Create a bus Id */
-    /* Low level DRM open */
-    ret = DRIOpenDRMMaster(pScrn, SAREA_MAX, bus_id, "i915");
-    xfree(bus_id);
-    if (!ret) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "[dri] DRIGetVersion failed to open the DRM\n"
-		       "[dri] Disabling DRI.\n");
-	    return FALSE;
+    return TRUE;
+}
+
+static void
+i830_close_drm_master(ScrnInfoPtr scrn)
+{
+    I830Ptr i830 = I830PTR(scrn);
+    if (i830->drmSubFD > 0) {
+	drmClose(i830->drmSubFD);
+	i830->drmSubFD = -1;
     }
+}
+
+static Bool
+I830DrmModeInit(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+
+    pI830->accel = ACCEL_UXA;
 
-    pI830->drmSubFD = DRIMasterFD(pScrn);
     if (drmmode_pre_init(pScrn, pI830->drmSubFD, pI830->cpp) == FALSE) {
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		   "Kernel modesetting setup failed\n");
@@ -1477,11 +1510,17 @@ I830XvInit(ScrnInfoPtr pScrn)
 }
 
 /**
- * This is called per zaphod head (so usually just once) to do initialization
- * before the Screen is created.
+ * This is called before ScreenInit to do any require probing of screen
+ * configuration.
  *
  * This code generally covers probing, module loading, option handling
  * card mapping, and RandR setup.
+ *
+ * Since xf86InitialConfiguration ends up requiring that we set video modes
+ * in order to detect configuration, we end up having to do a lot of driver
+ * setup (talking to the DRM, mapping the device, etc.) in this function.
+ * As a result, we want to set up that server initialization once rather
+ * that doing it per generation.
  */
 static Bool
 I830PreInit(ScrnInfoPtr pScrn, int flags)
@@ -1531,6 +1570,8 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
 
    pI830->PciInfo = xf86GetPciInfoForEntity(pI830->pEnt->index);
 
+   i830_open_drm_master(pScrn);
+
    if (xf86RegisterResources(pI830->pEnt->index, NULL, ResNone)) {
       PreInitCleanup(pScrn);
       return FALSE;
@@ -2839,12 +2880,15 @@ i830AdjustFrame(int scrnIndex, int x, int y, int flags)
 static void
 I830FreeScreen(int scrnIndex, int flags)
 {
-#ifdef INTEL_XVMC
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+#ifdef INTEL_XVMC
     I830Ptr pI830 = I830PTR(pScrn);
     if (pI830 && pI830->XvMCEnabled)
 	intel_xvmc_finish(xf86Screens[scrnIndex]);
 #endif
+
+    i830_close_drm_master(pScrn);
+
    I830FreeRec(xf86Screens[scrnIndex]);
    if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
       vgaHWFreeHWRec(xf86Screens[scrnIndex]);

commit c3bf8b980134a2761701e4bc18235695a1cb07a4
Author: Eric Anholt <eric@anholt.net>
Date:   Thu May 21 11:05:01 2009 -0700

    Fix backwards logic on whether to sync to vblank or not.
    
    Thanks to Michel Dänzer for catching it.

diff --git a/src/i830_video.c b/src/i830_video.c
index 6fec8ff..5beee52 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2497,7 +2497,7 @@ I830PutImage(ScrnInfoPtr pScrn,
 	    int y1, y2;
 	    int pipe = -1, event, load_scan_lines_pipe;
 
-	    if (pPixmap != pScreen->GetScreenPixmap(pScreen)) {
+	    if (pPixmap == pScreen->GetScreenPixmap(pScreen)) {
 		if (pI830->use_drm_mode)
 		    pipe = drmmode_get_pipe_from_crtc_id(pI830->bufmgr, crtc);
 		else {

commit 7deebf983f53c505bc25171ab77fdc408f250a6e
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue May 26 15:58:19 2009 +0200

    xsfbs: don't run dpkg --print-installation-architecture
    
    This is deprecated in new dpkg, and had no users anyway.

diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
index 8840ff9..197eb74 100644
--- a/debian/xsfbs/xsfbs.sh
+++ b/debian/xsfbs/xsfbs.sh
@@ -57,8 +57,6 @@ EOF
   exit $SHELL_LIB_USAGE_ERROR
 fi
 
-ARCHITECTURE="$(dpkg --print-installation-architecture)"
-
 if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
   RECONFIGURE="true"
 else

commit 4178d948cd66a938222d0d7c6353ee8d60229e40
Author: David Nusinow <dnusinow@debian.org>
Date:   Mon May 25 20:08:50 2009 -0400

    Add README.source

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..34ab4bf
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,73 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+  git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.

commit ad2128825ba28551cfef203da017151e2eac32ef
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Wed May 20 12:32:10 2009 -0400

    Only return FALSE when dri_bo_map() fails
    
    Small typo in the previous commit.

diff --git a/src/i830_exa.c b/src/i830_exa.c
index 3ca7933..d0ada02 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -514,11 +514,12 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 		    return FALSE;
 		}
 	    } else {
-		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
+		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) {
 		    xf86DrvMsg(scrn->scrnIndex, X_WARNING,
 			       "%s: bo map failed\n",
 			       __FUNCTION__);
-		return FALSE;
+		    return FALSE;
+		}
 	    }
 	    pixmap->devPrivate.ptr = bo->virtual;
 	} else { /* or not... */

commit 09beee378cecd1079e7a9fa6eee8f084d680d37e
Author: Eric Anholt <eric@anholt.net>
Date:   Mon May 18 18:01:05 2009 -0700

    Don't do GTT maps on objects bigger than half the available aperture size.
    
    The basic problem is that software fallbacks will do single instructions that
    copy from one GTT-mapped BO into another GTT-mapped BO.  If we can't get both
    of them bound simultanously, we fault one in, retry the instruction, fault the
    other in (kicking out #1), retry the instruction, fault #1 back in
    (kicking out #2), etc.
    
    Note that we'll still get into a nasty spot if you do a composite operation
    with a mask where all 3 are big-but-less-than-half-available-aperture, where
    you'll thrash.  It at least means you'll make progress, though, since each
    instruction will only be operating on two BOs at at time, and the situation
    seems unlikely.
    
    Bug #20152 (3/3)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7df7b6f..24e0e26 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -232,6 +232,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		drmmode_output_dpms(output, DPMSModeOn);
 	}
 
+	i830_set_max_gtt_map_size(pScrn);
+
 done:
 	if (!ret) {
 		crtc->x = saved_x;
diff --git a/src/i830.h b/src/i830.h
index 0969c48..7c260de 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -437,6 +437,7 @@ typedef struct _I830Rec {
    int accel_pixmap_offset_alignment;
    int accel_max_x;
    int accel_max_y;
+   int max_gtt_map_size;
 
    I830WriteIndexedByteFunc writeControl;
    I830ReadIndexedByteFunc readControl;
@@ -748,6 +749,7 @@ Bool i830_bind_all_memory(ScrnInfoPtr pScrn);
 Bool i830_unbind_all_memory(ScrnInfoPtr pScrn);
 unsigned long i830_get_fence_size(I830Ptr pI830, unsigned long size);
 unsigned long i830_get_fence_pitch(I830Ptr pI830, unsigned long pitch, int format);
+void i830_set_max_gtt_map_size(ScrnInfoPtr pScrn);
 
 Bool I830BindAGPMemory(ScrnInfoPtr pScrn);
 Bool I830UnbindAGPMemory(ScrnInfoPtr pScrn);
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 824f032..3ca7933 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -506,9 +506,18 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 
 	/* Kernel manages fences at GTT map/fault time */
 	if (i830->kernel_exec_fencing) {
-	    if (drm_intel_gem_bo_map_gtt(bo)) {
-		xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n",
-			   __FUNCTION__);
+	    if (bo->size < i830->max_gtt_map_size) {
+		if (drm_intel_gem_bo_map_gtt(bo)) {
+		    xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+			       "%s: bo map failed\n",
+			       __FUNCTION__);
+		    return FALSE;
+		}
+	    } else {
+		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
+		    xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+			       "%s: bo map failed\n",
+			       __FUNCTION__);
 		return FALSE;
 	    }
 	    pixmap->devPrivate.ptr = bo->virtual;
@@ -542,7 +551,10 @@ i830_uxa_finish_access (PixmapPtr pixmap)
 	}
 
 	if (i830->kernel_exec_fencing)
-	    drm_intel_gem_bo_unmap_gtt(bo);
+	    if (bo->size < i830->max_gtt_map_size)
+		drm_intel_gem_bo_unmap_gtt(bo);
+	    else
+		dri_bo_unmap(bo);
 	else
 	    drm_intel_bo_unpin(bo);
 	pixmap->devPrivate.ptr = NULL;
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 2a697a7..99b9fc8 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1128,6 +1128,8 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
     if (!pI830->use_drm_mode && pI830->FbBase && front_buffer->bound)
 	memset (pI830->FbBase + front_buffer->offset, 0, size);
 
+    i830_set_max_gtt_map_size(pScrn);
+
     return front_buffer;
 }
 
@@ -1588,6 +1590,7 @@ i830_bind_all_memory(ScrnInfoPtr pScrn)
     }
     if (!pI830->use_drm_mode)
 	i830_update_cursor_offsets(pScrn);
+    i830_set_max_gtt_map_size(pScrn);
 
     return TRUE;
 }
@@ -1672,3 +1675,26 @@ Bool i830_allocate_xvmc_buffer(ScrnInfoPtr pScrn, const char *name,
     return TRUE;
 }
 #endif
+
+void
+i830_set_max_gtt_map_size(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+    struct drm_i915_gem_get_aperture aperture;
+    int ret;
+
+    /* Default low value in case it gets used during server init. */
+    pI830->max_gtt_map_size = 16 * 1024 * 1024;
+
+    if (!pI830->have_gem)
+	return;
+
+    ret = ioctl(pI830->drmSubFD, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
+    if (ret == 0) {
+	/* Let objects up get bound up to the size where only 2 would fit in
+	 * the aperture, but then leave slop to account for alignment like
+	 * libdrm does.
+	 */
+	pI830->max_gtt_map_size = aperture.aper_available_size * 3 / 4 / 2;
+    }
+}

commit 34660fd2df5d61b77ed7041d32ac29053fc94f5a
Author: Eric Anholt <eric@anholt.net>
Date:   Fri May 15 23:21:05 2009 -0700

    Only sync XV to vblank when drawing to the frontbuffer.
    
    This fixes emitting syncs to random pipes with boxes bigger than that
    pipe's vertical, leading to GPU hangs.
    
    Bug #21738

diff --git a/src/i830_video.c b/src/i830_video.c
index 1c3a5b7..6fec8ff 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2495,13 +2495,15 @@ I830PutImage(ScrnInfoPtr pScrn,
         if (sync) {
 	    BoxPtr box;
 	    int y1, y2;
-            int pipe, event, load_scan_lines_pipe;
-
-	    if (pI830->use_drm_mode)
-		pipe = drmmode_get_pipe_from_crtc_id(pI830->bufmgr, crtc);
-	    else {
-		I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
-		pipe = intel_crtc->pipe;
+	    int pipe = -1, event, load_scan_lines_pipe;
+
+	    if (pPixmap != pScreen->GetScreenPixmap(pScreen)) {
+		if (pI830->use_drm_mode)
+		    pipe = drmmode_get_pipe_from_crtc_id(pI830->bufmgr, crtc);
+		else {
+		    I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
+		    pipe = intel_crtc->pipe;
+		}
 	    }
 
 	    if (pipe >= 0) {

commit 87332a7cc16af82aa47e07fbf90da3635b071dbf
Author: Keith Packard <keithp@keithp.com>
Date:   Mon May 11 13:52:00 2009 -0700

    Use drm_intel_bo_disable_reuse API to flag scanout and cursor buffers
    
    Buffers referenced by the kernel for scanout or cursor display should not be
    reused by the driver. Use the new drm API to disable reuse of these buffers.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/src/i830.h b/src/i830.h
index 33a92c6..0969c48 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -902,6 +902,7 @@ extern const int I830CopyROP[16];
 #define NEED_NON_STOLEN			0x00000004
 #define NEED_LIFETIME_FIXED		0x00000008
 #define ALLOW_SHARING			0x00000010
+#define DISABLE_REUSE			0x00000020
 
 /* Chipset registers for VIDEO BIOS memory RW access */
 #define _855_DRAM_RW_CONTROL 0x58
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 892c26e..2a697a7 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -799,6 +799,9 @@ i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
 	}
     }
 
+    if (flags & DISABLE_REUSE)
+	drm_intel_bo_disable_reuse(mem->bo);
+
     /* Insert new allocation into the list */
     mem->prev = NULL;
     mem->next = pI830->bo_list;
@@ -1076,7 +1079,7 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
     i830_memory *front_buffer = NULL;
     enum tile_format tile_format = TILE_NONE;
 
-    flags = ALLOW_SHARING;
+    flags = ALLOW_SHARING|DISABLE_REUSE;
 
     /* We'll allocate the fb such that the root window will fit regardless of
      * rotation.
@@ -1142,6 +1145,8 @@ i830_allocate_cursor_buffers(ScrnInfoPtr pScrn)
 
     flags = pI830->CursorNeedsPhysical ? NEED_PHYSICAL_ADDR : 0;
 
+    flags |= DISABLE_REUSE;
+
     /* Try to allocate one big blob for our cursor memory.  This works
      * around a limitation in the FreeBSD AGP driver that allows only one
      * physical allocation larger than a page, and could allow us

commit ebe05200df381c0e6ee636f0f83440bfedea9bcb
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Fri May 15 08:50:17 2009 -0700

    Add --enable-debug flag to configure
    
    Defaults to enabled.

diff --git a/configure.ac b/configure.ac
index 028d17d..bb05d1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,14 @@ AC_ARG_ENABLE(video-debug, AC_HELP_STRING([--enable-video-debug],
               [VIDEO_DEBUG="$enableval"],
               [VIDEO_DEBUG=no])
 
+AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
+				    [Compile with debug support [[default=yes]]]))
+if test "x$enableval" == "xyes" ; then
+	DEBUGFLAGS="-g"
+else
+	DEBUGFLAGS=""
+fi
+
 dnl AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc],
 dnl                                   [Disable XvMC support [[default=auto]]]),
 dnl               [XVMC="$enableval"],
@@ -116,7 +124,7 @@ if test x$DRI = xauto; then
         fi
 fi
 AC_MSG_RESULT([$DRI])
-CFLAGS="$save_CFLAGS"
+CFLAGS="$save_CFLAGS $DEBUGFLAGS"
 
 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
 

commit 04772b6c09a88f0483c2a7efc48029967c77b9bc
Author: Keith Packard <keithp@keithp.com>
Date:   Thu May 14 16:57:11 2009 -0700

    If DRM can't figure out which pipe to sync on, then don't sync at all.
    
    Syncing to the wrong pipe can wedge the hardware if the exclusion area is
    larger than the vtotal
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 8aef4cf..028d17d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,7 +130,7 @@ if test "x$GCC" = "xyes"; then
 	-Wnested-externs -fno-strict-aliasing"
 fi
 
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.6])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.11])
 AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then


Reply to: