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

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



 configure.ac           |    4 +-
 src/i830.h             |   16 +++++++++
 src/i830_batchbuffer.c |    6 +++
 src/i830_batchbuffer.h |   22 +++++++++++++
 src/i830_driver.c      |   13 ++-----
 src/i830_exa.c         |    4 +-
 src/i830_lvds.c        |    1 
 src/i915_render.c      |   81 ++++++++++++++++++++++++++++++++++++++++---------
 src/i915_video.c       |   11 ++++--
 9 files changed, 127 insertions(+), 31 deletions(-)

New commits:
commit 08683d1d053875bcacd7c358d66ef2bfad458a56
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Jan 21 14:10:04 2009 -0800

    Bump version to 2.6.1.

diff --git a/configure.ac b/configure.ac
index 249e9a9..2958a0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-intel],
-        2.6.0,
+        2.6.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-intel)
 

commit 52d3c64f2b896966b934d647765674303a8dfa29
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jan 21 09:02:13 2009 -0800

    Don't run in KD_TEXT mode even with KMS
    
    Leaving the VT in KD_TEXT mode keeps the kernel's blanking code active,
    so when a DPMS event happens, the fb console is restored rather than X's
    configuration.  On the downside it means the kernel won't print messages
    in the background, which would be visible if a panic or emergency switch
    occurred.  The proper fix here is a new kernel mode, which we can move
    to when ready.
    (cherry picked from commit 253b8db298f38676e47dc902534465054f7b58b8)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 247425c..92f1554 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1131,10 +1131,6 @@ i830SetHotkeyControl(ScrnInfoPtr pScrn, int mode)
  * DRM mode setting Linux only at this point... later on we could
  * add a wrapper here.
  */
-#ifdef __linux__
-#include <linux/kd.h>
-#endif
-
 static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
 {
 #if XSERVER_LIBPCIACCESS
@@ -1159,10 +1155,6 @@ static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
     if (ret)
 	return FALSE;
 
-#ifdef __linux__
-    ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
-#endif
-
     return TRUE;
 }
 #else

commit 11c23dd22a737aaa52ef18cd65164da9c5115d3f
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jan 21 09:01:05 2009 -0800

    Tear down batchbuffers unconditionally on LeaveVT
    
    Even if KMS is enabled we should do this, to avoid running batches that
    depend on other state we tear down in LeaveVT.
    (cherry picked from commit 131b414feb2ecabe31b538d65725ac4427a4387a)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 70d660a..247425c 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3559,7 +3559,6 @@ I830LeaveVT(int scrnIndex, int flags)
 	*/
        if (!pI830->memory_manager)
 	   intel_bufmgr_fake_evict_all(pI830->bufmgr);
-       intel_batch_teardown(pScrn);
 
        if (!pI830->memory_manager)
 	   i830_stop_ring(pScrn, TRUE);
@@ -3570,6 +3569,8 @@ I830LeaveVT(int scrnIndex, int flags)
        }
    }
 
+   intel_batch_teardown(pScrn);
+
    if (I830IsPrimary(pScrn))
       i830_unbind_all_memory(pScrn);
 

commit f519da8ba21ef27b4a2ed4516336b25c6feb824e
Author: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
Date:   Tue Jan 20 11:35:36 2009 +0800

    Support sysfs backlight control for Sony laptops in xf86-video-intel
    
    The sony_laptop kernel module (since v2.6.23) supports backlight control
    via the sysfs interface:
    /sys/class/backlight/sony
    
    This patch will enable xf86-video-intel to use this backlight control method
    for Sony VAIO Laptops with Intel integrated video.
    (cherry picked from commit ada44c1c0edcd3ea9e41ed6b6fdb2bf0e87c9c67)

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 639450a..1bb9bb9 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -83,6 +83,7 @@ static char *backlight_interfaces[] = {
     "acpi_video1",
     "acpi_video0",
     "fujitsu-laptop",
+    "sony",
     NULL,
 };
 

