xf86-video-intel: Branch '2.7' - 10 commits - configure.ac man/Makefile.am src/drmmode_display.c src/i810_driver.c src/i810.h src/i830_bios.c src/i830_display.c src/i830_driver.c src/i830_exa.c src/i830_lvds.c src/i830_memory.c src/i830_video.c src/Makefile.am

Carl Worth cworth at kemper.freedesktop.org
Thu Apr 2 09:03:16 PDT 2009


 configure.ac          |    2 +-
 man/Makefile.am       |   20 ++------------------
 src/Makefile.am       |    6 ------
 src/drmmode_display.c |    2 +-
 src/i810.h            |    1 -
 src/i810_driver.c     |   19 +------------------
 src/i830_bios.c       |    6 ++++++
 src/i830_display.c    |    3 +++
 src/i830_driver.c     |   28 +++++++++++++++++++++++-----
 src/i830_exa.c        |   44 +++++++++++++++++++++++++++++---------------
 src/i830_lvds.c       |    7 +++++++
 src/i830_memory.c     |    5 ++---
 src/i830_video.c      |   13 ++++++++-----
 13 files changed, 83 insertions(+), 73 deletions(-)

New commits:
commit 10b5014c42dc055d9559ee112cc7a017e887d813
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Tue Mar 31 07:50:10 2009 -0700

    Match GTT unmap with map in KMS rotation case
    
    Missed this when the GTT unmap call was added.  If we don't do this we
    trigger an assertion in libdrm, since the buffer has never been mapped
    normally.
    
    Fixes bug #20943.
    
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
    (cherry picked from commit 087f72e1f5d7d11b8795ba80a842874f5a9bb01d)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e485256..a276ff7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -372,7 +372,7 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat
 		 * unbound. */
 		drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id);
 		drmmode_crtc->rotate_fb_id = 0;
-		drm_intel_bo_unmap(drmmode_crtc->rotate_bo);
+		drm_intel_gem_bo_unmap_gtt(drmmode_crtc->rotate_bo);
 		dri_bo_unreference(drmmode_crtc->rotate_bo);
 		drmmode_crtc->rotate_bo = NULL;
 	}
commit 26cab64654bdf68095412d0aaba157774d1ca16b
Author: Zhenyu Wang <zhenyu.z.wang at intel.com>
Date:   Tue Mar 31 13:49:44 2009 +0800

    Disable LVDS detect methods
    
    Both methods ACPI lid and SWF bit have issues in LVDS detect from
    wider testing. Fallback to origin code.
    (cherry picked from commit 4f046af760b92c07f59664359453933fb5358e3d)

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 7569e99..7fc0bce 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -881,6 +881,13 @@ i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 static xf86OutputStatus
 i830_lvds_detect(xf86OutputPtr output)
 {
+    /* Fallback to origin, mark LVDS always connected.
+     * From wider tests, we have seen both broken cases with
+     * ACPI lid and SWF bit. So disable them for now until we
+     * get a reliable way for LVDS detect.
+     */
+    return XF86OutputStatusConnected;
+
     enum lid_status lid;
 
     lid = i830_lvds_acpi_lid_open(output);
commit d43016865c670d9281c6b664094fb41a252fbdc0
Author: Albert Damen <albrt at gmx.net>
Date:   Mon Mar 30 11:38:02 2009 -0700

    Non-GEM allocations incorrectly force TILE_NONE (bug 20797)
    
    With -intel 2.6.3 performance was very bad when using a non gem enabled kernel
    (2.6.27) and EXA. For example sauerbraten ran with 4 fps and screensaver GLBlur
    with 1 fps. With -intel 2.6.1 performance was good using the same kernel.
    
    Git bisecting led me to commit f1ed73c1ef3e3daa9f695194dcc813167cbcb53d (in 2.6
    branch) "Make i830_allocate_memory take tiling parameters" as first bad commit.
    
    Using gdb I found tiling was set exactly the same in 2.6.3 as in 2.6.1, so that
    was good (TILE_XMAJOR for front, back and depth buffers).
    Looking further I found the line mem->tiling = TILE_NONE; (line 961 in
    src/i830_memory.c) at the end of i830_allocate_memory suspicious, as
    mem->tiling now already gets set via i830_allocate_aperture and some buffers do
    have tiling. Removing that line indeed fixed the performance issue. Now
    sauerbraten runs with 30+ fps and GLBlur runs smoothly.
    (cherry picked from commit e964d4e53af3a47de6d09c884be1cc0044d03bea)

diff --git a/src/i830_memory.c b/src/i830_memory.c
index 052d906..e3314c5 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -958,8 +958,6 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
 	}
     }
 
