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

index 2b87a00df0f7d3abe0911a8a246a17bff3b9d860..30dfebdb8c21a5c72d7b0e3408f54bff676a7418 100644 (file)
 #include "vc4_context.h"
 #include "util/hash_table.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
 vc4_job_free(struct vc4_context *vc4, struct vc4_job *job)
 {
@@ -46,22 +39,26 @@ vc4_job_free(struct vc4_context *vc4, struct vc4_job *job)
                 vc4_bo_unreference(&referenced_bos[i]);
         }
 
-        remove_from_ht(vc4->jobs, &job->key);
+        _mesa_hash_table_remove_key(vc4->jobs, &job->key);
 
         if (job->color_write) {
-                remove_from_ht(vc4->write_jobs, job->color_write->texture);
+                _mesa_hash_table_remove_key(vc4->write_jobs,
+                                            job->color_write->texture);
                 pipe_surface_reference(&job->color_write, NULL);
         }
         if (job->msaa_color_write) {
-                remove_from_ht(vc4->write_jobs, job->msaa_color_write->texture);
+                _mesa_hash_table_remove_key(vc4->write_jobs,
+                                            job->msaa_color_write->texture);
                 pipe_surface_reference(&job->msaa_color_write, NULL);
         }
         if (job->zs_write) {
-                remove_from_ht(vc4->write_jobs, job->zs_write->texture);
+                _mesa_hash_table_remove_key(vc4->write_jobs,
+                                            job->zs_write->texture);
                 pipe_surface_reference(&job->zs_write, NULL);
         }
         if (job->msaa_zs_write) {
-                remove_from_ht(vc4->write_jobs, job->msaa_zs_write->texture);
+                _mesa_hash_table_remove_key(vc4->write_jobs,
+                                            job->msaa_zs_write->texture);
                 pipe_surface_reference(&job->msaa_zs_write, NULL);
         }