intel: Convert from GLboolean to 'bool' from stdbool.h.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_urb.c
index f2cdb203b85235ffddf27d1f14e7dbc9524dd85a..cef44b56cbfd684042bd692494269250cbbb0e87 100644 (file)
@@ -97,7 +97,7 @@ static const struct {
 };
 
 
-static GLboolean check_urb_layout( struct brw_context *brw )
+static bool check_urb_layout(struct brw_context *brw)
 {
    brw->urb.vs_start = 0;
    brw->urb.gs_start = brw->urb.nr_vs_entries * brw->urb.vsize;
@@ -148,7 +148,7 @@ static void recalculate_urb_fence( struct brw_context *brw )
 
       brw->urb.constrained = 0;
 
-      if (intel->is_ironlake) {
+      if (intel->gen == 5) {
          brw->urb.nr_vs_entries = 128;
          brw->urb.nr_sf_entries = 48;
          if (check_urb_layout(brw)) {
@@ -186,17 +186,17 @@ static void recalculate_urb_fence( struct brw_context *brw )
             * entries and the values for minimum nr of entries
             * provided above.
             */
-           _mesa_printf("couldn't calculate URB layout!\n");
+           printf("couldn't calculate URB layout!\n");
            exit(1);
         }
         
-        if (INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
-           _mesa_printf("URB CONSTRAINED\n");
+        if (unlikely(INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS)))
+           printf("URB CONSTRAINED\n");
       }
 
 done:
-      if (INTEL_DEBUG & DEBUG_URB)
-        _mesa_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
+      if (unlikely(INTEL_DEBUG & DEBUG_URB))
+        printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
                      brw->urb.vs_start,
                      brw->urb.gs_start,
                      brw->urb.clip_start,
@@ -248,5 +248,13 @@ void brw_upload_urb_fence(struct brw_context *brw)
    uf.bits1.sf_fence  = brw->urb.cs_start; 
    uf.bits1.cs_fence  = brw->urb.size;
 
+   /* erratum: URB_FENCE must not cross a 64byte cacheline */
+   if ((brw->intel.batch.used & 15) > 12) {
+      int pad = 16 - (brw->intel.batch.used & 15);
+      do
+        brw->intel.batch.map[brw->intel.batch.used++] = MI_NOOP;
+      while (--pad);
+   }
+
    BRW_BATCH_STRUCT(brw, &uf);
 }