-    mem->tiling = TILE_NONE;
-
     return mem;
 }
 
commit 556391cbce8146eab5e570277245e5881256e9be
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Mon Mar 30 11:27:56 2009 -0700

    Require libdrm 2.4.6 for GTT unmap support
    
    Need the new functions available.
    (cherry picked from commit 51cf8a453c2bc2e8604bfc41a649e971c1ba5026)

diff --git a/configure.ac b/configure.ac
index aeb675c..7d38cad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,7 +206,7 @@ if test "x$GCC" = "xyes"; then
 	-Wnested-externs -fno-strict-aliasing"
 fi
 
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.5])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.6])
 AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then
         PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
commit f6f59ee2533e786906dc9a32cf7072f2d2796201
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Mon Mar 30 09:53:40 2009 -0700

    Tiling fixes, third set
    
    Hopefully this concludes the fixes necessary to deal with the various
    combinations of kernel and user level tiling.  We have several cases to
    handle:
      1) KMS (kernel handles all tiling)
      2) UMS w/memory management + kexec fencing (kernel handles all tiling)
      3) UMS w/memory mangement but no kexec fencing (userland handles tiling)
      4) UMS w/o memory management (userland handles tiling)
    
    For cases (1) & (2) we can use GTT mapping, which will give us good
    performance and take care of allocating fence registers as needed.  It's
    important *not* to have userland set up fence regs in this case, since
    the kernel will be using all of them.
    
    For case (3), we use the begin/end GTT map functions provided by libdrm,
    in combination with pinning and fence register setup in i830_memory.c to
    deal with tiled surfaces.  This also gives us good performance and
    correctness.
    
    For case (4) we use the old style virtual mapping + offset for dealing
    with surfaces; note that UXA doesn't seem to work in this configuration
    regardless of these fixes.
    
    Fixes bug #20803.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
    (cherry picked from commit 8dabcc40747bfd478f296728741240241698f165)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7502d30..d7ee615 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -823,22 +823,40 @@ i830_update_front_offset(ScrnInfoPtr pScrn)
    ScreenPtr pScreen = pScrn->pScreen;
    I830Ptr pI830 = I830PTR(pScrn);
    int pitch = pScrn->displayWidth * pI830->cpp;
+   pointer data = NULL;
 
    /* Update buffer locations, which may have changed as a result of
     * i830_bind_all_memory().
     */
    pScrn->fbOffset = pI830->front_buffer->offset;
 
+   if (pI830->starting || pI830->accel == ACCEL_UXA)
+       return;
+
    /* If we are still in ScreenInit, there is no screen pixmap to be updated
     * yet.  We'll fix it up at CreateScreenResources.
     */
-   if (!pI830->starting && pI830->accel != ACCEL_UXA) {
-      if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen),
+   if (!pI830->memory_manager) {
+       data = pI830->FbBase + pScrn->fbOffset; /* default to legacy */
+   } else {
+      dri_bo *bo = pI830->front_buffer->bo;
+
+      if (bo) {
+	  if (pI830->kernel_exec_fencing) {
+	      if (drm_intel_gem_bo_map_gtt(bo))
+		  xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: bo map failed\n",
+			     __FUNCTION__);
+	  } else {
+	      /* Will already be pinned by bind_all_memory in this case */
+	      drm_intel_gem_bo_start_gtt_access(bo, 1);
+	  }
+	  data = bo->virtual;
+      }
+   }
+   if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen),
 				       pScrn->virtualX, pScrn->virtualY, -1, -1,
