Hook up i915 driver to new DRI2 infrastructure.
[mesa.git] / src / mesa / drivers / dri / i915 / intel_tris.c
index 61b0bb3fd31507fceecc033acdbd2fa1443cc384..9d93636900583950f9673905b70168ddf0c0766b 100644 (file)
@@ -89,29 +89,20 @@ intelStartInlinePrimitive(struct intel_context *intel,
 {
    BATCH_LOCALS;
 
+   intel_wait_flips(intel);
+
    intel->vtbl.emit_state(intel);
 
-   /* Need to make sure at the very least that we don't wrap
-    * batchbuffers in BEGIN_BATCH below, otherwise the primitive will
-    * be emitted to a batchbuffer missing the required full-state
-    * preamble.
-    */
-   if (intel_batchbuffer_space(intel->batch) < 100) {
-      intel_batchbuffer_flush(intel->batch);
-      intel->vtbl.emit_state(intel);
-   }
+   intel->no_batch_wrap = GL_TRUE;
 
 /*    _mesa_printf("%s *", __progname); */
 
-   intel_wait_flips(intel, batch_flags);
-
    /* Emit a slot which will be filled with the inline primitive
     * command later.
     */
    BEGIN_BATCH(2, batch_flags);
    OUT_BATCH(0);
 
-   assert(intel->batch->id == intel->last_state_batch_id);
    assert((intel->batch->dirty_state & (1<<1)) == 0);
 
    intel->prim.start_ptr = intel->batch->ptr;
@@ -121,6 +112,8 @@ intelStartInlinePrimitive(struct intel_context *intel,
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
+   intel->no_batch_wrap = GL_FALSE;
+
 /*    _mesa_printf(">"); */
 }
 
@@ -129,11 +122,11 @@ void
 intelWrapInlinePrimitive(struct intel_context *intel)
 {
    GLuint prim = intel->prim.primitive;
-   GLuint batchflags = intel->batch->flags;
+   enum cliprect_mode cliprect_mode = intel->batch->cliprect_mode;
 
    intel_flush_inline_primitive(intel);
    intel_batchbuffer_flush(intel->batch);
-   intelStartInlinePrimitive(intel, prim, batchflags);  /* ??? */
+   intelStartInlinePrimitive(intel, prim, cliprect_mode);  /* ??? */
 }
 
 GLuint *
@@ -247,8 +240,8 @@ intel_draw_point(struct intel_context *intel, intelVertexPtr v0)
    int j;
 
    /* Adjust for sub pixel position -- still required for conform. */
-   *(float *) &vb[0] = v0->v.x - 0.125;
-   *(float *) &vb[1] = v0->v.y - 0.125;
+   *(float *) &vb[0] = v0->v.x;
+   *(float *) &vb[1] = v0->v.y;
    for (j = 2; j < vertsize; j++)
       vb[j] = v0->ui[j];
 }
@@ -942,7 +935,7 @@ intelRasterPrimitive(GLcontext * ctx, GLenum rprim, GLuint hwprim)
    if (hwprim != intel->prim.primitive) {
       INTEL_FIREVERTICES(intel);
 
-      intelStartInlinePrimitive(intel, hwprim, INTEL_BATCH_CLIPRECTS);
+      intelStartInlinePrimitive(intel, hwprim, LOOP_CLIPRECTS);
    }
 }
 
@@ -1079,10 +1072,10 @@ intel_meta_draw_poly(struct intel_context *intel,
    if (!was_locked)
        LOCK_HARDWARE(intel);
 
-   /* All 3d primitives should be emitted with INTEL_BATCH_CLIPRECTS,
+   /* All 3d primitives should be emitted with LOOP_CLIPRECTS,
     * otherwise the drawing origin (DR4) might not be set correctly.
     */
-   intelStartInlinePrimitive(intel, PRIM3D_TRIFAN, INTEL_BATCH_CLIPRECTS);
+   intelStartInlinePrimitive(intel, PRIM3D_TRIFAN, LOOP_CLIPRECTS);
    vb = (union fi *) intelExtendInlinePrimitive(intel, n * 6);
 
    for (i = 0; i < n; i++) {