commit e1c2f5d7afbd29dfb6f1e24589e13729ac71a2a7
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Jan 15 09:31:55 2009 -0800

    Fix invarient state emits for DRI2 (do it per batch, since there's no lock).
    (cherry picked from commit cab5b7a7b0e17414f98b2363b0961c87f32f9c05)

diff --git a/configure.ac b/configure.ac
index bb69f72..249e9a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,7 +209,7 @@ if test "x$GCC" = "xyes"; then
 	-Wnested-externs -fno-strict-aliasing"
 fi
 
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.3])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.0])
 AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then
         PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index b1c8a8d..671e8c8 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -117,6 +117,12 @@ intel_next_batch(ScrnInfoPtr pScrn)
 
     pI830->batch_used = 0;
     pI830->batch_ptr = pI830->batch_bo->virtual;
+
+    /* If we are using DRI2, we don't know when another client has executed,
+     * so we have to reinitialize our 3D state per batch.
+     */
+    if (pI830->directRenderingType == DRI_DRI2)
+	*pI830->last_3d = LAST_3D_OTHER;
 }
 
 void

commit 12ad7f650a01916fd05e0aee9a72f70b112e50a0
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Jan 16 16:59:17 2009 -0800

    Protect i915 textured video against batchbuffer wrapping.
    (cherry picked from commit d89de6d60a86105a198d904821853e6ed7de3305)

diff --git a/src/i915_video.c b/src/i915_video.c
index 7761a45..b903b5e 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -49,8 +49,9 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 {
    I830Ptr pI830 = I830PTR(pScrn);
    uint32_t format, ms3, s5;
-   BoxPtr pbox;
-   int nbox, dxo, dyo, pix_xoff, pix_yoff;
+   BoxPtr pbox = REGION_RECTS(dstRegion);
+   int nbox = REGION_NUM_RECTS(dstRegion);
+   int dxo, dyo, pix_xoff, pix_yoff;
    Bool planar;
 
 #if 0
@@ -72,6 +73,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
       return;
    }
 
+   intel_batch_start_atomic(pScrn, 200 + 20 * nbox);
+
    IntelEmitInvarientState(pScrn);
    *pI830->last_3d = LAST_3D_VIDEO;
 
@@ -362,8 +365,6 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
    dxo = dstRegion->extents.x1;
    dyo = dstRegion->extents.y1;
 
-   pbox = REGION_RECTS(dstRegion);
-   nbox = REGION_NUM_RECTS(dstRegion);
    while (nbox--)
    {
       int box_x1 = pbox->x1;
@@ -412,6 +413,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
       ADVANCE_BATCH();
    }
 
+   intel_batch_end_atomic(pScrn);
+
    i830MarkSync(pScrn);
 }
 

commit 6b299ffac73e7f2069f8207bda677a82e6a60c81
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Jan 15 19:05:52 2009 -0800

    Re-emit i915 composite setup when the batchbuffer wraps.
    
    This also introduces tests to make sure that we asked for enough reserved space
    and that we don't allow wrapping at the wrong time.
    
    This fixes a hang during text rendering with DRI2 and a GL client running,
    but could potentially affect text rendering with GEM in general with an
    exceptional batchbuffer setup.
    (cherry picked from commit db43b7870a37ea273941302096a6f00120dfae71)
    (cherry picked from commit 15780c53f5717936ea10ac87aff8a881c172f1dc)

