freedreno/a6xx: Convert gmem blits to OUT_REG()
[mesa.git] / src / gallium / drivers / svga / svga_sampler_view.c
index 9c33a79db0f039387fb6c2fd31d137fa3ef1b18c..d382071fc4938102c21b27ae96050d7af9d78df2 100644 (file)
@@ -29,7 +29,7 @@
 #include "pipe/p_defines.h"
 #include "util/u_inlines.h"
 #include "os/os_thread.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_string.h"
@@ -48,7 +48,7 @@ svga_debug_describe_sampler_view(char *buf, const struct svga_sampler_view *sv)
 {
    char res[128];
    debug_describe_resource(res, sv->texture);
-   util_sprintf(buf, "svga_sampler_view<%s,[%u,%u]>",
+   sprintf(buf, "svga_sampler_view<%s,[%u,%u]>",
                 res, sv->min_lod, sv->max_lod);
 }
 
@@ -62,7 +62,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
    struct svga_screen *ss = svga_screen(pipe->screen);
    struct svga_texture *tex = svga_texture(pt);
    struct svga_sampler_view *sv = NULL;
-   SVGA3dSurfaceFlags flags = SVGA3D_SURFACE_HINT_TEXTURE;
+   SVGA3dSurface1Flags flags = SVGA3D_SURFACE_HINT_TEXTURE;
    SVGA3dSurfaceFormat format = svga_translate_format(ss, pt->format,
                                                       PIPE_BIND_SAMPLER_VIEW);
    boolean view = TRUE;
@@ -91,18 +91,18 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
 
    /* First try the cache */
    if (view) {
-      pipe_mutex_lock(ss->tex_mutex);
+      mtx_lock(&ss->tex_mutex);
       if (tex->cached_view &&
           tex->cached_view->min_lod == min_lod &&
           tex->cached_view->max_lod == max_lod) {
          svga_sampler_view_reference(&sv, tex->cached_view);
-         pipe_mutex_unlock(ss->tex_mutex);
+         mtx_unlock(&ss->tex_mutex);
          SVGA_DBG(DEBUG_VIEWS, "svga: Sampler view: reuse %p, %u %u, last %u\n",
                               pt, min_lod, max_lod, pt->last_level);
          svga_validate_sampler_view(svga_context(pipe), sv);
          return sv;
       }
-      pipe_mutex_unlock(ss->tex_mutex);
+      mtx_unlock(&ss->tex_mutex);
    }
 
    sv = CALLOC_STRUCT(svga_sampler_view);
@@ -151,7 +151,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
                                           flags, format,
                                           min_lod,
                                           max_lod - min_lod + 1,
-                                          -1, 1, -1,
+                                          -1, 1, -1, FALSE,
                                           &sv->key);
 
    if (!sv->handle) {
@@ -163,9 +163,9 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
       return sv;
    }
 
-   pipe_mutex_lock(ss->tex_mutex);
+   mtx_lock(&ss->tex_mutex);
    svga_sampler_view_reference(&tex->cached_view, sv);
-   pipe_mutex_unlock(ss->tex_mutex);
+   mtx_unlock(&ss->tex_mutex);
 
    debug_reference(&sv->reference,
                    (debug_reference_descriptor)
@@ -200,7 +200,7 @@ svga_validate_sampler_view(struct svga_context *svga,
 
    for (i = v->min_lod; i <= v->max_lod; i++) {
       for (k = 0; k < numFaces; k++) {
-         assert(i < Elements(tex->view_age));
+         assert(i < ARRAY_SIZE(tex->view_age));
          if (v->age < tex->view_age[i])
             svga_texture_copy_handle(svga,
                                      tex->handle, 0, 0, 0, i, k,