xf86-video-intel: 2 commits - src/i830_driver.c src/i915_video.c

Keith Packard keithp at kemper.freedesktop.org
Fri May 1 18:39:18 PDT 2009


 src/i830_driver.c |    6 ++++--
 src/i915_video.c  |   18 +++++++++++++++---
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 8255cca2c9092f7ecb798944aa8f03fa3efcfa6c
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 18:34:43 2009 -0700

    Split i915 textured video commands to fit into batch buffers.
    
    i915 textured video commands are quite long, but must be contained in the
    same batch buffer as the 3D setup commands. When the number of clip rects
    for the video becomes too large for the associated commands to fit in the
    same batch buffer, this change breaks the sequence into pieces, ensuring
    that each batch contains the necessary setup sequence.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i915_video.c b/src/i915_video.c
index 1d1fa01..150cf04 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -50,7 +50,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
    I830Ptr pI830 = I830PTR(pScrn);
    uint32_t format, ms3, s5;
    BoxPtr pbox = REGION_RECTS(dstRegion);
-   int nbox = REGION_NUM_RECTS(dstRegion);
+   int nbox_total = REGION_NUM_RECTS(dstRegion);
+   int nbox_this_time;
    int dxo, dyo, pix_xoff, pix_yoff;
    Bool planar;
 
@@ -73,7 +74,17 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
       return;
    }
 
-   intel_batch_start_atomic(pScrn, 200 + 20 * nbox);
+#define BYTES_FOR_BOXES(n)	((200 + (n) * 20) * 4)
+#define BOXES_IN_BYTES(s)	((((s)/4) - 200) / 20)
+#define BATCH_BYTES(p)		((p)->batch_bo->size - 16)
+
+   while (nbox_total) {
+	nbox_this_time = nbox_total;
+	if (BYTES_FOR_BOXES(nbox_this_time) > BATCH_BYTES(pI830))
+		nbox_this_time = BOXES_IN_BYTES(BATCH_BYTES(pI830));
+	nbox_total -= nbox_this_time;
+
+   intel_batch_start_atomic(pScrn, 200 + 20 * nbox_this_time);
 
    IntelEmitInvarientState(pScrn);
    pI830->last_3d = LAST_3D_VIDEO;
@@ -366,7 +377,7 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
    dxo = dstRegion->extents.x1;
    dyo = dstRegion->extents.y1;
 
-   while (nbox--)
+   while (nbox_this_time--)
    {
       int box_x1 = pbox->x1;
       int box_y1 = pbox->y1;
@@ -415,5 +426,6 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
    }
 
    intel_batch_end_atomic(pScrn);
+   }
 }
 
commit e5e0fb846bda3e1757b89e50d5244d28457b9fe3
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 1 12:26:04 2009 -0700

    Call down to lower CloseScreen before shutting down DRM allocator
    
    Lower level functions will destroy objects that are managed by the DRM
    allocator, so make sure those are done before the allocator shuts down.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 1ff5866..1887a51 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3085,6 +3085,9 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
    free(pI830->offscreenImages);
    pI830->offscreenImages = NULL;
 
+   pScreen->CloseScreen = pI830->CloseScreen;
+   (*pScreen->CloseScreen) (scrnIndex, pScreen);
+
    dri_bufmgr_destroy(pI830->bufmgr);
    pI830->bufmgr = NULL;
 
@@ -3098,8 +3101,7 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
    pScrn->PointerMoved = pI830->PointerMoved;
    pScrn->vtSema = FALSE;
    pI830->closing = FALSE;
-   pScreen->CloseScreen = pI830->CloseScreen;
-   return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+   return TRUE;
 }
 
 static ModeStatus


More information about the xorg-commit mailing list