-				       pitch, (pointer)(pI830->FbBase +
-							pScrn->fbOffset)))
+				       pitch, data))
        FatalError("Couldn't adjust screen pixmap\n");
-   }
 }
 
 /**
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 0a22486..fc4e66c 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -37,6 +37,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i810_reg.h"
 #include "i915_drm.h"
 #include <string.h>
+#include <sys/mman.h>
 
 #define ALWAYS_SYNC		0
 #define ALWAYS_FLUSH		0
@@ -837,8 +838,6 @@ i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo)
 static Bool
 i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
     dri_bo *bo = i830_get_pixmap_bo (pixmap);
 
     if (bo) {
@@ -853,16 +852,27 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 	    i830->need_sync = FALSE;
 	}
 
-	if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager) {
-	    if (drm_intel_bo_pin(bo, 4096) != 0)
-		return FALSE;
-	    drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW);
-	    pixmap->devPrivate.ptr = pI830->FbBase + bo->offset;
-	} else {
+	/* No VT sema or GEM?  No GTT mapping. */
+	if (!scrn->vtSema || !i830->memory_manager) {
 	    if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
 		return FALSE;
 	    pixmap->devPrivate.ptr = bo->virtual;
+	    return TRUE;
+	}
+
+	/* 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__);
+		return FALSE;
+	    }
+	} else { /* or not... */
+	    if (drm_intel_bo_pin(bo, 4096) != 0)
+		return FALSE;
+	    drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW);
 	}
+	pixmap->devPrivate.ptr = bo->virtual;
     }
     return TRUE;
 }
@@ -870,8 +880,6 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 static void
 i830_uxa_finish_access (PixmapPtr pixmap)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
     dri_bo *bo = i830_get_pixmap_bo (pixmap);
 
     if (bo) {
@@ -879,14 +887,20 @@ i830_uxa_finish_access (PixmapPtr pixmap)
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
 	I830Ptr i830 = I830PTR(scrn);
 
-	if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager)
-	    drm_intel_bo_unpin(bo);
-	else
+	if (bo == i830->front_buffer->bo)
+	    i830->need_flush = TRUE;
+
+	if (!scrn->vtSema || !i830->memory_manager) {
 	    dri_bo_unmap(bo);
+	    pixmap->devPrivate.ptr = NULL;
+	    return;
+	}
 
+	if (i830->kernel_exec_fencing)
+	    drm_intel_gem_bo_unmap_gtt(bo);
+	else
+	    drm_intel_bo_unpin(bo);
 	pixmap->devPrivate.ptr = NULL;
-	if (bo == i830->front_buffer->bo)
-	    i830->need_flush = TRUE;
     }
 }
 
commit a03feab1b7ce511e1704bee96c83290d1c7b2785
Author: Zhenyu Wang <zhenyu.z.wang at intel.com>
Date:   Wed Mar 25 11:13:52 2009 +0800

    Disable LVDS config parsing from VBT for now
    
    As wider tests showed that this doesn't work for all VBIOS, so
    disable it for now and reenable it after we get reliable method.
    (cherry picked from commit 375b2e40fcb17e94538a75392950e2533c1bb031)

diff --git a/src/i830_bios.c b/src/i830_bios.c
index 9b13bf4..4f2355d 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -181,6 +181,12 @@ parse_driver_feature(I830Ptr pI830, struct bdb_header *bdb)
     if (!IS_I9XX(pI830))
 	return;
 
+    /* XXX Disable this parsing, as it looks doesn't work for all
+       VBIOS. Reenable it if we could find out the reliable VBT parsing
+       for LVDS config later. */
+    if (1)
+	return;
+
     feature = find_section(bdb, BDB_DRIVER_FEATURES);
     if (!feature)
 	return;
commit 767524888840d7e06f6b5d6fa720b21d882d4625
Author: Ma, Ling <ling.ma at intel.com>
Date:   Wed Mar 25 14:39:46 2009 +0800

    disable center mode for 965GM and G4X platform
    
    When disabling VGA mode, usually we don't need to touch VGA center mode.
    However because of hardware reason, for Cresline, Cantiga & Eaglelake platform,
    we have to disable center mode as well. The patch fixed bug- TV Out strobing regression,
    reported by Robert Lowery in intel-gfx at lists.freedesktop.org mailing list.
    
    Signed-off-by: Ma Ling <ling.ma at intel.com>
    (cherry picked from commit b5b377806422c9538fa9f846819ad253c1a50846)

diff --git a/src/i830_display.c b/src/i830_display.c
index 21883c4..43ea4d4 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -865,6 +865,9 @@ i830_disable_vga_plane (xf86CrtcPtr crtc)
     sr01 = INREG8(SRX + 1);
     OUTREG8(SRX + 1, sr01 | (1 << 5));
     usleep(30);
+    /* disable center mode on 965GM and G4X platform */
+    if (IS_I965GM(pI830) || IS_G4X(pI830))
+        vgacntrl &= ~(3 << 24);
 
     vgacntrl |= VGA_DISP_DISABLE;
 
commit 948fa20bd639752af3a6f1b30a0b2b356d0bc9a5
Author: Kalev Lember <kalev at smartlink.ee>
Date:   Fri Mar 20 02:21:41 2009 +0200

    Fix VT switch with XV overlay video enabled.
    
    drm_intel_bo_unpin() was called with NULL argument.
    
    Signed-off-by: Kalev Lember <kalev at smartlink.ee>
    (cherry picked from commit 74d0713e002a9781ed00fdd10eb6f75907ae796c)

diff --git a/src/i830_video.c b/src/i830_video.c
index 3c6fbf3..3f3aaac 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1048,11 +1048,14 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
 	if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
 	    i830_overlay_off(pScrn);
 	}
-	if (!pPriv->textured)
-	    drm_intel_bo_unpin(pPriv->buf);
-	drm_intel_bo_unreference(pPriv->buf);
-	pPriv->buf = NULL;
-	pPriv->videoStatus = 0;
+
+	if (pPriv->buf) {
+	    if (!pPriv->textured)
+		drm_intel_bo_unpin(pPriv->buf);
+	    drm_intel_bo_unreference(pPriv->buf);
+	    pPriv->buf = NULL;
+	    pPriv->videoStatus = 0;
+	}
     } else {
 	if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
 	    pPriv->videoStatus |= OFF_TIMER;
commit 79aebcb7f6b7f0bed6cdce34e2e3086dc6bf9b3c
Author: Rémi Cardona <remi at gentoo.org>
Date:   Fri Nov 14 13:55:52 2008 +0100

    clean up man page generation and remove all traces of the i810 driver
    
    The i810 compatibility symlink has been broken since libpciaccess, so just
    let it die.
    (cherry picked from commit b345b4e6adf00f8b2626e5c2563fc159e2295cc5)

diff --git a/man/Makefile.am b/man/Makefile.am
index 7432d5a..ac08621 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -25,21 +25,12 @@
 # 
 
 drivermandir = $(DRIVER_MAN_DIR)
+driverman_DATA = $(DRIVER_NAME).$(DRIVER_MAN_SUFFIX)
 
-DRIVER_MAN_DIR_SUFFIX = $(DRIVER_MAN_DIR:@mandir@/man%=%)
-
-driverman_PRE = @DRIVER_NAME at .man
-
-driverman_DATA = \
-	$(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) \
-	i810. at DRIVER_MAN_SUFFIX@
-
-EXTRA_DIST = @DRIVER_NAME at .man
+EXTRA_DIST = $(DRIVER_NAME).man
 
 CLEANFILES = $(driverman_DATA)
 
-SED = sed
-
 # Strings to replace in man pages
 XORGRELSTRING = @PACKAGE_STRING@
   XORGMANNAME = X Version 11
@@ -60,10 +51,3 @@ SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
 
 .man.$(DRIVER_MAN_SUFFIX):
 	sed $(MAN_SUBSTS) < $< > $@
-
-BUILT_SOURCES = shadows.DONE
-
-shadows.DONE:
-	-rm -f i810. at DRIVER_MAN_SUFFIX@
-	echo .so man$(DRIVER_MAN_DIR_SUFFIX)/intel.$(DRIVER_MAN_SUFFIX) > \
-		i810. at DRIVER_MAN_SUFFIX@
diff --git a/src/Makefile.am b/src/Makefile.am
index e05dbab..ad87afc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -220,9 +220,3 @@ if XVMC
 intel_drv_la_SOURCES += \
 	$(INTEL_XVMC_SRCS)
 endif
-
-install-data-local: install-intel_drv_laLTLIBRARIES
-	(cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so && ln -s intel_drv.so i810_drv.so)
-
-uninstall-local:
-	(cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so)
diff --git a/src/i810.h b/src/i810.h
index 7ea2043..c88771e 100644
--- a/src/i810.h
+++ b/src/i810.h
@@ -70,7 +70,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define I810_VERSION 4000
 #define I810_NAME "intel"
 #define I810_DRIVER_NAME "intel"
-#define I810_LEGACY_DRIVER_NAME "i810"
 
 #define INTEL_VERSION_MAJOR PACKAGE_VERSION_MAJOR
 #define INTEL_VERSION_MINOR PACKAGE_VERSION_MINOR
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 6ae388d..fe4bd62 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -472,21 +472,6 @@ static XF86ModuleVersionInfo intelVersRec = {
 
 _X_EXPORT XF86ModuleData intelModuleData = { &intelVersRec, i810Setup, NULL };
 
-static XF86ModuleVersionInfo i810VersRec = {
-   "i810",
-   MODULEVENDORSTRING,
-   MODINFOSTRING1,
-   MODINFOSTRING2,
-   XORG_VERSION_CURRENT,
-   INTEL_VERSION_MAJOR, INTEL_VERSION_MINOR, INTEL_VERSION_PATCH,
-   ABI_CLASS_VIDEODRV,
-   ABI_VIDEODRV_VERSION,
-   MOD_CLASS_VIDEODRV,
-   {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData i810ModuleData = { &i810VersRec, i810Setup, NULL };
-
 static pointer
 i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
 {
@@ -681,9 +666,7 @@ I810Probe(DriverPtr drv, int flags)
     * driver, and return if there are none.
     */
    if ((numDevSections =
-	xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 &&
-       (numDevSections =
-	xf86MatchDevice(I810_LEGACY_DRIVER_NAME, &devSections)) <= 0) {
+	xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 ) {
       return FALSE;
    }
 
commit 3afc0d100c6897f9d17756043e92a3e6cccc099f
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Fri Mar 20 12:33:22 2009 -0700

    Don't manage fences part two
    
    Don't try to clear fences that were never installed.  Missed this bit in
    the last fix for #20265.
    (cherry picked from commit 48b91e066878db63a1558e4cd3e6d12ff9c49197)

diff --git a/src/i830_memory.c b/src/i830_memory.c
index 36dab11..052d906 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -270,7 +270,8 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
     if (mem == NULL || !mem->bound)
 	return TRUE;
 
-    if (mem->tiling != TILE_NONE && !pI830->use_drm_mode)
+    if (mem->tiling != TILE_NONE && !pI830->use_drm_mode &&
+	!pI830->kernel_exec_fencing)
 	i830_clear_tiling(pScrn, mem->fence_nr);
 
 #ifdef XF86DRI


More information about the xorg-commit mailing list