xf86-video-intel: src/i830.h src/i830_render.c src/i915_render.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 9 04:48:59 PDT 2009


 src/i830.h        |    1 +
 src/i830_render.c |   14 ++++++++------
 src/i915_render.c |    8 ++++----
 3 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 1a77ca74bc829e019a06fe9ad559f013054c27ff
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 9 12:09:05 2009 +0100

    i915: Restore nearest sampling
    
    My recent commit [94fc93] to use the pixel centre for sampling with the i830
    broke the i915. This restores the previous sampling coordinates for the
    i915 whilst preserving the correct coordinates for i830.
    
    Fixes: gnome characters disappear
           http://bugs.freedesktop.org/show_bug.cgi?id=23803
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i830.h b/src/i830.h
index c8002b4..c3b0d02 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -467,6 +467,7 @@ typedef struct _I830Rec {
    float scale_units[2][2];
   /** Transform pointers for src/mask, or NULL if identity */
    PictTransform *transform[2];
+   float dst_coord_adjust;
    float src_coord_adjust;
    float mask_coord_adjust;
 
diff --git a/src/i830_render.c b/src/i830_render.c
index af6fb6e..dbee446 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -414,7 +414,9 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
     if (!i830_get_dest_format(pDstPicture, &pI830->render_dst_format))
 	return FALSE;
 
+    pI830->dst_coord_adjust = 0;
     pI830->src_coord_adjust = 0;
+    pI830->mask_coord_adjust = 0;
     if (pSrcPicture->filter == PictFilterNearest)
 	pI830->src_coord_adjust = 0.375;
     if (pMask != NULL) {
@@ -707,8 +709,8 @@ i830_emit_composite_primitive(PixmapPtr pDst,
     BEGIN_BATCH(1 + num_floats);
 
     OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (num_floats-1));
-    OUT_BATCH_F(dstX + w);
-    OUT_BATCH_F(dstY + h);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstX + w);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstY + h);
     OUT_BATCH_F(src_x[2] / pI830->scale_units[0][0]);
     OUT_BATCH_F(src_y[2] / pI830->scale_units[0][1]);
     if (!is_affine_src) {
@@ -724,8 +726,8 @@ i830_emit_composite_primitive(PixmapPtr pDst,
 	}
     }
 
-    OUT_BATCH_F(dstX);
-    OUT_BATCH_F(dstY + h);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstX);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstY + h);
     OUT_BATCH_F(src_x[1] / pI830->scale_units[0][0]);
     OUT_BATCH_F(src_y[1] / pI830->scale_units[0][1]);
     if (!is_affine_src) {
@@ -741,8 +743,8 @@ i830_emit_composite_primitive(PixmapPtr pDst,
 	}
     }
 
-    OUT_BATCH_F(dstX);
-    OUT_BATCH_F(dstY);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstX);
+    OUT_BATCH_F(pI830->dst_coord_adjust + dstY);
     OUT_BATCH_F(src_x[0] / pI830->scale_units[0][0]);
     OUT_BATCH_F(src_y[0] / pI830->scale_units[0][1]);
     if (!is_affine_src) {
diff --git a/src/i915_render.c b/src/i915_render.c
index c7858ae..ed0b615 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -166,7 +166,6 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 			 (int)pDstPicture->format);
 	}
     }
-    *dst_format |= DSTORG_HORT_BIAS (0x8) | DSTORG_VERT_BIAS (0x8);
     return TRUE;
 }
 
@@ -347,16 +346,17 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
     if (!i915_texture_setup(pSrcPicture, pSrc, 0))
 	I830FALLBACK("fail to setup src texture\n");
 
+    pI830->dst_coord_adjust = 0;
     pI830->src_coord_adjust = 0;
+    pI830->mask_coord_adjust = 0;
     if (pSrcPicture->filter == PictFilterNearest)
-	pI830->src_coord_adjust = 0.375;
+	pI830->dst_coord_adjust = -0.125;
     if (pMask != NULL) {
 	if (!i915_texture_setup(pMaskPicture, pMask, 1))
 	    I830FALLBACK("fail to setup mask texture\n");
 
-	pI830->mask_coord_adjust = 0;
 	if (pMaskPicture->filter == PictFilterNearest)
-	    pI830->mask_coord_adjust = 0.375;
+	    pI830->dst_coord_adjust = -0.125;
     } else {
 	pI830->transform[1] = NULL;
 	pI830->scale_units[1][0] = -1;


More information about the xorg-commit mailing list