v3d: Use _mesa_hash_table_remove_key() where appropriate.
authorEric Anholt <eric@anholt.net>
Fri, 19 Apr 2019 21:26:42 +0000 (14:26 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 26 Apr 2019 19:42:30 +0000 (12:42 -0700)
src/gallium/drivers/v3d/v3d_job.c

index 87eede2cd9cdf988d73074fa864d7ab2dde3c467..73546adfc667363c8d81c1973162893a418eb0ef 100644 (file)
 #include "util/set.h"
 #include "broadcom/clif/clif_dump.h"
 
-static void
-remove_from_ht(struct hash_table *ht, void *key)
-{
-        struct hash_entry *entry = _mesa_hash_table_search(ht, key);
-        _mesa_hash_table_remove(ht, entry);
-}
-
 static void
 v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
 {
@@ -52,29 +45,31 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
                 v3d_bo_unreference(&bo);
         }
 
-        remove_from_ht(v3d->jobs, &job->key);
+        _mesa_hash_table_remove_key(v3d->jobs, &job->key);
 
         if (job->write_prscs) {
                 set_foreach(job->write_prscs, entry) {
                         const struct pipe_resource *prsc = entry->key;
 
-                        remove_from_ht(v3d->write_jobs, (void *)prsc);
+                        _mesa_hash_table_remove_key(v3d->write_jobs, prsc);
                 }
         }
 
         for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
                 if (job->cbufs[i]) {
-                        remove_from_ht(v3d->write_jobs, job->cbufs[i]->texture);
+                        _mesa_hash_table_remove_key(v3d->write_jobs,
+                                                    job->cbufs[i]->texture);
                         pipe_surface_reference(&job->cbufs[i], NULL);
                 }
         }
         if (job->zsbuf) {
                 struct v3d_resource *rsc = v3d_resource(job->zsbuf->texture);
                 if (rsc->separate_stencil)
-                        remove_from_ht(v3d->write_jobs,
-                                       &rsc->separate_stencil->base);
+                        _mesa_hash_table_remove_key(v3d->write_jobs,
+                                                    &rsc->separate_stencil->base);
 
-                remove_from_ht(v3d->write_jobs, job->zsbuf->texture);
+                _mesa_hash_table_remove_key(v3d->write_jobs,
+                                            job->zsbuf->texture);
                 pipe_surface_reference(&job->zsbuf, NULL);
         }