Merge remote branch 'origin/gallium-0.2' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / i965 / brw_wm_sampler_state.c
index d40332e9aee987b1792da2c7b8fe827aa0f36d62..e1db31ec08cae71e2964f5b98eb5952781b24721 100644 (file)
@@ -34,7 +34,7 @@
 #include "brw_state.h"
 #include "brw_defines.h"
 
-#include "macros.h"
+#include "main/macros.h"
 
 
 
@@ -255,11 +255,10 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
  * complicates various things.  However, this is still too confusing -
  * FIXME: simplify all the different new texture state flags.
  */
-static int upload_wm_samplers( struct brw_context *brw )
+static void upload_wm_samplers( struct brw_context *brw )
 {
    struct wm_sampler_key key;
    int i;
-   int ret = 0;
 
    brw_wm_sampler_populate_key(brw, &key);
 
@@ -271,7 +270,7 @@ static int upload_wm_samplers( struct brw_context *brw )
    dri_bo_unreference(brw->wm.sampler_bo);
    brw->wm.sampler_bo = NULL;
    if (brw->wm.sampler_count == 0)
-      return 0;
+      return;
 
    brw->wm.sampler_bo = brw_search_cache(&brw->cache, BRW_SAMPLER,
                                         &key, sizeof(key),
@@ -304,19 +303,14 @@ static int upload_wm_samplers( struct brw_context *brw )
         if (!brw->attribs.Texture->Unit[i]._ReallyEnabled)
            continue;
 
-        ret |= dri_bufmgr_check_aperture_space(brw->wm.sdc_bo[i]);
-        dri_emit_reloc(brw->wm.sampler_bo,
-                       DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
-                       0,
-                       i * sizeof(struct brw_sampler_state) +
-                       offsetof(struct brw_sampler_state, ss2),
-                       brw->wm.sdc_bo[i]);
+        dri_bo_emit_reloc(brw->wm.sampler_bo,
+                          I915_GEM_DOMAIN_INSTRUCTION, 0,
+                          0,
+                          i * sizeof(struct brw_sampler_state) +
+                          offsetof(struct brw_sampler_state, ss2),
+                          brw->wm.sdc_bo[i]);
       }
    }
-
-   ret |= dri_bufmgr_check_aperture_space(brw->wm.sampler_bo);
-   return ret;
-
 }
 
 const struct brw_tracked_state brw_wm_samplers = {