util/hash_table: Rework the API to know about hashing

Previously, the hash_table API required the user to do all of the hashing
of keys as it passed them in.  Since the hashing function is intrinsically
tied to the comparison function, it makes sense for the hash table to know
about it.  Also, it makes for a somewhat clumsy API as the user is
constantly calling hashing functions many of which have long names.  This
is especially bad when the standard call looks something like

_mesa_hash_table_insert(ht, _mesa_pointer_hash(key), key, data);

In the above case, there is no reason why the hash table shouldn't do the
hashing for you.  We leave the option for you to do your own hashing if
it's more efficient, but it's no longer needed.  Also, if you do do your
own hashing, the hash table will assert that your hash matches what it
expects out of the hashing function.  This should make it harder to mess up
your hashing.

v2: change to call the old entrypoint "pre_hashed" rather than
    "with_hash", like cworth's equivalent change upstream (change by
    anholt, acked-in-general by Jason).

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
hash_table: Fix compiler warnings from the renaming.

Not sure how we both missed this.  None of the callers were using the
return value, though.
vc4: Fix a leak of the simulator's exec BO's actual vc4_bo.
vc4: Fix leak of simulator memory on screen cleanup.
vc4: Switch to using the util/ hash table.

No performance difference on a microbenchmark with norast that should hit it
enough to have mattered, n=220.
vc4: Fix leak of a copy of the scheduled QPU instructions.

They're copied into a vc4_bo after compiling is done.
vc4: Fix leak of the compiled shader programs in the cache.
vc4: Fix leak of vc4_bos stashed in the context.
vc4: Fix leaks of the CL contents.
vc4: Fix leaks of the compiled shaders' keys.
i965/brw_reg: struct constructor now needs explicit negate and abs values.

We were assuming, when constructing a new brw_reg struct, that the
negate and abs register modifiers would not be present by default in
the new register.

Now, we force explicitly setting these values when constructing a new
register.

This will avoid problems like forgetting to properly set them when we
are using a previous register to generate this new register, as it was
happening in the dFdx and dFdy generation functions.

Fixes piglit test shaders/glsl-deriv-varyings

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82991
Reviewed-by: Matt Turner <mattst88@gmail.com>
glsl: Add gl_MaxViewports to available builtin constants

It seems to have been forgotten during viewports array implementation time.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
vc4: 0-initialize the screen again.

I typoed this when rebasing the memory leak fixes.
vc4: Add support for UMAD.
vc4: Rename UNPACK_8* to UNPACK_8*_F.

There is an equivalent unpack function without conversion to float if you
use an integer operation instead.
vc4: Fix use of r3 as a temp in 8-bit unpacking.

We're actually allocating out of r3 now, and I missed it because I'd typed
this one as qpu_rn(3) instead of qpu_r3().
vc4: Refactor vertex attribute conversions a bit.

There was just way too much indentation.
vc4: Add support for 8-bit unnormalized vertex attrs.
vc4: Rename the 16-bit unpack #define.

It's only an f16 conversion if you're doing a float operation, otherwise
it's 16 bit signed to 32-bit signed.
vc4: Add support for 16-bit signed/unsigned norm/scaled vertex attrs.