diff --git a/src/i830.h b/src/i830.h
index dd5555d..e88cced 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -437,6 +437,10 @@ typedef struct _I830Rec {
    /** Number of bytes to be emitted in the current BEGIN_BATCH. */
    uint32_t batch_emitting;
    dri_bo *batch_bo;
+   /** Whether we're in a section of code that can't tolerate flushing */
+   Bool in_batch_atomic;
+   /** Ending batch_used that was verified by i830_start_batch_atomic() */
+   int batch_atomic_limit;
 
 #ifdef I830_XV
    /* For Xvideo */
@@ -586,6 +590,15 @@ typedef struct _I830Rec {
    uint32_t mapstate[6];
    uint32_t samplerstate[6];
 
+   struct {
+      int op;
+      PicturePtr pSrcPicture, pMaskPicture, pDstPicture;
+      PixmapPtr pSrc, pMask, pDst;
+      uint32_t dst_format;
+      Bool is_nearest;
+      Bool needs_emit;
+   } i915_render_state;
+
    /* 965 render acceleration state */
    struct gen4_render_state *gen4_render_state;
 
@@ -928,6 +941,9 @@ Bool i915_check_composite(int op, PicturePtr pSrc, PicturePtr pMask,
 Bool i915_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask,
 			    PicturePtr pDst, PixmapPtr pSrcPixmap,
 			    PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap);
+void i915_composite(PixmapPtr pDst, int srcX, int srcY,
+		    int maskX, int maskY, int dstX, int dstY, int w, int h);
+void i915_batch_flush_notify(ScrnInfoPtr pScrn);
 /* i965_render.c */
 unsigned int gen4_render_state_size(ScrnInfoPtr pScrn);
 void gen4_render_state_init(ScrnInfoPtr pScrn);
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 0511493..a72786e 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -51,6 +51,28 @@ intel_batch_require_space(ScrnInfoPtr pScrn, I830Ptr pI830, GLuint sz)
 }
 
 static inline void
+intel_batch_start_atomic(ScrnInfoPtr pScrn, unsigned int sz)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+
+    assert(!pI830->in_batch_atomic);
+    intel_batch_require_space(pScrn, pI830, sz);
+
+    pI830->in_batch_atomic = TRUE;
+    pI830->batch_atomic_limit = pI830->batch_used + sz * 4;
+}
+
+static inline void
+intel_batch_end_atomic(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+
+    assert(pI830->in_batch_atomic);
+    assert(pI830->batch_used <= pI830->batch_atomic_limit);
+    pI830->in_batch_atomic = FALSE;
+}
+
+static inline void
 intel_batch_emit_dword(I830Ptr pI830, uint32_t dword)
 {
     assert(pI830->batch_ptr != NULL);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 4c40d40..70d660a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3345,6 +3345,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    if (IS_I965G(pI830))
        pI830->batch_flush_notify = i965_batch_flush_notify;
+   else if (IS_I9XX(pI830))
+       pI830->batch_flush_notify = i915_batch_flush_notify;
    else
        pI830->batch_flush_notify = NULL;
 
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 29445ac..24ebc37 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -702,7 +702,7 @@ I830EXAInit(ScreenPtr pScreen)
     {
 	pI830->EXADriverPtr->CheckComposite = i915_check_composite;
    	pI830->EXADriverPtr->PrepareComposite = i915_prepare_composite;
-    	pI830->EXADriverPtr->Composite = i830_composite;
+	pI830->EXADriverPtr->Composite = i915_composite;
     	pI830->EXADriverPtr->DoneComposite = i830_done_composite;
     } else {
  	pI830->EXADriverPtr->CheckComposite = i965_check_composite;
@@ -940,7 +940,7 @@ i830_uxa_init (ScreenPtr pScreen)
     {
 	i830->uxa_driver->check_composite = i915_check_composite;
    	i830->uxa_driver->prepare_composite = i915_prepare_composite;
-    	i830->uxa_driver->composite = i830_composite;
+	i830->uxa_driver->composite = i915_composite;
     	i830->uxa_driver->done_composite = i830_done_composite;
     } else {
  	i830->uxa_driver->check_composite = i965_check_composite;
diff --git a/src/i915_render.c b/src/i915_render.c
index ab288e1..5dd97e6 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -315,39 +315,69 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
 {
     ScrnInfoPtr pScrn = xf86Screens[pSrcPicture->pDrawable->pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
-    uint32_t dst_format, dst_pitch;
-    uint32_t blendctl;
-    int out_reg = FS_OC;
-    FS_LOCALS(20);
-    Bool is_affine_src, is_affine_mask;
-    Bool is_nearest = FALSE;
 
     i830_exa_check_pitch_3d(pSrc);
     if (pMask)
 	i830_exa_check_pitch_3d(pMask);
     i830_exa_check_pitch_3d(pDst);
 
-    IntelEmitInvarientState(pScrn);
-    *pI830->last_3d = LAST_3D_RENDER;
-
-    if (!i915_get_dest_format(pDstPicture, &dst_format))
+    if (!i915_get_dest_format(pDstPicture,
+			      &pI830->i915_render_state.dst_format))
 	return FALSE;
-    dst_pitch = intel_get_pixmap_pitch(pDst);
 
+    pI830->i915_render_state.is_nearest = FALSE;
     if (!i915_texture_setup(pSrcPicture, pSrc, 0))
 	I830FALLBACK("fail to setup src texture\n");
     if (pSrcPicture->filter == PictFilterNearest)
-	is_nearest = TRUE;
+	pI830->i915_render_state.is_nearest = TRUE;
     if (pMask != NULL) {
 	if (!i915_texture_setup(pMaskPicture, pMask, 1))
 	    I830FALLBACK("fail to setup mask texture\n");
 	if (pMaskPicture->filter == PictFilterNearest)
-	    is_nearest = TRUE;
+	    pI830->i915_render_state.is_nearest = TRUE;
     } else {
 	pI830->transform[1] = NULL;
 	pI830->scale_units[1][0] = -1;
 	pI830->scale_units[1][1] = -1;
     }
+
+    pI830->i915_render_state.op = op;
+    pI830->i915_render_state.pSrcPicture = pSrcPicture;
+    pI830->i915_render_state.pMaskPicture = pMaskPicture;
+    pI830->i915_render_state.pDstPicture = pDstPicture;
+    pI830->i915_render_state.pSrc = pSrc;
+    pI830->i915_render_state.pMask = pMask;
+    pI830->i915_render_state.pDst = pDst;
+    pI830->i915_render_state.needs_emit = TRUE;
+
+    return TRUE;
+}
+
+static void
+i915_emit_composite_setup(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+    int op = pI830->i915_render_state.op;
+    PicturePtr pSrcPicture = pI830->i915_render_state.pSrcPicture;
+    PicturePtr pMaskPicture = pI830->i915_render_state.pMaskPicture;
+    PicturePtr pDstPicture = pI830->i915_render_state.pDstPicture;
+    PixmapPtr pSrc = pI830->i915_render_state.pSrc;
+    PixmapPtr pMask = pI830->i915_render_state.pMask;
+    PixmapPtr pDst = pI830->i915_render_state.pDst;
+    uint32_t dst_format = pI830->i915_render_state.dst_format, dst_pitch;
+    uint32_t blendctl;
+    int out_reg = FS_OC;
+    FS_LOCALS(20);
+    Bool is_affine_src, is_affine_mask;
+    Bool is_nearest = pI830->i915_render_state.is_nearest;
+
+    pI830->i915_render_state.needs_emit = FALSE;
+
+    IntelEmitInvarientState(pScrn);
+    *pI830->last_3d = LAST_3D_RENDER;
+
+    dst_pitch = intel_get_pixmap_pitch(pDst);
+
     is_affine_src = i830_transform_is_affine (pI830->transform[0]);
     is_affine_mask = i830_transform_is_affine (pI830->transform[1]);
 
@@ -503,6 +533,29 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
 	i915_fs_mov(FS_OC, i915_fs_operand(out_reg, W, W, W, W));
 
     FS_END();
+}
 
-    return TRUE;
+void
+i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+	       int dstX, int dstY, int w, int h)
+{
+    ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+    I830Ptr pI830 = I830PTR(pScrn);
+
+    intel_batch_start_atomic(pScrn, 150);
+
+    if (pI830->i915_render_state.needs_emit)
+	i915_emit_composite_setup(pScrn);
+
+    i830_composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY, w, h);
+
+    intel_batch_end_atomic(pScrn);
+}
+
+void
+i915_batch_flush_notify(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+
+    pI830->i915_render_state.needs_emit = TRUE;
 }


Reply to: