svga: handle P016 format as well
[mesa.git] / src / gallium / drivers / svga / svga_sampler_view.c
index 9c33a79db0f039387fb6c2fd31d137fa3ef1b18c..ee4ef3ca7b07e6cbcb5b0726f408e08cc822b8e7 100644 (file)
@@ -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);
@@ -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,